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

martabel
Shopify Partner
40 0 1

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?

0 Likes
martabel
Shopify Partner
40 0 1

Up please! Need solution.

0 Likes
martabel
Shopify Partner
40 0 1

Up please

0 Likes
martabel
Shopify Partner
40 0 1

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

0 Likes
Alex
Shopify Staff
Shopify Staff
1555 81 294

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.

0 Likes
martabel
Shopify Partner
40 0 1

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

0 Likes
martabel
Shopify Partner
40 0 1

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.

0 Likes
martabel
Shopify Partner
40 0 1

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.


 

0 Likes
martabel
Shopify Partner
40 0 1
0 Likes
Alex
Shopify Staff
Shopify Staff
1555 81 294

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.

0 Likes