Payment Enablement RFI Element
The Payment Enablement RFI Element allows platforms to collect additional payments information from connected accounts during activation of payments capabilities.
createElement('paymentEnablementRfi', options?)
Use this function to create an instance of an individual Element.
Parameters
type
required'paymentEnablementRfi'The type of element you are creating.
options
optionalRfiElementOptionsOptions for creating
paymentEnablementRfi Element.hideHeader
optionalbooleanIf set to true, the RFI flow header will be hidden, allowing platforms to configure a customized taskflow header on top the Element. By default, the header will be displayed within the RFI flow and shows the platform's content.
If set to true, the side navigation will be hidden. By default, standard side navigation will be shown.
locale
optional'en' | 'zh' | 'fr'The locale for the Element, applied to Element UI strings and error messages. By default, the locale configured in
init() is used.langKey
optional'en' | 'zh' | 'fr'DeprecatedUse
locale instead.Returns
PaymentEnablementRfiElement | null
1import { createElement } from '@airwallex/components-sdk';23const element = await createElement('paymentEnablementRfi', {4 hideHeader: true,5 hideNav: true,6});
destroy()
Destroys the Element instance.
1element.destroy();
mount(domElement)
Mounts Element to your HTML DOM.
Parameters
domElement
requiredstring | HTMLElementThe container DOM element to mount the element.
1// 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 RFI page is ready.
Parameters
type
required'ready'The event name.
handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
type
required'paymentEnablementRfi'1type RfiEventData = {2 type: 'paymentEnablementRfi';3}45element.on('ready', (data: RfiEventData) => {6 // Handle ready event7});
on('success', handler)
This event fires when the rfi flow is completed successfully.
Parameters
type
required'success'The event name.
handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
rfiId
requiredstring1type RfiEventData = {2 rfiId: string;3}45element.on('success', (data: RfiEventData) => {6 // Handle success event7});
on('cancel', handler)
This event fires when the element is exited by cancellation.
Parameters
type
required'cancel'The event name.
handler
required() => voidThe callback function that will be called when the event occurs.
1element.on('cancel', () => {2 console.log('RFI cancelled');3});
on('error', handler)
This event fires when an error occurs within the element.
Parameters
type
required'error'The event name.
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' | 'INVALID_KYC_STATUS' | 'INVALID_RFI_STATUS'message
optionalstring1type errorCode = 'API_ERROR' | 'SUBMIT_FAILED' | 'INVALID_KYC_STATUS' | 'INVALID_RFI_STATUS' | 'UNKNOWN';2type ErrorData = { code: errorCode, message?: string }34element.on('error', (data: ErrorData) => {5 console.error('RFI error:', data.code, data.message);6});
unmount()
Unmounts the Element. Note that the Element instance will remain.
1element.unmount();
Was this page helpful?