btcpayserver/node-btcpay

notificationURL in create_invoice method is not working as expected

0x7ee opened this issue · 0 comments

0x7ee commented

Whenever i'm trying to create an invoice using the following call:

...
await this.client.create_invoice({
  price: 5,
  currency: 'USD',

  // only root domain works, nested routes such as '/webook/btcpay' don't work
  // even root with parameters like '/webhook?type=btcpay' don't work

  // works
  notificationURL: 'https://enwi754p7u1nb.x.pipedream.net',

  // also works
  // notificationURL: 'https://enwi754p7u1nb.x.pipedream.net/webhook'

  // paid events are not sent, only confirmed and complete events are sent
  // notificationURL: 'https://enwi754p7u1nb.x.pipedream.net/webhook?type=btcpay'

  // same as above
  // notificationURL: 'https://enwi754p7u1nb.x.pipedream.net/webhook/btcpay'
});
...

the none-commented version works fine (paid, confirmed, complete events are received normally)
but the commented versions don't send 'paid' events, only sends confirmed and complete events

what i expected is that: all versions receive all types of events

also note that when i create invoices in the ui, all the variant urls works fine (eg: https://testnet.demo.btcpayserver.org/invoices)

i'd be happy to provide real reproducible code if necessary

Update

so i solved the issue by using 'extendedNotifications' parameter like this:

client.create_invoice({
  ...
  extendedNotifications: true,
  ...
})

Now i can receive all the desired notifications regardless of the supplied 'notificationURL'