IkasCustomerStore
customer
IkasCustomer | null | undefinedRefer to the IkasCustomer reference.
initialized
booleantrue
if the store is successfully initialized.
customerConsentGranted
booleantrue
if the customer accepted the cookies.
isCaptchaRequired
booleanThere are several operations that might require captcha validation.
The ikas merchant can select from the dashboard to utilize captcha or not.
If the merchant prefers to use captcha, this field will return true
.
socialLogin
functionInitiates the social login flow, by redirecting the customer to the appropriate provider's URL.
async socialLogin(provider: "facebook" | "google")
provider
:
"facebook" | "google"
socialLoginToken
functionPerforms login with the token received from the social login provider.
async socialLoginToken(token: string)
token
:
string
register
functionasync register( firstName: string, lastName: string, email: string, password: string, isMarketingAccepted?: boolean, attributes?: IkasCustomerAttributeValue[] )
firstName
:
string
lastName
:
string
email
:
string
isMarketingAccepted
:
boolean | undefined
attributes
:
IkasCustomerAttributeValue[] | undefined
recoverPassword
functionasync recoverPassword(password: string, passwordAgain: string, token: string)
password
:
string
passwordAgain
:
string
token
:
string
getOrderByEmail
functionGet a specific customer order by email and orderNumber.
async getOrderByEmail(email: string, orderNumber: string)
getOrderTransactions
functionGet payment transactions of an order.
async getOrderTransactions(params: { checkoutId?: string; id?: string; orderId?: string; } = {})
params
:
{checkoutId?: string; id?: string; orderId?: string;}
createEmailSubscription
functionSubscribe to the newsletter/marketing notifications.
async createEmailSubscription(email: string)
onCustomerConsentGrant
functionCallback to call when the customer accepts the cookies.
onCustomerConsentGrant()
waitUntilInitialized
functionUse this function to wait for the customer store initialization. The customer field will be filled if the customer is logged-in.
waitUntilInitialized()