question

robertm avatar image
robertm asked David Marginian Deactivated commented

Refund failed with message "Could not find order for OrderId"

When calling the paymentConnector.refundPayment, I am receiving a FAIL with the message "Could not find order for OrderId". The transaction that I am attempting to refund does not have an order id attached to it as it was completed using the eComm payments. I am providing the PaymentId as that is available and I would think would be enough to be able to process the refund. Please advise.

Refund
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Can you explain your use case? All payments in Clover have an order id, unfortunately, the Payment Connector's Refund API requires it. You will need to obtain the order id for the payment.

10 |2000

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

robertm avatar image
robertm answered David Marginian Deactivated commented

The overall solution consists of both a semi-integrated application running on the terminal as well as a website with the hosted iFrame to accept payments in select scenarios, when the POS is not accessible. In this case, the payment was made using the hosted iFrame and eComm API. Those payments do not require an order id to be associated with them. After the payment has been completed using the eComm API and the details recorded within the POS, the payment is later selected for refund. Since the refund is being initiated through the POS interface, it will route the request to the terminal for processing within the Semi-Integrated solution running on the terminal. It can successfully be refunded through the eComm API, but when it the refund is attempted with the refundPayment request, it fails with the message as indicated.

3 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.

David Marginian avatar image David Marginian ♦♦ commented ·

You will need to persist and store the order id. As I said, all Clover payments are associated with an order. I am not sure what ecomm api you are using to pay, but if you are using charge you will need to retrieve the charge via GET /v1/charges/{ {chargeid}} after you post it to get the order.

0 Likes 0 ·
robertm avatar image robertm David Marginian ♦♦ commented ·
I see the gap now. When creating a charge using the eComm API, it automatically creates an order in the background and doesn't have any of the order information in the charge response. To get the order id, you have to "Get a Charge" to retrieve the order information that was automatically generated by Clover on the eComm charge. This seems rather confusing and hides a little information from the eComm payment that should be there. I would suggest submitting a request to expand the eComm call to "Create a Charge" to include this order object, or at least the order id, as part of the response object to close this gap and remove any confusion.
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ robertm commented ·
I believe a ticket already exists for this. Generally though, people making charges don't care about the order. In your case because the Payment Connector requires the order id, you do.
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