Sha256: 5245dc31c4759951a45295b061547630b9a52af4a32f03805ce138e5bfbafa37

Contents?: true

Size: 928 Bytes

Versions: 3

Compression:

Stored size: 928 Bytes

Contents

module Ecommerce
  module Resources
    #
    # A wrapper to Ecommerce invoice per plan API
    #
    # [API]
    #   Documentation: http://myfreecomm.github.io/passaporte-web/ecommerce/api/index.html
    #
    class InvoicePlan < Base
      #
      # 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: http://myfreecomm.github.io/passaporte-web/ecommerce/api/orders.html#listagem-das-faturas-pagas-para-um-plano
      #
      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecommerce-client-0.0.5 lib/ecommerce/resources/invoice_plan.rb
ecommerce-client-0.0.4 lib/ecommerce/resources/invoice_plan.rb
ecommerce-client-0.0.3 lib/ecommerce/resources/invoice_plan.rb