Card
Configure and manage Card payment method
Card
Card payments are a widely recognized and trusted method, allowing customers to pay using their credit or debit cards. PayOS enables seamless integration with major card providers, ensuring a secure and efficient checkout experience for your customers.
Introduction
Card payments are essential for any online business, providing a familiar and straightforward option for customers to complete their purchases. Integrating Card payments with PayOS allows you to offer various card types, including Visa, Mastercard, American Express, and Discover, while leveraging PayOS’s secure infrastructure to process transactions efficiently. This guide explains how to integrate Card payments into your application or website using PayOS.
Pre-requisites
Before accepting Card payments through PayOS, ensure you meet the following requirements:
-
PayOS integration:
You have integrated with PayOS, either using our hosted checkout, SDK, or server-to-server API. -
Payment processor configuration:
You have set up an integration account for Card payments with a supported Payment Service Provider (PSP) in PayOS. Card payments are typically supported through PSPs such as Flutterwave, Cellulant DPO, Stitch, Paystack, PayU, MPGS, Cybersource, Checkout.com, Stripe, Lean Technologies, or Paymob. Ensure that the commercial relationships with these PSPs are in place or can be utilised through PayOS. -
Enable Card payments:
You have enabled Card payments as a payment option in your PayOS configuration through the PayOS Portal. -
Meta fields setup:
If Card payments require specific meta fields (such as billing details), ensure these fields are correctly configured underMerchant configurations -> Meta fields
on your PayOS dashboard and included in your requests.
Ways to integrate Card with PayOS
PayOS supports multiple integration methods for offering Card payments at checkout:
-
PayOS hosted checkout
Using PayOS’s hosted checkout is the simplest way to accept Card payments. With this option:- There’s minimal development required on your end.
- PayOS automatically displays the Card payment method during checkout.
- You can control the payment methods offered through the session creation API call, specifying Card as a payment method if desired.
-
PayOS SDK
If you prefer more control over your checkout experience, you can integrate with the PayOS SDK:- The SDK provides UI components to include Card as a payment method seamlessly.
- It simplifies capturing any required inputs (like card details) and initiating transactions, without extensive server-side coding.
- Consult the PayOS SDK documentation for detailed steps on integrating Card payments.
-
Server-to-server integration
For complete control over your payment process and checkout flow, you can integrate Card payments using PayOS’s server-to-server APIs:- This approach offers greater flexibility in implementing the payment flow and handling customer data.
- You will be responsible for capturing necessary inputs (e.g., card details) and forwarding them to PayOS securely.
Let’s explore the server-to-server approach in more detail.
Retrieving available payment methods
Using the PayOS API, you can retrieve a list of available payment methods for a given checkout session by calling the GET /v1/payment/available-methods
endpoint with a sessionId
. For Card payments, the method type is typically returned as card
.
Request:
Response:
In this response:
- The Card payment method is listed with
"type": "card"
. - The
requiredInput
field indicates that the customer must enter their card details.
Creating a checkout session
To create a checkout session that includes Card as a payment option, make a POST request to the /v1/checkout/session
endpoint. You can specify which payment methods to offer in the paymentMethods
array. For Card, set "type": "card"
.
Response:
In this example:
- The
paymentMethods
array restricts the session to only the Card payment method ("type": "card"
). restrict
set totrue
ensures that this session provides only Card as the available payment method.- The
sessionId
in the response references this specific checkout session, which can be used to retrieve available methods, complete the payment, or make further adjustments before checkout completion.
Handling the payment
After creating a session, your application can direct customers to the paymentLink
if using the hosted checkout. If you’re using the PayOS SDK or a server-to-server integration, you’ll use the session details to process the Card payment. This involves:
- Capturing card details securely through the PayOS SDK or your own forms (ensuring PCI compliance).
- Passing the card details to PayOS through the appropriate API calls for tokenization and charge authorization.
Supported regions / countries
Card payments through PayOS are supported in the following regions and countries:
(Note: Support for additional regions and countries may be added in the future. Check PayOS documentation or contact support for updates.)
Supported workflows and services
The following table outlines the workflows and services supported when using Card payments with PayOS:
Ensuring a seamless and secure payment experience
To optimise your integration and ensure customer satisfaction, consider the following best practices:
-
Prioritise security and compliance:
Protecting customer data is paramount. PayOS adheres to PCI DSS standards and other relevant regulations. Ensure you also follow any additional region-specific compliance requirements, especially when handling sensitive financial information across different countries. -
Focus on a smooth user experience:
Present payment methods clearly and intuitively. When customers reach the checkout stage, they should easily recognise and trust the payment options available. For example, highlight local payment methods prominently in regions where they are popular. -
Monitor performance and reliability:
Keep an eye on transaction success rates and processing times. PayOS’s dashboard provides insights into each payment method’s performance, enabling you to resolve any latency or downtime issues quickly to maintain customer trust. -
Scale with your business growth:
As your business expands, your payment needs may evolve. PayOS’s flexible infrastructure makes it easy to add new payment methods, integrate with additional PSPs, or adjust your configurations to handle increased transaction volumes without compromising performance.
Additional resources and next steps
With PayOS, managing and enabling diverse payment methods becomes more efficient and manageable. For detailed integration instructions, coding examples, and advanced customisation options, explore these resources:
-
PayOS API documentation
Dive deeper into PayOS’s API endpoints and discover how to implement server-to-server integrations, handle advanced payment flows, and manage transactions programmatically. -
Integration Guides
Review step-by-step guides for integrating PayOS’s SDKs or connecting to popular PSPs, ensuring a smooth setup experience regardless of your technical background or business model.
By configuring payment methods with PayOS, you can offer your customers a streamlined and secure checkout experience tailored to their preferences and regional payment norms. Continuously refine your payment configurations and leverage PayOS’s robust features to stay agile in an ever-evolving e-commerce landscape.