in payment.tokenize() method , to get response from card nonce api call taking too much time , at that time how can i handle the error and break the process if it is not completed in a quick time. because my ui is in block state till response comes. thats not a good practice to block ui for a long time. i need to handle the error or need to exit tokenization process… suggest me how… immediate response will be appriciable.
Tokenization shouldn’t take but a few seconds. How long is it taking for your application to get the token back?
some times it is executing quickly, but some times it is taking too much time,response is not coming for a long time, at that time i need to handle that, just like to break the execution and show error message like request processing error. as it is a async function where can i handle that.
At this time when you call
tokenize it will either return a token or errors. There isn’t a way to cancel
tokenize once requested. Do you have a token that took a long time to get after the request and do you log the time of the request? I could then check our logs to see when we sent the tokenized card back.
Random thought -
Could you charge the card (with the nonce from the form), and then afterwards use the nonce to create the saved card?
I realize it’s a second code path to test, but just a thought.
The nonce is a one time use token so using to to charge a card and then save it on file isn’t possible.