CustomerManager

Manager for customer operations

Properties

Link copied to clipboard

Gets the current logged in customer.

Link copied to clipboard

Get LiveData object for current customer

Functions

Link copied to clipboard
fun create(customerInfo: CustomerInfo, termsOfService: Boolean, ageVerification: Boolean, email: String? = null, password: String? = null, callback: (Customer?, SdkError?) -> Unit? = null)

Create a customer account using customerInfo from the user. Consent for termsOfService and ageVerification should be collected from the user (e.g. checkboxes).

Link copied to clipboard
fun login(email: String, password: String, callback: (Customer?, SdkError?) -> Unit? = null)

Login customer using existing credentials (email and password).

Link copied to clipboard
fun loginWithToken(token: String, callback: (Customer?, SdkError?) -> Unit? = null)

Login customer using a previously obtained customer token.

Link copied to clipboard
fun logout(callback: (SdkError?) -> Unit? = null)

Logs out the current customer

Link copied to clipboard
fun requestNewPassword(email: String, callback: (Unit?, SdkError?) -> Unit? = null)

Request new password for the given email.

Link copied to clipboard
fun setNewPassword(newPasswordInfo: NewPasswordInfo, callback: (Customer?, SdkError?) -> Unit? = null)

Set password for the current customer. Provide the reset password token, current password, and new password in newPasswordInfo.

Link copied to clipboard
fun signUp(email: String, password: String, callback: (Customer?, SdkError?) -> Unit? = null)

Link an email and password with the current anonymous logged in user.

Link copied to clipboard
fun update(customerInfo: CustomerInfo, callback: (Customer?, SdkError?) -> Unit? = null)

Update customer info for the logged in customer.