BoomPay/partners

Adyen

Add BoomPay to Adyen's payment method catalogue as a redirect APM: respond to /paymentMethods, handle /payments with type 'boompay', return a redirect action, and confirm via webhook.

GatewayREST / Checkout APIRedirect APM

Adyen’s checkout architecture has a formal slot for redirect-based Alternative Payment Methods: your platform responds to /paymentMethods with BoomPay listed, handles a /payments request when the customer selects it, and returns Adyen’s RedirectShopper action pointing at BoomPay’s hosted link. The return path flows through your own callback before surfacing to the merchant via Adyen’s normal notification system.

Flow

01

paymentMethods

Adyen Checkout SDK calls /paymentMethods. Your response includes boompay when the merchant has it enabled.

02

/payments request

Customer selects Boomcoin. Adyen routes a /payments request with paymentMethod.type: 'boompay' to your handler.

03

Intent created

Your handler calls BoomPay's createIntent() and returns a RedirectShopper action with the intent link as the URL.

04

Customer pays

Adyen's SDK redirects the browser to BoomPay's hosted page. The customer approves from their Boom wallet.

05

Signed return

BoomPay redirects to your successUrl/failureUrl with paymentIntentId and X-Boom-Signature.

06

Order confirmed

Your handler verifies the signature, re-fetches the payment, and updates the order — Adyen fires its own merchant notification from there.

Code

adyen/payment-methods.js
// Adyen calls your payment method microservice to populate the /paymentMethods
// response at checkout. Include BoomPay when the merchant has it enabled.
function getAvailablePaymentMethods(merchantConfig, order) {
  const methods = [...merchantConfig.enabledMethods]; // e.g. cards, paypal, etc.

  if (merchantConfig.boompayEnabled && merchantConfig.boompayApiKey) {
    methods.push({
      type: 'boompay',
      name: 'Boomcoin (BoomPay)',
      details: [], // no extra fields needed from the shopper
    });
  }

  return methods;
}
adyen/boompay-payment.js
const BoomPay = require('boom-pay-sdk');

// Adyen routes a /payments request with paymentMethod.type === 'boompay'
// to your APM handler. You create a BoomPay intent and return Adyen's
// standard redirect action.
async function handleBoompayPayment(adyenPaymentRequest, merchant) {
  const boomPay = new BoomPay({
    apiKey: merchant.boompayApiKey,
    sandbox: process.env.NODE_ENV !== 'production',
  });

  const intent = await boomPay.payments.createIntent({
    amount: toBoompayAmount(adyenPaymentRequest.amount),
    successUrl: `${process.env.PSP_BASE}/boompay/return?status=success&ref=${adyenPaymentRequest.reference}&mid=${merchant.id}`,
    failureUrl: `${process.env.PSP_BASE}/boompay/return?status=failure&ref=${adyenPaymentRequest.reference}&mid=${merchant.id}`,
    label: `Adyen order ${adyenPaymentRequest.reference}`,
    metadata: {
      adyenReference: adyenPaymentRequest.reference,
      merchantId: merchant.id,
    },
  });

  // Adyen's redirect action shape: Adyen delivers this to the checkout SDK,
  // which redirects the browser to url automatically.
  return {
    resultCode: 'RedirectShopper',
    action: {
      type: 'redirect',
      url: intent.link,
      method: 'GET',
      paymentMethodType: 'boompay',
    },
  };
}

// Amount conversion: Adyen uses minor units (cents), BoomPay uses BMC.
// Replace this with your actual fiat-to-BMC rate source.
function toBoompayAmount(adyenAmount) {
  const fiatMajor = adyenAmount.value / 100;
  return fiatMajor; // placeholder: implement real FX conversion
}
adyen/boompay-return.js
const crypto = require('crypto');

// BoomPay redirects the customer's browser here after payment.
// Verify BoomPay's return signature before doing anything with the result.
async function handleBoompayReturn(req, res) {
  const { ref, 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) {
    // Mark the Adyen order as authorised in your platform's order store
    // and fire Adyen's own merchant webhook notification.
    await adyenOrderStore.markAuthorised(ref, { provider: 'boompay', reference: intentId });
    return res.redirect(merchant.adyenSuccessReturnUrl);
  }

  await adyenOrderStore.markFailed(ref);
  res.redirect(merchant.adyenFailureReturnUrl);
}
!

Adyen’s webhook (AUTHORISED / REFUSED) is separate from BoomPay’s return redirect and fires on Adyen’s own schedule. For BoomPay, the browser redirect is the only confirmation signal — there is no server-to-server webhook from BoomPay itself. Re-fetching via getPayment() on return is the authoritative check.

Merchant configuration

In your Adyen merchant dashboard layer, surface BoomPay as a toggleable payment method. When enabled, prompt the merchant for their BoomPay API key, validate it via wallets.getDefaultWallet() (see the Integration Guide), and store it against their merchant profile. No Adyen-side API calls are needed to register the payment method — your /paymentMethods response controls availability entirely.

Go-live checklist

  • Implement a real fiat→BMC conversion in toBoompayAmount() — the placeholder passes the fiat major-unit value through unchanged.
  • Confirm your /paymentMethods handler filters BoomPay out when the merchant hasn’t configured a key — a method listed with no key will error on the /payments call.
  • Test the RedirectShopper action shape against your Adyen checkout SDK version — the action field structure is stable but confirm the exact keys against Adyen’s current API reference.
  • Run one full sandbox flow (success) and one cancellation before certifying for production.