Class: Ecommerce::Resources::InvoicePlan

Inherits:
Base
  • Object
show all
Defined in:
lib/ecommerce/resources/invoice_plan.rb

Overview

A wrapper to Ecommerce invoice per plan API

API

Documentation: myfreecomm.github.io/passaporte-web/ecommerce/api/index.html

Class Method Summary collapse

Methods inherited from Base

client, #initialize

Constructor Details

This class inherits a constructor from Ecommerce::Resources::Base

Class Method Details

.find_all(slug, page = 1, limit = 20) ⇒ Object

Lists all paid invoices of a plan and return a collection of invoice with pagination information (represented by Ecommerce::Resources::InvoiceOrderCollection)

API

Method: <tt>GET /api/:slug/invoices/paid/

Documentation: myfreecomm.github.io/passaporte-web/ecommerce/api/orders.html#listagem-das-faturas-pagas-para-um-plano



19
20
21
22
23
24
# File 'lib/ecommerce/resources/invoice_plan.rb', line 19

def self.find_all(slug, page = 1, limit = 20)
  body = { page: page, limit: limit }
  client.get("/api/#{slug}/invoices/paid/", body: body) do |response|
    Ecommerce::Resources::InvoiceOrderCollection.build(response)
  end
end