Payment Gateways

Accept payments with Stripe, PayPal, account balance and more. Set up gateway configs, webhooks and recurring subscriptions.

Payment gateways are set up in two layers, just like servers:

  • A gateway is the integration, for example Stripe Checkout. It's an extension you enable or disable.
  • A gateway config is a customer-facing payment method built on a gateway, with its own name, description, icon and API keys. Customers choose from your gateway configs at checkout.

You can create several configs for the same gateway, for example two Stripe accounts, or a staff-only test config next to a live one.

Included gateways

GatewayTypeNotes
Stripe CheckoutPaymentHosted Stripe checkout page. Needs a secret key (sk_…) and a webhook signing secret (whsec_…).
PayPal BusinessPaymentPayPal REST API. Needs a client ID, client secret and webhook ID. Sandbox and live modes.
PayPal SimplePaymentSimplest setup: only a PayPal email address.
PayPal SubscriptionSubscriptionAutomatic recurring billing through PayPal. Can create the webhook for you.
BalancePaymentPays from the customer's account credit. Supports refunds back to the balance.
Sandbox / Sandbox SubscriptionPayment / SubscriptionCompletes immediately without charging anyone. For testing only.

You can install more gateways from the Marketplace, for example Mollie or Tebex.

Set up a gateway

Enable the gateway. Go to Admin → Gateways → Installed Gateways and click Enable next to the gateway.

Create a gateway config. Click Setup, or go to Gateway Configs → Create and choose the gateway. Fill in:

FieldDescription
Display nameWhat customers see at checkout, for example "Credit / Debit Card".
Display descriptionA short line under the name, for example "Visa, Mastercard, Apple Pay".
IconOptional logo shown at checkout.
Webhook IDThe identifier in this config's webhook URL. It's generated from the display name and must be unique.
Gateway fieldsAPI keys, secrets and mode. They're stored encrypted.

Register the webhook with your provider. Gateways that support webhooks receive them at:

https://your-domain.com/gateways/webhooks/{webhook_id}

Add this URL in your provider's dashboard. For Stripe, go to Developers → Webhooks, add the URL, subscribe to checkout.session.completed, and copy the signing secret into the config.

Without a working webhook, a payment is only confirmed if the customer returns to your site after paying. If they close the tab, the order isn't created. Always set up the webhook.

Choose who can use it. Leave Enabled on to show the config at checkout. Turn on Staff only to hide it from customers. This is useful for testing a new gateway on your live store.

Your license plan may limit how many gateway configs you can create.

How a payment is confirmed

Customer picks a gateway ─▶ redirected to provider ─▶ pays
                                                        │
          ┌─────────────────────────────────────────────┴─────────────┐
          ▼                                                           ▼
  Provider calls the webhook                            Customer returns to the callback URL
  /gateways/webhooks/{webhook_id}                       /gateways/callbacks/{webhook_id}
          └──────────────────────┬────────────────────────────────────┘
                                 ▼
         Payment marked "paid" (only once, whichever arrives first)
                                 ▼
          Orders created and provisioned, or renewal applied

Every incoming webhook is logged with its headers and payload, including failures, which helps when you debug a provider integration.

Currencies

Each gateway can list the currencies it supports. At payment time, WemX charges in the customer's selected display currency if the gateway supports it. Otherwise it converts to the gateway's own default currency. See Currencies.

One-time payments vs subscriptions

  • Payment gateways charge once. They're used for checkout, manual renewals, invoice payments and balance top-ups.
  • Subscription gateways set up a recurring agreement at the provider. After an order is active, the customer can open the order's Subscription tab and subscribe, and from then on the provider renews the order automatically. See Subscriptions.

The Balance gateway

The Balance gateway lets customers pay from their account credit, which they top up through any other gateway. It's also used for:

  • Automatic renewals from balance, which customers turn on for each order.
  • Refunds to balance. Any paid payment can be refunded as account credit, even if the original gateway doesn't support refunds.

Balance payments aren't taxed by default, because tax is charged when the credit is used to pay for an order.

Refunds

Open a paid payment under Admin → Payments and choose Refund. You can refund:

  • through the original gateway, if it supports refunds (some also support partial amounts), or
  • to the customer's balance, which always works.

See Payments & invoices.

On this page