Open mohit-sharma-rp opened 1 month ago
Hi @mohit-sharma-rp ,
Interesting find, I'm a little surprised this hasn't come up yet... certainly looks like that call couldn't succeed without supplying the store code. You're more than welcome to open a PR for this issue if you'd like; we wouldn't merge it directly but could cherry pick your code into our next release branch if everything looks good. Thanks again for the report!
Cheers, Spencer
Hi @sgabhart22 PR is opened for this issue https://github.com/amzn/amazon-payments-magento-2-plugin/pull/1248
What I expected
CleanUpIncompleteSessions
cron should be run without any error.What happened instead
When the
CleanUpIncompleteSessions
cron job runs, it throws the following error: Error in log: ERROR strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in vendor/amzn/amazon-pay-api-sdk-php/Amazon/Pay/API/Client.php on line 43Steps to reproduce the issue
amazon_pay_cleanup_sessions
cron job using n98 command and it will throw errorYour setup
More details about the issue:
The error occurs when the cron job runs to clean up incomplete transactions at this line: https://github.com/amzn/amazon-payments-magento-2-plugin/blob/5.17.1/Cron/CleanUpIncompleteSessions.php#L122 A
null
value is passed to thegetCheckoutSession
method, causing the error and preventing the cron job from completing.Solution:
After passing the transaction store the cron job completed without any errors, and the order status was updated to "Cancelled".
$amazonSession = $this->amazonPayAdapter->getCheckoutSession($transactionData['store_id'], $checkoutSessionId);