Paypal Gateway

Posted :

in :

by :

Request address

POST: https://api.ttrpay.net/v1/transaction/create

Postman

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

KeyTypeValueRequireDescription
product_namestringHosting test plan 1✔️The name of a specific product being sold or listed
customer_last_namestringlogan✔️Last name of customer
customer_first_namestringttrpay✔️First name of customer
customer_emailstringyour-mail@ttrpay.net✔️Email of customer
customer_phonestring212-555-9999✔️Number phone of customer. max: 20 charactor
total_pricedecimal9.00✔️The total amount of money in the order
Note: USD only
merchant_ref_codestringorder-2052002✔️Order_id from Merchant System
pmethodstringPAYPAL✔️required: PAYPAL
success_urlstringhttps://ttrpay.net/?ref=success_url✔️URL for redirect when payment success
failed_urlstringhttps://ttrpay.net/?ref=failed_url✔️URL for redirect when payment failed
customer_ipstring123.123.123.123✔️Please provide your customer ip
ipn_urlstringhttps://test-webhook.ttrpay.net/✔️URL IPN of merchant
Result Paramerter
ParameterTypeDescription
codestringSuccess Code or Error Code. example: 00 => success, 03 => wailting OTP, 01 => failed
messagestringSuccess mesage or failed msg
transaction_idstringttrpay hashcode
payment_linkstringpaypal payment link, or failed link
Return parameters
Result success:
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/' } }

Webhook event: readmore

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *