question

jdcunha avatar image
jdcunha asked David Marginian Deactivated commented

Can a payment made through v1/charges be voided/refunded via Clover device?

I am developing a mobile POS application that is a semi-integration with the Clover Flex. I support taking payments through the Clover Flex, as well as through the ecommerce API (v1/charges) using a card token generated by the Clover iframe in a WebView.

I want to be able to void/refund any payment through the Clover Flex device. This works fine for payments that were made with the device. However, I am having trouble accomplishing this for payments that were made with v1/charges. The response from v1/charges comes back with a charge ID, and initiating a void/refund to the device through the CloverConnector does not work when setting the payment ID to the charge ID. Also, it seems that an order ID is required as well but v1/charges does not return an order ID. Furthermore I am uncertain on whether charge ID from the v1/charges response and payment ID from the CloverConnector sale response represent the same thing.

Any clarification and advice would be appreciated!

semi-integrationse-commerce apiRefund
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 David Marginian Deactivated edited

You should be able to do this via CloverConnector. The CloverConnector refund APIs do require an order id and charge id is the same as a payment id. Two options 1) Calll our REST API to retrieve the payment and expand the order - https://docs.clover.com/reference/paygetpayment-2 and https://docs.clover.com/docs/expanding-fields. 2) Call retrievePayment on ICliverConnector. This may work but I am not sure. The payments may have to have been taken on the device. It also may be subject to other limitations (order/payment may not be available forever).

10 |2000

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

jdcunha avatar image
jdcunha answered David Marginian Deactivated commented

I see that the response from v1/charges/{chargeId} contains order ID. Is there a reason why the response from v1/charges does not? Is there a way to tell the API to include the order ID in this response?

Would ideally not like to make another API call just to be able to save the order ID which should have been included in the response from making the charge itself, and 2) won't work for the reasons you mentioned.

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.

David Marginian avatar image David Marginian ♦♦ commented ·
No, unfortunately there is not at this time.
0 Likes 0 ·
jdcunha avatar image
jdcunha answered David Marginian Deactivated commented

I've got another issue now, I'm using OAuth (https://sandbox.dev.clover.com/oauth/authorize?client_id={appId} ) to retrieve a private API token in my app. I can successfully use this token to call v1/charges and make a payment, but when I try to use the same token afterward to call v1/charges/{chargeId}, I get a 401 response.

Any idea why this might be happening? Are there permissions I may not be aware of?

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 ·

The required permissions are documented here - https://docs.clover.com/docs/ecommerce-app-permissions. If your app is missing required permissions you will need to uninstall and reinstall it from the dashboard and then obtain a new access token.

0 Likes 0 ·
jdcunha avatar image jdcunha David Marginian ♦♦ commented ·
Could you assist me in uninstalling the app from the dashboard?
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