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?
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.
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 ?
Shopify sends a POST JSON request to your refund url with the Request Values.
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.
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.