I’m having intermittent issues with the .tokenize() method when using the webpayments SDK. The error it’s returning is: {“message”:“the tokenization request is already in process”,“type”:“TOKENIZATION_IN_PROCESS”} but I can’t find any documentation on what would be causing this. It only happens intermittently and is not always reproducible in either the sandbox or production environments
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:
https://developer.squareup.com/docs/app-marketplace/requirements/web-payments-sdk
Additional Documentation
Troubleshoot the Payments API
In-App Payments SDK: How It Works
Sandbox Payments
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.
The error message “TOKENIZATION_IN_PROCESS” indicates that a tokenization request is already in progress. This error can occur if the .tokenize() method is called multiple times concurrently. The Web Payments SDK is designed to handle one tokenization request at a time. If you’re seeing this error intermittently, it might be due to a race condition in your code where .tokenize() is being called more than once before the first call has completed. To resolve this issue, ensure that .tokenize() is not called again until the first tokenization request has completed.
This answer was reviewed by @Bryan-Square.
Is it possible that something triggered tokenization inadvertently?