Paypal button onClick callback is being called twice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm using Smart Payment Buttons. I have added an onClick callback for paypal button to be able to validate my internal form before proceeding to actual payment. Everything worked fine for some time, but last week I noticed a strange issue. When the user clicks on the paypal button for the first time paypal lib actually triggers my callback two times in a row, and callback sends requests to my server. First is ok but second fails for irrelevant reasons, but this leads to validation failure and paypal popup closing. If I click on the paypal button again(without refreshing the checkout page) the callback gets triggered once and everything works fine, but if I refresh the page again this callback duplication repeats.
I thought maybe I;ve done something wrong due to button integration, but I've checked this on official online sandbox and I faced completely the same behavior here.
- Labels:
-
PayPal HTML Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, did you find any solution or workaround for this event dublication issue on the PayPal button? I am facing the same issue with the createOrder() callback beeing called twice.
![](/skins/images/7E5164EB81F8D9C49ECAF3E2A7A26B2B/responsive_peak/images/icon_anonymous_message.png)
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Funds received, but no VERIFIED response in REST APIs
- When is the onError function called? in PayPal Payments Standard
- Critical JavaScript SDK issue with subscriptions (Please help!) in SDKs
- Express-checkout + Webhook issues in Sandbox Environment
- PayPal Smart Buttons not calling onApprove in Braintree Client-side Integration (JS, iOS, Android SDKs)