How to obtaining the checkoutId, linkToken and completing a transaction
POST
request to Magic API api/merchants/checkout
endpoint. If it succeeds, the response from that request will include the
checkoutId
of the newly created checkout object.
Once the checkoutId
is obtained you can get the linkToken
by making
a POST
request to Magic API
api/merchants/checkout/<checkout_id>/generate_link_token
endpoint. Make sure
to include the checkoutId
on the url.
This process can be implemented using a Django view as follows:
onSuccess
callback explained in the previous section. Such callback should include
a request to an endpoint in the merchant’s backend that will request Magic’s API
to complete the transaction.
This endpoint can be implemented using a Django view as follows: