Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Process Credit Memo - Deprecated functionality: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /vendor/amzn/amazon-pay-magento-2-module/Gateway/Request/SettlementRequestBuilder.php on line 131 #1249

Open
amcguireweb opened this issue Oct 17, 2024 · 1 comment

Comments

@amcguireweb
Copy link

What I expected

To process credit memo successfully.

What happened instead

Error: Deprecated functionality:
rtrim(): Passing null to parameter #1 ($string) of type string is deprecated
in /vendor/amzn/amazon-pay-magento-2-module/Gateway/Request/SettlementRequestBuilder.php on line 131

Steps to reproduce the issue

Submit order with Amazon Pay as payment method, and then attempt to process a credit memo.

Your setup

  • Magento version: 2.4.6-p3
  • Amazon Pay Extension Version: 5.17.1
  • Magento Edition: Enterprise Cloud

Line 131:
rtrim($paymentDO->getPayment()->getParentTransactionId(), '-capture'),

For some reason, $paymentDO->getPayment()->getParentTransactionId() = null here.

@sgabhart22
Copy link
Contributor

Hi @amcguireweb ,

This is a bit of a peculiar issue that we got a similar report of some months back... there should always be separate transactions recorded for authorizations and captures, but it appears that on some installations, a capture can be recorded in the sales_payment_transaction table without a parent auth. I've never been successful in reproducing this. But the auth transaction contains the Amazon Pay charge ID that we need to reference to properly process the refund through Amazon.

At any rate, I've come up with a patch that should identify the charge ID from information we have available in the capture transaction record in the case that there is no parent transaction. Please let us know if you continue to have issues with refunds!

gh-1249.patch.txt

Thanks,
Spencer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants