1
votes

I am working on paypal adaptive payment & i need to refund with API , i am able to refund sucessfuly in case of parrralel payment but getting problem in chain payment

eg- buyer/sender made total payment of $200 at time of payment
receiver1 = $90
receiver2 = $90
receiver(primary) = $20

when i process refund 0f $10 from each receivers from API ,API return status COMPLETED for each reciver, primary receiver get refund of $10 & $10 from secondary receivers , but buyer get refund of only $10.
API code

-H "X-PAYPAL-SECURITY-PASSWORD: api_password" 
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature" 
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" 
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" 
-H "X-PAYPAL-APPLICATION-ID: your_app_id "  https://svcs.sandbox.paypal.com/AdaptivePayments/Refund  -d  
"requestEnvelope.errorLanguage=en_US 
requestEnvelope.errorLanguage = en_US
payKey = AP-95V43510SV018561T0
receiverList.receiver(0).email = [email protected]
receiverList.receiver(0).amount = 10.00
receiverList.receiver(0).email = [email protected]
receiverList.receiver(0).amount = 10.00
receiverList.receiver(0).email = [email protected]
receiverList.receiver(0).amount = 10.00
currencyCode = USD

API response:

  responseEnvelope.timestamp:2015-08-12T22%3A21%3A54.003-07%3A00
  responseEnvelope.ack:Success
  responseEnvelope.correlationId:189c035575d2d
  responseEnvelope.build:17603431
  currencyCode:USD
  refundInfoList.refundInfo(0).receiver.amount:10.00
  refundInfoList.refundInfo(0).receiver.email:reciver-1%40example.com
  refundInfoList.refundInfo(0).refundStatus:REFUNDED
  refundInfoList.refundInfo(0).refundNetAmount:9.71
  refundInfoList.refundInfo(0).refundFeeAmount:0.29
  refundInfoList.refundInfo(0).refundGrossAmount:10.00
  refundInfoList.refundInfo(0).totalOfAllRefunds:10.00
  refundInfoList.refundInfo(0).refundHasBecomeFull:false
  refundInfoList.refundInfo(0).encryptedRefundTransactionId:4R029320L1387345S
  refundInfoList.refundInfo(0).refundTransactionStatus:COMPLETED
  refundInfoList.refundInfo(1).receiver.amount:10.00
  refundInfoList.refundInfo(1).receiver.email:reciver-2%40example.com
  refundInfoList.refundInfo(1).refundStatus:REFUNDED
  refundInfoList.refundInfo(1).refundNetAmount:9.71
  refundInfoList.refundInfo(1).refundFeeAmount:0.29
  refundInfoList.refundInfo(1).refundGrossAmount:10.00
  refundInfoList.refundInfo(1).totalOfAllRefunds:10.00
  refundInfoList.refundInfo(1).refundHasBecomeFull:false
  refundInfoList.refundInfo(1).encryptedRefundTransactionId:94P25967RW2250454
  refundInfoList.refundInfo(1).refundTransactionStatus:COMPLETED
  refundInfoList.refundInfo(2).receiver.amount:10.00
  refundInfoList.refundInfo(2).receiver.email:primary-reciver%40example.com
  refundInfoList.refundInfo(2).refundStatus:REFUNDED
  refundInfoList.refundInfo(2).refundNetAmount:10.00
  refundInfoList.refundInfo(2).refundFeeAmount:0.00
  refundInfoList.refundInfo(2).refundGrossAmount:10.00
  refundInfoList.refundInfo(2).totalOfAllRefunds:10.00
  refundInfoList.refundInfo(2).refundHasBecomeFull:false
  refundInfoList.refundInfo(2).encryptedRefundTransactionId:48K03063M44155052
  refundInfoList.refundInfo(2).refundTransactionStatus:COMPLETED

Thanks in advance for help

1

1 Answers

0
votes

You need to specify the amount as 20 USD for primary :

receiverList.receiver(0).email = [email protected]
receiverList.receiver(0).amount = 20.00

So whatever amount you associate with primary receiver in refund API that will be given back to the buyer .