I have used the Amelia Booking plugin for my one of the site.
I would like to implement the split payment & refund to customer functionality with PayPal payment gateway.
I made one addon which can split the payment using PayPal payout APIs(https://api-m.sandbox.paypal.com/v1/payments/payouts).
Split is working fine but to make a refund I need customer’s PayPal details.
So I did below things:
Amelia is storing the transaction information in the database in below format.
{
"data":
{
"PayerId": "4ABCDEFGHIJKL",
"PaymentId": "PAYID-ABCDEFGHIJKLMNO2PQRSTUVW",
"transactionReference": "PAYID-ABCDEFGHIJKLMNO2PQRSTUVW"
},
"amount": "00.00",
"gateway": "payPal",
"currency": "USD"
}
So from above information I can access “transactionReference” to fetch the customer’s details using (https://api-m.sandbox.paypal.com/v1/payments/payment/{transactionReference}) API call to make refund.
But unfortunately this endpoint is deprecated, so is there anyway to fetch the customer’s PayPal data using above information from PayPal v2 API ?