Refund PayPal PAYID using v2 REST API?

hamidguls
Contributor
Contributor

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 for my site 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}) {Jbbess}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 ?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.