Revolut, Airwallex and Braintree
Core Forms 5.3 adds three payment gateways that take payments into your own merchant account: Revolut, Airwallex and Braintree. They work with Core Forms payment forms and the Core Commerce checkout, like the other gateways.
All three take one-time payments. A recurring plan bought with one of them renews manually: the customer renews from their account when the term ends. None of them is a merchant of record, so Core Commerce tax applies as usual.
| Revolut | Airwallex | Braintree | |
|---|---|---|---|
| Where the buyer pays | Revolut’s hosted page | Airwallex’s hosted page | A card page on your site |
| Payment methods | Card, Apple Pay, Google Pay, Revolut Pay | Card and the local methods Airwallex offers | Card, with 3-D Secure |
| Webhook | Set up for you when you save the key | You add it in Airwallex | None needed |
| Refunds made at the provider | Picked up by webhook | Picked up by webhook | Picked up every six hours |
| Currencies | 21 (see below) | About 130 | One per merchant account |
Turn a gateway on under Core Forms → Settings → Payments, then add it to each currency it should take under Currency routing.
Revolut
You need a Revolut Business account with the Merchant API.
- In Revolut Business, open Merchant → APIs and create a secret key without request signing. It starts with
sk_. The sandbox is a separate Revolut account with its own key. - Paste the key into Sandbox secret key or Live secret key and save.
- On saving, Core Forms registers this site’s webhook with Revolut and fills in the webhook signing secret. This needs a public HTTPS address: on a local or plain-HTTP site, save the key on the live site instead.
How a payment works:
- Checkout creates a Revolut order for the purchase amount and sends the buyer to Revolut’s payment page.
- When the buyer comes back, the order is read from Revolut and a completed payment is confirmed at once. The webhook confirms it too, so closing the tab after paying is fine.
- Webhooks only name an order. Core Forms reads the order back from Revolut before anything changes, and never confirms an order for a different amount or currency than the purchase.
- A full refund in Revolut Business refunds the purchase in Core Forms. A partial refund leaves it in place.
Revolut charges in AUD, CAD, CHF, CZK, DKK, EUR, GBP, HKD, HUF, ILS, JPY, MXN, NOK, NZD, PLN, RON, SEK, SGD, TRY, USD and ZAR.
Airwallex
- In the Airwallex web app, open Developer → API keys and create a key. Copy the client ID, the API key and your account ID. The sandbox (demo.airwallex.com) has its own keys.
- Paste them into the sandbox or live fields.
- Open Developer → Webhooks, add the webhook URL shown in the Airwallex card, and select these events:
checkout_session.completed
payment_intent.succeeded
payment_intent.cancelled
refund.accepted
refund.settled
- Paste the webhook’s secret into Sandbox webhook secret or Live webhook secret and save.
- Turn off Automatic Currency Conversion for these payments in Airwallex, so buyers pay in the currency you charge.
How a payment works:
- Checkout creates an Airwallex Checkout Session and sends the buyer to Airwallex’s payment page. Airwallex lists Checkout Sessions as beta.
- A succeeded payment is confirmed when the buyer comes back, and again by webhook. Every webhook is read back from Airwallex before anything changes.
- One Airwallex account can serve several sites: events for another account, or for payments another site or plugin created, are ignored.
- A purchase is refunded once its accepted and settled refunds cover the whole payment.
Currencies with three decimals (such as KWD and BHD), and ISK, SLE and MGA, aren’t offered, because Airwallex and Core Forms count their decimals differently.
Braintree
- In the Braintree Control Panel, open the gear icon, then API, and copy the merchant ID, public key and private key. The sandbox has its own keys.
- Paste them into the sandbox or production fields and save.
- Each currency you charge needs a merchant account in Braintree. Core Forms reads your merchant accounts from Braintree, and refuses a currency that has none.
- Ask Braintree to switch on 3-D Secure for your account.
3-D Secure takes one of three values:
required(default): every card goes through 3-D Secure. A card whose bank couldn’t run the check is still accepted when Braintree allows it.strict: only cards whose liability moved to the card issuer.off: no 3-D Secure.
How a payment works:
- Braintree has no hosted checkout, so the buyer pays on a card page on your site. The card fields are Braintree’s own secure fields, loaded from Braintree.
- The card page link works for a day, in the mode (test or live) checkout was in. After that, or after you switch modes, the buyer starts again from your site.
- After 3-D Secure, the card is checked with Braintree, never trusted from the browser, and then charged. The purchase is confirmed straight away.
A purchase is never charged twice. Before each charge, Core Forms reads what Braintree already has for that purchase:
- A charge that went through confirms the purchase instead of charging again.
- A charge still being authorized makes the buyer wait.
- If Braintree’s answer to a charge is lost (a timeout, say), the buyer is told not to pay again, and the card page charges nothing more until Braintree shows that charge. A charge Braintree never shows is treated as never made only after 30 minutes and two searches at least 5 minutes apart, because Braintree’s search can lag.
- The lost charge is confirmed when the buyer comes back to your site, or by the six-hourly check below.
Declined cards. To slow card testing, card payments pause after:
- 5 declines on one purchase, for a day after the last one;
- 10 declines from one connection, for a day;
- 100 declines on the whole site, for an hour.
Refunds, voids and settlement. Braintree sends no webhook for card payments, refunds or voids, so every six hours Core Forms reads recent refunds, voids, declined settlements and charges from Braintree. Each one is matched to the transaction that paid for the purchase:
- A refund that covers the whole payment refunds the purchase. A partial refund leaves it in place.
- A void before the purchase was confirmed fails it. A void after, or a settlement Braintree declines later, refunds it, since no money arrived.
- A charge whose answer was lost confirms the purchase.
- A second charge for the same purchase never changes it. You get a payment alert email asking you to refund it in Braintree.
The check reads back to where the last complete run stopped, up to 120 days. If Braintree can’t be reached, it reads the same period again next time. A key without permission for one kind of search skips only that search.
Braintree needs no webhook URL here, and the Braintree card in Settings shows none.
Keys in wp-config.php
Every field can be set in wp-config.php instead, named CORE_FORMS_{GATEWAY}_{FIELD} in capitals:
define( 'CORE_FORMS_REVOLUT_SECRET_KEY_LIVE', 'sk_...' );
define( 'CORE_FORMS_REVOLUT_WEBHOOK_SECRET_LIVE', 'wsk_...' );
define( 'CORE_FORMS_AIRWALLEX_CLIENT_ID_LIVE', '...' );
define( 'CORE_FORMS_AIRWALLEX_API_KEY_LIVE', '...' );
define( 'CORE_FORMS_AIRWALLEX_ACCOUNT_ID_LIVE', 'acct_...' );
define( 'CORE_FORMS_AIRWALLEX_WEBHOOK_SECRET_LIVE', '...' );
define( 'CORE_FORMS_BRAINTREE_MERCHANT_ID_LIVE', '...' );
define( 'CORE_FORMS_BRAINTREE_PUBLIC_KEY_LIVE', '...' );
define( 'CORE_FORMS_BRAINTREE_PRIVATE_KEY_LIVE', '...' );
With a Revolut signing secret in wp-config.php, saving the key doesn’t register the webhook. Save the key once without that constant, so Core Forms registers the webhook and saves its secret, then move the secret into wp-config.php.
Not supported yet
- Automatic renewals. Stackless for FluentCart renews these gateways by charging a saved card on its own schedule. Core Commerce renewals run at the provider, and these three have no subscription Core Forms can start.
- Refunding from Core Forms. Refund in the provider’s dashboard; the refund then reaches Core Forms.
- Airwallex API keys that cover several Airwallex accounts. Use a key for the one account you take payments into.
- Disputes and chargebacks. Handle them in the provider’s dashboard.
- Several accounts for one gateway.