These are the current available callbacks to manipulate the payment form:
Callback called when an error occurs: return a promise
with the KR
object.
const { KR } = await KR.onError((error) => {
// Handle error
})
Note
Please see the type definition file for more information about the
error
object.
Callback called when the payment form is submitted: return a promise
with the KR
object.
const { KR } = await KR.onSubmit((paymentResponse) => {
// Handle result
})
Note
Please see the type definition file for more information about the
paymentResponse
object.
Callback called when the payment form DOM elements are created: return a promise
with the KR
object.
const { KR } = await KR.onFormCreated(() => {
// Handle result
})
Callback called when the payment form application is loaded: return a promise
with the KR
object.
const { KR } = await KR.onLoaded(() => {
// Handle result
})
Callback called when the payment form is ready to be submitted: return a promise
with the KR
object.
const { KR } = await KR.onFormReady(() => {
// Handle result
})
Callback called when a cards payment form field is focused: return a promise
with the KR
object.
const { KR } = await KR.onFocus((field) => {
// Handle result
})
Note
Please see the type definition file for more information about the
field
object.
Callback called when a cards payment form field loses the focus: return a promise
with the KR
object.
const { KR } = await KR.onBlur((field) => {
// Handle result
})
Note
Please see the type definition file for more information about the
field
object.
Callback called when the brand of a cards payment form field changes: return a promise
with the
KR
object.
const { KR } = await KR.onBrandChanged(({ KR, card }) => {
// Handle result
})
Note
Please see the type definition file for more information about the
card
object.
Callback called when a transaction is created: return a promise
with the KR
object.
const { KR } = await KR.onTransactionCreated((paymentResponse) => {
// Handle result
})
Note
Please see the type definition file for more information about the
paymentResponse
object.
Callback called when a 3D Secure authentication is aborted: return a promise
with the KR
object.
const { KR } = await KR.on3dSecureAbort(() => {
// Handle result
})
Callback called when the payment form popin is closed: return a promise
with the KR
object.
const { KR } = await KR.onPopinClosed(() => {
// Handle result
})
Callback called when the installment field value of a cards payment changes: return a promise
with the KR
object.
const { KR } = await KR.onInstallmentChanged(({ KR, installmentInfo }) => {
// Handle result
})
Note
Please see the type definition file for more information about the
installmentInfo
object.
Callback called when the payment form is valid: return a promise
with the KR
object.
const { KR } = await KR.onFormValid(() => {
// Handle result
})
Callback called when the cards payment form button is submitted: return a promise
with the
KR
object.
const { KR } = await KR.button.onClick(() => {
// Handle result
})
Callback called when the wallet payment form tab changes: return a promise
with the KR
object.
const { KR } = await KR.wallet.onTabChange((tab) => {
// Handle result
})