Class: Stigg::Resources::V1::Subscriptions::Invoice

Inherits:
Object
  • Object
show all
Defined in:
lib/stigg/resources/v1/subscriptions/invoice.rb

Overview

Operations related to subscriptions

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Invoice

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Invoice.

Parameters:



33
34
35
# File 'lib/stigg/resources/v1/subscriptions/invoice.rb', line 33

def initialize(client:)
  @client = client
end

Instance Method Details

#mark_as_paid(id, request_options: {}) ⇒ Stigg::Models::V1::Subscriptions::InvoiceMarkAsPaidResponse

Marks the latest invoice of a subscription as paid in the billing provider. The invoice must exist and have an OPEN status.

Parameters:

  • id (String)

    The unique identifier of the entity

  • request_options (Stigg::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
# File 'lib/stigg/resources/v1/subscriptions/invoice.rb', line 21

def mark_as_paid(id, params = {})
  @client.request(
    method: :post,
    path: ["api/v1/subscriptions/%1$s/invoice/paid", id],
    model: Stigg::Models::V1::Subscriptions::InvoiceMarkAsPaidResponse,
    options: params[:request_options]
  )
end