I am using a HPSDK and with some payment methods the payment will be pending at first. It takes some time for the payment to go through and then it will change to "DONE" in the payment backend. When i refund through Shopify it will then be pending at first, because from payment gateway payment status came back. Now when later it goes through, how could i change the pending to completed in shopify?
In order to transition a pending refund into a completed one, you can send a separate POST request to the same URL that you used for x_url_callback when you created your pending refund.
You would just need to use a new value for x_gateway_reference and make sure that your x_result was set to completed instead of pending, and that will complete the refund.
It's worth noting that doing this will overwrite your previous pending refund, but it doesn't create a brand new, separate transaction on the order. It overwrites the pending one with the payload that you sent to complete it.
At this time, in the admin you will still see a transaction message of 'Transaction pending' if you expand the refund information in the order timeline. That is just left over from your previous pending refund though. It does not mean that the completion didn't work, it just isn't being overwritten currently. Everything else on the transaction and order should work normally, and I've reported this as a bug so that our engineers are able to look into a fix.
Hope this helps, enjoy!
Have you created a collection on your online store and experienced an issue with adding yo...By Ollie Aug 24, 2022