question

prashant92 avatar image
prashant92 asked Frank Faustino Deactivated commented

How to know payment successfully processed for order using webhook?

I am using webhook in my application.
when i am starting to create an order, it gives me status update and an order_id.
When i complete the payment process, it is showing me Status : Create and new order id.
Not sure why it is sending me new order id which is not created yet.
Please help me.
OrdersClover MiniWebhooks
2 comments
10 |2000

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

Frank Faustino avatar image Frank Faustino ♦♦ commented ·
Hi, @prashant92.

I'm not able to reproduce this behavior on our end. Can you please share how you're creating the order and making the payment for the order? It would be very helpful to see a code snippet and also the webhook responses you're receiving.

Thank you!
0 Likes 0 ·
prashant92 avatar image prashant92 Frank Faustino ♦♦ commented ·

Hi @Frank Faustino

While creating order we get the webhook status for the order as update status(not the create status) and when the payment for the order is complete it generates the next order id and status for the next order comes to be create status.
i am creating this order from android emulator using register app and for payment using payment app for cash.

0 Likes 0 ·

1 Answer

·
Frank Faustino avatar image
Frank Faustino Deactivated answered Frank Faustino Deactivated commented
After a successful payment, the Register app changes the Order's state field to "locked" and adds a payments field that includes the payments details. Then a new order is created in anticipation for the merchant's next order, which is why you're seeing two webhook notifications for UPDATE and then CREATE. This is normal behavior for the Register app.

To know if a cash payment was successful, you'll have to query the Orders API and expand the payments field with this endpoint: https://apisandbox.dev.clover.com/v3/merchants/{ {merchantId}}/orders/{ {orderId}}?expand=lineItems,payments

You don't have to do this for a successful card payment since a webhook notification is sent for those.
2 comments
10 |2000

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

prashant92 avatar image prashant92 commented ·

But i am using payment mode cash.

There is not Order's state like "locked".

0 Likes 0 ·
Frank Faustino avatar image Frank Faustino ♦♦ prashant92 commented ·

Can you please provide the App ID, Order ID and Payment ID for when the incident happened so I can investigate further?

0 Likes 0 ·

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