Class: ShellSmartPayApi::MobilePaymentRegistrationRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb

Overview

MobilePaymentRegistrationRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(reference_id = nil, pan = nil, pan_expiry = nil, period = nil, account_id = nil, payer_id = nil, col_co_id = nil, collecting_companies = nil) ⇒ MobilePaymentRegistrationRequest

Returns a new instance of MobilePaymentRegistrationRequest.



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 82

def initialize(reference_id = nil, pan = nil, pan_expiry = nil,
               period = nil,  = nil, payer_id = nil,
               col_co_id = nil, collecting_companies = nil)
  @reference_id = reference_id
  @pan = pan
  @pan_expiry = pan_expiry
  @period = period
  @account_id = 
  @payer_id = payer_id
  @col_co_id = col_co_id
  @collecting_companies = collecting_companies
end

Instance Attribute Details

#account_idString

In Shell, a Payer can have several accounts (representing company branches, divisions or generally different cost-centers that a customer wants to group cards on). You can specify this property or the AccountNumber.

Returns:

  • (String)


39
40
41
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 39

def 
  @account_id
end

#col_co_idString

The ID of the Collecting Company (in GFN), also known as Shell Code of the selected payer. This property is mandatory if the ColCoCode code is not passed

Returns:

  • (String)


52
53
54
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 52

def col_co_id
  @col_co_id
end

#collecting_companiesArray[CollectingCompany]

Array of Colco Ids

Returns:



56
57
58
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 56

def collecting_companies
  @collecting_companies
end

#panString

Original card PAN (generated on creation of Card (see Card Order Service))

Returns:

  • (String)


21
22
23
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 21

def pan
  @pan
end

#pan_expiryString

Expiry Date associated with the PAN in format YYMM.

Returns:

  • (String)


25
26
27
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 25

def pan_expiry
  @pan_expiry
end

#payer_idString

The Payer Id, or the Customer Id of the Payment Customer. In Shell, a Payer is a customer belonging to a specific market geography. A Payer can have several Accounts; each account can then have different groups of cards.

Returns:

  • (String)


46
47
48
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 46

def payer_id
  @payer_id
end

#periodInteger

Specifies how many months the DPAN should be valid for. If not present, the Token Server determines the expiry date using its default algorithm. Note that the Token Server might not respect this value and use configured business rules to override the requested validity period

Returns:

  • (Integer)


32
33
34
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 32

def period
  @period
end

#reference_idString

Unique Reference ID the DPAN is registered to. The Reference ID has been implemented to accept normal alphanumeric characters plus the following ‘special characters’: dot, underscore and hyphen. The following characters are not acceptable: , / @ ! # & * ()

Returns:

  • (String)


17
18
19
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 17

def reference_id
  @reference_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  reference_id = hash.key?('referenceId') ? hash['referenceId'] : nil
  pan = hash.key?('pan') ? hash['pan'] : nil
  pan_expiry = hash.key?('panExpiry') ? hash['panExpiry'] : nil
  period = hash.key?('period') ? hash['period'] : nil
   = hash.key?('AccountId') ? hash['AccountId'] : nil
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : nil
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : nil
  # Parameter is an array, so we need to iterate through it
  collecting_companies = nil
  unless hash['CollectingCompanies'].nil?
    collecting_companies = []
    hash['CollectingCompanies'].each do |structure|
      collecting_companies << (CollectingCompany.from_hash(structure) if structure)
    end
  end

  collecting_companies = nil unless hash.key?('CollectingCompanies')

  # Create object from extracted values.
  MobilePaymentRegistrationRequest.new(reference_id,
                                       pan,
                                       pan_expiry,
                                       period,
                                       ,
                                       payer_id,
                                       col_co_id,
                                       collecting_companies)
end

.namesObject

A mapping from model property names to API property names.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 59

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['reference_id'] = 'referenceId'
  @_hash['pan'] = 'pan'
  @_hash['pan_expiry'] = 'panExpiry'
  @_hash['period'] = 'period'
  @_hash['account_id'] = 'AccountId'
  @_hash['payer_id'] = 'PayerId'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['collecting_companies'] = 'CollectingCompanies'
  @_hash
end

.nullablesObject

An array for nullable fields



78
79
80
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 78

def self.nullables
  []
end

.optionalsObject

An array for optional fields



73
74
75
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 73

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



138
139
140
141
142
143
144
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 138

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} reference_id: #{@reference_id.inspect}, pan: #{@pan.inspect}, pan_expiry:"\
  " #{@pan_expiry.inspect}, period: #{@period.inspect}, account_id: #{@account_id.inspect},"\
  " payer_id: #{@payer_id.inspect}, col_co_id: #{@col_co_id.inspect}, collecting_companies:"\
  " #{@collecting_companies.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



130
131
132
133
134
135
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 130

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} reference_id: #{@reference_id}, pan: #{@pan}, pan_expiry: #{@pan_expiry},"\
  " period: #{@period}, account_id: #{@account_id}, payer_id: #{@payer_id}, col_co_id:"\
  " #{@col_co_id}, collecting_companies: #{@collecting_companies}>"
end