question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Notification URL / responses

See original GitHub issue

For the invoices you can provide the common Redirect Url but also a Notification Url. The latter is used for updates on payment status (partial payment? expired?; at least thats what I assume).

Sidenote: This way you can also get the payment notification if the user pays but does not hit the redirect url after successful payment or something else breaks on that route.

Logging the response form BTCPay a few interesting things show:

1) notification response: orderId vs posData

  • the notification response (from BTCPay) does not include the orderId but posData field. Because Order Id missing you can’t easily load it but you may need some more complicated logic to load your internal order by the BTCPay invoice ID (which is most likely not that straight forward)

Response:

{
  "id": "NBBMjdueu3hrd9bDCmbDH2",
  "url": null,
  "posData": "32",
  "status": "complete",
  "btcPrice": null,
  "price": 0.58,
  "currency": "USD",
  "invoiceTime": 1529272228000,
  "expirationTime": 1529273128000,
  "currentTime": 1529272277186,
  "btcPaid": null,
  "btcDue": null,
  "rate": 0.0,
  "exceptionStatus": false,
  "buyerFields": {
    "buyerEmail": "xxxx",
    "transactionCurrency": null,
    "paymentSubtotals": @ "BTC_LightningLike": 8930,
    "paymentTotals": @ "BTC_LightningLike": 8930,
    "amountPaid": "0.00000000",
    "exchangeRates": @ "BTC": {
      "USD": 0.0
    }
  }
}
  • in the BTCPay UI you have the order ID shown but not the posData image

To make this more consistent and assuming that BTCPay already returns the same notification data as the original BitPay API I would suggest to:

2) Notification responses verbose

Makes sense that the server notifies on every status change but this does not look right to me. On payment I get 6 times the same response with payment completed. Seems the server keeps sending notification those last payments (not sure if intended or not?) The actual last payment was around 23:30 but now 00:20 server still sends old completed payment notifications, each 3 times: image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
ndeetcommented, Jun 19, 2018

Cool, thank you.

I just did a normal BTC payment and compared the notification. There the payment status is as expected “paid” for the first notification, followed by “confirmed” after first confirmation. (without waiting I guess after 6 confs it will be “complete”). 👍

Another small difference/nitpick: the BTC payment provides the url of invoice, the LN payment does not.

1reaction
NicolasDoriercommented, Dec 7, 2018

1477630c78dc4dcced40db3ea38c80fa50630b6a

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a Notification URL
The first step to create Square webhooks is to create a notification URL that receives and processes ... Respond with a 2xx HTTP...
Read more >
Notification URL setup
The notification URL is a templated URL which supports the common parameters, including {InstanceId} , {InstallId} , {AssetId} , {AssetName} , {UserName} ,...
Read more >
Webhook notifications
Each notification URL can handle several event types, and conversely the responses for a single notification type can be sent to several ...
Read more >
Register a notification url
To receive such notifications, you can register a callback URL that will be used by the marketplace to send the ID of the...
Read more >
Handling notification responses from APNs
Each response contains a header with fields indicating the status of the response. If the request was successful, the body of the response...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found