Hosted Checkout

Integrating with Switch

The Switch Hosted Checkout allows you to redirect your Customers from your cart to our checkout when it is time to pay. Hosted Checkout uses Dynamic Forms to make it easier on you to change around Payment Methods as you see fit as well as streamline your checkout process.

  • Pay by Link

    Transfer the Transaction conundrum to us. Redirect Customers to the Hosted Checkout and avoid the Payment setup.

  • PCI Compliance

    Stop worrying about PCI Compliance. With Hosted Checkout your Customer’s Payment information never touches your website, you can leave the compliance concerns to us.

  • Alternative Payment Methods

    Let your Customers ditch the cards. Allow your clients to use alternative forms of Payment in your terminals through QR codes.

POST /checkout.switchpayments.com

MethodPathDescription
POSThttps://checkout.switchpayments.comCreate hosted checkout page.
HOSTED CHECKOUT EXAMPLE
{
"checkoutParams": {
"currency": "EUR",
"showReference": false,
"cancelUrl": "https://checkout-demo.switchpayments.com/cart",
"chargesUrl": "https://checkout-demo.switchpayments.com/create-charge",
"redirectUrl": "https://checkout-demo.switchpayments.com/checkout-complete?",
"chargeTypes": [
"afterpay",
"alipay",
"boleto",
"card_onetime",
"giropay",
"ideal",
"klarna_invoice",
"lotericas",
"multibanco",
"mbway",
"neosurf",
"ninja_wallet",
"offline_bank_transfer",
"p24",
"paypal",
"paysafecard",
"sofort",
"trustly",
"yandex"
],
"products": [
{
"title": "Sample product 1",
"reference": "595326123",
"quantity": 1,
"price": 14.99,
"thumbnail": "https://checkout-demo.switchpayments.com/img/sample-desktop.jpg"
},
{
"title": "Sample product",
"reference": "5955200026",
"quantity": 1,
"price": 4.19,
"thumbnail": "https://checkout-demo.switchpayments.com/img/sample-camera.jpg"
},
{
"title": "Sample product 3",
"reference": "595326124",
"quantity": 1,
"price": 2.5
},
{
"title": "Sample product 4",
"reference": "595326456",
"quantity": 1,
"price": 1.5
},
{
"title": "Sample product 5",
"reference": "595365930",
"quantity": 1,
"price": 10,
"thumbnail": "https://checkout-demo.switchpayments.com/img/sample-headphones.jpeg"
}
],
"totals": {
"vat": 0,
"shippingCosts": 5,
"subtotal": 33.18
},
"merchant": {
"name": "Sample Merchant",
"logo": "https://switchpayments.com/homepage/imgs/base/switch-logo_normal.png",
"publicKey": "publicKey",
"environment": "SANDBOX"
},
"amount": 38.18,
"merchantTransactionId": 25
}
}

Enabling Hosted Checkout in your payment operations is a four-step process.

1. Redirect Customer

You must redirect the Customer from your website to Hosted Checkout, you can do this immediately from the pay option in your cart or generate a URL which can be accessed by the Customer at a later time.

Your Hosted Checkout Transaction should include the same data as it is required by Dynamic Forms, this includes parameters such as amount, currency and chargesURL. Additionally it can also figure customization parameters exclusive to the Hosted Checkout feature, namely merchant_name and logo. Last but not least, it is relevant to input the order information. This refers to the selected products, shipping costs, and VAT, for example.

2. Create Charge

When creating a Charge, Merchants are expected to supply their own URL to the Hosted Checkout. This URL is called when the Customer submits the Payment details and should return the respective charge_id.

3. Implement Webhook Endpoint

It is essential to implement an endpoint which will receive the Webhooks generated from the Hosted Checkout procedures. This process is similar to what we implement for Dynamic Forms or REST Integration.

4. Redirect Customer Back

You should include a redirecting URL that guides the users back to your website once the Payment procedures have been completed.