solidus_paypal_commerce_platform icon indicating copy to clipboard operation
solidus_paypal_commerce_platform copied to clipboard

Can't cancel older orders that get REFUND_TIME_LIMIT_EXCEEDED from PayPal

Open mntmn opened this issue 6 months ago • 0 comments

We have the PayPal Commerce Platform integrated in Solidus since a long time and I'm looking for solutions to clean up old orders that we can't cancel using the Admin UI. The problem is that paypal will return something like the following for the refund request that's automatically done on cancelling, and Solidus will crash:

E, [2025-06-03T17:16:15.661636 #1859] ERROR -- : [redacted] [SolidusPaypalCommercePlatform::Client#execute] #<OpenStruct name="UNPROCESSABLE_ENTITY", message="The requested action could not be performed, semantically incorrect, or failed business validation.", debug_id="redacted", details=[#<OpenStruct issue="REFUND_TIME_LIMIT_EXCEEDED", description="You are over the time limit to perform a refund on this capture">], links=[#<OpenStruct href="https://developer.paypal.com/docs/api/payments/v2/#error-REFUND_TIME_LIMIT_EXCEEDED", rel="information_link">]>

Solidus Version: 3.4

To Reproduce This is not easy to reproduce, because you have to wait 180 (?) days after a paypal payment and then try to refund it / cancel the associated order.

Current behavior See above.

Expected behavior

  • Solidus should not crash, instead, it should display an error message about the refund time limit.
  • We need an option to void the payment in the Admin UI. I've tried this over the CLI and that works (calling void on the payment), and then I can cancel the order normally. In this case, we refund the customer manually.

mntmn avatar Jun 03 '25 17:06 mntmn