Class: CyberSourceMergedSpec::InvoiceSettingsInformation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/invoice_settings_information.rb

Overview

InvoiceSettingsInformation 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(merchant_logo: SKIP, merchant_display_name: SKIP, custom_email_message: SKIP, enable_reminders: SKIP, header_style: SKIP, delivery_language: SKIP, default_currency_code: SKIP, payer_authentication_in_invoicing: SKIP, show_vat_number: false, vat_registration_number: SKIP, ship_to: false, phone_number: false, email: false, enable_merchant_email_notifications: false, custom_labels: SKIP, custom_redirect_urls: SKIP, additional_properties: nil) ⇒ InvoiceSettingsInformation

Returns a new instance of InvoiceSettingsInformation.



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
217
218
219
220
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 184

def initialize(merchant_logo: SKIP, merchant_display_name: SKIP,
               custom_email_message: SKIP, enable_reminders: SKIP,
               header_style: SKIP, delivery_language: SKIP,
               default_currency_code: SKIP,
               payer_authentication_in_invoicing: SKIP,
               show_vat_number: false, vat_registration_number: SKIP,
               ship_to: false, phone_number: false, email: false,
               enable_merchant_email_notifications: false,
               custom_labels: SKIP, custom_redirect_urls: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @merchant_logo =  unless  == SKIP
  @merchant_display_name = merchant_display_name unless merchant_display_name == SKIP
  @custom_email_message = custom_email_message unless custom_email_message == SKIP
  @enable_reminders = enable_reminders unless enable_reminders == SKIP
  @header_style = header_style unless header_style == SKIP
  @delivery_language = delivery_language unless delivery_language == SKIP
  @default_currency_code = default_currency_code unless default_currency_code == SKIP
  unless payer_authentication_in_invoicing == SKIP
    @payer_authentication_in_invoicing =
      payer_authentication_in_invoicing
  end
  @show_vat_number = show_vat_number unless show_vat_number == SKIP
  @vat_registration_number = vat_registration_number unless vat_registration_number == SKIP
  @ship_to = ship_to unless ship_to == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @email = email unless email == SKIP
  unless enable_merchant_email_notifications == SKIP
    @enable_merchant_email_notifications =
      enable_merchant_email_notifications
  end
  @custom_labels = custom_labels unless custom_labels == SKIP
  @custom_redirect_urls = custom_redirect_urls unless custom_redirect_urls == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#custom_email_messageString

The content of the email message that we send to your customers.

Returns:

  • (String)


24
25
26
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 24

def custom_email_message
  @custom_email_message
end

#custom_labelsArray[CustomLabel]

A list of custom labels that allows you to override (rename) default field names and control the visibility of specific fields on invoices and items. If the list is empty, the labels will not be overwritten.

Returns:



125
126
127
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 125

def custom_labels
  @custom_labels
end

#custom_redirect_urlsCustomRedirectUrls

Object containing custom redirect URLs for different payment outcomes. Each property allows specifying a URL to which the customer will be redirected after a payment event.

Returns:



131
132
133
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 131

def custom_redirect_urls
  @custom_redirect_urls
end

#default_currency_codeString

Currency used for the order. Use the three-character [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/cur rencies.pdf)

Used by

Authorization Required field. Authorization Reversal For an authorization reversal (reversalInformation) or a capture (processingOptions.capture is set to true), you must use the same currency that you used in your payment authorization request.

PIN Debit

Currency for the amount you requested for the PIN debit purchase. This value is returned for partial authorizations. The issuing bank can approve a partial amount if the balance on the debit card is less than the requested transaction amount. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Returned by PIN debit purchase. For PIN debit reversal requests, you must use the same currency that was used for the PIN debit purchase or PIN debit credit that you are reversing. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Required field for PIN Debit purchase and PIN Debit credit requests. Optional field for PIN Debit reversal requests.

GPX

This field is optional for reversing an authorization or credit.

DCC for First Data

Your local currency.

Tax Calculation

Required for international tax and value added tax only. Optional for U.S. and Canadian taxes. Your local currency.

Returns:

  • (String)


81
82
83
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 81

def default_currency_code
  @default_currency_code
end

#delivery_languageString

The language of the email that we send to your customers. Possible values are zh-CN, zh-TW, en-US, fr-FR, de-DE, ja-JP, pt-BR, ru-RU and es-419.

Returns:

  • (String)


42
43
44
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 42

def delivery_language
  @delivery_language
end

#emailTrueClass | FalseClass

Collect the payers email address when the email address is not known or confirm it if it is known at the time of invoice creation.

Returns:

  • (TrueClass | FalseClass)


114
115
116
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 114

def email
  @email
end

#enable_merchant_email_notificationsTrueClass | FalseClass

Whether you would like to receive payment notification for successful transaction

Returns:

  • (TrueClass | FalseClass)


119
120
121
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 119

def enable_merchant_email_notifications
  @enable_merchant_email_notifications
end

#enable_remindersTrueClass | FalseClass

Whether you would like us to send an auto-generated reminder email to your invoice recipients. Currently, this reminder email is sent five days before the invoice is due and one day after it is past due.

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 30

def enable_reminders
  @enable_reminders
end

#header_styleHeaderStyle

Whether you would like us to send an auto-generated reminder email to your invoice recipients. Currently, this reminder email is sent five days before the invoice is due and one day after it is past due.

Returns:



36
37
38
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 36

def header_style
  @header_style
end

#merchant_display_nameString

The merchant's display name shown on the invoice.

Returns:

  • (String)


20
21
22
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 20

def merchant_display_name
  @merchant_display_name
end

#merchant_logoString

The image file, which must be encoded in Base64 format. Supported file formats are png, jpg, and gif. The image file size restriction is 1 MB.

Returns:

  • (String)


16
17
18
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 16

def 
  @merchant_logo
end

#payer_authentication_in_invoicingString

For a merchant's invoice payments, enable 3D Secure payer authentication version 1, update to 3D Secure version 2, or disable 3D Secure. Possible values are:

  • enable
  • update
  • disable

Returns:

  • (String)


90
91
92
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 90

def payer_authentication_in_invoicing
  @payer_authentication_in_invoicing
end

#phone_numberTrueClass | FalseClass

Collect the payers phone number.

Returns:

  • (TrueClass | FalseClass)


109
110
111
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 109

def phone_number
  @phone_number
end

#ship_toTrueClass | FalseClass

Collect the payers shipping address.

Returns:

  • (TrueClass | FalseClass)


105
106
107
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 105

def ship_to
  @ship_to
end

#show_vat_numberTrueClass | FalseClass

Display VAT number on Invoice.

Returns:

  • (TrueClass | FalseClass)


94
95
96
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 94

def show_vat_number
  @show_vat_number
end

#vat_registration_numberString

Your government-assigned tax identification number.

Tax Calculation

Required field for value added tax only. Not applicable to U.S. and Canadian taxes.

Returns:

  • (String)


101
102
103
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 101

def vat_registration_number
  @vat_registration_number
end

Class Method Details

.from_element(root) ⇒ Object



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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 289

def self.from_element(root)
   = XmlUtilities.from_element(root, 'merchantLogo', String)
  merchant_display_name = XmlUtilities.from_element(root,
                                                    'merchantDisplayName',
                                                    String)
  custom_email_message = XmlUtilities.from_element(root,
                                                   'customEmailMessage',
                                                   String)
  enable_reminders = XmlUtilities.from_element(root, 'enableReminders',
                                               TrueClass)
  header_style = XmlUtilities.from_element(root, 'HeaderStyle', HeaderStyle)
  delivery_language = XmlUtilities.from_element(root, 'deliveryLanguage',
                                                String)
  default_currency_code = XmlUtilities.from_element(root,
                                                    'defaultCurrencyCode',
                                                    String)
  payer_authentication_in_invoicing = XmlUtilities.from_element(
    root, 'payerAuthenticationInInvoicing', String
  )
  show_vat_number = XmlUtilities.from_element(root, 'showVatNumber',
                                              TrueClass)
  vat_registration_number = XmlUtilities.from_element(
    root, 'vatRegistrationNumber', String
  )
  ship_to = XmlUtilities.from_element(root, 'shipTo', TrueClass)
  phone_number = XmlUtilities.from_element(root, 'phoneNumber', TrueClass)
  email = XmlUtilities.from_element(root, 'email', TrueClass)
  enable_merchant_email_notifications = XmlUtilities.from_element(
    root, 'enableMerchantEmailNotifications', TrueClass
  )
  custom_labels = XmlUtilities.from_element_to_array(root, 'CustomLabel',
                                                     CustomLabel)
  custom_redirect_urls = XmlUtilities.from_element(root,
                                                   'CustomRedirectUrls',
                                                   CustomRedirectUrls)

  new(merchant_logo: ,
      merchant_display_name: merchant_display_name,
      custom_email_message: custom_email_message,
      enable_reminders: enable_reminders,
      header_style: header_style,
      delivery_language: delivery_language,
      default_currency_code: default_currency_code,
      payer_authentication_in_invoicing: payer_authentication_in_invoicing,
      show_vat_number: show_vat_number,
      vat_registration_number: vat_registration_number,
      ship_to: ship_to,
      phone_number: phone_number,
      email: email,
      enable_merchant_email_notifications: enable_merchant_email_notifications,
      custom_labels: custom_labels,
      custom_redirect_urls: custom_redirect_urls,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 223

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('merchantLogo') ? hash['merchantLogo'] : SKIP
  merchant_display_name =
    hash.key?('merchantDisplayName') ? hash['merchantDisplayName'] : SKIP
  custom_email_message =
    hash.key?('customEmailMessage') ? hash['customEmailMessage'] : SKIP
  enable_reminders =
    hash.key?('enableReminders') ? hash['enableReminders'] : SKIP
  header_style = HeaderStyle.from_hash(hash['headerStyle']) if hash['headerStyle']
  delivery_language =
    hash.key?('deliveryLanguage') ? hash['deliveryLanguage'] : SKIP
  default_currency_code =
    hash.key?('defaultCurrencyCode') ? hash['defaultCurrencyCode'] : SKIP
  payer_authentication_in_invoicing =
    hash.key?('payerAuthenticationInInvoicing') ? hash['payerAuthenticationInInvoicing'] : SKIP
  show_vat_number = hash['showVatNumber'] ||= false
  vat_registration_number =
    hash.key?('vatRegistrationNumber') ? hash['vatRegistrationNumber'] : SKIP
  ship_to = hash['shipTo'] ||= false
  phone_number = hash['phoneNumber'] ||= false
  email = hash['email'] ||= false
  enable_merchant_email_notifications =
    hash['enableMerchantEmailNotifications'] ||= false
  # Parameter is an array, so we need to iterate through it
  custom_labels = nil
  unless hash['customLabels'].nil?
    custom_labels = []
    hash['customLabels'].each do |structure|
      custom_labels << (CustomLabel.from_hash(structure) if structure)
    end
  end

  custom_labels = SKIP unless hash.key?('customLabels')
  custom_redirect_urls = CustomRedirectUrls.from_hash(hash['customRedirectUrls']) if
    hash['customRedirectUrls']

  # 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.
  InvoiceSettingsInformation.new(merchant_logo: ,
                                 merchant_display_name: merchant_display_name,
                                 custom_email_message: custom_email_message,
                                 enable_reminders: enable_reminders,
                                 header_style: header_style,
                                 delivery_language: delivery_language,
                                 default_currency_code: default_currency_code,
                                 payer_authentication_in_invoicing: payer_authentication_in_invoicing,
                                 show_vat_number: show_vat_number,
                                 vat_registration_number: vat_registration_number,
                                 ship_to: ship_to,
                                 phone_number: phone_number,
                                 email: email,
                                 enable_merchant_email_notifications: enable_merchant_email_notifications,
                                 custom_labels: custom_labels,
                                 custom_redirect_urls: custom_redirect_urls,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 134

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['merchant_logo'] = 'merchantLogo'
  @_hash['merchant_display_name'] = 'merchantDisplayName'
  @_hash['custom_email_message'] = 'customEmailMessage'
  @_hash['enable_reminders'] = 'enableReminders'
  @_hash['header_style'] = 'headerStyle'
  @_hash['delivery_language'] = 'deliveryLanguage'
  @_hash['default_currency_code'] = 'defaultCurrencyCode'
  @_hash['payer_authentication_in_invoicing'] =
    'payerAuthenticationInInvoicing'
  @_hash['show_vat_number'] = 'showVatNumber'
  @_hash['vat_registration_number'] = 'vatRegistrationNumber'
  @_hash['ship_to'] = 'shipTo'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash['email'] = 'email'
  @_hash['enable_merchant_email_notifications'] =
    'enableMerchantEmailNotifications'
  @_hash['custom_labels'] = 'customLabels'
  @_hash['custom_redirect_urls'] = 'customRedirectUrls'
  @_hash
end

.nullablesObject

An array for nullable fields



180
181
182
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 180

def self.nullables
  []
end

.optionalsObject

An array for optional fields



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 158

def self.optionals
  %w[
    merchant_logo
    merchant_display_name
    custom_email_message
    enable_reminders
    header_style
    delivery_language
    default_currency_code
    payer_authentication_in_invoicing
    show_vat_number
    vat_registration_number
    ship_to
    phone_number
    email
    enable_merchant_email_notifications
    custom_labels
    custom_redirect_urls
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 398

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant_logo: #{@merchant_logo.inspect}, merchant_display_name:"\
  " #{@merchant_display_name.inspect}, custom_email_message: #{@custom_email_message.inspect},"\
  " enable_reminders: #{@enable_reminders.inspect}, header_style: #{@header_style.inspect},"\
  " delivery_language: #{@delivery_language.inspect}, default_currency_code:"\
  " #{@default_currency_code.inspect}, payer_authentication_in_invoicing:"\
  " #{@payer_authentication_in_invoicing.inspect}, show_vat_number:"\
  " #{@show_vat_number.inspect}, vat_registration_number: #{@vat_registration_number.inspect},"\
  " ship_to: #{@ship_to.inspect}, phone_number: #{@phone_number.inspect}, email:"\
  " #{@email.inspect}, enable_merchant_email_notifications:"\
  " #{@enable_merchant_email_notifications.inspect}, custom_labels: #{@custom_labels.inspect},"\
  " custom_redirect_urls: #{@custom_redirect_urls.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 383

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant_logo: #{@merchant_logo}, merchant_display_name:"\
  " #{@merchant_display_name}, custom_email_message: #{@custom_email_message},"\
  " enable_reminders: #{@enable_reminders}, header_style: #{@header_style}, delivery_language:"\
  " #{@delivery_language}, default_currency_code: #{@default_currency_code},"\
  " payer_authentication_in_invoicing: #{@payer_authentication_in_invoicing}, show_vat_number:"\
  " #{@show_vat_number}, vat_registration_number: #{@vat_registration_number}, ship_to:"\
  " #{@ship_to}, phone_number: #{@phone_number}, email: #{@email},"\
  " enable_merchant_email_notifications: #{@enable_merchant_email_notifications},"\
  " custom_labels: #{@custom_labels}, custom_redirect_urls: #{@custom_redirect_urls},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/cyber_source_merged_spec/models/invoice_settings_information.rb', line 344

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'merchantLogo', )
  XmlUtilities.add_as_subelement(doc, root, 'merchantDisplayName',
                                 merchant_display_name)
  XmlUtilities.add_as_subelement(doc, root, 'customEmailMessage',
                                 custom_email_message)
  XmlUtilities.add_as_subelement(doc, root, 'enableReminders',
                                 enable_reminders)
  XmlUtilities.add_as_subelement(doc, root, 'HeaderStyle', header_style)
  XmlUtilities.add_as_subelement(doc, root, 'deliveryLanguage',
                                 delivery_language)
  XmlUtilities.add_as_subelement(doc, root, 'defaultCurrencyCode',
                                 default_currency_code)
  XmlUtilities.add_as_subelement(doc, root,
                                 'payerAuthenticationInInvoicing',
                                 payer_authentication_in_invoicing)
  XmlUtilities.add_as_subelement(doc, root, 'showVatNumber',
                                 show_vat_number)
  XmlUtilities.add_as_subelement(doc, root, 'vatRegistrationNumber',
                                 vat_registration_number)
  XmlUtilities.add_as_subelement(doc, root, 'shipTo', ship_to)
  XmlUtilities.add_as_subelement(doc, root, 'phoneNumber', phone_number)
  XmlUtilities.add_as_subelement(doc, root, 'email', email)
  XmlUtilities.add_as_subelement(doc, root,
                                 'enableMerchantEmailNotifications',
                                 enable_merchant_email_notifications)
  XmlUtilities.add_array_as_subelement(doc, root, 'CustomLabel',
                                       custom_labels)
  XmlUtilities.add_as_subelement(doc, root, 'CustomRedirectUrls',
                                 custom_redirect_urls)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end