Class: VisaAcceptanceMergedSpec::FluidData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::FluidData
- Defined in:
- lib/visa_acceptance_merged_spec/models/fluid_data.rb
Overview
FluidData Model.
Instance Attribute Summary collapse
-
#descriptor ⇒ String
The identifier for a payment solution, which is sending the encrypted payment data for decryption.
-
#encoding ⇒ String
Encoding method used to encrypt the payment data.
-
#key_serial_number ⇒ String
The encoded or encrypted value that a payment solution returns for an authorization request.
-
#value ⇒ String
Represents the encrypted payment data BLOB.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(key_serial_number: SKIP, descriptor: SKIP, value: SKIP, encoding: SKIP, additional_properties: nil) ⇒ FluidData
constructor
A new instance of FluidData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(key_serial_number: SKIP, descriptor: SKIP, value: SKIP, encoding: SKIP, additional_properties: nil) ⇒ FluidData
Returns a new instance of FluidData.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 82 def initialize(key_serial_number: SKIP, descriptor: SKIP, value: SKIP, encoding: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @key_serial_number = key_serial_number unless key_serial_number == SKIP @descriptor = descriptor unless descriptor == SKIP @value = value unless value == SKIP @encoding = encoding unless encoding == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#descriptor ⇒ String
The identifier for a payment solution, which is sending the encrypted
payment data for decryption. Valid values:
Samsung Pay: RklEPUNPTU1PTi5TQU1TVU5HLklOQVBQLlBBWU1FTlQ=
Note: For other payment solutions, the value may be specific to the
terminal or device initiatinf the payment. For example, the descriptor for
a Bluefin payment encryption would be a device-generated descriptor.
Used by Authorization and Standalone Credits. Required for authorizations
and standalone credits.
Card Present processing:
Format of the encrypted payment data.
The value for Bluefin PCI P2PE is Ymx1ZWZpbg==.
paymentInformation.fluidData.encoding must be Base64.
The value for Visa Acceptance P2PE decryption depends on the encoding
method used and identified in encoding field.
If paymentInformation.fluidData.encoding is Base64, the value is:
RklEPUVNVi5QQVlNRU5ULkFQSQ==
If paymentInformation.fluidData.encoding is HEX, the value is:
4649443D454D562E5041594D454E542E41504
37 38 39 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 37 def descriptor @descriptor end |
#encoding ⇒ String
Encoding method used to encrypt the payment data.
Valid values: Base64, HEX
If no value is provided, Base64 is taken as the default value. And the
Base64 descriptor is used for paymentInformation.fluidData.encoding
55 56 57 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 55 def encoding @encoding end |
#key_serial_number ⇒ String
The encoded or encrypted value that a payment solution returns for an authorization request. For details about the valid values for a key, see [Creating an Online Authorization](
16 17 18 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 16 def key_serial_number @key_serial_number end |
#value ⇒ String
Represents the encrypted payment data BLOB. The entry for this field is dependent on the payment solution used by the merchant. Used by Authorization and Standalone Credits. Required for authorizations and standalone credits that use a Visa Acceptance suppored Point-to-Point encryption method. Card Present processing This field represents the encrypted payment data generated by the payment terminal/device.
48 49 50 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 48 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. key_serial_number = hash.key?('keySerialNumber') ? hash['keySerialNumber'] : SKIP descriptor = hash.key?('descriptor') ? hash['descriptor'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP encoding = hash.key?('encoding') ? hash['encoding'] : 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. FluidData.new(key_serial_number: key_serial_number, descriptor: descriptor, value: value, encoding: encoding, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['key_serial_number'] = 'keySerialNumber' @_hash['descriptor'] = 'descriptor' @_hash['value'] = 'value' @_hash['encoding'] = 'encoding' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
68 69 70 71 72 73 74 75 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 68 def self.optionals %w[ key_serial_number descriptor value encoding ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} key_serial_number: #{@key_serial_number.inspect}, descriptor:"\ " #{@descriptor.inspect}, value: #{@value.inspect}, encoding: #{@encoding.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 |
# File 'lib/visa_acceptance_merged_spec/models/fluid_data.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} key_serial_number: #{@key_serial_number}, descriptor: #{@descriptor},"\ " value: #{@value}, encoding: #{@encoding}, additional_properties:"\ " #{@additional_properties}>" end |