Table of Contents
ToggleRequest address
POST: https://api.ttrpay.net/v1/transaction/create
Test account
Email: mid_demo@cashields.org
Password: Sandbox@123
Merchant-Key: d3JWyGxoVVPm0Q6k
Paypal sandbox:
Email: sb-x43n6e32773424@personal.example.com
Password: 9%%c{W5+
Request parameters
| Key | Type | Value | Require | Description |
|---|---|---|---|---|
| product_name | string | Hosting test plan 1 | ✔️ | The name of a specific product being sold or listed |
| customer_last_name | string | logan | ✔️ | Last name of customer |
| customer_first_name | string | ttrpay | ✔️ | First name of customer |
| customer_email | string | your-mail@ttrpay.net | ✔️ | Email of customer |
| customer_phone | string | 212-555-9999 | ✔️ | Number phone of customer. max: 20 charactor |
| total_price | decimal | 9.00 | ✔️ | The total amount of money in the order Note: USD only |
| merchant_ref_code | string | order-2052002 | ✔️ | Order_id from Merchant System |
| pmethod | string | PAYPAL | ✔️ | required: PAYPAL |
| success_url | string | https://ttrpay.net/?ref=success_url | ✔️ | URL for redirect when payment success |
| failed_url | string | https://ttrpay.net/?ref=failed_url | ✔️ | URL for redirect when payment failed |
| customer_ip | string | 123.123.123.123 | ✔️ | Please provide your customer ip |
| ipn_url | string | https://test-webhook.ttrpay.net/ | ✔️ | URL IPN of merchant |
Result Paramerter
| Parameter | Type | Description |
|---|---|---|
| code | string | Success Code or Error Code. example: 00 => success, 03 => wailting OTP, 01 => failed |
| message | string | Success mesage or failed msg |
| transaction_id | string | ttrpay hashcode |
| payment_link | string | paypal payment link, or failed link |
Return parameters
Result success:
Success create paypal payment link you need to redirect your page to payment_link
Success create paypal payment link you need to redirect your page to payment_link
{
"status": true,
"result": {
"code": "00",
"message": "Create paylink successfully",
"transaction_id": "202412-17344912xxxx",
"payment_link": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-2KL30609245339347&useraction=commit"
}
}
Result failed:
{
'status' => false,
'result' => {
'code': '01',
'message': 'some error message',
'transaction_id': '202412-17344912xxxx',
'payment_link': 'https://yoursite.com/wc-api/failed/'
}
}

Leave a Reply