1

I have an error in my admin configuration when viewing Payment Methods section which only appears when I enable the Amazon_Core module which prevents me from being able to save settings for my payment methods:

Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at getData (main.js:58)
    at Array.map (<anonymous>)
    at Object.apply (main.js:74)
    at HTMLDocument.bootstrap (bootstrap.js:106)
    at fire (jquery.js:3232)
    at Object.add [as done] (jquery.js:3291)
    at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
    at jQuery.fn.init (jquery.js:2967)
    at new jQuery.fn.init (jquery-migrate.js:241)

If I disable the Amazon_Core module, this error goes away and the admin payment method section works as expected.

Any ideas how to trouble shoot this error?

Ultimately, we're needing to be able to use the Amazon Login & Payment modules. What's odd is this error is not present in our local environment, only on our live server.

1 Answer 1

6

Figured this out, our store name had a apostrophe in it which was causing the error: https://github.com/amzn/amazon-payments-magento-2-plugin/issues/428#issuecomment-470570367

Here is the fix:

File: vendor/amzn/amazon-pay-and-login-with-amazon-core-module/Model/Config/SimplePath.php

Replace Line: 487

'merchantStoreDescription' => $this->getConfig('general/store_information/name'),

with:

'merchantStoreDescription' => htmlspecialchars($this->getConfig('general/store_information/name'), ENT_QUOTES),
1
  • just came across this issue. Thanks for posting :)
    – Anthony
    Jun 1, 2021 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.