Payments KYB Element
createElement('paymentsKyb', options?)
Parameters
type
required'paymentsKyb'options
optionalPaymentsKybElementOptionspaymentsKyb Element.hideHeader
optionalbooleanlocale
optional'en' | 'zh' | 'fr'init() is used.langKey
optional'en' | 'zh' | 'fr'Deprecatedlocale instead.Returns
PaymentsKybElement | null
1import { createElement } from '@airwallex/components-sdk';23const element = await createElement('paymentsKyb', {4 hideHeader: true,5 hideNav: true,6});
destroy()
1element.destroy();
mount(domElement)
Parameters
domElement
requiredstring | HTMLElement1// There are two ways to mount element:2// 1. Call with container DOM id3element.mount('container-dom-id');45// 2. Find the created DOM in existing HTML and call with container DOM element6const containerElement = document.getElementById('container-dom-id');7element.mount(containerElement);
on('ready', handler)
This event will be fired when the Payments Kyb element is ready for starting the Kyb application. If PERMISSION_DENIED error takes place, this event will not be triggered.
Parameters
type
required'ready'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
kybStatus
required'PENDING_REVIEW' | 'IN_REVIEW' | 'REJECTED' | 'ACCEPTED' | 'APPROVED'kycStatus
required'INIT' | 'SUBMITTED' | 'SUCCESS' | 'FAILED'type
required'paymentsKyb'1{2 kybStatus: 'PENDING_REVIEW' | 'IN_REVIEW' | 'REJECTED' | 'ACCEPTED' | 'APPROVED',3 kycStatus: 'INIT' | 'SUBMITTED' | 'SUCCESS' | 'FAILED'4}
on('success', handler)
Parameters
type
required'success'handler
required() => void1element.on('success', () => {2 // Handle success event3});
on('cancel', handler)
Parameters
type
required'cancel'handler
required() => void1element.on('cancel', () => {2 console.log('KYB cancelled');3});
on('error', handler)
Parameters
type
required'error'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
code
required'API_ERROR' | 'SUBMIT_FAILED'message
optionalstring1{ code: string, message?: string }
on('reserveOptionsOffered', handler)
UserReserveSelection is only used when the reserve selection is available for the accounts. Contact Account Manager for more details.
Parameters
type
required'reserveOptionsOffered'handler
requiredfunction1{2 reserveOptions: UserReserveSelection3}
on('selectReserve', handler)
Parameters
type
required'selectReserve'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
selected
required'DELAY' | 'FIXED_AMOUNT' | 'MIXED' | 'NOT_ACCEPTED' | 'ROLLING' | 'ROLLING_2'1{2 selected: UserReserveSelection3}
unmount()
1element.unmount();