question

jbbdev avatar image
jbbdev asked David Marginian Deactivated answered

Create Order and Pay (but payment fails scenario)

Hi,

I am currently working on allowing users to create and pay for an order to a clover merchant through a mobile application. Currently, this is the approach I am following:

1.User creates a checkout order- https://sandbox.dev.clover.com/v3/merchants/{mId}/atomic_order/checkouts

- The user then taps an "Order now" button, which calls the following:

2. Create Order - https://sandbox.dev.clover.com/v3/merchants/{mId}/atomic_order/orders

- Once the create order call is completed, the user is redirected to the IFrame in a WebView, and enters their card details, when they submit the card details, the following endpoint is called.

3. Pay for Order - https://scl-sandbox.dev.clover.com/v1/orders/{orderId}/pay


From my understanding, if the payment for the order fails, the order is still being created, and will still show up in the Clover Merchants Order screen as Open. Is there a way to prevent this from happening? Is the best way to do this to catch any error that would happen during payment and then delete the order? Let me know if there is a better approach to my problem. Also, this approach should have minimal PCI compliance burden correct?


Thank you!

OrdersPaymentsclover developer community
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered

I can't think of another option other than deleting the order. Yes, this approach will have a low PCI burden.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community