I'm working with payment first time and if someone could give me advice I would appreciate. I have this situation:
If credit cards are saved, I'm getting back from service those cards (new iframe with filled data) where user can choose with which one he will pay. . The problem is when I click on pay button , the number of sent requests to the server is how many times i've clicked to change card (if I change card).
Before this problem, I had another , every time I click to change card (among saved cards), service creates new iframe with filled data, but it doesn't clear previous one., so I had to remove childNode with an old iframe (so user can see only one filled form of selected card) ..so I assume that it isn't removed even if in inspect form there is only selected iframe .. I've tried with stopPropagation(), but no luck, and with stopImmediatePropagation() console log is only one time instead multiple which is okay, but then I can't sent request.
I'm not sure if I explained well, hope I will find some answers..
payment service I'm using is called Monri, and my client doesn't want to change it.
question from:
https://stackoverflow.com/questions/65602968/stop-multiple-requests-send-only-one-javascript 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…