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

core.js:7187 ERROR SyntaxError: Unexpected token E in JSON at position 0 at JSON.parse (<anonymous>) at rxp-hpp.js:300 #29

Open
viqashussain opened this issue Oct 23, 2019 · 5 comments

Comments

@viqashussain
Copy link

I'm testing my payment form and when I try to test a card that returns a 200 auth code, I receive the following error:

core.js:7187 ERROR SyntaxError: Unexpected token E in JSON at position 0
at JSON.parse ()
at rxp-hpp.js:300

It's because the message received from GlobalPayments is not in the correct format.

@liao02x
Copy link

liao02x commented Feb 14, 2020

Came across the same issue. Here is my test case:

  1. Put something in the far future like 11/44 for the expiry date for the credit card.
  2. Using 4242 4242 4242 4242 for test cards.

The server returns "Error: 509
Message: Expiry date invalid" as a string instead of a valid JSON, so the error happens when doing JSON.parse(event.data).

I'll have to do some modifications to the library as a hack, but the maintainer should fix it ASAP.

@tonygayter
Copy link

Did anyone find a solution to this? Im hitting this problem

@jsblanco
Copy link

Is this ever going to be addressed? I'm having the same issue

@sbparsons
Copy link

As am I - not a fan of modifying third party JS files as it means future updates are risky... but that's where we are I guess.

@sarimarri
Copy link

I had exactly same issue then at line 300 please include the following code

try {
				var test = event.data;

				console.log("test"+event.data);  //Here the log can print the issue and you can handle it.
				}

catch (err) {
console.log(err);
return;
}

@slogsdon slogsdon mentioned this issue Mar 29, 2021
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

6 participants