Cards
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:
- Integrate with Payrails using one of our SDKs or our API
- 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, Unlimit and coming soon (Nuvei, WorldPay) - Enable cards as a payment option.
- 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:
- Configure the hosted payment page settings in your Payrails dashboard.
- Redirect customers to the hosted payment page URL when they initiate a payment.
- 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:
- Collect card information from the customer using a secure payment form on your app or website.
- Tokenize the card data using the Payrails API, which securely sends the data to Payrails and returns a token.
- Use the token to process the payment through the Payrails API, specifying the desired PSP and transaction details.
- 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, |
Supported workflows and services
Workflow | Supported |
---|---|
Available via Payrails SDK | โ๏ธ |
Available via Payrails API | โ๏ธ |
โ๏ธ | |
โ๏ธ | |
โ๏ธ | |
โ๏ธ | |
โ๏ธ | |
โ๏ธ | |
Interoperability | Vault tokens, PSP tokens, Network tokens |
Updated 2 months ago