Class: MasterCard::API::MerchantIdentifier::MerchantIdentifier

Inherits:
BaseObject
  • Object
show all
Defined in:
lib/mastercard/api/merchantidentifier/merchantidentifier.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.getApiVersionObject



76
77
78
# File 'lib/mastercard/api/merchantidentifier/merchantidentifier.rb', line 76

def self.getApiVersion
    return "1.0.0"
end

.query(criteria) ⇒ Object



88
89
90
91
92
93
94
95
96
97
# File 'lib/mastercard/api/merchantidentifier/merchantidentifier.rb', line 88

def self.query(criteria)
    #
    #Query objects of type MerchantIdentifier by id and optional criteria
    #@param type criteria
    #@return MerchantIdentifier object representing the response.
    #

    obj = MerchantIdentifier.new(criteria)
    return self.queryObject(obj)
end

Instance Method Details

#getHeaderParams(action) ⇒ Object

Raises:

  • (StandardError)


52
53
54
55
56
57
58
59
60
61
62
# File 'lib/mastercard/api/merchantidentifier/merchantidentifier.rb', line 52

def getHeaderParams(action)
    #Returns a list containing header params
    #@return list
    action = action.upcase
    
    if action == "QUERY"
        return []
        end
    
    raise StandardError.new("Invalid action supplied: #{action.to_s}")
end

#getQueryParams(action) ⇒ Object

Raises:

  • (StandardError)


64
65
66
67
68
69
70
71
72
73
74
# File 'lib/mastercard/api/merchantidentifier/merchantidentifier.rb', line 64

def getQueryParams(action)
    #Returns a list containing query params
    #@return list
    action = action.upcase
    
    if action == "QUERY"
        return ["MerchantId","Type"]
    end
    
    raise StandardError.new("Invalid action supplied: #{action.to_s}")
end

#getResourcePath(action) ⇒ Object

Raises:

  • (StandardError)


38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/mastercard/api/merchantidentifier/merchantidentifier.rb', line 38

def getResourcePath(action)
    #Returns the resource path based on the action
    #@return str

    action = action.upcase
    
    if action == "QUERY"
        return "/merchantid/v1/merchantid"
        end
    
    raise StandardError.new("Invalid action supplied: #{action.to_s}")

end