BoomPay/docs

Wix

A Velo Payment Provider Service Plugin: three backend functions implementing Wix's payments SPI, self-service for your own site and requiring no partner approval.

Velo / JSPayment Provider SPISelf-service

Wix doesn’t expose an open plugin marketplace for payments the way WordPress does. What it has is a Service Plugin Interface (SPI) — a defined contract you implement with Velo backend code. For a single site, registering a Payment Provider SPI is self-service through the editor’s Dev Mode, no partner approval required. A full public listing in Wix’s payment provider marketplace, available to every Wix merchant, is a separate and heavier process through Wix’s business-development team — not what’s covered here.

Architecture

01

Buyer reaches payment step

Wix Checkout shows Boomcoin as a payment method, using the title and logo from getConfig().

02

createTransaction() runs

Wix calls your SPI implementation with order details; it calls BoomPay's createIntent() and returns a redirect.

03

Buyer pays on BoomPay

The buyer is sent to BoomPay's hosted page to approve payment from their Boom wallet.

04

Signed return

BoomPay redirects to a page on your site with paymentIntentId and X-Boom-Signature in the query string.

05

Status confirmed

A backend web method verifies the signature and re-fetches the payment before the page redirects to a thank-you or failure page.

Files

backend/boompay-payment-provider.js
// backend/boompay-payment-provider.js
// Implements Wix's Payment Provider Service Plugin (SPI). Registered from
// the editor: Dev Mode -> Extensions -> add a "Payment Provider" extension,
// which scaffolds a backend module like this one for you to fill in.
import { fetch } from 'wix-fetch';
import { getSecret } from 'wix-secrets-backend';

const SANDBOX = true; // flip to false once you're ready to go live
const BASE_URL = SANDBOX ? 'https://sapi.boom.market' : 'https://api.boom.market';

export async function getConfig() {
  return {
    paymentMethods: [
      {
        title: 'Boomcoin (BoomPay)',
        paymentMethodId: 'boompay-bmc',
        logos: {
          white: { url: 'https://your-cdn.example.com/boompay-logo-white.png' },
          colored: { url: 'https://your-cdn.example.com/boompay-logo.png' },
        },
      },
    ],
    credentialsFields: [],
  };
}

export async function createTransaction(options) {
  const apiKey = await getSecret('BOOMPAY_API_KEY');
  const { order, returnUrls } = options;

  const res = await fetch(`${BASE_URL}/v1/boompay/paymentIntent`, {
    method: 'POST',
    headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      amount: Number(order.description.totalAmount),
      successUrl: returnUrls.successUrl,
      failureUrl: returnUrls.failureUrl,
      label: `Wix order ${order.orderId}`,
      metadata: { wixOrderId: order.orderId },
    }),
  });
  const intent = await res.json();

  // The field names below follow Wix's Create Transaction SPI contract as
  // currently documented, but that contract has shifted over time and isn't
  // independently re-verified here -- check it against Wix's own Payment
  // Provider SPI reference before shipping rather than trusting this verbatim.
  return {
    pluginTransactionId: intent.id,
    redirectUrl: intent.link,
  };
}

export async function refundTransaction(options) {
  // BoomPay's SDK has no refund endpoint -- refunds need to be handled
  // manually from the Boom wallet, outside this integration.
  throw new Error('not_supported');
}
src/pages/PaymentReturn.js
// On the page your successUrl/failureUrl point to (a Velo page, not a
// backend module) -- reads BoomPay's signed query params and confirms status.
import { fetch } from 'wix-fetch';
import wixLocation from 'wix-location';
import { getSecret } from 'wix-secrets-backend';

$w.onReady(async function () {
  const { paymentIntentId } = wixLocation.query;
  // Signature verification happens server-side via a backend web method --
  // never compare it to your API key directly in page code.
  const result = await verifyAndFetch(paymentIntentId, wixLocation.query['X-Boom-Signature']);

  if (result.paidAt) {
    wixLocation.to('/thank-you');
  } else {
    wixLocation.to('/payment-failed');
  }
});
!

Signature verification needs your API key, which must never reach page-level Velo code (anything under src/pages runs partly in the visitor’s browser). Do the actual HMAC check inside a backend web method using wix-secrets-backend, the same way the SPI file above does, and have the page call that method rather than reimplementing the check itself.

Setup

In the editor, open Dev Mode → Extensions, add a new Payment Provider extension, and Wix scaffolds the backend file structure for you to fill in as above. Store your API key via Dev Mode → Secrets Manager rather than hardcoding it, and reference it with getSecret() as shown.

Testing in sandbox

With SANDBOX set to true, place a test order through your site’s checkout choosing Boomcoin, and confirm you land on a sapi.boom.market page. Approve the test payment and verify the buyer is correctly routed to your thank-you page, then deliberately cancel a second test payment and confirm the failure path sends them somewhere sensible instead of a dead end.

Go-live checklist

  • Confirm the exact response shape expected by createTransaction against Wix’s current Payment Provider SPI reference — it’s the one piece of this integration not fully pinned down here.
  • Flip SANDBOX to false and swap in a live API key once a full test order has gone through.
  • Decide how you’ll handle refunds before launch, since BoomPay’s API doesn’t expose one — most integrations process them manually from the Boom wallet and reconcile orders by hand.