Amazon Pay
Present BoomPay alongside Amazon Pay as a parallel checkout option: Amazon Pay handles its own wallet flow, BoomPay handles Boomcoin, and a shared confirmation layer reconciles both.
Amazon Pay is a closed wallet tied to Amazon customer accounts — it doesn’t expose an API for registering third-party payment rails inside its own flow. The workable integration pattern is presenting BoomPay and Amazon Pay as two distinct checkout buttons on the same page: Amazon Pay’s own SDK handles the Amazon flow, and BoomPay’s redirect handles the Boomcoin flow. Your platform’s return handler reconciles both outcomes through the same confirmation logic.
Amazon Pay’s partner API focuses on merchant onboarding, dispute management, and reporting — it doesn’t provide a mechanism for PSPs to register alternative settlement rails within Amazon Pay’s checkout button itself. If you need BoomPay to appear inside Amazon Pay’s widget, that is not currently possible through Amazon Pay’s published APIs.
Flow
Page loads with both options
Your server pre-generates a BoomPay intent link. The page renders Amazon Pay's button via their JS SDK plus a separate Boomcoin button.
Customer picks Boomcoin
Clicking the Boomcoin button redirects to BoomPay's hosted link.
Customer pays
The customer approves from their Boom wallet on BoomPay's hosted page.
Signed return
BoomPay redirects back with paymentIntentId and X-Boom-Signature.
Confirm
Your handler verifies the signature, confirms via getPayment(), and fires your merchant notification.
Code
const BoomPay = require('boom-pay-sdk');
// When loading the checkout page, pre-generate the BoomPay intent link
// alongside the Amazon Pay session. Both are passed to the frontend.
async function prepareCheckout(merchant, order) {
const boomPay = new BoomPay({
apiKey: merchant.boompayApiKey,
sandbox: process.env.NODE_ENV !== 'production',
});
const intent = await boomPay.payments.createIntent({
amount: toBmc(order.total, order.currency),
successUrl: `${process.env.PSP_BASE}/boompay/return?status=success&order=${order.id}&mid=${merchant.id}`,
failureUrl: `${process.env.PSP_BASE}/boompay/return?status=failure&order=${order.id}&mid=${merchant.id}`,
label: `${merchant.name} Order ${order.reference}`,
metadata: { orderId: order.id, merchantId: merchant.id },
});
return {
amazonPayConfig: merchant.amazonPayConfig, // merchant's Amazon Pay merchant ID etc.
boompayLink: intent.link,
};
}
function toBmc(amount, currency) {
return amount; // placeholder -- replace with real conversion
}const crypto = require('crypto');
async function handleBoompayReturn(req, res) {
const { order: orderId, mid, status } = req.query;
const intentId = req.query.paymentIntentId;
const signature = (req.query['X-Boom-Signature'] || '').replace(/ /g, '+');
const merchant = await db.getMerchant(mid);
const expected = crypto.createHmac('sha1', merchant.boompayApiKey)
.update(intentId).digest('base64');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) {
return res.status(403).send('Invalid signature');
}
const boomPay = new BoomPay({ apiKey: merchant.boompayApiKey, sandbox: process.env.NODE_ENV !== 'production' });
const payment = await boomPay.payments.getPayment(intentId);
if (status === 'success' && payment.paidAt) {
await db.markOrderPaid(orderId, { provider: 'boompay', reference: intentId });
await notifyMerchant(merchant, 'PAYMENT_COMPLETE', orderId);
return res.redirect(merchant.successUrl);
}
await db.markOrderFailed(orderId);
res.redirect(merchant.failureUrl);
}Go-live checklist
- Implement
toBmc()with a real conversion rate before going live. - Ensure the Amazon Pay button and BoomPay button cannot both be activated for the same order simultaneously.
- Confirm Amazon Pay’s JS SDK version in use is compatible with your checkout layout when both options are rendered together.