Smart Payment Buttons Integration: How to include idempotency in actions.order.create() call
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everyone,
Doing my first PayPal integration using the Smart Payment Buttons Integration. I am wondering if there is any way to include idempotency in the order creation call from the Javascript SDK (i.e. the actions.order.create() call). I am facing the issue that actions.order.create() happily creates multiple orders with multiple order ids. Order capture will then capture each and every one of these orders, even when the same Paypal-Request-Id is passed to all of the capture requests. This can easily cause accidential double charges, exactly the thing that idempotency is tryng to protect against. Is this a bug in the PayPal process? To capture, I am calling the REST Order API directly from my server (not using actions.order.capture()) and I can therefore include the Paypal-Request-Id header in the capture request. I've tried to do order creation through the REST API, there it does honour idempotency and is returning the same order id in all requests with Paypal-Request-Id set to the same string. How do I access the same behaviour when creating orders through the actions.order.create() call in the JS SDK? Only tried all of the above on the Sandbox so far.
Thanks,
Frank
- Labels:
-
PayPal HTML Buttons

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Is it possible to make payments in RON (Romanian Leu) through PayPal? in REST APIs
- p is not a function error using the example downloaded from Paypal in SDKs
- How to enable on-demand / recurring payments to existing PayPal checkout? in SDKs
- iDEAL payments being refunded back to customers in PayPal Payments Standard
- How do you create subscriptions with PayPal Advanced Checkout? in SDKs