Class: CyberSourceMergedSpec::ProcessingInformation57

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

Overview

ProcessingInformation57 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(payment_solution: SKIP, visa_checkout_id: SKIP, additional_properties: nil) ⇒ ProcessingInformation57

Returns a new instance of ProcessingInformation57.



64
65
66
67
68
69
70
71
72
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 64

def initialize(payment_solution: SKIP, visa_checkout_id: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_solution = payment_solution unless payment_solution == SKIP
  @visa_checkout_id = visa_checkout_id unless visa_checkout_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#payment_solutionString

Type of digital payment solution for the transaction. Possible Values:

  • visacheckout: Visa Checkout. This value is required for Visa Checkout transactions. For details, see payment_solution field description in [Visa Checkout Using the REST API.](https://developer.cybersource.com/content/dam/docs/cybs/en-us/apifie lds/reference/all/rest/api-fields.pdf)
  • 001: Apple Pay.
  • 004: Cybersource In-App Solution.
  • 005: Masterpass. This value is required for Masterpass transactions on OmniPay Direct.
  • 006: Android Pay.
  • 007: Chase Pay.
  • 008: Samsung Pay.
  • 012: Google Pay.
  • 013: Cybersource P2PE Decryption
  • 014: Mastercard credential on file (COF) payment network token. Returned in authorizations that use a payment network token associated with a TMS token.
  • 015: Visa credential on file (COF) payment network token. Returned in authorizations that use a payment network token associated with a TMS token.
  • 027: Click to Pay.

Returns:

  • (String)


35
36
37
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 35

def payment_solution
  @payment_solution
end

#visa_checkout_idString

Identifier for the Visa Checkout order. Visa Checkout provides a unique order ID for every transaction in the Visa Checkout callID field.

Returns:

  • (String)


41
42
43
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 41

def visa_checkout_id
  @visa_checkout_id
end

Class Method Details

.from_element(root) ⇒ Object



97
98
99
100
101
102
103
104
105
106
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 97

def self.from_element(root)
  payment_solution = XmlUtilities.from_element(root, 'paymentSolution',
                                               String)
  visa_checkout_id = XmlUtilities.from_element(root, 'visaCheckoutId',
                                               String)

  new(payment_solution: payment_solution,
      visa_checkout_id: visa_checkout_id,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_solution =
    hash.key?('paymentSolution') ? hash['paymentSolution'] : SKIP
  visa_checkout_id =
    hash.key?('visaCheckoutId') ? hash['visaCheckoutId'] : SKIP

  # 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.
  ProcessingInformation57.new(payment_solution: payment_solution,
                              visa_checkout_id: visa_checkout_id,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



44
45
46
47
48
49
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 44

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_solution'] = 'paymentSolution'
  @_hash['visa_checkout_id'] = 'visaCheckoutId'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



52
53
54
55
56
57
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 52

def self.optionals
  %w[
    payment_solution
    visa_checkout_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



129
130
131
132
133
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 129

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_solution: #{@payment_solution.inspect}, visa_checkout_id:"\
  " #{@visa_checkout_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_solution: #{@payment_solution}, visa_checkout_id:"\
  " #{@visa_checkout_id}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cyber_source_merged_spec/models/processing_information57.rb', line 108

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

  XmlUtilities.add_as_subelement(doc, root, 'paymentSolution',
                                 payment_solution)
  XmlUtilities.add_as_subelement(doc, root, 'visaCheckoutId',
                                 visa_checkout_id)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end