Introduction

Accepting card payments is essential for any online business, as it allows customers to make transactions quickly and securely. Payrails simplifies the process of accepting card payments, providing a seamless experience for both you and your customers. This guide will walk you through the steps to integrate card payments into your app or website using Payrails, ensuring a smooth and reliable transaction process.

Pre-requisites

Before you start accepting card payments with Payrails, there are a few requirements you must meet:

  1. Integrate with Payrails using one of our SDKs or our API
  2. Configure a new integration account for cards via one of the following Payment Service Providers:
    Adyen, AmEx, Checkout.com, dLocal, Fawry, Flutterwave, Garanti BBVA, HyperPay, Lidio, PayU, Pine Labs, Stripe, Tap, and coming soon (Nuvei)
  3. Enable cards as a payment option.
  4. Make sure you're sending the provider specific card meta fields (found under Merchant configurations -> Meta fields on your Payrails dashboard and in the examples below) in your requests.

Ways to integrate cards

Payrails offers two main integration types for accepting card payments, each with its own set of advantages:

Payrails SDK

Payrails provides a hosted payment page, which is a fully customizable and responsive payment form hosted on our secure servers. This option is perfect for businesses that want to offer a seamless payment experience without the need to handle sensitive card information directly.

Benefits:

  • Reduces your PCI-DSS compliance scope.
  • Provides a customizable and responsive payment form.
  • Minimizes the need for complex front-end development.

Integration Steps:

  1. Configure the hosted payment page settings in your Payrails dashboard.
  2. Redirect customers to the hosted payment page URL when they initiate a payment.
  3. Handle the response from Payrails after the transaction is completed.

Server-to-server integration

Payrails also provides an API integration option, which allows you to build a fully custom payment form within your app or website. This option requires a higher level of PCI-DSS compliance but offers more flexibility and control over the payment experience.

Benefits:

  • Complete control over the payment form's design and functionality.
  • Enables seamless integration with your existing user interface.
  • Provides more flexibility in handling payment-related events and actions.

Integration Steps:

  1. Collect card information from the customer using a secure payment form on your app or website.
  2. Tokenize the card data using the Payrails API, which securely sends the data to Payrails and returns a token.
  3. Use the token to process the payment through the Payrails API, specifying the desired PSP and transaction details.
  4. Handle the response from Payrails to confirm the transaction's success or handle any errors.

Choose the integration type that best suits your business needs and follow the appropriate steps to start accepting card payments with Payrails.

Parse card from lookup response

With a server-to-server integration, you can call our lookup payment options endpoint to get available payment options and relevant configurations for each payment method. As the example below, you can see genericRedirect returned as an option of the paymentCompositionOptions. You can use this value later to authorize payments with Payrails as you can see in the next sections.

{
    "name": "lookup",
    "actionId": "0bb6413e-cabb-4074-99e6-9e815c69f25b",
    "executedAt": "2024-05-08T12:33:21.527395295Z",
    "data": {
        "paymentCompositionOptions": [
            {
                "integrationType": "api",
                "paymentMethodCode": "card",
                "description": "Card"
            }
        ]
    },
    "links": {
        "execution": "http://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424",
        "authorize": {
            "method": "POST",
            "href": "http://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424/authorize"
        }
    }
}

Pass card payment method in request to authorize payment with Payrails

You can then make a request to our authorize a payment endpoint with card as the paymentMethodCode. See an example below:

{
  "executionId": "c0fd1c51-e709-47e5-bfd1-5d1c98f7d990",
  "amount": {
    "value": "100",
    "currency": "USD"
  },
  "paymentComposition": [{
    "integrationType": "api",
    "paymentMethodCode": "card",
    "amount": {
      "value": "100",
      "currency": "USD"
    }
  }],
  "meta": {
    "order": {
      "lines": [{
        "id": "UUID",
        "name": "Order Name",
        "quantity": 1,
        "unitPrice": {
          "currency": "USD",
          "value": "100"
        }
      }]
    }
  },
  "returnInfo": {
    "success": "https://mysuccessurl.com",
    "error": "https://myerrorurl.com"
  }
}

Supported regions / countries

Region(s)Countries
EuropešŸ‡¦šŸ‡¹ Austria, šŸ‡§šŸ‡Ŗ Belgium, šŸ‡§šŸ‡¬ Bulgaria, šŸ‡­šŸ‡· Croatia, šŸ‡ØšŸ‡¾ Cyprus,
šŸ‡ØšŸ‡æ Czech Republic, šŸ‡©šŸ‡° Denmark, šŸ‡ŖšŸ‡Ŗ Estonia, šŸ‡«šŸ‡® Finland,
šŸ‡«šŸ‡· France, šŸ‡©šŸ‡Ŗ Germany, šŸ‡¬šŸ‡® Gibraltar, šŸ‡¬šŸ‡· Greece, šŸ‡­šŸ‡ŗ Hungary,
šŸ‡®šŸ‡ø Iceland, šŸ‡®šŸ‡Ŗ Ireland, šŸ‡®šŸ‡¹ Italy, šŸ‡±šŸ‡» Latvia, šŸ‡±šŸ‡® Liechtenstein,
šŸ‡±šŸ‡¹ Lithuania, šŸ‡±šŸ‡ŗ Luxembourg, šŸ‡²šŸ‡¹ Malta, šŸ‡³šŸ‡± Netherlands, šŸ‡³šŸ‡“ Norway,
šŸ‡µšŸ‡± Poland, šŸ‡µšŸ‡¹ Portugal, šŸ‡·šŸ‡“ Romania, šŸ‡øšŸ‡° Slovakia, šŸ‡øšŸ‡® Slovenia,
šŸ‡ŖšŸ‡ø Spain, šŸ‡øšŸ‡Ŗ Sweden, šŸ‡ØšŸ‡­ Switzerland, šŸ‡¹šŸ‡· Turkey, šŸ‡¬šŸ‡§ UK, others..
North and Central AmericašŸ‡ŗšŸ‡ø USA, šŸ‡²šŸ‡½ Mexico, šŸ‡ØšŸ‡¦ Canada, šŸ‡ØšŸ‡· Costa Rica, šŸ‡øšŸ‡» El Salvador,
šŸ‡¬šŸ‡¹ Guatemala, šŸ‡­šŸ‡³ Honduras, šŸ‡³šŸ‡® Nicaragua, šŸ‡µšŸ‡¦ Panama,
šŸ‡©šŸ‡“ Dominican Republic, šŸ‡µšŸ‡· Puerto Rico, others..
South AmericašŸ‡¦šŸ‡· Argentina, šŸ‡§šŸ‡· Brazil, šŸ‡§šŸ‡“ Bolivia, šŸ‡ØšŸ‡± Chile, šŸ‡ØšŸ‡“ Colombia,
šŸ‡ŖšŸ‡Ø Ecuador, šŸ‡µšŸ‡¾ Paraguay, šŸ‡µšŸ‡Ŗ Peru, šŸ‡ŗšŸ‡¾ Uruguay, others..
AfricašŸ‡ØšŸ‡² Cameroon, šŸ‡ŖšŸ‡¬ Egypt, šŸ‡¬šŸ‡­ Ghana, šŸ‡°šŸ‡Ŗ Kenya, šŸ‡²šŸ‡¦ Morocco,
šŸ‡²šŸ‡¼ Malawi, šŸ‡³šŸ‡¬ Nigeria, šŸ‡·šŸ‡¼ Rwanda, šŸ‡øšŸ‡³ Senegal, šŸ‡æšŸ‡¦ South Africa,
šŸ‡¹šŸ‡æ Tanzania, šŸ‡ŗšŸ‡¬ Uganda, others..
Asia PacificšŸ‡¦šŸ‡ŗ Australia, šŸ‡§šŸ‡­ Bahrain, šŸ‡§šŸ‡© Bangladesh, šŸ‡ØšŸ‡³ China, šŸ‡­šŸ‡° Hong Kong,
šŸ‡®šŸ‡³ India, šŸ‡®šŸ‡© Indonesia, šŸ‡®šŸ‡¶ Iraq, šŸ‡®šŸ‡± Israel, šŸ‡ÆšŸ‡µ Japan, šŸ‡ÆšŸ‡“ Jordan,
šŸ‡°šŸ‡¼ Kuwait, šŸ‡²šŸ‡¾ Malaysia, šŸ‡²šŸ‡» Maldives, šŸ‡³šŸ‡æ New Zealand, šŸ‡“šŸ‡² Oman,
šŸ‡µšŸ‡° Pakistan, šŸ‡µšŸ‡­ Philippines, šŸ‡øšŸ‡¦ Saudi Arabia, šŸ‡øšŸ‡¬ Singapore, šŸ‡°šŸ‡· South Korea,
šŸ‡±šŸ‡° Sri Lanka, šŸ‡¹šŸ‡¼ Taiwan, šŸ‡¹šŸ‡­ Thailand, šŸ‡¦šŸ‡Ŗ UAE, šŸ‡»šŸ‡³ Vietnam, others..

Supported workflows and services

WorkflowSupported
Available via Payrails SDKāœ”ļø
Available via Payrails APIāœ”ļø
Delayed / Manual Captureāœ”ļø
Instant Captureāœ”ļø
Cancel / Voidāœ”ļø
Refund / Reverseāœ”ļø
Save Instrumentsāœ”ļø
Merchant Initiated Transaction (MIT)āœ”ļø
InteroperabilityVault tokens, PSP tokens, Network tokens