This is iPaytotal Hosted Page API documentation. In this API, users details will be sent to iPaytotal server with curl request, whereas Credit card details page will be loaded over iPaytotal server. Follow bellow steps to integrate hosted page API with iPaytotal.
1. | api_key | |
2. | method | (optional) Need to specify the Payment Method, The following can be the possible values: - unipay (specific for Unionpay Card) - visa-mc (specific for Visa, Master, AMEX, Discover Cards) - crypto (specific for Cryptocurrencies) |
3. | response_url | |
4. | first_name | |
5. | last_name | |
6. | address | |
7. | country | (must be 2 digit country code Ex.US) |
8. | state | |
9. | city | |
10. | zip | |
11. | phone_no | must be add country code with mobile no. (Ex : +449745195841) |
12. | ||
13. | currency | (must be 3 digit currency code Ex. USD, EUR) |
14. | amount | |
15. | ip_address | |
16. | sulte_apt_no | (optional) This value will be return in your redirect url as a query string. |
17. | webhook_url | (optional) post url of merchant website where webhook notification will be sent. |
Send a Curl request with all the parameters provided to the URL below. We encourage all users to please provide all the necessary fields. All credit card fields in the request parameters must be provided and must be the same information indicated in the cardholder's credit card/billing information.
Request URL: https://ipaytotal.solutions/api/hosted-pay/payment-request
Request type: POST
After a successful request, the response will be returned in JSON format.
Successs JSON Response type example :
{
"status": "success",
"payment_redirect_url": "https://ipaytotal.solutions/hosted-pay?hash=gVRC9OjvYehEbiTAS7RXoxC7L15660",
"api_key": "fskjcncbjsdhbjcjhbxxjjvYehEbiTAS7RXoxC7L15660",
"sulte_apt_no": null,
"valid_till": "2020-03-29 07:55:34"
}
If the request data contains a valid format, then the above response will be returned. You will need to redirect to “payment_redirect_url” for payment page before “valid_till”.
If in case there will be validation errors in the request, the response will be similar to the following:
{
"status": "fail",
"message": "Some parameters are missing or invalid request data.",
"errors": {
"country": [
"The country field is required."
],
"state": [
"The state field is required."
]
},
"sulte_apt_no": null,
"api_key": "fskjcncbjsdhbjcjhbxxjjvYehEbiTAS7RXoxC7L15660"
}
After you redirect to url payment_redirect_url, a form will be loaded over iPaytotal payment page. You will need to fill credit card details if asked
If making request in testing URL, then it will ask for Credit card details. Use this bellow testing card data
Testing Card data
card_no: 4242 4242 4242 4242 Expiry Month: 02 Expiry Year: 2021 CVV Number: 123
card_no: 4000 0000 0000 0077 Expiry Month: 02 Expiry Year: 2021 CVV Number: 123
After Credit card form is completely filled up, the user must press the Pay button. This request will take some time, if user card has 3D secure feature enabled, it will also redirect the process to a 3D secure page, where user will be asked to input PIN or OTP if asked. After the entire process is complete, user will be redirected to the merchant website and will reflect the transaction status.
If transaction is successful, the user will be redirected to ”response_url” with the response in query string like the one below:
If the transaction fails, the user will redirect as well to “response_url” with the response query string similar to the one belw:
For more details see iPaytotal Hosted API.docx
file in the root of the project.
If "webhook_url" parameter is sent with the request payload, then the process will send a transaction webhook to the merchant server at "webhook_url". The request will be sent in JSON format.
Below is a webhook request example:
{
"order_id": "202095632606577891",
"sulte_apt_no": "TS4565",
"transaction_status": "success",
"reason": "Transaction success",
"currency": "USD",
"amount": "12",
"test": true,
"transaction_date": "2020-06-03 12:01:45"
}
Request explanation:
order_id: IPaytotal transaction order ID.
sulte_apt_no: Merchant transaction order ID.
transaction_status: Transaction status - "success"/"fail"
reason: Response from the bank about transaction.
test: Transaction environment in test mode. - true/false