5. Payment Processing
This documentation provides detailed instructions for handling payment processing after creating a new invoice using the Add Invoice endpoint. It includes steps for redirecting users to the payment page, managing callback redirections, verifying payment statuses, and handling payment errors.
Redirect to Payment Page
To initiate the payment process, follow these steps:
- Retrieve the invoice details by calling the Get Invoice endpoint. This endpoint will provide you with the payment URL.
- Redirect the user to the provided payment URL.
- The user will then be able to proceed with the payment through this URL.
Test Transaction
To test transactions and experience the Paylink payment system before going live, you can use the test cards provided by Paylink. These test cards allow you to simulate various payment scenarios in a safe, controlled environment.
Callback Redirection
Upon completion of the payment, the user's browser will be redirected back to the callBackUrl
specified during the invoice generation process. The callback URL will contain two parameters:
Field Name | Description |
---|---|
TransactionNo | Unique transaction number of the created invoice in the Paylink system. |
OrderNumber | Unique number of the invoice in the merchant's application. |
Verify Payment
It's crucial to verify the payment status and amount on your callback URL. Follow these steps to ensure the integrity of the payment:
- Check Amount Paid: Retrieve the amount paid (referred to as amount) by calling the Get Invoice endpoint immediately after the payment. Compare this amount with the invoice amount to ensure consistency.
- Verify Order Status: Check the payment status (referred to as orderStatus) to ensure it is marked as "paid".
IMPORTANT NOTE
Merchant's application must follow these instructions immediately after the payment. Otherwise, ignoring the instruction may jeopardize the security of the payment process.
Handle Payment Errors
When you retrieve the invoice details by calling the Get Invoice endpoint, you can handle payment errors by checking the paymentErrors
array. This array contains objects that describe any errors that occurred. Here’s an example:
[
{
"errorCode": "05", // Error code.
"errorTitle": "Do Not Honor", // Title of the error.
"errorMessage": "Do Not Honor", // Detailed description of the error.
"errorTime": "2020/10/25" // Time of the decline.
},
{
// Another error object...
}
]
For a complete list of possible error codes and their meanings, refer to our Payment Errors Codes documentation.
Understanding these error codes is crucial for diagnosing payment failures, enabling prompt resolution and smoother transaction processes.
Updated 7 months ago