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:
I’m wondering if the Order Callback hook does not really pass the txid? or if that’s not the case, can you maybe point me in the right direction?
By the way, I am still on the testing part of this integration and no real payment has been done yet.
Hi @cge when you provide the order callback hook, Blockonomics server will send callback and it will have txid in the response.
Please checkout our API doc Blockchain API | Bitcoin API - Blockonomics and here’s a tutorial on our dev library - Introduction to Payment Button API – Dev Library
Let me know if you need detailed explanation. Thanks!
@cge txid is not sent in order hook callback. You should call
GET /api/merchant_order/<uuid> endpoint to get the txid and other customer data .
For detail you can also refer to Introduction to Payment Button API – Dev Library
The Order Hook will only contain the Bitcoin payment status and the order UUID
Example callback from server
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
Here is the response for above, note that it includes txid
"name": "article buying",
"name": "yellow fellow",
"description": "Sample buy"
Please let me know if you have any questions, thanks!
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.
Again, thank you for your help.
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