Second Part of an Integration: Integrating our Frontend Components.
Checkout ID
and Link Token
) using http requests. It is recommended such
parameters to be obtained using a solution located on the Merchant’s server
(i.e using a backend solution), in order to hide the Magic API keys obtained on
the creation of the Merchant’s Account.
The overall app flow to use the Magic Link button would be:
onSuccess
and onError
. Such callbacks will be called once all the
data has been gathered in the hosted page. More details on the Magic Link Button
parameters below.
Parameters
checkoutId
: Pass obtained Checkout id From Create Checkout API of Magic.
linkToken
: Pass obtained Link Token From Get Link Token API of Magic.
onSuccess
: Pass a function in which the Merchant will call Process Payment API of Magic
to complete the transaction. This function will be called when the consumer
clicks on Pay now button on the hosted page.
onError
: Pass a function in which the Merchant will perform a custom action if there is any error on processing with the bank or consumer, this function will be called when there is any error with adding a payment method for authenticating the consumer.
isSandbox
: Add this parameter if Merchant needs to use Magic in Sandbox mode.
checkoutId
and linkToken
and to complete the purchase transaction.