It is upto you what you do with ‘res’ object which is received from the API. In this case, I am destructuring ‘res’ object to get data key from it and in order to do that, I must wait(await) for ‘res’ object to be resolved first.
I have used Stripe which uses somewhat similar pop up for payments.
Follow below steps:
document.getElementById('buttonId').click(). If the button doesn’t have an id then try to get the button by it’s classname using…