cybersource_rest_client 0.0.44 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/asymmetric_key_management_api.rb +10 -10
  3. data/lib/cybersource_rest_client/api/secure_file_share_api.rb +206 -206
  4. data/lib/cybersource_rest_client/models/inline_response_400_2.rb +15 -5
  5. data/lib/cybersource_rest_client/models/inline_response_502.rb +224 -0
  6. data/lib/cybersource_rest_client/models/kms_v2_keys_sym_post201_response_key_information.rb +11 -1
  7. data/lib/cybersource_rest_client/models/mit_void_request.rb +22 -4
  8. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +14 -4
  9. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +1 -1
  10. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type_method.rb +1 -1
  11. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +11 -1
  12. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +33 -1
  13. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +14 -4
  14. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_japan_payment_options.rb +97 -1
  15. data/lib/cybersource_rest_client/models/ptsv2voids_processing_information.rb +190 -0
  16. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information_partner.rb +20 -4
  17. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information.rb +13 -4
  18. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +1 -1
  19. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_fluid_data.rb +190 -0
  20. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +11 -1
  21. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +17 -1
  22. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +1 -1
  23. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information_partner.rb +190 -0
  24. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +20 -4
  25. data/lib/cybersource_rest_client.rb +4 -0
  26. metadata +28 -24
@@ -17,6 +17,24 @@ module CyberSource
17
17
  # This value is a 2-digit code indicating the payment method. Use Payment Method Code value that applies to the tranasction. - 10 (One-time payment) - 21, 22, 23, 24 (Bonus(one-time)payment) - 61 (Installment payment) - 31, 32, 33, 34 (Integrated (Bonus + Installment)payment) - 80 (Revolving payment)
18
18
  attr_accessor :payment_method
19
19
 
20
+ # This value is a 2-digit code indicating the Number of Bonuses. Valid value from 1 to 6.
21
+ attr_accessor :bonuses
22
+
23
+ # This value is a 2-digit code indicating the first bonus month. Valid value from 1 to 12.
24
+ attr_accessor :bonus_month
25
+
26
+ # This value is a 2-digit code indicating the second bonus month. Valid value from 1 to 12.
27
+ attr_accessor :second_bonus_month
28
+
29
+ # This value contains the bonus amount of the first month. Maximum value without decimal 99999999.
30
+ attr_accessor :bonus_amount
31
+
32
+ # This value contains the bonus amount of the second month. Maximum value without decimal 99999999.
33
+ attr_accessor :second_bonus_amount
34
+
35
+ # This will contain the details of the kind of transaction that has been processe. Used only for Japan. Possible Values: - 0 = Normal (authorization with amount and clearing/settlement; data capture or paper draft) - 1 = Negative card authorization (authorization-only with 0 or 1 amount) - 2 = Reservation of authorization (authorization-only with amount) - 3 = Cancel transaction - 4 = Merchant-initiated reversal/refund transactions - 5 = Cancel reservation of authorization - 6 = Post authorization
36
+ attr_accessor :preapproval_type
37
+
20
38
  # Number of Installments.
21
39
  attr_accessor :installments
22
40
 
@@ -42,6 +60,12 @@ module CyberSource
42
60
  def self.attribute_map
43
61
  {
44
62
  :'payment_method' => :'paymentMethod',
63
+ :'bonuses' => :'bonuses',
64
+ :'bonus_month' => :'bonusMonth',
65
+ :'second_bonus_month' => :'secondBonusMonth',
66
+ :'bonus_amount' => :'bonusAmount',
67
+ :'second_bonus_amount' => :'secondBonusAmount',
68
+ :'preapproval_type' => :'preapprovalType',
45
69
  :'installments' => :'installments',
46
70
  :'terminal_id' => :'terminalId',
47
71
  :'first_billing_month' => :'firstBillingMonth',
@@ -56,6 +80,12 @@ module CyberSource
56
80
  def self.swagger_types
57
81
  {
58
82
  :'payment_method' => :'String',
83
+ :'bonuses' => :'String',
84
+ :'bonus_month' => :'String',
85
+ :'second_bonus_month' => :'String',
86
+ :'bonus_amount' => :'String',
87
+ :'second_bonus_amount' => :'String',
88
+ :'preapproval_type' => :'String',
59
89
  :'installments' => :'String',
60
90
  :'terminal_id' => :'String',
61
91
  :'first_billing_month' => :'String',
@@ -78,6 +108,30 @@ module CyberSource
78
108
  self.payment_method = attributes[:'paymentMethod']
79
109
  end
80
110
 
111
+ if attributes.has_key?(:'bonuses')
112
+ self.bonuses = attributes[:'bonuses']
113
+ end
114
+
115
+ if attributes.has_key?(:'bonusMonth')
116
+ self.bonus_month = attributes[:'bonusMonth']
117
+ end
118
+
119
+ if attributes.has_key?(:'secondBonusMonth')
120
+ self.second_bonus_month = attributes[:'secondBonusMonth']
121
+ end
122
+
123
+ if attributes.has_key?(:'bonusAmount')
124
+ self.bonus_amount = attributes[:'bonusAmount']
125
+ end
126
+
127
+ if attributes.has_key?(:'secondBonusAmount')
128
+ self.second_bonus_amount = attributes[:'secondBonusAmount']
129
+ end
130
+
131
+ if attributes.has_key?(:'preapprovalType')
132
+ self.preapproval_type = attributes[:'preapprovalType']
133
+ end
134
+
81
135
  if attributes.has_key?(:'installments')
82
136
  self.installments = attributes[:'installments']
83
137
  end
@@ -126,6 +180,42 @@ module CyberSource
126
180
  @payment_method = payment_method
127
181
  end
128
182
 
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] bonuses Value to be assigned
185
+ def bonuses=(bonuses)
186
+ @bonuses = bonuses
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] bonus_month Value to be assigned
191
+ def bonus_month=(bonus_month)
192
+ @bonus_month = bonus_month
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] second_bonus_month Value to be assigned
197
+ def second_bonus_month=(second_bonus_month)
198
+ @second_bonus_month = second_bonus_month
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] bonus_amount Value to be assigned
203
+ def bonus_amount=(bonus_amount)
204
+ @bonus_amount = bonus_amount
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] second_bonus_amount Value to be assigned
209
+ def second_bonus_amount=(second_bonus_amount)
210
+ @second_bonus_amount = second_bonus_amount
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] preapproval_type Value to be assigned
215
+ def preapproval_type=(preapproval_type)
216
+ @preapproval_type = preapproval_type
217
+ end
218
+
129
219
  # Custom attribute writer method with validation
130
220
  # @param [Object] terminal_id Value to be assigned
131
221
  def terminal_id=(terminal_id)
@@ -168,6 +258,12 @@ module CyberSource
168
258
  return true if self.equal?(o)
169
259
  self.class == o.class &&
170
260
  payment_method == o.payment_method &&
261
+ bonuses == o.bonuses &&
262
+ bonus_month == o.bonus_month &&
263
+ second_bonus_month == o.second_bonus_month &&
264
+ bonus_amount == o.bonus_amount &&
265
+ second_bonus_amount == o.second_bonus_amount &&
266
+ preapproval_type == o.preapproval_type &&
171
267
  installments == o.installments &&
172
268
  terminal_id == o.terminal_id &&
173
269
  first_billing_month == o.first_billing_month &&
@@ -186,7 +282,7 @@ module CyberSource
186
282
  # Calculates hash code according to all attributes.
187
283
  # @return [Fixnum] Hash code
188
284
  def hash
189
- [payment_method, installments, terminal_id, first_billing_month, business_name, business_name_katakana, jis2_track_data, business_name_alpha_numeric].hash
285
+ [payment_method, bonuses, bonus_month, second_bonus_month, bonus_amount, second_bonus_amount, preapproval_type, installments, terminal_id, first_billing_month, business_name, business_name_katakana, jis2_track_data, business_name_alpha_numeric].hash
190
286
  end
191
287
 
192
288
  # Builds the object from hash
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CyberSource
16
+ class Ptsv2voidsProcessingInformation
17
+ # This field is to accept the id of credit/capture in the body of L1 requests so the type of void can be identified and processed correctly downstream.
18
+ attr_accessor :payment_id
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'payment_id' => :'paymentId'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'payment_id' => :'String'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'paymentId')
43
+ self.payment_id = attributes[:'paymentId']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Custom attribute writer method with validation
61
+ # @param [Object] payment_id Value to be assigned
62
+ def payment_id=(payment_id)
63
+ @payment_id = payment_id
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ payment_id == o.payment_id
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Fixnum] Hash code
82
+ def hash
83
+ [payment_id].hash
84
+ end
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+ self.class.swagger_types.each_pair do |key, type|
92
+ if type =~ /\AArray<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Deserializes the data based on type
107
+ # @param string type Data type
108
+ # @param string value Value to be deserialized
109
+ # @return [Object] Deserialized data
110
+ def _deserialize(type, value)
111
+ case type.to_sym
112
+ when :DateTime
113
+ DateTime.parse(value)
114
+ when :Date
115
+ Date.parse(value)
116
+ when :String
117
+ value.to_s
118
+ when :Integer
119
+ value.to_i
120
+ when :Float
121
+ value.to_f
122
+ when :BOOLEAN
123
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
124
+ true
125
+ else
126
+ false
127
+ end
128
+ when :Object
129
+ # generic object (usually a Hash), return directly
130
+ value
131
+ when /\AArray<(?<inner_type>.+)>\z/
132
+ inner_type = Regexp.last_match[:inner_type]
133
+ value.map { |v| _deserialize(inner_type, v) }
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
+ k_type = Regexp.last_match[:k_type]
136
+ v_type = Regexp.last_match[:v_type]
137
+ {}.tap do |hash|
138
+ value.each do |k, v|
139
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
140
+ end
141
+ end
142
+ else # model
143
+ temp_model = CyberSource.const_get(type).new
144
+ temp_model.build_from_hash(value)
145
+ end
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_hash (backward compatibility)
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_body
157
+ to_hash
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ next if value.nil?
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map { |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+ end
190
+ end
@@ -17,17 +17,22 @@ module CyberSource
17
17
  # Identifier for the partner that is integrated to CyberSource. Send this value in all requests that are sent through the partner solution. CyberSource assigns the ID to the partner. **Note** When you see a solutionId of 999 in reports, the solutionId that was submitted is incorrect.
18
18
  attr_accessor :solution_id
19
19
 
20
+ # Value that identifies the application vendor and application version for a third party gateway. CyberSource provides you with this value during testing and validation. This field is supported only on CyberSource through VisaNet. #### Used by **Authorization, Authorization Reversal, Capture, Credit, Incremental Authorization, and Void** Optional field. #### PIN debit Required field for PIN debit credit, PIN debit purchase, or PIN debit reversal request.
21
+ attr_accessor :third_party_certification_number
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'solution_id' => :'solutionId'
26
+ :'solution_id' => :'solutionId',
27
+ :'third_party_certification_number' => :'thirdPartyCertificationNumber'
24
28
  }
25
29
  end
26
30
 
27
31
  # Attribute type mapping.
28
32
  def self.swagger_types
29
33
  {
30
- :'solution_id' => :'String'
34
+ :'solution_id' => :'String',
35
+ :'third_party_certification_number' => :'String'
31
36
  }
32
37
  end
33
38
 
@@ -42,6 +47,10 @@ module CyberSource
42
47
  if attributes.has_key?(:'solutionId')
43
48
  self.solution_id = attributes[:'solutionId']
44
49
  end
50
+
51
+ if attributes.has_key?(:'thirdPartyCertificationNumber')
52
+ self.third_party_certification_number = attributes[:'thirdPartyCertificationNumber']
53
+ end
45
54
  end
46
55
 
47
56
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -63,12 +72,19 @@ module CyberSource
63
72
  @solution_id = solution_id
64
73
  end
65
74
 
75
+ # Custom attribute writer method with validation
76
+ # @param [Object] third_party_certification_number Value to be assigned
77
+ def third_party_certification_number=(third_party_certification_number)
78
+ @third_party_certification_number = third_party_certification_number
79
+ end
80
+
66
81
  # Checks equality by comparing each attribute.
67
82
  # @param [Object] Object to be compared
68
83
  def ==(o)
69
84
  return true if self.equal?(o)
70
85
  self.class == o.class &&
71
- solution_id == o.solution_id
86
+ solution_id == o.solution_id &&
87
+ third_party_certification_number == o.third_party_certification_number
72
88
  end
73
89
 
74
90
  # @see the `==` method
@@ -80,7 +96,7 @@ module CyberSource
80
96
  # Calculates hash code according to all attributes.
81
97
  # @return [Fixnum] Hash code
82
98
  def hash
83
- [solution_id].hash
99
+ [solution_id, third_party_certification_number].hash
84
100
  end
85
101
 
86
102
  # Builds the object from hash
@@ -32,6 +32,8 @@ module CyberSource
32
32
 
33
33
  attr_accessor :shipping_address
34
34
 
35
+ attr_accessor :fluid_data
36
+
35
37
  # Attribute mapping from ruby-style variable name to JSON key.
36
38
  def self.attribute_map
37
39
  {
@@ -43,7 +45,8 @@ module CyberSource
43
45
  :'account_features' => :'accountFeatures',
44
46
  :'payment_instrument' => :'paymentInstrument',
45
47
  :'instrument_identifier' => :'instrumentIdentifier',
46
- :'shipping_address' => :'shippingAddress'
48
+ :'shipping_address' => :'shippingAddress',
49
+ :'fluid_data' => :'fluidData'
47
50
  }
48
51
  end
49
52
 
@@ -58,7 +61,8 @@ module CyberSource
58
61
  :'account_features' => :'TssV2TransactionsGet200ResponsePaymentInformationAccountFeatures',
59
62
  :'payment_instrument' => :'PtsV2PaymentsPost201ResponseTokenInformationPaymentInstrument',
60
63
  :'instrument_identifier' => :'TssV2TransactionsGet200ResponsePaymentInformationInstrumentIdentifier',
61
- :'shipping_address' => :'PtsV2PaymentsPost201ResponseTokenInformationShippingAddress'
64
+ :'shipping_address' => :'PtsV2PaymentsPost201ResponseTokenInformationShippingAddress',
65
+ :'fluid_data' => :'TssV2TransactionsGet200ResponsePaymentInformationFluidData'
62
66
  }
63
67
  end
64
68
 
@@ -105,6 +109,10 @@ module CyberSource
105
109
  if attributes.has_key?(:'shippingAddress')
106
110
  self.shipping_address = attributes[:'shippingAddress']
107
111
  end
112
+
113
+ if attributes.has_key?(:'fluidData')
114
+ self.fluid_data = attributes[:'fluidData']
115
+ end
108
116
  end
109
117
 
110
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -133,7 +141,8 @@ module CyberSource
133
141
  account_features == o.account_features &&
134
142
  payment_instrument == o.payment_instrument &&
135
143
  instrument_identifier == o.instrument_identifier &&
136
- shipping_address == o.shipping_address
144
+ shipping_address == o.shipping_address &&
145
+ fluid_data == o.fluid_data
137
146
  end
138
147
 
139
148
  # @see the `==` method
@@ -145,7 +154,7 @@ module CyberSource
145
154
  # Calculates hash code according to all attributes.
146
155
  # @return [Fixnum] Hash code
147
156
  def hash
148
- [payment_type, customer, card, invoice, bank, account_features, payment_instrument, instrument_identifier, shipping_address].hash
157
+ [payment_type, customer, card, invoice, bank, account_features, payment_instrument, instrument_identifier, shipping_address, fluid_data].hash
149
158
  end
150
159
 
151
160
  # Builds the object from hash
@@ -41,7 +41,7 @@ module CyberSource
41
41
  # Identifier for the issuing bank that provided the customer’s encoded account number. Contact your processor for the bank’s ID.
42
42
  attr_accessor :account_encoder_id
43
43
 
44
- # Flag that specifies the type of account associated with the card. The cardholder provides this information during the payment process. #### Cielo and Comercio Latino Possible values: - CREDIT: Credit card - DEBIT: Debit card This field is required for: - Debit transactions on Cielo and Comercio Latino. - Transactions with Brazilian-issued cards on CyberSource through VisaNet. **Note** The value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR0 - Position: 51 - Field: Combination Card Transaction Identifier This field is supported only for Mastercard transactions in Brazil on CyberSource through VisaNet.
44
+ # Flag that specifies the type of account associated with the card. The cardholder provides this information during the payment process. Possible values: - C: Credit transaction - D: Debit transaction This field is supported only for all card Types on Visa Platform Connect. This field is required for: - Debit transactions on Cielo and Comercio Latino. - Transactions with Brazilian-issued cards on CyberSource through VisaNet. **Note** The value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR0 - Position: 51 - Field: Combination Card Transaction Identifier
45
45
  attr_accessor :use_as
46
46
 
47
47
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CyberSource
16
+ class TssV2TransactionsGet200ResponsePaymentInformationFluidData
17
+ # 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 Cybersource 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`
18
+ attr_accessor :descriptor
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'descriptor' => :'descriptor'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'descriptor' => :'String'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'descriptor')
43
+ self.descriptor = attributes[:'descriptor']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Custom attribute writer method with validation
61
+ # @param [Object] descriptor Value to be assigned
62
+ def descriptor=(descriptor)
63
+ @descriptor = descriptor
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ descriptor == o.descriptor
72
+ end
73
+
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
+
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Fixnum] Hash code
82
+ def hash
83
+ [descriptor].hash
84
+ end
85
+
86
+ # Builds the object from hash
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ # @return [Object] Returns the model itself
89
+ def build_from_hash(attributes)
90
+ return nil unless attributes.is_a?(Hash)
91
+ self.class.swagger_types.each_pair do |key, type|
92
+ if type =~ /\AArray<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Deserializes the data based on type
107
+ # @param string type Data type
108
+ # @param string value Value to be deserialized
109
+ # @return [Object] Deserialized data
110
+ def _deserialize(type, value)
111
+ case type.to_sym
112
+ when :DateTime
113
+ DateTime.parse(value)
114
+ when :Date
115
+ Date.parse(value)
116
+ when :String
117
+ value.to_s
118
+ when :Integer
119
+ value.to_i
120
+ when :Float
121
+ value.to_f
122
+ when :BOOLEAN
123
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
124
+ true
125
+ else
126
+ false
127
+ end
128
+ when :Object
129
+ # generic object (usually a Hash), return directly
130
+ value
131
+ when /\AArray<(?<inner_type>.+)>\z/
132
+ inner_type = Regexp.last_match[:inner_type]
133
+ value.map { |v| _deserialize(inner_type, v) }
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
+ k_type = Regexp.last_match[:k_type]
136
+ v_type = Regexp.last_match[:v_type]
137
+ {}.tap do |hash|
138
+ value.each do |k, v|
139
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
140
+ end
141
+ end
142
+ else # model
143
+ temp_model = CyberSource.const_get(type).new
144
+ temp_model.build_from_hash(value)
145
+ end
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_hash (backward compatibility)
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_body
157
+ to_hash
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ next if value.nil?
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map { |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+ end
190
+ end