btcpayserver / btcpayserver

Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
https://btcpayserver.org/
MIT License
6.27k stars 1.63k forks source link

GreenField: Bitpay Pairing/APKey Management endpoint #1748

Closed cariaso closed 2 years ago

cariaso commented 4 years ago

via http://some.onion/stores/storeid/Tokens http://some.onion/api-tokens http://some.onion/api-access-request?pairingCode=abc123&selectedStore=storeid http://some.onion/stores/storeid/Tokens?pairingCode=abc123

I'm able to generate a pairingCode and use it to create a key with https://github.com/btcpayserver/btcpay-python

However the Greenfield API doesn't give me a way to achieve the generation of such a key.

That key allows me to make these calls: btcpay_client.create_invoice({"price": 123, "currency": "USD", "orderId": orderId}) btcpay_client.get_invoice(invoiceId) btcpay_client.get_invoices(order_id=orderId)

I don't know whether it's better to either

  1. expand Greenfield to enable the creation of a pairingCode or
  2. expand Greenfield to enable non-lightning create_invoice(), get_invoices(), get_invoice() but I would like the ability to bootstrap the creation of invoices without needing web clicks.
NicolasDorier commented 4 years ago

@cariaso can you describe the json payloads you would expect.

cariaso commented 4 years ago
response = create_pairing_code({
    storeId:"storeId",
    label:"alabel",
   })
response = {
   pairingCode : "x123abc"
}
Kukks commented 4 years ago

Ok so this is not a greenfield api to create invoices(#1760 ) but an api to manage Bitpay API keys

NicolasDorier commented 2 years ago

I will close this one, we shouldn't add API related to bitpay's API. The Bitpay's API is deprecated, new development should use Greenfield.