View Issue Details

IDProjectCategoryView StatusLast Update
0007790module Amazon Paymainpublic2025-05-02 10:56
Reporterdspeckhardt Assigned To 
PrioritynormalSeverityminorReproducibilityrandom
Status acknowledgedResolutionopen 
Product Version2.1.6 
Summary0007790: TypeError Constants::isAmazonPayment(): Argument #1 ($paymentId) must be of type string, null given
DescriptionOxidSolutionCatalysts\AmazonPay\Core\Constants::isAmazonPayment(): Argument #1 ($paymentId) must be of type string, null given, called in .../vendor/oxid-esales/amazon-pay-module/src/Controller/OrderController.php on line 131

In there OrderController on one place you have a fallback to empty string, which is probably necessary.
See: https://github.com/OXID-eSales/amazon-pay-module/blob/v2.1.6/src/Controller/OrderController.php#L49

But in other places in the OrderController you are not applying the fallback. For example in the line 131, where the type error occurs.
https://github.com/OXID-eSales/amazon-pay-module/blob/v2.1.6/src/Controller/OrderController.php#L131

You should make sure, that the parameter is never null by applying the fallback OR change the method to accest also NULL, which is probably the best solution, because the method Constants::isAmazonPayment() is also called from other classes then the OrderController...
Steps To ReproduceIt happens, when $basket->getPaymentId() is null, which is allowed by the OXID Framework.
Additional InformationThis Exception leads to failing order execution in the frontend, so it is critical.
TagsNo tags attached.

Activities

QA

2025-05-02 10:55

administrator   ~0017941

Dear dspeckhardt,

thanks for this report.

I acknowlegde this issue for code enhancment. If no paymentID is provided there should be a redirect at this point.

Could you please provide for better context your scenario that this happens?

Best Regards
QA -SG-