question

miaaa avatar image
miaaa asked miaaa commented

How to track full/partial refund

My app is calculating reward points based on each transaction and our program rewards cash to customers. So I just wondering what would be the best way to track refund activity.

I was trying to put a refund button in my app Mainpage so that I can scan the barcode on receipt and then pull out the transaction details, then do refund in Transactions. But how can I launch the app Transactions with specific transaction details open by scanning barcode? (The barcode contains payment_id) This approach has lots of drawbacks. For example, Transactions can only do fully refund but not partially refund. And this approach needs lots of human work. The cashier will need to be very careful and look at the receipt and identify whether this transaction is our program transaction. (we print our program name on receipt) The cashier then launches our app and do fully refund. There is a lot of chances for error to occur.

My second thoughts is that avoid human work and let my app listen to all refunds in the background. But I have no clue where to start. How can I get all refund object? Or is there any way that I can access the refund table in Clover database? How can I listen to refund from both app Orders and app Transactions ?

Thanks in advance!

OrdersRefund
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

Bryanne Vega avatar image
Bryanne Vega answered miaaa commented

Hi!

Please take a look at the Webhooks

Whenever a payment/order etc is added, edited, removed, you can receive a notification to your endpoint so you can update accordingly.

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.

miaaa avatar image miaaa commented ·

Hi @Bryanne, Thanks for the answer. Just learn how to setup Webhooks. But I only receive something like { "appId": "DX1ES5KB6BEFC", "merchants": { "544NYTMEJQZSA": [ { "objectId": "C:NSJCREHYQEY82", "type": "CREATE", "ts": 1483553318510 }, { "objectId": "C:NSJCREHYQEY82", "type": "UPDATE", "ts": 1483553318513 } ] } }

Not an actual order/payment object. I just get noticed that the order/payment is either CREATE/UPDATE. I was wondering that is it what I supposed to get or did I do something wrong?

0 Likes 0 ·
miaaa avatar image miaaa commented ·

Will it be possible to achieve this by using Android SDK? Since webhook seems triggered for all transactions. But I only want to get the transaction which check-out through my app. And I am confused about the relationship between Android App and webhooks. I found that there is a field in developer dashboard that I can put a webhook URL into my android app. But then I still received POST request for all transactions.

0 Likes 0 ·
miaaa avatar image miaaa commented ·

I think I figured it out, thanks. I just found this question you asked a year ago: https://devask.clover.com/question/25...

0 Likes 0 ·

Welcome to the
Clover Developer Community