FROM CACHE - en_header

Doing refund using Hosted Payment Gateway is first giving "Pending"

martabel
Shopify Partner
69 1 5

1) Shopify send refund request to my refund endpoit

2) Gateway does the refund

3) If everything went well send response to Shopify's callback url  with completed status

4) Return with 200 OK

 

From user point of view, it will say "Refunded 0.0" and only after a refresh is made to a page it will say that refund was successful. Why is this happening?

Replies 11 (11)
martabel
Shopify Partner
69 1 5

Up please! Need solution.

martabel
Shopify Partner
69 1 5
martabel
Shopify Partner
69 1 5

Hey, still need a solution. Could someone from Shopify staff give their input please.

Alex
Shopify Staff
Shopify Staff
1561 81 324

Hey @martabel.

 

If you're only performing the asynchronous callback, the flash notification in the bottom of the screen will say that $0.00 was refunded, because Shopify doesn't know yet that you've confirmed any refund amount as a gateway based on the response your gateway sent.

 

When you receive a refund request, you are expected to both respond with response values under a 200 status, and perform an asynchronous callback with those same response values (just in case something happened preventing your initial response from making it to Shopify).

 

Does this make sense? Hope it helps.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

martabel
Shopify Partner
69 1 5

So I need to response to Shopify request with the same values I send to async callback and this would fix it?

martabel
Shopify Partner
69 1 5

Shopify sends a POST JSON request to your refund url with the Request Values.

Note

Your server must reply with a 200 HTTP OK or the order will be canceled.

 

 

This is really unclear. It states I should send 200 HTTP ok and then callback. Also there is no format here, what format should I use etc.

martabel
Shopify Partner
69 1 5

I sent the values as JSON and as Form values both ways did not work. Still says 0.0 euros. Callback should be after the return ?


@martabel wrote:

Shopify sends a POST JSON request to your refund url with the Request Values.

Note

Your server must reply with a 200 HTTP OK or the order will be canceled.

 

 

This is really unclear. It states I should send 200 HTTP ok and then callback. Also there is no format here, what format should I use etc.


 

martabel
Shopify Partner
69 1 5
Alex
Shopify Staff
Shopify Staff
1561 81 324

I agree that the docs are not as clear as they can be, for sure. In my experience, sending the async callback after responding with a 200 status (with the same JSON) has been successful.

 

If you give me a shop, API key, and a recent time frame, I can check logs and see what might be happening.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

memshuz
New Member
2 0 0

Hi, 

We still have the same issue, we succeed to do the callback request, but the flash notification still showing "Refund 0.00". 

We responding 200 ok, and after this doing the callback.

What are we missing ?

Looking forward to your quick reply

 

 

memshuz
New Member
2 0 0

Hello @martabel 

How are you ?!

Did you succeed to update the flash notification during refund with callback request ? 

Thank you, have a good day