craftcms / commerce-paypal-checkout

PayPal Checkout gateway for Craft Commerce.
https://plugins.craftcms.com/commerce-paypal-checkout
MIT License
5 stars 10 forks source link

Cannot issue refunds (or partial refunds) #49

Closed terryupton closed 2 years ago

terryupton commented 2 years ago

Description When trying to issue a (partial) refund via the back-end system we are getting the following error and response.

"{\"name\":\"UNPROCESSABLE_ENTITY\",\"message\":\"The requested action could not be performed, semantically incorrect, or failed business validation.\",\"debug_id\":\"77e69de5ed47e\",\"details\":[{\"issue\":\"DECIMAL_PRECISION\",\"field\":\"/amount/value\",\"value\":\"10.8900000000000005684341886080801486968994140625\",\"description\":\"The value of the field should not be more than two decimal places.\",\"location\":\"body\"}],\"links\":[{\"href\":\"https://developer.paypal.com/docs/api/payments/v2/#error-DECIMAL_PRECISION\",\"rel\":\"information_link\"}]}"

Assuming this is related to the plugin (it is a PayPal payment) or is this a commerce core issue?

To Reproduce How, and what happened?

  1. Access order > transactions
  2. Enter refund value and message
  3. Click click refund and this error is returned as a failed refund.
Screenshot 2021-12-15 at 09 26 36 Screenshot 2021-12-15 at 09 26 55
nfourtythree commented 2 years ago

This was resolved in the latest release of Commerce.

Please update Commerce to get this fix, thanks!

terryupton commented 2 years ago

Hey @nfourtythree

Today client has tried to do another partial refund and still seeing an issue/error with this as follows:

{
    "message": "{\"name\":\"UNPROCESSABLE_ENTITY\",\"message\":\"The requested action could not be performed, semantically incorrect, or failed business validation.\",\"debug_id\":\"2358796573cd8\",\"details\":[{\"issue\":\"DECIMAL_PRECISION\",\"field\":\"/amount/value\",\"value\":\"16.949999999999999289457264239899814128875732421875\",\"description\":\"The value of the field should not be more than two decimal places.\",\"location\":\"body\"}],\"links\":[{\"href\":\"https://developer.paypal.com/docs/api/payments/v2/#error-DECIMAL_PRECISION\",\"rel\":\"information_link\"}]}"
}

Commerce and Paypal were both updated and on the latest versions.

nfourtythree commented 2 years ago

Hi @terryupton

Thank you for reporting this. We have just pushed the 1.3.2.1 version of this plugin which includes a fix for the bug you mentioned.

Thanks!