question

Robin Walmsley avatar image
Robin Walmsley asked Jeffrey Blattman commented

Using the API how do I detect if a card payment was subsequently VOIDED by the customer.

As per the title.
We're running a web app which passes control to the Clover Pay App to take payment. But if the user hits Void Transaction after taking a card payment, when we API GET the Order, there is a payment against it marked as result SUCCESS.
This is confusing, as there are no other transactions returned, and it, therefore appears as though the card payment was successful.

If I request all payments against an order .. like this
GET /v3/merchants/{mId}/orders/{orderId}/payments
the RESULT field has VOIDED as an option and the voidReason field has "USER_CANCEL" as an option (which Im trying to trap). The point is, all I get is a single payment sent back as result SUCCESS.

Thanks
REST APIPayments
1 comment
10 |2000

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

The payment record in the order and the payment record as returned from the payments endpoint should agree. I ran a test and I see the voided record on the order as expected. Can you provide a MVCE that illustrates the problem? https://stackoverflow.com/help/mcve

0 Likes 0 ·

1 Answer

Robin Walmsley avatar image
Robin Walmsley answered Jeffrey Blattman commented
Hi Jeffrey

Thanks for taking the time to reply.
When I went back to the code to copy into here, I noticed I was using the API to request the OrderId and expanded to also return the payments .. which does return the original successful payment but not the voided one. Our app is a web app built with PHP javascript etc, which calls a few java methods, and I noticed the returned ID Java class was the payment ID. When I pushed this through the API call I did indeed get a result of VOIDED.

So, my mistake.
Thanks again for your effort, you inadvertently fixed it for me :)
1 comment
10 |2000

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Glad to hear.

0 Likes 0 ·

Welcome to the
Clover Developer Community