Class: BtcPay::Client::Api::StoreInvoices

Inherits:
Base
  • Object
show all
Defined in:
lib/btcpay/client/api/store_invoices.rb

Constant Summary collapse

PATH =
'/stores/:store_id/invoices'

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from BtcPay::Client::Service

Instance Method Details

#all(store_id, **opts) ⇒ Object Also known as: index



10
11
12
# File 'lib/btcpay/client/api/store_invoices.rb', line 10

def all(store_id, **opts)
  client.get(store_path(store_id), options: opts)
end

#create(store_id, payload, **opts) ⇒ Object



17
18
19
# 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) ⇒ Object Also known as: archive



29
30
31
# 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

#get(store_id, invoice_id, **opts) ⇒ Object Also known as: find



22
23
24
# 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

#unarchive(store_id, invoice_id, **opts) ⇒ Object



42
43
44
# 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) ⇒ Object



37
38
39
# 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