Complete Checkout
What You'll Need | Initialise Deko Wallet | Show Finance Offers | Start Checkout | Complete Checkout | Confirm Payment
7. Customer Completes Checkout
Following successful checkout (applying for and using the selected finance product to complete a purchase), the Deko Wallet checkout
method resolves with a receipt object, whereas if checkout is unsuccessful (the application for finance is rejected or cancelled and the purchase is declined) then the checkout
method fails.
To capture both successful and unsuccessful checkout scenarios from Deko Wallet, please follow the Javascript example shown below. Platforms are also encouraged to implement a separate callback handler via which we can notify you privately and asynchronously of the outcome of a transaction, including to confirm payment.
const receipt = wallet.checkout(cac)
.then((receipt) => {
// SEE the decoded receipt JWT example in the next window
console.log(‘SUCCESS ====’, receipt);
// This will happen only on a payment success
return receipt;
})
.catch((e) => {
console.log(‘FAILURE ====’, e.message);
alert(`FAILURE - ${e.message}`);
// This will happen when either the customer does not meet credit lending qualification or their deposit payment card has been declined
});
Updated 8 months ago