Search code examples
phpwordpresspaypalwoocommercepaypal-adaptive-payments

Paypal refund api for paypal adaptive payments when sender is more than one?


I have paypal adaptive payments enabled in my website. When customer buy any product from a third party seller then about 90% of the amount seller gets and about 10% amount is transferred to me. Bu in case customer wants refund for that product then it should return amount from both accounts which are primary receiver and secondary receiver. So how to do that using refund api. I want to use this php api but i think it is only for one receiver.

Refund api

is there any other solution for this so payment will deduct from both the receiver primary and secondary ?


Solution

  • Refer to https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ ("Using the payment key to refund an entire payment" part ), you can call https://svcs.sandbox.paypal.com/AdaptivePayments/Refund API , The total amount from each receiver is refunded to the sender.