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, and coming soon (Nuvei) - 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, š®š³ 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
Workflow | Supported |
---|---|
Available via Payrails SDK | āļø |
Available via Payrails API | āļø |
Delayed / Manual Capture | āļø |
Instant Capture | āļø |
Cancel / Void | āļø |
Refund / Reverse | āļø |
Save Instruments | āļø |
Merchant Initiated Transaction (MIT) | āļø |
Interoperability | Vault tokens, PSP tokens, Network tokens |
Updated 21 days ago