Cannot do a partial refund on any transaction with PHP-SDK-Checkout v2

andyts93
New Community Member

Hi all,

I'm using the paypal/Checkout-PHP-SDK library in combination with smart buttons to manage payments. Here's my workflow:

- OrdersCreateRequest

- OrdersCaptureRequest

- Get capture ID

- CapturesRefundRequest passing an amount and the capture ID

 

In the last step the library makes a call to /v2/payments/captures/[CAPTUREID]/refund with the the amount parameter in the body. I always get back an error 500 with this message 

 

 

{"name":"UNPROCESSABLE_ENTITY","message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"2e076a8062117","details":[{"issue":"PARTIAL_REFUND_NOT_ALLOWED","description":"You cannot do a refund less than the original capture amount."}],"links":[{"href":"https://developer.paypal.com/docs/api/payments/v2/#error-PARTIAL_REFUND_NOT_ALLOWED","rel":"information_link"}]}

 

 

I've tried with different amount, some of them matching the amount of one product but nothing changes but it works if I do a full refund of the order.

 

How can I do a partial refund?

Login to Me Too
2 REPLIES 2

raph-php
Contributor
Contributor

Reply from Paypal staff:

Since your are in Sandbox mode, please be sure that both payer and merchant use the same currency.

Login to Me Too

scotspine
Contributor
Contributor

just wasted over half a day on this one using the .net api. once again, some more helpful error messages would be more...helpful. or, here's a thought, how about mentioning it in the docs? ...just a thought...

Login to Me Too

Haven't Found your Answer?

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