I am using the Payment Widget. In the blockonomicsPaymentCallback, the transaction Id is available in the function arguments, however, in the Order Callback Hook the txid is no longer available. I can see in the Callback logs that the txid is passed by this api:
Hi @cge
The Order Hook will only contain the Bitcoin payment status and the order UUID
Example callback from server
<OrderHook_URL>?status=2&uuid=2b0c7e2cd523458098b2
To get the values of the custom fields, you can call the order API point. Here are some examples which include your use case Introduction to Payment Button API – Dev Library see Order Hook URL Endpoint Logic
Here is an example request https://www.blockonomics.co/api/merchant_order/23ba2ce9c9114d91b755
Here is the response for above, note that it includes txid
Sorry for the late reply. Thank you for your answer. This helps alot.
One more question, what are the chances that a transaction fails? Based on the status that is passed onto the callback it does not have a failed status.
Hi @cge Please note that a callback succeeds when the server returns 200 HTTP status. Callback are retried 7 times with an exponential backoff of 4 seconds" So failing callbacks are retried up to 7 times.
As for the actual succeeding callbacks, one callback is sent for status 0, one for status 1 and one for status 2 and this is the intended behaviour. You will need to catch the status of the callback and have the code act accordingly. It is strongly suggested to accept payments only after status 2 has arrived. Here is our API documentation regarding same - Blockchain API | Bitcoin API - Blockonomics