Sha256: a5a2fcb167c22281b04eeeb6cd326bd948b31d0b10af844330d1d1e7f26458ae

Contents?: true

Size: 1001 Bytes

Versions: 3

Compression:

Stored size: 1001 Bytes

Contents

module Eligible
  class Claim < APIResource
    def self.ack(params, api_key = nil)
      reference_id = Util.value(params, :reference_id)
      send_request(:get, "/claims/#{reference_id}/acknowledgements.json", api_key, params, :reference_id)
    end

    def self.post(params, api_key = nil)
      send_request(:post, '/claims.json', api_key, **params)
    end

    def self.acks(params, api_key = nil)
      send_request(:get, '/claims/acknowledgements.json', api_key, **params)
    end

    def self.payment_report(params, api_key = nil)
      reference_id = Util.value(params, :reference_id)
      require_param(reference_id, 'Reference id')
      id = Util.value(params, :id)
      url = id.nil? ? "/claims/#{reference_id}/payment_reports" : "/claims/#{reference_id}/payment_reports/#{id}"
      send_request(:get, url, api_key, **params)
    end

    def self.payment_reports(params, api_key = nil)
      send_request(:get, '/claims/payment_reports.json', api_key, **params)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eligible-3.0.2 lib/eligible/claim.rb
eligible-3.0.1 lib/eligible/claim.rb
eligible-3.0.0 lib/eligible/claim.rb