Class: PaysecureApiDocumentationLive::CreateMerchantApiRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb

Overview

CreateMerchantApiRequest 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(username:, mcc:, iec_no:, allow_global_collection:, legal_name:, name:, reg_no:, email_id:, website_url:, trading_start_date:, date_of_incorporation:, trading_address:, trading_country:, trading_state:, trading_postal:, corporate_address:, corporate_country:, corporate_state:, corporate_postal:, business_phone:, contact_phone:, contact_name:, officer_title:, officer_name:, default_currency:, default_timezone:, allowed_payment_methods:, allowed_currencies:, is_live_transaction_allowed:, additional_properties: nil) ⇒ CreateMerchantApiRequest

Returns a new instance of CreateMerchantApiRequest.



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
208
209
210
211
212
213
214
215
216
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 173

def initialize(username:, mcc:, iec_no:, allow_global_collection:,
               legal_name:, name:, reg_no:, email_id:, website_url:,
               trading_start_date:, date_of_incorporation:,
               trading_address:, trading_country:, trading_state:,
               trading_postal:, corporate_address:, corporate_country:,
               corporate_state:, corporate_postal:, business_phone:,
               contact_phone:, contact_name:, officer_title:, officer_name:,
               default_currency:, default_timezone:,
               allowed_payment_methods:, allowed_currencies:,
               is_live_transaction_allowed:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @username = username
  @mcc = mcc
  @iec_no = iec_no
  @allow_global_collection = allow_global_collection
  @legal_name = legal_name
  @name = name
  @reg_no = reg_no
  @email_id = email_id
  @website_url = website_url
  @trading_start_date = trading_start_date
  @date_of_incorporation = date_of_incorporation
  @trading_address = trading_address
  @trading_country = trading_country
  @trading_state = trading_state
  @trading_postal = trading_postal
  @corporate_address = corporate_address
  @corporate_country = corporate_country
  @corporate_state = corporate_state
  @corporate_postal = corporate_postal
  @business_phone = business_phone
  @contact_phone = contact_phone
  @contact_name = contact_name
  @officer_title = officer_title
  @officer_name = officer_name
  @default_currency = default_currency
  @default_timezone = default_timezone
  @allowed_payment_methods = allowed_payment_methods
  @allowed_currencies = allowed_currencies
  @is_live_transaction_allowed = is_live_transaction_allowed
  @additional_properties = additional_properties
end

Instance Attribute Details

#allow_global_collectionTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 26

def allow_global_collection
  @allow_global_collection
end

#allowed_currenciesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


122
123
124
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 122

def allowed_currencies
  @allowed_currencies
end

#allowed_payment_methodsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


118
119
120
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 118

def allowed_payment_methods
  @allowed_payment_methods
end

#business_phoneString

TODO: Write general description for this method

Returns:

  • (String)


90
91
92
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 90

def business_phone
  @business_phone
end

#contact_nameString

TODO: Write general description for this method

Returns:

  • (String)


98
99
100
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 98

def contact_name
  @contact_name
end

#contact_phoneString

TODO: Write general description for this method

Returns:

  • (String)


94
95
96
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 94

def contact_phone
  @contact_phone
end

#corporate_addressString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 74

def corporate_address
  @corporate_address
end

#corporate_countryString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 78

def corporate_country
  @corporate_country
end

#corporate_postalString

TODO: Write general description for this method

Returns:

  • (String)


86
87
88
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 86

def corporate_postal
  @corporate_postal
end

#corporate_stateString

TODO: Write general description for this method

Returns:

  • (String)


82
83
84
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 82

def corporate_state
  @corporate_state
end

#date_of_incorporationString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 54

def date_of_incorporation
  @date_of_incorporation
end

#default_currencyString

TODO: Write general description for this method

Returns:

  • (String)


110
111
112
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 110

def default_currency
  @default_currency
end

#default_timezoneString

TODO: Write general description for this method

Returns:

  • (String)


114
115
116
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 114

def default_timezone
  @default_timezone
end

#email_idString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 42

def email_id
  @email_id
end

#iec_noString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 22

def iec_no
  @iec_no
end

#is_live_transaction_allowedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


126
127
128
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 126

def is_live_transaction_allowed
  @is_live_transaction_allowed
end

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 30

def legal_name
  @legal_name
end

#mccInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 18

def mcc
  @mcc
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 34

def name
  @name
end

#officer_nameString

TODO: Write general description for this method

Returns:

  • (String)


106
107
108
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 106

def officer_name
  @officer_name
end

#officer_titleString

TODO: Write general description for this method

Returns:

  • (String)


102
103
104
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 102

def officer_title
  @officer_title
end

#reg_noString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 38

def reg_no
  @reg_no
end

#trading_addressString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 58

def trading_address
  @trading_address
end

#trading_countryString

TODO: Write general description for this method

Returns:

  • (String)


62
63
64
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 62

def trading_country
  @trading_country
end

#trading_postalString

TODO: Write general description for this method

Returns:

  • (String)


70
71
72
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 70

def trading_postal
  @trading_postal
end

#trading_start_dateString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 50

def trading_start_date
  @trading_start_date
end

#trading_stateString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 66

def trading_state
  @trading_state
end

#usernameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 14

def username
  @username
end

#website_urlString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 46

def website_url
  @website_url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
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
275
276
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
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 219

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  username = hash.key?('username') ? hash['username'] : nil
  mcc = hash.key?('mcc') ? hash['mcc'] : nil
  iec_no = hash.key?('iecNo') ? hash['iecNo'] : nil
  allow_global_collection =
    hash.key?('allowGlobalCollection') ? hash['allowGlobalCollection'] : nil
  legal_name = hash.key?('legalName') ? hash['legalName'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  reg_no = hash.key?('regNo') ? hash['regNo'] : nil
  email_id = hash.key?('emailId') ? hash['emailId'] : nil
  website_url = hash.key?('websiteUrl') ? hash['websiteUrl'] : nil
  trading_start_date =
    hash.key?('tradingStartDate') ? hash['tradingStartDate'] : nil
  date_of_incorporation =
    hash.key?('dateOfIncorporation') ? hash['dateOfIncorporation'] : nil
  trading_address =
    hash.key?('tradingAddress') ? hash['tradingAddress'] : nil
  trading_country =
    hash.key?('tradingCountry') ? hash['tradingCountry'] : nil
  trading_state = hash.key?('tradingState') ? hash['tradingState'] : nil
  trading_postal = hash.key?('tradingPostal') ? hash['tradingPostal'] : nil
  corporate_address =
    hash.key?('corporateAddress') ? hash['corporateAddress'] : nil
  corporate_country =
    hash.key?('corporateCountry') ? hash['corporateCountry'] : nil
  corporate_state =
    hash.key?('corporateState') ? hash['corporateState'] : nil
  corporate_postal =
    hash.key?('corporatePostal') ? hash['corporatePostal'] : nil
  business_phone = hash.key?('businessPhone') ? hash['businessPhone'] : nil
  contact_phone = hash.key?('contactPhone') ? hash['contactPhone'] : nil
  contact_name = hash.key?('contactName') ? hash['contactName'] : nil
  officer_title = hash.key?('officerTitle') ? hash['officerTitle'] : nil
  officer_name = hash.key?('officerName') ? hash['officerName'] : nil
  default_currency =
    hash.key?('defaultCurrency') ? hash['defaultCurrency'] : nil
  default_timezone =
    hash.key?('defaultTimezone') ? hash['defaultTimezone'] : nil
  allowed_payment_methods =
    hash.key?('allowedPaymentMethods') ? hash['allowedPaymentMethods'] : nil
  allowed_currencies =
    hash.key?('allowedCurrencies') ? hash['allowedCurrencies'] : nil
  is_live_transaction_allowed =
    hash.key?('isLiveTransactionAllowed') ? hash['isLiveTransactionAllowed'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  CreateMerchantApiRequest.new(username: username,
                               mcc: mcc,
                               iec_no: iec_no,
                               allow_global_collection: allow_global_collection,
                               legal_name: legal_name,
                               name: name,
                               reg_no: reg_no,
                               email_id: email_id,
                               website_url: website_url,
                               trading_start_date: trading_start_date,
                               date_of_incorporation: date_of_incorporation,
                               trading_address: trading_address,
                               trading_country: trading_country,
                               trading_state: trading_state,
                               trading_postal: trading_postal,
                               corporate_address: corporate_address,
                               corporate_country: corporate_country,
                               corporate_state: corporate_state,
                               corporate_postal: corporate_postal,
                               business_phone: business_phone,
                               contact_phone: contact_phone,
                               contact_name: contact_name,
                               officer_title: officer_title,
                               officer_name: officer_name,
                               default_currency: default_currency,
                               default_timezone: default_timezone,
                               allowed_payment_methods: allowed_payment_methods,
                               allowed_currencies: allowed_currencies,
                               is_live_transaction_allowed: is_live_transaction_allowed,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



129
130
131
132
133
134
135
136
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
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 129

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['username'] = 'username'
  @_hash['mcc'] = 'mcc'
  @_hash['iec_no'] = 'iecNo'
  @_hash['allow_global_collection'] = 'allowGlobalCollection'
  @_hash['legal_name'] = 'legalName'
  @_hash['name'] = 'name'
  @_hash['reg_no'] = 'regNo'
  @_hash['email_id'] = 'emailId'
  @_hash['website_url'] = 'websiteUrl'
  @_hash['trading_start_date'] = 'tradingStartDate'
  @_hash['date_of_incorporation'] = 'dateOfIncorporation'
  @_hash['trading_address'] = 'tradingAddress'
  @_hash['trading_country'] = 'tradingCountry'
  @_hash['trading_state'] = 'tradingState'
  @_hash['trading_postal'] = 'tradingPostal'
  @_hash['corporate_address'] = 'corporateAddress'
  @_hash['corporate_country'] = 'corporateCountry'
  @_hash['corporate_state'] = 'corporateState'
  @_hash['corporate_postal'] = 'corporatePostal'
  @_hash['business_phone'] = 'businessPhone'
  @_hash['contact_phone'] = 'contactPhone'
  @_hash['contact_name'] = 'contactName'
  @_hash['officer_title'] = 'officerTitle'
  @_hash['officer_name'] = 'officerName'
  @_hash['default_currency'] = 'defaultCurrency'
  @_hash['default_timezone'] = 'defaultTimezone'
  @_hash['allowed_payment_methods'] = 'allowedPaymentMethods'
  @_hash['allowed_currencies'] = 'allowedCurrencies'
  @_hash['is_live_transaction_allowed'] = 'isLiveTransactionAllowed'
  @_hash
end

.nullablesObject

An array for nullable fields



169
170
171
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 169

def self.nullables
  []
end

.optionalsObject

An array for optional fields



164
165
166
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 164

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 327

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} username: #{@username.inspect}, mcc: #{@mcc.inspect}, iec_no:"\
  " #{@iec_no.inspect}, allow_global_collection: #{@allow_global_collection.inspect},"\
  " legal_name: #{@legal_name.inspect}, name: #{@name.inspect}, reg_no: #{@reg_no.inspect},"\
  " email_id: #{@email_id.inspect}, website_url: #{@website_url.inspect}, trading_start_date:"\
  " #{@trading_start_date.inspect}, date_of_incorporation: #{@date_of_incorporation.inspect},"\
  " trading_address: #{@trading_address.inspect}, trading_country:"\
  " #{@trading_country.inspect}, trading_state: #{@trading_state.inspect}, trading_postal:"\
  " #{@trading_postal.inspect}, corporate_address: #{@corporate_address.inspect},"\
  " corporate_country: #{@corporate_country.inspect}, corporate_state:"\
  " #{@corporate_state.inspect}, corporate_postal: #{@corporate_postal.inspect},"\
  " business_phone: #{@business_phone.inspect}, contact_phone: #{@contact_phone.inspect},"\
  " contact_name: #{@contact_name.inspect}, officer_title: #{@officer_title.inspect},"\
  " officer_name: #{@officer_name.inspect}, default_currency: #{@default_currency.inspect},"\
  " default_timezone: #{@default_timezone.inspect}, allowed_payment_methods:"\
  " #{@allowed_payment_methods.inspect}, allowed_currencies: #{@allowed_currencies.inspect},"\
  " is_live_transaction_allowed: #{@is_live_transaction_allowed.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/paysecure_api_documentation_live/models/create_merchant_api_request.rb', line 308

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} username: #{@username}, mcc: #{@mcc}, iec_no: #{@iec_no},"\
  " allow_global_collection: #{@allow_global_collection}, legal_name: #{@legal_name}, name:"\
  " #{@name}, reg_no: #{@reg_no}, email_id: #{@email_id}, website_url: #{@website_url},"\
  " trading_start_date: #{@trading_start_date}, date_of_incorporation:"\
  " #{@date_of_incorporation}, trading_address: #{@trading_address}, trading_country:"\
  " #{@trading_country}, trading_state: #{@trading_state}, trading_postal: #{@trading_postal},"\
  " corporate_address: #{@corporate_address}, corporate_country: #{@corporate_country},"\
  " corporate_state: #{@corporate_state}, corporate_postal: #{@corporate_postal},"\
  " business_phone: #{@business_phone}, contact_phone: #{@contact_phone}, contact_name:"\
  " #{@contact_name}, officer_title: #{@officer_title}, officer_name: #{@officer_name},"\
  " default_currency: #{@default_currency}, default_timezone: #{@default_timezone},"\
  " allowed_payment_methods: #{@allowed_payment_methods}, allowed_currencies:"\
  " #{@allowed_currencies}, is_live_transaction_allowed: #{@is_live_transaction_allowed},"\
  " additional_properties: #{@additional_properties}>"
end