class BtcPay::Client::Api::StoreInvoices

Constants

PATH

Public Instance Methods

all(store_id, **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_GetInvoices

# File lib/btcpay/client/api/store_invoices.rb, line 10
def all(store_id, **opts)
  client.get(store_path(store_id), options: opts)
end
Also aliased as: index
archive(store_id, invoice_id, **opts)
Alias for: delete
create(store_id, payload, **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_CreateInvoice

# File lib/btcpay/client/api/store_invoices.rb, line 17
def create(store_id, payload, **opts)
  client.post(store_path(store_id), payload: payload, options: opts)
end
delete(store_id, invoice_id, **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_ArchiveInvoice

# File lib/btcpay/client/api/store_invoices.rb, line 29
def delete(store_id, invoice_id, **opts)
  client.delete(store_path(store_id, invoice_id), options: opts)
end
Also aliased as: archive
find(store_id, invoice_id, **opts)
Alias for: get
get(store_id, invoice_id, **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_GetInvoice

# File lib/btcpay/client/api/store_invoices.rb, line 22
def get(store_id, invoice_id, **opts)
  client.get(store_path(store_id, invoice_id), options: opts)
end
Also aliased as: find
index(store_id, **opts)
Alias for: all
unarchive(store_id, invoice_id, **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_UnarchiveInvoice

# File lib/btcpay/client/api/store_invoices.rb, line 42
def unarchive(store_id, invoice_id, **opts)
  client.post(store_path(store_id, invoice_id, 'unarchive'), payload: {}, options: opts)
end
update_status(store_id, invoice_id, status = 'Complete', **opts) click to toggle source

@see docs.btcpayserver.org/API/Greenfield/v1/#operation/Invoices_MarkInvoiceStatus @see github.com/btcpayserver/btcpayserver/blob/master/BTCPayServer.Client/Models/InvoiceStatus.cs

# File lib/btcpay/client/api/store_invoices.rb, line 37
def update_status(store_id, invoice_id, status = 'Complete', **opts)
  client.post(store_path(store_id, invoice_id, 'status'), payload: { status: status }, options: opts)
end

Protected Instance Methods

set_base_path() click to toggle source
# File lib/btcpay/client/api/store_invoices.rb, line 48
def set_base_path
  @base_path = PATH.dup
end