Class: ShellDataReportingApIs::RecentTransactionReq

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb

Overview

RecentTransactionReq Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_code = nil, payer_number = nil, account_number = SKIP, product_code = SKIP, purchased_in_country = SKIP, card_pan = SKIP, from_date_time = SKIP, to_date_time = SKIP, transaction_status = SKIP, fuel_only = SKIP, product_group_name = SKIP, vehicle_registration_number = SKIP, include_declines = SKIP, card_issuer_name = SKIP, column_list = SKIP) ⇒ RecentTransactionReq

Returns a new instance of RecentTransactionReq.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 137

def initialize(col_co_code = nil, payer_number = nil,  = SKIP,
               product_code = SKIP, purchased_in_country = SKIP,
               card_pan = SKIP, from_date_time = SKIP, to_date_time = SKIP,
               transaction_status = SKIP, fuel_only = SKIP,
               product_group_name = SKIP,
               vehicle_registration_number = SKIP, include_declines = SKIP,
               card_issuer_name = SKIP, column_list = SKIP)
  @col_co_code = col_co_code
  @payer_number = payer_number
  @account_number =  unless  == SKIP
  @product_code = product_code unless product_code == SKIP
  @purchased_in_country = purchased_in_country unless purchased_in_country == SKIP
  @card_pan = card_pan unless card_pan == SKIP
  @from_date_time = from_date_time unless from_date_time == SKIP
  @to_date_time = to_date_time unless to_date_time == SKIP
  @transaction_status = transaction_status unless transaction_status == SKIP
  @fuel_only = fuel_only unless fuel_only == SKIP
  @product_group_name = product_group_name unless product_group_name == SKIP
  unless vehicle_registration_number == SKIP
    @vehicle_registration_number =
      vehicle_registration_number
  end
  @include_declines = include_declines unless include_declines == SKIP
  @card_issuer_name = card_issuer_name unless card_issuer_name == SKIP
  @column_list = column_list unless column_list == SKIP
end

Instance Attribute Details

#account_numberString

Customer account number.

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 22

def 
  @account_number
end

#card_issuer_nameString

Card issuer name

Returns:

  • (String)


68
69
70
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 68

def card_issuer_name
  @card_issuer_name
end

#card_panString

Card identifier number masked

Returns:

  • (String)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 34

def card_pan
  @card_pan
end

#col_co_codeInteger

Three character Collecting Company Code (Shell Code) of the selected payer

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 14

def col_co_code
  @col_co_code
end

#column_listString

Column list to be part of response, it can be ‘All’ to return all possible column. E.g. ‘All’ To get specific columns pass multiple columns name separated by comma along with ‘PayerNumber’. E.g. “PayerNumber,ProductCode”

Returns:

  • (String)


75
76
77
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 75

def column_list
  @column_list
end

#from_date_timeString

Start date and time of transactions

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 38

def from_date_time
  @from_date_time
end

#fuel_onlyString

When passed as ‘true’ Only returned records with Fuel transactions.(All Fuels).When passed as ‘false’ the above condition will not be checked. (Both All Fuels and Non-Fuel)

Returns:

  • (String)


52
53
54
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 52

def fuel_only
  @fuel_only
end

#include_declinesTrueClass | FalseClass

Flag to enable to get declined records

Returns:

  • (TrueClass | FalseClass)


64
65
66
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 64

def include_declines
  @include_declines
end

#payer_numberString

Unique Identifier for the customer at payment point.

Returns:

  • (String)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 18

def payer_number
  @payer_number
end

#product_codeString

Global product code

Returns:

  • (String)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 26

def product_code
  @product_code
end

#product_group_nameString

Product group name

Returns:

  • (String)


56
57
58
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 56

def product_group_name
  @product_group_name
end

#purchased_in_countryString

Delco country

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 30

def purchased_in_country
  @purchased_in_country
end

#to_date_timeString

End date and time of transactions. Mandatory if FromDateTime is provided.

Returns:

  • (String)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 42

def to_date_time
  @to_date_time
end

#transaction_statusString

Status of transaction. DO NOT pass the value if includeDeclines is passed

Returns:

  • (String)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 46

def transaction_status
  @transaction_status
end

#vehicle_registration_numberString

Vehicle registration number embossed on the card

Returns:

  • (String)


60
61
62
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 60

def vehicle_registration_number
  @vehicle_registration_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 165

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : nil
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : nil
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  product_code = hash.key?('ProductCode') ? hash['ProductCode'] : SKIP
  purchased_in_country =
    hash.key?('PurchasedInCountry') ? hash['PurchasedInCountry'] : SKIP
  card_pan = hash.key?('CardPAN') ? hash['CardPAN'] : SKIP
  from_date_time = hash.key?('FromDateTime') ? hash['FromDateTime'] : SKIP
  to_date_time = hash.key?('ToDateTime') ? hash['ToDateTime'] : SKIP
  transaction_status =
    hash.key?('TransactionStatus') ? hash['TransactionStatus'] : SKIP
  fuel_only = hash.key?('FuelOnly') ? hash['FuelOnly'] : SKIP
  product_group_name =
    hash.key?('ProductGroupName') ? hash['ProductGroupName'] : SKIP
  vehicle_registration_number =
    hash.key?('VehicleRegistrationNumber') ? hash['VehicleRegistrationNumber'] : SKIP
  include_declines =
    hash.key?('IncludeDeclines') ? hash['IncludeDeclines'] : SKIP
  card_issuer_name =
    hash.key?('CardIssuerName') ? hash['CardIssuerName'] : SKIP
  column_list = hash.key?('ColumnList') ? hash['ColumnList'] : SKIP

  # Create object from extracted values.
  RecentTransactionReq.new(col_co_code,
                           payer_number,
                           ,
                           product_code,
                           purchased_in_country,
                           card_pan,
                           from_date_time,
                           to_date_time,
                           transaction_status,
                           fuel_only,
                           product_group_name,
                           vehicle_registration_number,
                           include_declines,
                           card_issuer_name,
                           column_list)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['product_code'] = 'ProductCode'
  @_hash['purchased_in_country'] = 'PurchasedInCountry'
  @_hash['card_pan'] = 'CardPAN'
  @_hash['from_date_time'] = 'FromDateTime'
  @_hash['to_date_time'] = 'ToDateTime'
  @_hash['transaction_status'] = 'TransactionStatus'
  @_hash['fuel_only'] = 'FuelOnly'
  @_hash['product_group_name'] = 'ProductGroupName'
  @_hash['vehicle_registration_number'] = 'VehicleRegistrationNumber'
  @_hash['include_declines'] = 'IncludeDeclines'
  @_hash['card_issuer_name'] = 'CardIssuerName'
  @_hash['column_list'] = 'ColumnList'
  @_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
135
# File 'lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb', line 118

def self.nullables
  %w[
    col_co_code
    payer_number
    account_number
    product_code
    purchased_in_country
    card_pan
    from_date_time
    to_date_time
    transaction_status
    fuel_only
    product_group_name
    vehicle_registration_number
    include_declines
    card_issuer_name
  ]
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_data_reporting_ap_is/models/recent_transaction_req.rb', line 99

def self.optionals
  %w[
    account_number
    product_code
    purchased_in_country
    card_pan
    from_date_time
    to_date_time
    transaction_status
    fuel_only
    product_group_name
    vehicle_registration_number
    include_declines
    card_issuer_name
    column_list
  ]
end