Add to checkout
Integrate Skrill payments using Pay.com.js or the REST API.
You can accept Skrill payments in three ways:
- Universal checkout: Pay.com.js displays Skrill in its payment form.
- Headless checkout: You build your own checkout UI, and Pay.com.js starts the Skrill payment when the customer selects it.
- Server-to-server: You create the charge from your server and redirect the customer to Skrill.
Before you start, ask your account manager to enable Skrill for your account, then turn it on in the Pay.com dashboard.
Universal checkout
Universal checkout displays Skrill 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"skrill"inpayment_method_types.{ "amount": 5000, "currency": "eur", "customer_reference_id": "cust-001", "payment_method_types": ["card", "skrill"] }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 Skrill and clicks Pay, Pay.com.js opens Skrill in a window over your page. If the customer closes the window, Pay.com.js calls
onFailure.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 Skrill payment when the customer selects it.
- 1
Create a payment session
Create the payment session on your server as in Universal checkout, with
"skrill"inpayment_method_types, and initialize Pay.com.js with itsclient_secret. - 2
Check that Skrill is available
Call
checkout.getPaymentMethods(), and show your Skrill 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 skrill = methods.find((method) => method.paymentMethodType === 'skrill') - 3
Start the payment
When the customer selects Skrill, call
checkout.headless()with'skrill'.try { await checkout.headless('skrill') } catch (error) { // onFailure receives the error details too. }Pay.com.js opens Skrill in a window over your page. If the customer closes the window, Pay.com.js calls
onFailure.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 Skrill payment takes three steps: create the charge, create a linked authentication session to obtain the redirect URL, and redirect the customer to Skrill.
- 1
Create the charge
Send
POST /v1/chargeswithsource_data.typeset to"skrill". Pay.com sendssource_data.billing_details.emailto Skrill as the email of the customer's Skrill account.{ "amount": 5000, "currency": "eur", "source_data": { "type": "skrill", "billing_details": { "email": "jane.smith@example.com" } }, "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": "skrill" }, "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, Skrill redirects them back to yourreturn_url. Fulfill the order when you receive thecharge.succeededwebhook event, and handlecharge.failedas a canceled or declined payment.
Skrill options
Set these in payment_method_options.skrill on the payment session or the charge.
| Option | Type | Description |
|---|---|---|
verification.enabled | boolean | Whether the verification feature is enabled. |
verification.accepted_verification_level_values | array of string | List of accepted verification levels. |
verification.require_match_for_customer_details.first_name | boolean | Whether to require an exact match on the customer's first name. |
verification.require_match_for_customer_details.last_name | boolean | Whether to require an exact match on the customer's last name. |
verification.require_match_for_customer_details.country | boolean | Whether to require an exact match on the customer's country/region. |
verification.require_match_for_customer_details.postal_code | boolean | Whether to require an exact match on the customer's postal/ZIP code. |
verification.require_match_for_customer_details.line1 | boolean | Whether to require an exact match on the first line of the street address. |
verification.require_match_for_customer_details.dob | boolean | Whether to require an exact match on the customer's date of birth. |
Test in the sandbox
Test with your sandbox API key (sk-pay-com-sandbox-...) against https://api.sandbox.pay.com/v1. Sandbox payments never move real funds. See Environments.
In the sandbox, Pay.com displays a payment simulator instead of Skrill's page. It shows the payment's ID and lets you choose a Payment Status and a Result Code before clicking Submit. With Pay.com.js, the simulator opens in place of Skrill's page. From your server, open the authentication session's url in a browser.
| Payment status | Result |
|---|---|
COMPLETED | The charge moves to succeeded, the charge.succeeded event fires, and Pay.com.js calls onSuccess. |
PROCESSING | The charge stays pending, and Pay.com.js calls onPending. |
FAILED or ERROR | The charge moves to failed, the charge.failed event fires, and Pay.com.js calls onFailure. |
To test a customer who leaves without paying, close the simulator without submitting. The charge stays requires_authentication.