Open james-allan opened 3 years ago
I'm wondering if this is specifically related to PayPal Checkout. We have a user in 4370972-zen that ran into a similar issue with both PayPal Checkout and PayPal Payments.
We don't have logs for checkout, but refunding an order placed via their account (works fine when our test account is used on their site) returns the following error:
Response Body: {"name":"NOT_AUTHORIZED","message":"Authorization failed due to insufficient permissions.","debug_id":"redacted","details":[{"issue":"PERMISSION_DENIED","field":"capture_id","value":"redacted","description":"You do not have permission to access or perform operations on this resource.","location":"path"}],"links":[{"href":"https://developer.paypal.com/docs/api/payments/v2/#error-PERMISSION_DENIED","rel":"information_link"}]}
And then if we manually refund the order, we see this error on visiting Store > My Account page> Orders
Any thoughts on if this is related?
Describe the bug
Slack thread: p1599652831251300-slack-CJTS771PB Ticket: 3255765-zd-woothemes
The site received a
[payment_status] => Canceled_Reversal
IPN with a custom arg{"order_id":87076,"order_key":"***"}
, that 87076 order ID though may (cannot confirm) be associated with a refund because while processing that IPN the follow fatal error occurred.If you follow that stacktrace through, you'll find that it is this line that is throwing the error. It just checks that it got something back from
wc_get_order()
, in this case, it did get something back but it was a refund class which doesn't have aget_order_key()
function.I've tried to investigate why a refund ID was passed into the IPN but there's not much history we can find about that ID given you cant search for and view it.
I propose we just tighten that code so it knows we have an order (not a refund) before proceeding.