paymentMethod.tokenize(verificationDetails) returns unknown error

I’m trying to implement web payment API with EMV 3D secure to my web store.
I’m not sure the reason, but paymentMethod.tokenize(verificationDetails) returns unknown error on sandbox environment.

The code is almost identical with sample code, like this,

	const verificationDetails = {
	amount: '10.00',
	billingContact: {
		givenName: 'John',
		familyName: 'Doe',
		email: '[email protected]',
		phone: '3214563987',
	},
	currencyCode: 'JPY',
	intent: 'CHARGE',
	customerInitiated: true,
	sellerKeyedIn: false
	};
	const tokenResult = await paymentMethod.tokenize(verificationDetails);
	if (tokenResult.status === 'OK') {
		return tokenResult.token;
	} else {
		let errorMessage = `Tokenization failed with status: ${tokenResult.status}`;
		if (tokenResult.errors) {
			errorMessage += ` and errors: ${JSON.stringify(
				tokenResult.errors
			)}`;
		}
		throw new Error(errorMessage);
	}

It works without 3D secure, means tokenize() works without argument.

Javascript console said,

Tokenization has faild.
An unknown error has occurred.
(Anonymous Funcion) - square.js:5826
...

Any ideas?

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Test in the Sandbox
Square Developer
Troubleshoot In-App Payments SDK Problems

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

What test value are you using when you get this error? :slight_smile:

I used “SCA testing in the Web Payments SDK” values on the document, but I think this error is not related to the specific test value.

Which one did you use so I can try and replicate the error? :slight_smile:

Visa 4800 0000 0000 0004 or Mastercard 5222 2200 0000 0005.

I’ve got same error, I mean it happened at the same line of square.js, line 5826.
just line number, I could not get the exact reason of error.

FYI, same code works at production environment.