cybersource_rest_client 0.0.16 → 0.0.17
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.
- checksums.yaml +4 -4
- data/lib/cybersource_rest_client.rb +12 -5
- data/lib/cybersource_rest_client/api/credit_api.rb +1 -1
- data/lib/cybersource_rest_client/api/download_dtd_api.rb +4 -4
- data/lib/cybersource_rest_client/api/download_xsd_api.rb +4 -4
- data/lib/cybersource_rest_client/api/payments_api.rb +1 -1
- data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +9 -9
- data/lib/cybersource_rest_client/api/reports_api.rb +9 -9
- data/lib/cybersource_rest_client/api/search_transactions_api.rb +1 -1
- data/lib/cybersource_rest_client/api/transaction_batches_api.rb +2 -8
- data/lib/cybersource_rest_client/models/{request_body.rb → create_adhoc_report_request.rb} +1 -1
- data/lib/cybersource_rest_client/models/{request_body_1.rb → create_report_subscription_request.rb} +1 -1
- data/lib/cybersource_rest_client/models/error.rb +23 -13
- data/lib/cybersource_rest_client/models/error_bean.rb +1 -1
- data/lib/cybersource_rest_client/models/error_links.rb +15 -15
- data/lib/cybersource_rest_client/models/error_response.rb +2 -20
- data/lib/cybersource_rest_client/models/inline_response_400.rb +59 -14
- data/lib/cybersource_rest_client/models/inline_response_400_1.rb +14 -59
- data/lib/cybersource_rest_client/models/{inline_response_400_1_fields.rb → inline_response_400_fields.rb} +1 -1
- data/lib/cybersource_rest_client/models/link.rb +4 -25
- data/lib/cybersource_rest_client/models/links.rb +14 -18
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +22 -4
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information_electronic_benefits_transfer.rb +199 -0
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information_purchase_options.rb +184 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +29 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +6 -6
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +13 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type.rb +203 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type_method.rb +184 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +22 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_electronic_benefits_transfer.rb +224 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_purchase_options.rb +209 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +29 -4
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_line_items.rb +6 -6
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +13 -4
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_order_information_line_items.rb +6 -6
- data/lib/cybersource_rest_client/models/ptsv2paymentsidvoids_payment_information.rb +183 -0
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information_line_items.rb +6 -6
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_type.rb +1 -1
- data/lib/cybersource_rest_client/models/void_capture_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_credit_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_payment_request.rb +13 -4
- data/lib/cybersource_rest_client/models/void_refund_request.rb +13 -4
- metadata +12 -5
@@ -45,6 +45,10 @@ module CyberSource
|
|
45
45
|
|
46
46
|
attr_accessor :bank_transfer_options
|
47
47
|
|
48
|
+
attr_accessor :purchase_options
|
49
|
+
|
50
|
+
attr_accessor :electronic_benefits_transfer
|
51
|
+
|
48
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
49
53
|
def self.attribute_map
|
50
54
|
{
|
@@ -58,7 +62,9 @@ module CyberSource
|
|
58
62
|
:'purchase_level' => :'purchaseLevel',
|
59
63
|
:'industry_data_type' => :'industryDataType',
|
60
64
|
:'recurring_options' => :'recurringOptions',
|
61
|
-
:'bank_transfer_options' => :'bankTransferOptions'
|
65
|
+
:'bank_transfer_options' => :'bankTransferOptions',
|
66
|
+
:'purchase_options' => :'purchaseOptions',
|
67
|
+
:'electronic_benefits_transfer' => :'electronicBenefitsTransfer'
|
62
68
|
}
|
63
69
|
end
|
64
70
|
|
@@ -75,7 +81,9 @@ module CyberSource
|
|
75
81
|
:'purchase_level' => :'String',
|
76
82
|
:'industry_data_type' => :'String',
|
77
83
|
:'recurring_options' => :'Ptsv2paymentsidrefundsProcessingInformationRecurringOptions',
|
78
|
-
:'bank_transfer_options' => :'Ptsv2creditsProcessingInformationBankTransferOptions'
|
84
|
+
:'bank_transfer_options' => :'Ptsv2creditsProcessingInformationBankTransferOptions',
|
85
|
+
:'purchase_options' => :'Ptsv2creditsProcessingInformationPurchaseOptions',
|
86
|
+
:'electronic_benefits_transfer' => :'Ptsv2creditsProcessingInformationElectronicBenefitsTransfer'
|
79
87
|
}
|
80
88
|
end
|
81
89
|
|
@@ -130,6 +138,14 @@ module CyberSource
|
|
130
138
|
if attributes.has_key?(:'bankTransferOptions')
|
131
139
|
self.bank_transfer_options = attributes[:'bankTransferOptions']
|
132
140
|
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'purchaseOptions')
|
143
|
+
self.purchase_options = attributes[:'purchaseOptions']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.has_key?(:'electronicBenefitsTransfer')
|
147
|
+
self.electronic_benefits_transfer = attributes[:'electronicBenefitsTransfer']
|
148
|
+
end
|
133
149
|
end
|
134
150
|
|
135
151
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -295,7 +311,9 @@ module CyberSource
|
|
295
311
|
purchase_level == o.purchase_level &&
|
296
312
|
industry_data_type == o.industry_data_type &&
|
297
313
|
recurring_options == o.recurring_options &&
|
298
|
-
bank_transfer_options == o.bank_transfer_options
|
314
|
+
bank_transfer_options == o.bank_transfer_options &&
|
315
|
+
purchase_options == o.purchase_options &&
|
316
|
+
electronic_benefits_transfer == o.electronic_benefits_transfer
|
299
317
|
end
|
300
318
|
|
301
319
|
# @see the `==` method
|
@@ -307,7 +325,7 @@ module CyberSource
|
|
307
325
|
# Calculates hash code according to all attributes.
|
308
326
|
# @return [Fixnum] Hash code
|
309
327
|
def hash
|
310
|
-
[commerce_indicator, processor_id, payment_solution, reconciliation_id, link_id, report_group, visa_checkout_id, purchase_level, industry_data_type, recurring_options, bank_transfer_options].hash
|
328
|
+
[commerce_indicator, processor_id, payment_solution, reconciliation_id, link_id, report_group, visa_checkout_id, purchase_level, industry_data_type, recurring_options, bank_transfer_options, purchase_options, electronic_benefits_transfer].hash
|
311
329
|
end
|
312
330
|
|
313
331
|
# Builds the object from hash
|
@@ -0,0 +1,199 @@
|
|
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 Ptsv2creditsProcessingInformationElectronicBenefitsTransfer
|
17
|
+
# Flag that specifies the category for the EBT transaction. Possible values: - `CASH`: Cash benefits, which can be used to purchase any item at a participating retailer, as well as to obtain cash-back or make a cash withdrawal from a participating ATM. - `FOOD`: Food stamp benefits, which can be used only to purchase food items authorized by the USDA SNAP program.
|
18
|
+
attr_accessor :category
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'category' => :'category'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'category' => :'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?(:'category')
|
43
|
+
self.category = attributes[:'category']
|
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
|
+
if !@category.nil? && @category.to_s.length > 4
|
52
|
+
invalid_properties.push('invalid value for "category", the character length must be smaller than or equal to 4.')
|
53
|
+
end
|
54
|
+
|
55
|
+
invalid_properties
|
56
|
+
end
|
57
|
+
|
58
|
+
# Check to see if the all the properties in the model are valid
|
59
|
+
# @return true if the model is valid
|
60
|
+
def valid?
|
61
|
+
return false if !@category.nil? && @category.to_s.length > 4
|
62
|
+
true
|
63
|
+
end
|
64
|
+
|
65
|
+
# Custom attribute writer method with validation
|
66
|
+
# @param [Object] category Value to be assigned
|
67
|
+
def category=(category)
|
68
|
+
if !category.nil? && category.to_s.length > 4
|
69
|
+
fail ArgumentError, 'invalid value for "category", the character length must be smaller than or equal to 4.'
|
70
|
+
end
|
71
|
+
|
72
|
+
@category = category
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
category == o.category
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def eql?(o)
|
86
|
+
self == o
|
87
|
+
end
|
88
|
+
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Fixnum] Hash code
|
91
|
+
def hash
|
92
|
+
[category].hash
|
93
|
+
end
|
94
|
+
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
98
|
+
def build_from_hash(attributes)
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
100
|
+
self.class.swagger_types.each_pair do |key, type|
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
103
|
+
# is documented as an array but the input is not
|
104
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
105
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
110
|
+
end
|
111
|
+
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Deserializes the data based on type
|
116
|
+
# @param string type Data type
|
117
|
+
# @param string value Value to be deserialized
|
118
|
+
# @return [Object] Deserialized data
|
119
|
+
def _deserialize(type, value)
|
120
|
+
case type.to_sym
|
121
|
+
when :DateTime
|
122
|
+
DateTime.parse(value)
|
123
|
+
when :Date
|
124
|
+
Date.parse(value)
|
125
|
+
when :String
|
126
|
+
value.to_s
|
127
|
+
when :Integer
|
128
|
+
value.to_i
|
129
|
+
when :Float
|
130
|
+
value.to_f
|
131
|
+
when :BOOLEAN
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
|
+
true
|
134
|
+
else
|
135
|
+
false
|
136
|
+
end
|
137
|
+
when :Object
|
138
|
+
# generic object (usually a Hash), return directly
|
139
|
+
value
|
140
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
141
|
+
inner_type = Regexp.last_match[:inner_type]
|
142
|
+
value.map { |v| _deserialize(inner_type, v) }
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
|
+
k_type = Regexp.last_match[:k_type]
|
145
|
+
v_type = Regexp.last_match[:v_type]
|
146
|
+
{}.tap do |hash|
|
147
|
+
value.each do |k, v|
|
148
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else # model
|
152
|
+
temp_model = CyberSource.const_get(type).new
|
153
|
+
temp_model.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = self.send(attr)
|
175
|
+
next if value.nil?
|
176
|
+
hash[param] = _to_hash(value)
|
177
|
+
end
|
178
|
+
hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Outputs non-array value in the form of hash
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
185
|
+
def _to_hash(value)
|
186
|
+
if value.is_a?(Array)
|
187
|
+
value.compact.map { |v| _to_hash(v) }
|
188
|
+
elsif value.is_a?(Hash)
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
+
end
|
192
|
+
elsif value.respond_to? :to_hash
|
193
|
+
value.to_hash
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
data/lib/cybersource_rest_client/models/ptsv2credits_processing_information_purchase_options.rb
ADDED
@@ -0,0 +1,184 @@
|
|
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 Ptsv2creditsProcessingInformationPurchaseOptions
|
17
|
+
# Flag that indicates that this transaction is an EBT transaction.Possible values: - **true** - **false**
|
18
|
+
attr_accessor :is_electronic_benefits_transfer
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'is_electronic_benefits_transfer' => :'isElectronicBenefitsTransfer'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'is_electronic_benefits_transfer' => :'BOOLEAN'
|
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?(:'isElectronicBenefitsTransfer')
|
43
|
+
self.is_electronic_benefits_transfer = attributes[:'isElectronicBenefitsTransfer']
|
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
|
+
# Checks equality by comparing each attribute.
|
61
|
+
# @param [Object] Object to be compared
|
62
|
+
def ==(o)
|
63
|
+
return true if self.equal?(o)
|
64
|
+
self.class == o.class &&
|
65
|
+
is_electronic_benefits_transfer == o.is_electronic_benefits_transfer
|
66
|
+
end
|
67
|
+
|
68
|
+
# @see the `==` method
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def eql?(o)
|
71
|
+
self == o
|
72
|
+
end
|
73
|
+
|
74
|
+
# Calculates hash code according to all attributes.
|
75
|
+
# @return [Fixnum] Hash code
|
76
|
+
def hash
|
77
|
+
[is_electronic_benefits_transfer].hash
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
self.class.swagger_types.each_pair do |key, type|
|
86
|
+
if type =~ /\AArray<(.*)>/i
|
87
|
+
# check to ensure the input is an array given that the the attribute
|
88
|
+
# is documented as an array but the input is not
|
89
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
90
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
91
|
+
end
|
92
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
93
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
94
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
95
|
+
end
|
96
|
+
|
97
|
+
self
|
98
|
+
end
|
99
|
+
|
100
|
+
# Deserializes the data based on type
|
101
|
+
# @param string type Data type
|
102
|
+
# @param string value Value to be deserialized
|
103
|
+
# @return [Object] Deserialized data
|
104
|
+
def _deserialize(type, value)
|
105
|
+
case type.to_sym
|
106
|
+
when :DateTime
|
107
|
+
DateTime.parse(value)
|
108
|
+
when :Date
|
109
|
+
Date.parse(value)
|
110
|
+
when :String
|
111
|
+
value.to_s
|
112
|
+
when :Integer
|
113
|
+
value.to_i
|
114
|
+
when :Float
|
115
|
+
value.to_f
|
116
|
+
when :BOOLEAN
|
117
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
118
|
+
true
|
119
|
+
else
|
120
|
+
false
|
121
|
+
end
|
122
|
+
when :Object
|
123
|
+
# generic object (usually a Hash), return directly
|
124
|
+
value
|
125
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
126
|
+
inner_type = Regexp.last_match[:inner_type]
|
127
|
+
value.map { |v| _deserialize(inner_type, v) }
|
128
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
129
|
+
k_type = Regexp.last_match[:k_type]
|
130
|
+
v_type = Regexp.last_match[:v_type]
|
131
|
+
{}.tap do |hash|
|
132
|
+
value.each do |k, v|
|
133
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
else # model
|
137
|
+
temp_model = CyberSource.const_get(type).new
|
138
|
+
temp_model.build_from_hash(value)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Returns the string representation of the object
|
143
|
+
# @return [String] String presentation of the object
|
144
|
+
def to_s
|
145
|
+
to_hash.to_s
|
146
|
+
end
|
147
|
+
|
148
|
+
# to_body is an alias to to_hash (backward compatibility)
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
150
|
+
def to_body
|
151
|
+
to_hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# Returns the object in the form of hash
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_hash
|
157
|
+
hash = {}
|
158
|
+
self.class.attribute_map.each_pair do |attr, param|
|
159
|
+
value = self.send(attr)
|
160
|
+
next if value.nil?
|
161
|
+
hash[param] = _to_hash(value)
|
162
|
+
end
|
163
|
+
hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Outputs non-array value in the form of hash
|
167
|
+
# For object, use to_hash. Otherwise, just return the value
|
168
|
+
# @param [Object] value Any valid value
|
169
|
+
# @return [Hash] Returns the value in the form of hash
|
170
|
+
def _to_hash(value)
|
171
|
+
if value.is_a?(Array)
|
172
|
+
value.compact.map { |v| _to_hash(v) }
|
173
|
+
elsif value.is_a?(Hash)
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
176
|
+
end
|
177
|
+
elsif value.respond_to? :to_hash
|
178
|
+
value.to_hash
|
179
|
+
else
|
180
|
+
value
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -80,6 +80,9 @@ module CyberSource
|
|
80
80
|
# Your local pricing currency code. For the possible values, see the [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/currencies.pdf) For details, see `original_currency` field description in [Credit Card Services Using the SCMP API.](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm) For details about converting a foreign cardholder’s purchase from your local pricing currency to the cardholder’s billing currency, see the [Dynamic Currency Conversion with a Third Party Provider Guide.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm).
|
81
81
|
attr_accessor :original_currency
|
82
82
|
|
83
|
+
# Cashback amount requested by the customer. If a cashback amount is included in the request, it must be included in the orderInformation.amountDetails.totalAmount value.
|
84
|
+
attr_accessor :cashback_amount
|
85
|
+
|
83
86
|
# Attribute mapping from ruby-style variable name to JSON key.
|
84
87
|
def self.attribute_map
|
85
88
|
{
|
@@ -105,7 +108,8 @@ module CyberSource
|
|
105
108
|
:'tax_details' => :'taxDetails',
|
106
109
|
:'service_fee_amount' => :'serviceFeeAmount',
|
107
110
|
:'original_amount' => :'originalAmount',
|
108
|
-
:'original_currency' => :'originalCurrency'
|
111
|
+
:'original_currency' => :'originalCurrency',
|
112
|
+
:'cashback_amount' => :'cashbackAmount'
|
109
113
|
}
|
110
114
|
end
|
111
115
|
|
@@ -134,7 +138,8 @@ module CyberSource
|
|
134
138
|
:'tax_details' => :'Array<Ptsv2paymentsOrderInformationAmountDetailsTaxDetails>',
|
135
139
|
:'service_fee_amount' => :'String',
|
136
140
|
:'original_amount' => :'String',
|
137
|
-
:'original_currency' => :'String'
|
141
|
+
:'original_currency' => :'String',
|
142
|
+
:'cashback_amount' => :'String'
|
138
143
|
}
|
139
144
|
end
|
140
145
|
|
@@ -241,6 +246,10 @@ module CyberSource
|
|
241
246
|
if attributes.has_key?(:'originalCurrency')
|
242
247
|
self.original_currency = attributes[:'originalCurrency']
|
243
248
|
end
|
249
|
+
|
250
|
+
if attributes.has_key?(:'cashbackAmount')
|
251
|
+
self.cashback_amount = attributes[:'cashbackAmount']
|
252
|
+
end
|
244
253
|
end
|
245
254
|
|
246
255
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -327,6 +336,10 @@ module CyberSource
|
|
327
336
|
invalid_properties.push('invalid value for "original_currency", the character length must be smaller than or equal to 15.')
|
328
337
|
end
|
329
338
|
|
339
|
+
if !@cashback_amount.nil? && @cashback_amount.to_s.length > 13
|
340
|
+
invalid_properties.push('invalid value for "cashback_amount", the character length must be smaller than or equal to 13.')
|
341
|
+
end
|
342
|
+
|
330
343
|
invalid_properties
|
331
344
|
end
|
332
345
|
|
@@ -353,6 +366,7 @@ module CyberSource
|
|
353
366
|
return false if !@service_fee_amount.nil? && @service_fee_amount.to_s.length > 15
|
354
367
|
return false if !@original_amount.nil? && @original_amount.to_s.length > 15
|
355
368
|
return false if !@original_currency.nil? && @original_currency.to_s.length > 15
|
369
|
+
return false if !@cashback_amount.nil? && @cashback_amount.to_s.length > 13
|
356
370
|
true
|
357
371
|
end
|
358
372
|
|
@@ -556,6 +570,16 @@ module CyberSource
|
|
556
570
|
@original_currency = original_currency
|
557
571
|
end
|
558
572
|
|
573
|
+
# Custom attribute writer method with validation
|
574
|
+
# @param [Object] cashback_amount Value to be assigned
|
575
|
+
def cashback_amount=(cashback_amount)
|
576
|
+
if !cashback_amount.nil? && cashback_amount.to_s.length > 13
|
577
|
+
fail ArgumentError, 'invalid value for "cashback_amount", the character length must be smaller than or equal to 13.'
|
578
|
+
end
|
579
|
+
|
580
|
+
@cashback_amount = cashback_amount
|
581
|
+
end
|
582
|
+
|
559
583
|
# Checks equality by comparing each attribute.
|
560
584
|
# @param [Object] Object to be compared
|
561
585
|
def ==(o)
|
@@ -583,7 +607,8 @@ module CyberSource
|
|
583
607
|
tax_details == o.tax_details &&
|
584
608
|
service_fee_amount == o.service_fee_amount &&
|
585
609
|
original_amount == o.original_amount &&
|
586
|
-
original_currency == o.original_currency
|
610
|
+
original_currency == o.original_currency &&
|
611
|
+
cashback_amount == o.cashback_amount
|
587
612
|
end
|
588
613
|
|
589
614
|
# @see the `==` method
|
@@ -595,7 +620,7 @@ module CyberSource
|
|
595
620
|
# Calculates hash code according to all attributes.
|
596
621
|
# @return [Fixnum] Hash code
|
597
622
|
def hash
|
598
|
-
[total_amount, currency, discount_amount, duty_amount, gratuity_amount, tax_amount, national_tax_included, tax_applied_after_discount, tax_applied_level, tax_type_code, freight_amount, foreign_amount, foreign_currency, exchange_rate, exchange_rate_time_stamp, surcharge, settlement_amount, settlement_currency, amex_additional_amounts, tax_details, service_fee_amount, original_amount, original_currency].hash
|
623
|
+
[total_amount, currency, discount_amount, duty_amount, gratuity_amount, tax_amount, national_tax_included, tax_applied_after_discount, tax_applied_level, tax_type_code, freight_amount, foreign_amount, foreign_currency, exchange_rate, exchange_rate_time_stamp, surcharge, settlement_amount, settlement_currency, amex_additional_amounts, tax_details, service_fee_amount, original_amount, original_currency, cashback_amount].hash
|
599
624
|
end
|
600
625
|
|
601
626
|
# Builds the object from hash
|