Sha256: b880c654ebd4f00ee9ff88aa895a4afc5257ec34898b841048d0d4e1123c72f7

Contents?: true

Size: 779 Bytes

Versions: 6

Compression:

Stored size: 779 Bytes

Contents

module Paid
  class Invoice < APIResource
    include Paid::APIOperations::List
    include Paid::APIOperations::Update
    include Paid::APIOperations::Create

    def issue(params={}, opts={})
      api_key, headers = Util.parse_opts(opts)
      response, api_key = Paid.request(
        :post, issue_url, api_key || @api_key, params, headers)
      refresh_from(response, api_key)
    end

    def mark_as_paid(params={}, opts={})
      api_key, headers = Util.parse_opts(opts)
      response, api_key = Paid.request(
        :post, mark_as_paid_url, api_key || @api_key, params, headers)
      refresh_from(response, api_key)
    end

    private

    def issue_url
      api_url + '/issue'
    end

    def mark_as_paid_url
      api_url + '/mark_as_paid'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
paid-0.1.0 lib/paid/invoice.rb
paid-0.0.8 lib/paid/invoice.rb
paid-0.0.7 lib/paid/invoice.rb
paid-0.0.6 lib/paid/invoice.rb
paid-0.0.5 lib/paid/invoice.rb
paid-0.0.4 lib/paid/invoice.rb