Class: MasterCard::API::Qkr::CreditNote

Inherits:
Core::Model::BaseObject
  • Object
show all
Includes:
Core::Model
Defined in:
lib/mastercard/api/qkr/creditnote.rb

Class Method Summary collapse

Class Method Details

.create(mapObj) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/mastercard/api/qkr/creditnote.rb', line 61

def self.create(mapObj)
    #
    #Creates object of type CreditNote
    #
    #@param Dict mapObj, containing the required parameters to create a new object
    #@return [CreditNote] of the response of created instance.
    #@raise [APIException] an exception from the response status
    return self.execute("ac9c265a-1f7b-4d0d-ab06-16595912c36e", CreditNote.new(mapObj))
end

.read(id, criteria = nil) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/mastercard/api/qkr/creditnote.rb', line 81

def self.read(id, criteria = nil)
    #
    #Returns objects of type CreditNote by id and optional criteria
    #@param [String] id
    #@param [Dict] criteria
    #@return [CreditNote] object representing the response
    #@raise [APIException] an exception from the response status

    mapObj = CreditNote.new
    if !(id.nil? || id.to_s.empty?)
      mapObj.set("id", id)
    end
    if !criteria.nil?
        if criteria.instance_of? RequestMap
          mapObj.setAll(criteria.getObject())
        else
          mapObj.setAll(criteria)
        end
    end

    return self.execute("f207efcb-757c-4bf5-bab2-5a00f8b9a91b",CreditNote.new(mapObj))
end