Card
Learn how to accept payments with cards.
Direct card charge lets you accept both local and international cards, making it ideal if most of your customers use credit or debit cards and you want them to pay directly through your app with your custom card form design.
ComplianceProcessing direct card charges requires handling sensitive customer data, so PCI DSS compliance is mandatory. Once you’re certified, contact us or email [email protected] to activate this feature on your account.
Charging a card involves four key steps:
- Initiate the payment
Send the transaction and customer card details to the charge card endpoint. - Validate the charge
This is an added layer of security. The customer provides a validation code (like a 3DS OTP), which you send to the validate charge endpoint to complete the transaction. - Verify the payment
Finally, confirm the transaction’s success by calling the verify card charge endpoint before providing value to the customer.
Collect the Customer's Payment Details
You’ll need to collect the customer’s card details to begin.
{
"card_number": "4242424242424242",
"expiry": "12/30",
"cvv": "123",
"cardholder_name": "John Doe",
"amount": "1000",
"currency": "USD",
"email": "[email protected]",
"charge_id": "charge_12345",
"redirect_url": "https://example.com/redirect"
}
'
Visit the Charge Card endpoint documentation to explore all configurable options.
Find test cards here.
{
"success": true,
"requires_3ds_auth": true,
"orderReference": "00b1b3d0-1821-48ec-8136-4904ded5923b",
"3ds_auth_link": "https://in.paychangu.com/3ds/auth?reference=5984ae57-9920d
"
}
Handling 3DS Authorization
With 3DS authorization, simply redirect the user to the 3ds_auth_link
URL. They’ll complete the authentication on their bank’s page. Once done, we’ll redirect them back to your specified redirect_url, including the charge_id and status as query parameters.
TipBefore redirecting the user, be sure to store the
charge_id
returned in the response. You’ll need it later to verify the payment when the user is redirected back to your app.
Verify the Payment
You’re almost there! Before delivering value to the customer, confirm that the payment was successful by calling our verify card charge endpoint using the charge_id
. For more details, refer to our verify card charge guide.
curl --request GET \
--url https://api.paychangu.com/charge-card/verify/{charge_id} \
--header 'Authorization: Bearer {secret_key}'
Webhook
We also send you a webhook if you have it enabled. Learn more about webhooks and see examples here.
Updated 2 days ago