Class: ShellCardManagementApIs::SubmittedCard

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

Overview

Response entity object for SubmittedCard list <br/>Note: This list will be empty for status 9006 and 9012 i.e., request for all the cards failed.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(replacement_card_reference = SKIP, update_card_reference = 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, masked_pan = SKIP, payer_id = SKIP, payer_number = SKIP) ⇒ SubmittedCard

Returns a new instance of SubmittedCard.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 136

def initialize(replacement_card_reference = SKIP,
               update_card_reference = SKIP,  = SKIP,
                = SKIP, card_expiry_date = SKIP,
               card_id = SKIP, col_co_code = SKIP, col_co_id = SKIP,
               pan = SKIP, panid = SKIP, masked_pan = SKIP, payer_id = SKIP,
               payer_number = SKIP)
  unless replacement_card_reference == SKIP
    @replacement_card_reference =
      replacement_card_reference
  end
  @update_card_reference = update_card_reference unless update_card_reference == 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
  @masked_pan = masked_pan unless masked_pan == 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)


28
29
30
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 28

def 
  @account_id
end

#account_numberString

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

Returns:

  • (String)


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

def 
  @account_number
end

#card_expiry_dateString

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

Returns:

  • (String)


39
40
41
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 39

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)


44
45
46
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 44

def card_id
  @card_id
end

#col_co_codeInteger

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

Returns:

  • (Integer)


49
50
51
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 49

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)


54
55
56
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 54

def col_co_id
  @col_co_id
end

#masked_panString

Card PAN

Returns:

  • (String)


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

def masked_pan
  @masked_pan
end

#panString

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

Returns:

  • (String)


59
60
61
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 59

def pan
  @pan
end

#panidFloat

PANID of the card

Returns:

  • (Float)


63
64
65
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 63

def panid
  @panid
end

#payer_idInteger

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

Returns:

  • (Integer)


72
73
74
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 72

def payer_id
  @payer_id
end

#payer_numberString

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

Returns:

  • (String)


77
78
79
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 77

def payer_number
  @payer_number
end

#replacement_card_referenceInteger

Reference number for tracking of replacement card order request of the specific card,<br /> This is applicable for requests with target status as Block and OrderReplacement passed as True.

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 18

def replacement_card_reference
  @replacement_card_reference
end

#update_card_referenceInteger

Reference number for tracking of update status request of the specific card,

Returns:

  • (Integer)


23
24
25
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 23

def update_card_reference
  @update_card_reference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 161

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  replacement_card_reference =
    hash.key?('ReplacementCardReference') ? hash['ReplacementCardReference'] : SKIP
  update_card_reference =
    hash.key?('UpdateCardReference') ? hash['UpdateCardReference'] : 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
  masked_pan = hash.key?('MaskedPAN') ? hash['MaskedPAN'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP

  # Create object from extracted values.
  SubmittedCard.new(replacement_card_reference,
                    update_card_reference,
                    ,
                    ,
                    card_expiry_date,
                    card_id,
                    col_co_code,
                    col_co_id,
                    pan,
                    panid,
                    masked_pan,
                    payer_id,
                    payer_number)
end

.namesObject

A mapping from model property names to API property names.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 80

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['replacement_card_reference'] = 'ReplacementCardReference'
  @_hash['update_card_reference'] = 'UpdateCardReference'
  @_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['masked_pan'] = 'MaskedPAN'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 118

def self.nullables
  %w[
    replacement_card_reference
    update_card_reference
    account_id
    account_number
    card_expiry_date
    card_id
    col_co_code
    col_co_id
    pan
    panid
    masked_pan
    payer_id
    payer_number
  ]
end

.optionalsObject

An array for optional fields



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/shell_card_management_ap_is/models/submitted_card.rb', line 99

def self.optionals
  %w[
    replacement_card_reference
    update_card_reference
    account_id
    account_number
    card_expiry_date
    card_id
    col_co_code
    col_co_id
    pan
    panid
    masked_pan
    payer_id
    payer_number
  ]
end