Add to checkout
Integrate Volt open banking payments using Pay.com.js or the server-to-server path.
You can accept Volt payments in three ways:
- Universal checkout: Pay.com.js displays Volt in its payment form.
- Headless checkout: You build your own checkout UI, and Pay.com.js starts the Volt payment when the customer selects it.
- Server-to-server: You create the charge from your server and redirect the customer to Volt.
Before you start, ask your account manager to enable Volt for your account, then turn it on in the Pay.com dashboard.
Universal checkout
Universal checkout displays Volt in its payment form when the payment session includes it.
- 1
Create a payment session
On your server, create a payment session with
POST /v1/sessions/paymentand include"volt"inpayment_method_types.{ "amount": 5000, "currency": "eur", "customer_reference_id": "cust-001", "payment_method_types": ["card", "volt"] }Amounts are in the currency's minor unit, so
5000is €50.00.customer_reference_idis your own ID for the customer, and it's required. Return the session'sclient_secretto your page. - 2
Display the checkout
On your page, initialize Pay.com.js with the
client_secretand mount Universal checkout, as in Universal checkout. No method-specific configuration is required. - 3
Handle the result
When the customer selects Volt and clicks Pay, Pay.com.js opens Volt in a new tab. Meanwhile, your page asks the customer to finish there. If they close the tab, Pay.com.js keeps waiting for the payment's outcome.
When the customer finishes, Pay.com.js calls
onSuccessif the payment succeeded,onPendingif its result isn't final yet, oronFailureif it failed. Fulfill the order when you receive thecharge.succeededwebhook event.
Headless checkout
With Headless checkout, you build your own checkout UI, and Pay.com.js starts the Volt payment when the customer selects it.
- 1
Create a payment session
Create the payment session on your server as in Universal checkout, with
"volt"inpayment_method_types, and initialize Pay.com.js with itsclient_secret. - 2
Check that Volt is available
Call
checkout.getPaymentMethods(), and show your Volt button only when the list includes it. Don't usecheckout.canMakePayments()for this, because it reports only Apple Pay and Google Pay.const methods = await checkout.getPaymentMethods() const volt = methods.find((method) => method.paymentMethodType === 'volt') - 3
Start the payment
When the customer selects Volt, call
checkout.headless()with'volt'.try { await checkout.headless('volt') } catch (error) { // onFailure receives the error details too. }Pay.com.js opens Volt in a new tab. Meanwhile, your page asks the customer to finish there. If they close the tab, Pay.com.js keeps waiting for the payment's outcome.
When the customer finishes, Pay.com.js calls
onSuccessif the payment succeeded,onPendingif its result isn't final yet, oronFailureif it failed. Fulfill the order when you receive thecharge.succeededwebhook event.
Server-to-server
From your server, a Volt payment takes three steps: create the charge, create a linked authentication session to obtain the redirect URL, and redirect the customer to Volt.
- 1
Create the charge
Send
POST /v1/chargeswithsource_data.typeset to"volt". Pay.com passessource_data.billing_detailsto Volt to prefill its page for the customer.{ "amount": 5000, "currency": "eur", "source_data": { "type": "volt", "billing_details": { "address": { "country": "DE" } } }, "customer_reference_id": "cust-001", "reference": "order-12345", "description": "Order #12345" }{ "id": "chrg_702172227948251136", "resource": "charge", "amount": 5000, "currency": "eur", "status": "requires_authentication", "payment_method_details": { "type": "volt" }, "reference": "order-12345", "test_mode": true }The charge's
statusisrequires_authenticationuntil the customer approves the payment. - 2
Create a linked authentication session
Send
POST /v1/sessions/authentication/linkedwith the charge'sidasresourceand thereturn_urlto return the customer to.confirmdefaults totrue, so Pay.com completes the charge when the customer approves it. Each charge supports one linked authentication session.{ "resource": "chrg_702172227948251136", "return_url": "https://your-site.com/payment/complete" }{ "id": "sca_702172392511768576", "resource": "authentication_session", "status": "open", "return_url": "https://your-site.com/payment/complete", "url": "https://alternatives.sandbox.pay.com/authenticate?client_secret=...", "test_mode": true } - 3
Redirect the customer
Send the customer to the session's
urlwith a full-page redirect. After they approve or cancel the payment, Volt redirects them back to yourreturn_url. Fulfill the order when you receive thecharge.succeededwebhook event, and handlecharge.failedas a canceled or declined payment.
Restrict available bank countries
By default, the bank selection UI shows banks based on the customer's billing
country, with a fallback to their IP-based country. To restrict which
countries are available, pass allowed_countries under
payment_method_options.bank_account.
This option works with both the SDK and server-to-server integration paths. Add it to either the payment session or the charge request:
{
"payment_method_options": {
"bank_account": {
"allowed_countries": ["GB", "DE", "FR"]
}
}
}Testing
Test against https://api.sandbox.pay.com/v1 with your sk-pay-com-sandbox- API
key. Test transactions never move real funds. See
Environments. Volt must be enabled on your
sandbox account before you can test. Contact your account manager if it isn't
enabled yet.
Sandbox behavior
In the sandbox, Pay.com opens the Volt-hosted sandbox checkout instead of the real Volt payment page. The sandbox checkout shows a list of countries. You select a country, then select a mock bank to open the Mock Manager, where you choose a payment outcome to simulate.
- SDK integration: the SDK opens the Volt-hosted sandbox checkout page (in a new tab, or as a full-page redirect when inline redirects are enabled for your account).
- Server-to-server integration: the linked authentication session
returns a redirect
url. Opening this URL in a browser loads the Volt-hosted sandbox checkout as a full page.
In the live environment (sessions and API calls on https://api.pay.com/v1 with
an sk-pay-com-live- key), the customer is sent to the real Volt-hosted
checkout page to select their bank and authenticate.
How to reach the Mock Manager
To simulate an outcome, open the Mock Manager from the sandbox checkout:
- Create a charge or payment session as described above.
- Open the redirect URL (server-to-server) or click Pay in your SDK integration. The Volt-hosted sandbox checkout opens.
- On the country selector, choose a country.
- On the bank selection screen, select one of the available mock banks.
- The checkout shows two authentication options: Scan to pay (QR code) and Continue on desktop. Click Continue on desktop.
- On the mock bank page, click Open to open the Mock Manager.
- In the Mock Manager, choose a payment outcome to simulate.
Mock Manager outcomes
The Mock Manager simulates these outcomes:
| Outcome | Result |
|---|---|
| Complete and Receive | Charge moves to succeeded. charge.succeeded webhook fires. The customer is redirected to your return_url. |
| Complete and Receive (Legacy API) | Same as above, using Volt's legacy API flow. |
| Complete | Marks the payment as complete on Volt's side. The charge transitions based on the bank's response. |
| Delay | Simulates a delayed bank response. The charge remains in requires_authentication until the bank responds. |
| Fail | Charge moves to failed. charge.failed webhook fires. |
| Cancel | Simulates the customer canceling the payment. Charge moves to failed. |
Verifying the charge after authentication
After the customer completes the mock bank flow and is redirected to your
return_url, retrieve the charge to verify its final state:
curl -X GET "https://api.sandbox.pay.com/v1/charges/{charge_id}" \
-u ':sk-pay-com-sandbox-…'On success, the charge status changes to succeeded and the response
includes updated payment method details:
{
"id": "chrg_758731980656347136",
"status": "succeeded",
"payment_method": "pm_eu_bank_account_758732768082397184",
"payment_method_details": {
"type": "eu_bank_account",
"eu_bank_account": {
"bank_name": "OBIE Mock bank",
"account_holder_name": "Jane Smith",
"country": "DE",
"currency": "EUR",
"last4": "1649",
"source": "volt"
}
}
}