Class: ShellSmartPayApi::MobilePaymentRegistrationRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellSmartPayApi::MobilePaymentRegistrationRequest
- Defined in:
- lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb
Overview
MobilePaymentRegistrationRequest Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
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).
-
#col_co_id ⇒ String
The ID of the Collecting Company (in GFN), also known as Shell Code of the selected payer.
-
#collecting_companies ⇒ Array[CollectingCompany]
Array of Colco Ids.
-
#pan ⇒ String
Original card PAN (generated on creation of Card (see Card Order Service)).
-
#pan_expiry ⇒ String
Expiry Date associated with the PAN in format YYMM.
-
#payer_id ⇒ String
The Payer Id, or the Customer Id of the Payment Customer.
-
#period ⇒ Integer
Specifies how many months the DPAN should be valid for.
-
#reference_id ⇒ String
Unique Reference ID the DPAN is registered to.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#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
constructor
A new instance of MobilePaymentRegistrationRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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, account_id = 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 = account_id @payer_id = payer_id @col_co_id = col_co_id @collecting_companies = collecting_companies end |
Instance Attribute Details
#account_id ⇒ String
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.
39 40 41 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 39 def account_id @account_id end |
#col_co_id ⇒ String
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
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_companies ⇒ Array[CollectingCompany]
Array of Colco Ids
56 57 58 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 56 def collecting_companies @collecting_companies end |
#pan ⇒ String
Original card PAN (generated on creation of Card (see Card Order Service))
21 22 23 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 21 def pan @pan end |
#pan_expiry ⇒ String
Expiry Date associated with the PAN in format YYMM.
25 26 27 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 25 def pan_expiry @pan_expiry end |
#payer_id ⇒ String
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.
46 47 48 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 46 def payer_id @payer_id end |
#period ⇒ Integer
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
32 33 34 |
# File 'lib/shell_smart_pay_api/models/mobile_payment_registration_request.rb', line 32 def period @period end |
#reference_id ⇒ String
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: , / @ ! # & * ()
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 account_id = 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, account_id, payer_id, col_co_id, collecting_companies) end |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |