How can we refund for recurring payment in paypal

522 views Asked by At

I am working with the recurring payment in paypal, all thins are working fine for me, but i am stuck with one issue, i need to do refund, i research for that in paypal, i read that we need transactionid for refund, but when we use recurring payment in response they doesn't give transactionid, when we create profile for recurring payment paypal provide us ProfileID which is unique identifiers, so how can we refund payment for recurring profile ?

1

There are 1 answers

1
Drew Angell On BEST ANSWER

It's recommended that you use IPN to save a local history of payments related to profile IDs. If you need to refund a particular transaction you could then pull the transaction ID out of this history.

PayPal provides a basic IPN template here, and there are other more complete solutions available on GitHub / Packagist.

Another option would be to use the TransactionSearch API. You can pass in a Profile ID to get all of the related payments associated with that profile back, so then you could pull the transaction ID of the one you need.

Of course, for the actual refund you can use the RefundTransaction API.

All of these API calls can be made easily with our PayPal PHP SDK if you'd like to take a look at that.