Once a charge has been created, it status can be monitored by connecting the websocket client to https://api.pay.busha.co/charges/{chargeID}/status.
Replace chargeID
in the route with id
of created/existing charge.
The socket sends a Charge
on every update. whenever an event (payment
,expire
.e.t.c) occurs on the full charge object with the updates. check charge resource for more details.
// example of charge sent by the server
{
"addresses": {
"bitcoin": "35EZAktBdnkzJ1dT2QfDT4Gqhxco3UALSx",
"ethereum": "0x019Ec4f8bE636cCc4692CC672918470a85787ECF"
},
"pricing": {
"bitcoin": {
"currency": "BTC",
"value": "0.00111982"
},
"ethereum": {
"currency": "ETH",
"value": "0.03952834"
},
"local": {
"currency": "NGN",
"value": "2000"
}
},
"payments": [],
"id": "ff5eb3dd-12eb-4c41-b513-8f92f2e31970",
"created_at": "2019-06-12T23:43:25.982566Z",
"code": "OyRO1y2tJk",
"hosted_url": "http://pay.busha.co/charges/OyRO1y2tJk",
"redirect_url": "https://example.com",
"cancel_url": "https://example.com",
"expires_at": "2019-06-13T00:13:25.982216Z",
"timeline": [
{
"time": "2019-06-12T23:43:25.985952Z",
"status": "NEW",
"context": null
}
],
"metadata": {
"customer_id": "id_1005",
"customer_name": "Jane Doe"
}
}