Class: ShellCardManagementApIs::UpdateCard

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/update_card.rb

Overview

Request entity object for UpdateCardRequest list

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(caller = SKIP, is_replacement_chargeable = SKIP, notify_caller = SKIP, notify_caller_on_sync = SKIP, order_card_replacement = SKIP, card_settings = SKIP, reason_id = SKIP, reason_text = SKIP, target_status = SKIP, account_id = SKIP, account_number = SKIP, card_expiry_date = SKIP, card_id = SKIP, col_co_code = SKIP, col_co_id = SKIP, pan = SKIP, panid = SKIP, payer_id = SKIP, payer_number = SKIP) ⇒ UpdateCard

Returns a new instance of UpdateCard.



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 244

def initialize(caller = SKIP, is_replacement_chargeable = SKIP,
               notify_caller = SKIP, notify_caller_on_sync = SKIP,
               order_card_replacement = SKIP, card_settings = SKIP,
               reason_id = SKIP, reason_text = SKIP, target_status = SKIP,
                = SKIP,  = SKIP,
               card_expiry_date = SKIP, card_id = SKIP, col_co_code = SKIP,
               col_co_id = SKIP, pan = SKIP, panid = SKIP, payer_id = SKIP,
               payer_number = SKIP)
  @caller = caller unless caller == SKIP
  unless is_replacement_chargeable == SKIP
    @is_replacement_chargeable =
      is_replacement_chargeable
  end
  @notify_caller = notify_caller unless notify_caller == SKIP
  @notify_caller_on_sync = notify_caller_on_sync unless notify_caller_on_sync == SKIP
  @order_card_replacement = order_card_replacement unless order_card_replacement == SKIP
  @card_settings = card_settings unless card_settings == SKIP
  @reason_id = reason_id unless reason_id == SKIP
  @reason_text = reason_text unless reason_text == SKIP
  @target_status = target_status unless target_status == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @card_expiry_date = card_expiry_date unless card_expiry_date == SKIP
  @card_id = card_id unless card_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @pan = pan unless pan == SKIP
  @panid = panid unless panid == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
end

Instance Attribute Details

#account_idInteger

Account Id of the customer.<br /> Optional if AccountNumber is passed, else Mandatory.

Returns:

  • (Integer)


128
129
130
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 128

def 
  @account_id
end

#account_numberString

Account Number of the customer.<br /> Optional if AccountId is passed, else Mandatory.

Returns:

  • (String)


133
134
135
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 133

def 
  @account_number
end

#callerString

The caller to be notified with the status of the update card status request. <br /> The caller will also be notified with the status of the replacement card order request, if any.<br /> Mandatory, if NotifyCaller is true. <br /> Maximum field length: 20<br /> Allowed values:<br />

  • NextGenUI: This value to be used by next gen UI application.<br />

  • Motix: This value to be used by MOTiX application.<br />

  • FleetHubUILifeTime: This value to be used by Fleet Hub UI application

for life time restriction cards.<br /> Note: The values passed in this field are case insensitive.

Returns:

  • (String)


25
26
27
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 25

def caller
  @caller
end

#card_expiry_dateString

Expiry date of the card.<br /> Mandatory if PAN is passed, else optional.<br /> Format: yyyyMMdd

Returns:

  • (String)


139
140
141
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 139

def card_expiry_date
  @card_expiry_date
end

#card_idInteger

Card Id of the card.<br /> Optional if PAN is passed, else Mandatory.

Returns:

  • (Integer)


144
145
146
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 144

def card_id
  @card_id
end

#card_settingsCardSettings

True/False.<br /> Pass True if a replacement order card request is to be placed, else False.<br /> Optional.Default value False.<br /> Replacement of a card is only applicable when the target status requested is either permanently Block or Damaged for the existing card.<br /> Request for Replacement card will be placed only when the Block card or Block damaged card request is successfully placed.<br /> The Replacement card request will be processed only when the permanent Block card request is successfully processed. <br /> In case of damaged card request, the replacement card request will be processed immediately.

Returns:



82
83
84
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 82

def card_settings
  @card_settings
end

#col_co_codeInteger

Collecting company code of the customer. <br /> Optional if ColCoId is passed, else Mandatory.<br />

Returns:

  • (Integer)


149
150
151
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 149

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting company id of the customer. <br /> Optional if ColCoCode is passed, else Mandatory.<br />

Returns:

  • (Integer)


154
155
156
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 154

def col_co_id
  @col_co_id
end

#is_replacement_chargeableTrueClass | FalseClass

True/False<br /> Optional<br /> When not provided will considered as default value as True.<br /> If passed True, the replacement card will be chargeable, else replacement card will not be charged.

Returns:

  • (TrueClass | FalseClass)


33
34
35
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 33

def is_replacement_chargeable
  @is_replacement_chargeable
end

#notify_callerTrueClass | FalseClass

True/False.<br /> Optional.<br /> Default: False<br /> If true, the caller would be notified back with the status as success or failure after the update card status request is processed. Notification API subscription required to use this feature , please refer API documetation for more details

Returns:

  • (TrueClass | FalseClass)


43
44
45
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 43

def notify_caller
  @notify_caller
end

#notify_caller_on_syncTrueClass | FalseClass

True/False.<br /> Optional.<br /> Default: False<br /> If true, the caller would be notified back with the status as success or failed after the replacement card is synced with Gateway, if a replacement card was requested.

Returns:

  • (TrueClass | FalseClass)


52
53
54
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 52

def notify_caller_on_sync
  @notify_caller_on_sync
end

#order_card_replacementTrueClass | FalseClass

True/False.<br /> Pass True if a replacement order card request is to be placed, else False.<br /> Optional.Default value False.<br /> Replacement of a card is only applicable when the target status requested is either permanently Block or Damaged for the existing card.<br /> Request for Replacement card will be placed only when the Block card or Block damaged card request is successfully placed.<br /> The Replacement card request will be processed only when the permanent Block card request is successfully processed. <br /> In case of damaged card request, the replacement card request will be processed immediately.

Returns:

  • (TrueClass | FalseClass)


67
68
69
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 67

def order_card_replacement
  @order_card_replacement
end

#panString

PAN of the card.<br /> Optional if CardId is passed, else Mandatory.<br />

Returns:

  • (String)


159
160
161
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 159

def pan
  @pan
end

#panidFloat

PANID of the card

Returns:

  • (Float)


163
164
165
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 163

def panid
  @panid
end

#payer_idInteger

Payer id of the customer.<br /> Optional if PayerNumber is passed, else Mandatory.

Returns:

  • (Integer)


168
169
170
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 168

def payer_id
  @payer_id
end

#payer_numberString

PayerNumber of the customer.<br /> Optional if PayerId is passed, else Mandatory.

Returns:

  • (String)


173
174
175
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 173

def payer_number
  @payer_number
end

#reason_idInteger

Reason id for updating the card status. Either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’. Else ignored. Possible values: 1 (Lost) 2 (Stolen) 3 (Card no longer required)

<br>When passed, the reason Id will be mapped to allowed reason IDs

configured for the card type of the card. If the given reason Id is not allowed for certain card types, then the request will be rejected as invalid ResonId

Returns:

  • (Integer)


96
97
98
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 96

def reason_id
  @reason_id
end

#reason_textString

Reason text for updating the card status. Possible Values: 1) Lost 2) Stolen 3) Card no longer required Optional – However, either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’. Else, Ignored. When Reason Text is passed and the Target Status is either Block or Damaged, the text will be validated with the allowed list of values configured for the card type of the card. If the text is not allowed, request will be rejected as invaid ResonText. Note: ‘Customer blocked’ will be used as the reason for ‘Temporary Block’.

Returns:

  • (String)


112
113
114
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 112

def reason_text
  @reason_text
end

#target_statusInteger

The list of cards passed in ‘Cards’ parameter will be updated to this status.<br /> Mandatory.<br /> Allowed values –<br />

  • TemporaryBlock<br />

  • Unblock<br />

  • Block<br />

  • Damaged<br />

Returns:

  • (Integer)


123
124
125
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 123

def target_status
  @target_status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 277

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  caller = hash.key?('Caller') ? hash['Caller'] : SKIP
  is_replacement_chargeable =
    hash.key?('IsReplacementChargeable') ? hash['IsReplacementChargeable'] : SKIP
  notify_caller = hash.key?('NotifyCaller') ? hash['NotifyCaller'] : SKIP
  notify_caller_on_sync =
    hash.key?('NotifyCallerOnSync') ? hash['NotifyCallerOnSync'] : SKIP
  order_card_replacement =
    hash.key?('OrderCardReplacement') ? hash['OrderCardReplacement'] : SKIP
  card_settings = CardSettings.from_hash(hash['CardSettings']) if hash['CardSettings']
  reason_id = hash.key?('ReasonId') ? hash['ReasonId'] : SKIP
  reason_text = hash.key?('ReasonText') ? hash['ReasonText'] : SKIP
  target_status = hash.key?('TargetStatus') ? hash['TargetStatus'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  card_expiry_date =
    hash.key?('CardExpiryDate') ? hash['CardExpiryDate'] : SKIP
  card_id = hash.key?('CardId') ? hash['CardId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  pan = hash.key?('PAN') ? hash['PAN'] : SKIP
  panid = hash.key?('PANID') ? hash['PANID'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP

  # Create object from extracted values.
  UpdateCard.new(caller,
                 is_replacement_chargeable,
                 notify_caller,
                 notify_caller_on_sync,
                 order_card_replacement,
                 card_settings,
                 reason_id,
                 reason_text,
                 target_status,
                 ,
                 ,
                 card_expiry_date,
                 card_id,
                 col_co_code,
                 col_co_id,
                 pan,
                 panid,
                 payer_id,
                 payer_number)
end

.namesObject

A mapping from model property names to API property names.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 176

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['caller'] = 'Caller'
  @_hash['is_replacement_chargeable'] = 'IsReplacementChargeable'
  @_hash['notify_caller'] = 'NotifyCaller'
  @_hash['notify_caller_on_sync'] = 'NotifyCallerOnSync'
  @_hash['order_card_replacement'] = 'OrderCardReplacement'
  @_hash['card_settings'] = 'CardSettings'
  @_hash['reason_id'] = 'ReasonId'
  @_hash['reason_text'] = 'ReasonText'
  @_hash['target_status'] = 'TargetStatus'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['card_expiry_date'] = 'CardExpiryDate'
  @_hash['card_id'] = 'CardId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['pan'] = 'PAN'
  @_hash['panid'] = 'PANID'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 226

def self.nullables
  %w[
    caller
    reason_text
    target_status
    account_id
    account_number
    card_expiry_date
    card_id
    col_co_code
    col_co_id
    pan
    panid
    payer_id
    payer_number
  ]
end

.optionalsObject

An array for optional fields



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/shell_card_management_ap_is/models/update_card.rb', line 201

def self.optionals
  %w[
    caller
    is_replacement_chargeable
    notify_caller
    notify_caller_on_sync
    order_card_replacement
    card_settings
    reason_id
    reason_text
    target_status
    account_id
    account_number
    card_expiry_date
    card_id
    col_co_code
    col_co_id
    pan
    panid
    payer_id
    payer_number
  ]
end