python-teos icon indicating copy to clipboard operation
python-teos copied to clipboard

BTCPayserver integration test

Open sr-gi opened this issue 4 years ago • 2 comments

At the moment the tower is free of charge. However, in order to offer the tower as a service payments for storage + monitor is most likely going to be required, otherwise the tower would be an easy target for DoS attacks.

The goal for the tower is to be pretty modular, the core of it (daemon + Watcher + Responder) can be decoupled from the user interface (API + Gatekeeper). In the same way, the payment processor may be a completely independent instance.

The goal of the integration, for now, would be to request a BOLT11 invoice from teos (API or Gatekeeper) to a BTCPayserver instance, so it can be sent to the user in the response of register. Then, the registration would only be completed after the user pays the invoice (in a pretty similar way to LSAT).

The workflow should be:

  • The user sends a register request to the tower
  • The tower ask BTCPayserver for a new invoice and includes it in the register response
  • The tower polls/ gets notified by BTCPayserver on invoice paid (not completely sure about how this would work)
  • The registration is completed

A simpler, but also helpful, version of this would be to cover points 2 and 3 independently of the codebase, to asses whether this approach would be viable:

  • Request an invoice from BTCPayserver
  • Create a hook to get notified when the payment is received
  • Pay the invoice and test

sr-gi avatar Apr 03 '20 11:04 sr-gi

According to @Kukks there's a webhook option when creating the BOLT11 invoice in BTCPayserver that will generate an http endpoint where to check the state of the invoice, so it should be doable.

sr-gi avatar Apr 03 '20 14:04 sr-gi

Looking forward to it

RiccardoMasutti avatar May 16 '20 11:05 RiccardoMasutti