Create Beneficiary Element
createElement('beneficiaryForm', options?)
Use this function to create an instance of an individual Element.
Parameters
The type of element you are creating.
Options for creating beneficiaryForm Element.
Returns
BeneficiaryFormElement | null1import { createElement } from '@airwallex/components-sdk';2const element = await createElement('beneficiaryForm', {3 defaultValues: {4 beneficiary: {5 entity_type: 'COMPANY',6 bank_details: {7 account_currency: 'AUD',8 bank_country_code: 'AU',9 local_clearing_system: 'BANK_TRANSFER',10 },11 },12 transfer_methods: ['LOCAL'],13 },14});
BeneficiaryFormElementOptions
Options for creating the Beneficiary Form Element.
The Airwallex API version to use for the form. Only support for api version after 2023-04-15.
Customization options for the form's behavior.
Pre-filled values for the form fields. Note: Pre-filled values only take effect for fields that can be rendered on initial load. Fields that are dynamically generated through user interactions will not be affected by default values.
The locale for the Element, applied to Element UI strings and error messages. By default, the locale configured in init() is used.
BeneficiaryFormElement
Functions and external fields can be used in your integration flow with Beneficiary Form element.
mount(domElement)
Mounts Element to your HTML DOM.
Parameters
The container DOM element to mount the element.
Returns
void1// There are two ways to mount the element:2// 1. Call with the container DOM id3element.mount('container-dom-id');45// 2. Find the created DOM in the existing HTML and call with the container DOM element6const containerElement = document.getElementById('container-dom-id');7element.mount(containerElement);
on(eventCode, handler)
Listen to the Element events.
Parameters
The event code to listen for.
The callback function that will be called when the event occurs.
Returns
void1element.on('ready', () => {2 // The 'ready' event indicates that the form is ready for user interaction3 // This event can be used to hide loading indicators4 // For a complete list of event codes, please refer to the BeneficiaryFormEventCode enum5});