Open samuelebau opened 1 year ago
I also resolved this issue with the patch below, please include this fix in the upcoming version.
diff --git a/vendor/amzn/amazon-pay-magento-2-module/Plugin/OrderCurrencyComment.php b/vendor/amzn/amazon-pay-magento-2-module/Plugin/OrderCurrencyComment.php
--- a/vendor/amzn/amazon-pay-magento-2-module/Plugin/OrderCurrencyComment.php
+++ b/vendor/amzn/amazon-pay-magento-2-module/Plugin/OrderCurrencyComment.php (date 1698229883874)
@@ -61,9 +61,11 @@
if ($subject->getMethod() == Config::CODE) {
$order = $subject->getOrder();
if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode() &&
- (($subject->getMessage() instanceof Phrase
- && $subject->getMessage()->getText() == 'Canceled order online')
- || strpos($subject->getTransactionId(), '-void') !== false)
+ (
+ ($subject->getMessage() instanceof Phrase
+ && $subject->getMessage()->getText() == 'Canceled order online')
+ || strpos($subject->getTransactionId() ?? '', '-void') !== false
+ )
) {
return $result .' ['. $order->formatPriceTxt($subject->getAmountOrdered()) .']';
}
Hello @samuelebau ,
I'm afraid I was unable to reproduce this issue on a clean 2.4.4-p4 EE instance running on PHP 8.1. The base currency was EUR and the order currency was SEK:
The underlying problem seems to be that, for some reason, there is no transaction ID associated with the Payment on your order(s) that need to be refunded. There shouldn't ever be a point where an Amazon Pay order has no transaction ID set on the Payment if it's been authorized, and especially if it's been captured; are there any customizations or third party extensions that might be affecting the way the Amazon Pay module records these transaction IDs?
Thanks, Spencer
What I Expected
I expected to refund an order paid with Amazon via API requests
What happened instead
Exception: Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/current/vendor/amzn/amazon-pay-magento-2-module/Plugin/OrderCurrencyComment.php on line 66
When I try to refund an order with differentbase_currency_code
andorder_currency_code
Steps to reproduce the issue
base_currency_code
andorder_currency_code
Your setup