Korean Card Number Element
createElement('krCardNumber', options?)
Parameters
type
required'krCardNumber'options
optionalKRCardNumberElementOptionskrCardNumber Element.The authorization type for the card payment.
Set it to 'pre_auth' if you want to place a hold on your customer's card for more than 7 days, i.e., extend the authorization time window.
Currently it's only available when the card brand is Visa or Mastercard. autoCapture will be automatically set to false if you enable 'pre_auth'.
'final_auth'autoCapture
optionalbooleanWhether the amount should be captured automatically upon successful payment authorization.
Set it to false if you want to place a hold on the payment method and capture the funds sometime later.
truedisabled
optionalbooleankrCardNumber Element input is disabled or not.falseintent
optionalIntentThe Payment Intent you would like to checkout. Refer to Airwallex Client API
id
requiredstringamount
optionalnumberclient_secret
optionalstringclient_secret of the Payment Intent when Payment Intent is provided. Otherwise, this should be the client_secret of the Customer object.created_at
optionalstringcurrency
optionalstringcustomer_id
optionalstringcustomer_payment_consents
optionalobjectid
requiredstringnext_triggered_by
required'merchant' | 'customer'payment_method
requiredobjecttype
required'card' | 'ach_direct_debit' | 'becs_direct_debit'ach_direct_debit
optionalobjectaba_routing_number
requiredstringaccount_number
requiredstringowner_email
requiredstringowner_name
requiredstringbecs_direct_debit
optionalobjectaccount_number
requiredstringbsb_number
requiredstringowner_email
requiredstringowner_name
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'id
optionalstringstatus
required'PENDING_VERIFICATION' | 'VERIFIED' | 'DISABLED'customer_payment_methods
optionalobjectid
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'merchant_order_id
optionalstringpayment_consent_id
optionalstringrequest_id
optionalstringstatus
optionalstringupdated_at
optionalstringplaceholder
optionalstringstyle
optionalInputStylebase
optionalPseudoClassStyle & CSSPropertiesinvalid
optionalCSSPropertiespopupHeight
optionalnumberpopupWidth
optionalnumbervalid
optionalCSSPropertiesReturns
KRCardNumberElement | null
1import { init, createElement } from '@airwallex/components-sdk';23await init({4 env: 'prod',5 enabledElements: ['payments'],6});78const element = await createElement('krCardNumber', {9 showIcon: true, // Optional: Show card brand icon10});1112element.mount('kr-card-number-container');
blur()
1element.blur();
clear()
1element.clear();
confirm(data)
Call this function when the shopper is ready to make a payment as per the details in the Payment Intent.
Confirms the Payment Intent.
Parameters
data
requiredPaymentMethodRequestDataclient_secret
requiredstringclient_secret of the Payment Intent when Payment Intent is provided. Otherwise, this should be the client_secret of the Customer object.customer_id
optionalstringThe ID of the Customer used in registered user checkout. Refer to Airwallex Client API
This field is required when mode is 'recurring'.
error
optionalobjectcode
optionalstringmessage
optionalstringintent_id
optionalstringThe ID of the Payment Intent you would like to checkout. Required when mode is 'payment'.
Refer to Airwallex Client API
payment_consent
optionalPaymentConsentOptionsnext_triggered_by
required'merchant' | 'customer'merchant_trigger_reason
optional'scheduled' | 'unscheduled' | 'installments''unscheduled'terms_of_use
optionalTermsOfUsepayment_amount_type
required'FIXED' | 'VARIABLE'payment_currency
requiredstringstart_date
requiredstringbilling_cycle_charge_day
optionalnumberThe granularity per billing cycle. Required when payment_schedule.period_unit is WEEK, MONTH, or YEAR.
end_date
optionalstringfirst_payment_amount
optionalnumberThe first payment. It could include the costs associated with the first debited amount. Optional if payment_amount_type is VARIABLE.
fixed_payment_amount
optionalnumberThe fixed payment amount that can be charged for a single payment. Required if payment_amount_type is FIXED.
max_payment_amount
optionalnumberThe maximum payment amount that can be charged for a single payment. Optional if payment_amount_type is VARIABLE.
payment_schedule
optionalobjectperiod
requirednumberThe number of period units between billing cycles. For example, the payment cycle is one month if period=1 and period_unit=MONTH. Required when merchant_trigger_reason = scheduled.
period_unit
required'DAY' | 'WEEK' | 'MONTH' | 'YEAR'Specifies billing frequency. One of DAY, WEEK, MONTH, and YEAR. Required when merchant_trigger_reason = scheduled.
total_billing_cycles
optionalnumberThe total number of billing cycles of the payment schedule. If null, the mandate will continue indefinitely.
payment_method
optionalPaymentMethodObjTypecard
requiredobjectname
optionalstringbilling
optionalBillingaddress
requiredAddresscity
requiredstringcountry_code
requiredstringThe two-letter ISO country code of the shopper's country. https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
postcode
requiredstringstate
requiredstringstreet
requiredstringfirst_name
requiredstringlast_name
requiredstringdate_of_birth
optionalstringphone_number
optionalstringpayment_method_id
optionalstringpayment_method_options
optionalPaymentMethodOptionsTypecard
optionalobjectThe authorization type for the card payment.
Set it to 'pre_auth' if you want to place a hold on your customer’s card for more than 7 days, i.e., extend the authorization time window.
Currently 'pre_auth' is only available when the card brand is Visa or Mastercard. autoCapture will be automatically set to false if you enable pre_auth.
'final_auth'auto_capture
optionalbooleanWhether the amount should be captured automatically upon successful payment authorization.
Set it to false if you want to place a hold on the payment method and capture the funds sometime later.
truetriggered_by
optional'customer'This field is used to indicate whether the current payment is initiated by the cardholder. This field must be used only in combination with payment_method_id field and is applicable only for Cvc element. FYI : next_triggered_by is used to indicate the driver for subsequent payments in the series.
'customer': The payment is initiated by the customer using the stored payment method details.
id
optionalstringDeprecatedThe payment intent you would like to checkout Refer to Airwallex Client API
methodId
optionalstringDeprecatedReturns
Promise<Intent>
Intent
requiredobjectid
requiredstringamount
optionalnumberclient_secret
optionalstringclient_secret of the Payment Intent when Payment Intent is provided. Otherwise, this should be the client_secret of the Customer object.created_at
optionalstringcurrency
optionalstringcustomer_id
optionalstringcustomer_payment_consents
optionalobjectid
requiredstringnext_triggered_by
required'merchant' | 'customer'payment_method
requiredobjecttype
required'card' | 'ach_direct_debit' | 'becs_direct_debit'ach_direct_debit
optionalobjectaba_routing_number
requiredstringaccount_number
requiredstringowner_email
requiredstringowner_name
requiredstringbecs_direct_debit
optionalobjectaccount_number
requiredstringbsb_number
requiredstringowner_email
requiredstringowner_name
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'id
optionalstringstatus
required'PENDING_VERIFICATION' | 'VERIFIED' | 'DISABLED'customer_payment_methods
optionalobjectid
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'merchant_order_id
optionalstringpayment_consent_id
optionalstringrequest_id
optionalstringstatus
optionalstringupdated_at
optionalstring1element.confirm({2 client_secret: 'replace-with-your-client-secret',3});
destroy()
1element.destroy();
focus()
1element.focus();
mount(domElement)
Parameters
domElement
requiredstring | HTMLElementReturns
HTMLElement | null
1// 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('ready', handler)
Parameters
type
required'ready'handler
required() => void1element.on('ready', () => {2 console.log('Element is ready');3 });
on('change', handler)
Parameters
type
required'change'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
detail
requiredobjectcompleted
requiredbooleanempty
requiredbooleanerror
requiredobjectcode
requiredstringmessage
requiredstring1element.on('change', (e) => {2 const { completed, empty, error } = e.detail;3 console.log('Form changed', { completed, empty, error });4 });
on('focus', handler)
Parameters
type
required'focus'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
detail
requiredobjectcompleted
requiredbooleanempty
requiredbooleanerror
requiredobjectcode
requiredstringmessage
requiredstring1element.on('focus', (e) => {2 const { completed, empty, error } = e.detail;3 console.log('Form focused', { completed, empty, error });4 });
on('blur', handler)
Parameters
type
required'blur'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
detail
requiredobjectcompleted
requiredbooleanempty
requiredbooleanerror
requiredobjectcode
requiredstringmessage
requiredstring1element.on('blur', (e) => {2 const { completed, empty, error } = e.detail;3 console.log('Form blurred', { completed, empty, error });4 });
on('pressArrowKey', handler)
Parameters
type
required'pressArrowKey'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
detail
requiredobjectarrowKey
requiredstring1element.on('pressArrowKey', (e) => {2 const { arrowKey } = e.detail;3 console.log('Arrow key pressed', arrowKey);4 });
on('submit', handler)
Parameters
type
required'submit'handler
required() => void1element.on('submit', () => {2 console.log('Form submitted');3 });
unmount()
1element.unmount();
update(options?, initOptions?)
Parameters
options
optionalKrCardNumberElementOptionsThe authorization type for the card payment.
Set it to 'pre_auth' if you want to place a hold on your customer's card for more than 7 days, i.e., extend the authorization time window.
Currently it's only available when the card brand is Visa or Mastercard. autoCapture will be automatically set to false if you enable 'pre_auth'.
'final_auth'autoCapture
optionalbooleanWhether the amount should be captured automatically upon successful payment authorization.
Set it to false if you want to place a hold on the payment method and capture the funds sometime later.
truedisabled
optionalbooleankrCardNumber Element input is disabled or not.falseintent
optionalIntentThe Payment Intent you would like to checkout. Refer to Airwallex Client API
id
requiredstringamount
optionalnumberclient_secret
optionalstringclient_secret of the Payment Intent when Payment Intent is provided. Otherwise, this should be the client_secret of the Customer object.created_at
optionalstringcurrency
optionalstringcustomer_id
optionalstringcustomer_payment_consents
optionalobjectid
requiredstringnext_triggered_by
required'merchant' | 'customer'payment_method
requiredobjecttype
required'card' | 'ach_direct_debit' | 'becs_direct_debit'ach_direct_debit
optionalobjectaba_routing_number
requiredstringaccount_number
requiredstringowner_email
requiredstringowner_name
requiredstringbecs_direct_debit
optionalobjectaccount_number
requiredstringbsb_number
requiredstringowner_email
requiredstringowner_name
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'id
optionalstringstatus
required'PENDING_VERIFICATION' | 'VERIFIED' | 'DISABLED'customer_payment_methods
optionalobjectid
requiredstringcard
optionalobjectbin
requiredstringbrand
requiredstringfingerprint
requiredstringlast4
requiredstringnumber_type
required'AIRWALLEX_NETWORK_TOKEN' | 'EXTERNAL_NETWORK_TOKEN' | 'PAN'merchant_order_id
optionalstringpayment_consent_id
optionalstringrequest_id
optionalstringstatus
optionalstringupdated_at
optionalstringplaceholder
optionalstringstyle
optionalInputStylebase
optionalPseudoClassStyle & CSSPropertiesinvalid
optionalCSSPropertiespopupHeight
optionalnumberpopupWidth
optionalnumbervalid
optionalCSSPropertiesinitOptions
optionalInitOptionsenv
optional'demo' | 'prod''prod'fonts
optionalFontOptions[]family
optionalstringThe font-family property, for example, AxLLCircular.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
src
optionalstringThe font-source property, for example, https://checkout.airwallex.com/fonts/CircularXXWeb/CircularXXWeb-Regular.woff2.
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face
weight
optionalstring | numberThe font-weight property. Supported font weights include: regular (400) and bold (700). https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
locale
optionalenumar
da
de
en
es
fi
fr
he
id
it
ja
ko
ms
nl
pl
pt
ro
ru
si
sv
tr
vi
ur
zh
zh-HK
origin
optionalstringDeprecated1element.update({2 autoCapture: false,3});