Skip to main content

Card payments

Introduction

The card payments feature allows users to send money using their debit or credit cards through our platform's API. This documentation provides details on how to make card payments via HTTP POST requests and includes code examples in various programming languages.

Sending Money with Card Payments

To send money using card payments, users need to make an HTTP POST request to the specified endpoint with the required parameters.

Endpoint

https://api.mypayd.app/api/v1/payments

Authorization

Users need to include basic authentication credentials in the request headers.

AUTHORIZATION: Basic Auth

Username <username>
Password <password>

Request Body (Token Object)

The request body should include the necessary parameters for the transaction, such as the amount, recipient's email, location, username, payment method (card), and phone number.

json
{
"amount": 10,
"email": "johndoe@gmail.com",
"location": "city",
"username": "johndoe",
"payment_method": "card",
"phone": "0712345678"
}

Code Examples

Below are code examples in different programming languages demonstrating how to make card payments using HTTP POST requests.

curl --location 'https://api.mypayd.app/api/v1/payments' \
--data-raw '{
"amount": 10,
"email": "johndoe@gmail.com",
"location": "city",
"username": "johndoe",
"payment_method": "card",
"phone": "0712345678"
}'

Example of a successful response


{
"status": 1,
"status_code": "200",
"success": true,
"transaction_type": "bill payment",
"message": "Payment processed successfully",
"checkout_url": "https://example.com/checkout",
"transaction_reference": "trans123",
"merchant_reference": "trans123",
"channel": "card",
"payment_gateway": "paystack"
}

Conclusion

The card payments feature provides a convenient way for users to send money securely using their debit or credit cards. By following the instructions outlined in this documentation, users can easily integrate card payments into their applications or services.