Primer
configure(settings?: PrimerSettings): Promise<void>
: Optionally call this function to configure the SDK before presenting it.<aside> ⚠️ If no settings are provided, they SDK will get initialized with its default settings.
</aside>
showUniversalCheckout(clientToken: string): Promise<void>
: Call this function with the client token you have received from your BE in order to present the Universal Checkout.showVaultManager(clientToken: string): Promise<void>
: Call this function with the client token you have received from your BE in order to present the Vault Manager.showPaymentMethod(paymentMethodType: string, intent: PrimerSessionIntent, clientToken: string): Promise<void>
: Call this function with the client token you have received from your BE in order to directly present a payment method. Set the intent to CHECKOUT
or VAULT
.dismiss()
: Call this function to dismiss the Primer SDK.PrimerSettings
paymentHandling?
: can be AUTO
and MANUAL
, defaults to AUTO
.localeData?: [PrimerLocaleData](<https://www.notion.so/800de3a4a0ce4e07be05d7bf8c0755e4>)
paymentOptions?: [PrimerPaymentMethodOptions](<https://www.notion.so/800de3a4a0ce4e07be05d7bf8c0755e4>)
uiOptions?: [PrimerUIOptions](<https://www.notion.so/800de3a4a0ce4e07be05d7bf8c0755e4>)
debugOptions?: [PrimerDebugOptions](<https://www.notion.so/800de3a4a0ce4e07be05d7bf8c0755e4>)
onBeforeClientSessionUpdate?: () => void
: Register on this callback to get notified when the client session starts getting updated.onClientSessionUpdate?: (clientSession: PrimerClientSession) => void
: Register on this callback to get notified when the client session gets updated, and get the new client session object.onBeforePaymentCreate?: (checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) => void
: Register on this callback to get notified when the payment starts. You can abort or continue the payment through the decision handler.onCheckoutComplete?: (checkoutData: PrimerCheckoutData) => void
: Register on this callback to get notified when a payment has been created.onTokenizeSuccess?: (paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerTokenizationHandler) => void
: Register on this callback to get the payment method token data in the MANUAL
flow, and use the data to create a payment on your BE.