cybersource_rest_client 0.0.51 → 0.0.52

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +4 -2
  3. data/lib/cybersource_rest_client/models/invoicing_v2_invoice_settings_get200_response_invoice_settings_information.rb +32 -8
  4. data/lib/cybersource_rest_client/models/invoicingv2invoice_settings_invoice_settings_information.rb +32 -4
  5. data/lib/cybersource_rest_client/models/invoicingv2invoices_customer_information.rb +13 -4
  6. data/lib/cybersource_rest_client/models/invoicingv2invoices_customer_information_company.rb +190 -0
  7. data/lib/cybersource_rest_client/models/invoicingv2invoices_order_information_amount_details_freight.rb +20 -4
  8. data/lib/cybersource_rest_client/models/invoicingv2invoices_order_information_line_items.rb +84 -4
  9. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +17 -1
  10. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +20 -4
  11. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_recipient_information_card.rb +1 -1
  12. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +1 -1
  13. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type.rb +11 -1
  14. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +11 -1
  15. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +1 -1
  16. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response.rb +10 -1
  17. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information.rb +40 -1
  18. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_brands.rb +194 -0
  19. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +27 -1
  20. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_features.rb +286 -0
  21. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_issuer_information.rb +238 -0
  22. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_network.rb +190 -0
  23. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payout_options.rb +190 -0
  24. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +11 -1
  25. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_token_information.rb +24 -4
  26. data/lib/cybersource_rest_client.rb +6 -0
  27. metadata +24 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df3d4d0c9c1787c11fccc299a763b66850f9aeadef9fe50c68f1abc73b0277b6
4
- data.tar.gz: f463fe432173cba9b0cf4bab3017a061e3dea481c0581ab56fc2fb138794c60f
3
+ metadata.gz: 42f36efce71b153b362f20d6897835a11a4b66a2b3d12472aac3edc7b3d1dee0
4
+ data.tar.gz: 5b9eea3c04953b8b990be37f4d8b3e92c9e565dca2536bf2bdff0d3bed55408d
5
5
  SHA512:
6
- metadata.gz: 60c50b4dc970b7a30792e50b21640e91a5f3de965f017de26c583f93fd38f179d60882f2cc1ebc34dd11e9a2125882b332b5f92d770cdf4df8523570515a886e
7
- data.tar.gz: c5f0f1087444ca68917b6c0e8ceb4f41c3d4632d0510b21c3f393e37e1b0775a24efe7a72ff705ffb1cba556cf752de948d2d208bbccedb0cd1015bb4c8b97a2
6
+ metadata.gz: 66558780465d8f29ddb9dbfe2a429f4e574a3598d77aaea0c30310a5e06076098e9caa059cd816b1b2aa101b123326dd2862ddb200d373d57fc30c09cfcc331c
7
+ data.tar.gz: cc369436fc15e95bdb320721faedf5176eab9a40aafc5e1826ada9998c3553fc3f0ee9ded1ffaefdfa5d6fac1fa05eca3a5acf89e9b8bd567041af17e7fe73a7
@@ -3,12 +3,14 @@ require 'openssl'
3
3
  require 'jwt'
4
4
  require 'json'
5
5
  require 'active_support'
6
+ require 'time'
6
7
  require_relative '../../core/ITokenGeneration.rb'
7
8
  require_relative '../../util/Constants.rb'
8
9
  require_relative '../../util/ExceptionHandler.rb'
9
10
  require_relative '../../util/Cache.rb'
10
11
  require_relative '../../authentication/payloadDigest/digest.rb'
11
12
  require_relative '../../logging/log_factory.rb'
13
+
12
14
  public
13
15
  class GenerateJwtToken
14
16
  @log_obj
@@ -66,9 +68,9 @@ public
66
68
 
67
69
  # Note: Digest is not passed for GET calls
68
70
  digest = DigestGeneration.new.generateDigest(payload)
69
- jwtBody = "{\n \"digest\":\"" + digest + "\", \"digestAlgorithm\":\"SHA-256\", \"iat\":\"" + gmtDatetime + "\"}"
71
+ jwtBody = "{\n \"digest\":\"" + digest + "\", \"digestAlgorithm\":\"SHA-256\", \"iat\":" + Time.parse(gmtDatetime).to_i.to_s + "}"
70
72
  elsif request_type == Constants::GET_REQUEST_TYPE || request_type == Constants::DELETE_REQUEST_TYPE
71
- jwtBody = "{\n \"iat\":\"" + gmtDatetime + "\"\n} \n\n"
73
+ jwtBody = "{\n \"iat\":" + Time.parse(gmtDatetime).to_i.to_s + "\n} \n\n"
72
74
  else
73
75
  raise StandardError.new(Constants::ERROR_PREFIX + Constants::INVALID_REQUEST_TYPE_METHOD)
74
76
  end
@@ -34,9 +34,15 @@ module CyberSource
34
34
  # Currency used for the order. Use the three-character [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/currencies.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/quickref/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/quickref/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. For details, see the `currency` field description in [Dynamic Currency Conversion For First Data Using the SCMP API](http://apps.cybersource.com/library/documentation/dev_guides/DCC_FirstData_SCMP/DCC_FirstData_SCMP_API.pdf). #### Tax Calculation Required for international tax and value added tax only. Optional for U.S. and Canadian taxes. Your local currency.
35
35
  attr_accessor :default_currency_code
36
36
 
37
- # The 3D Secure payer authentication version or status for a merchant's invoice payments. Possible values are: - `1` - `2` - `None` - `Disabled`
37
+ # The 3D Secure payer authentication status for a merchant's invoice payments.
38
38
  attr_accessor :payer_authentication3_ds_version
39
39
 
40
+ # Display VAT number on Invoice.
41
+ attr_accessor :show_vat_number
42
+
43
+ # Your government-assigned tax identification number. #### Tax Calculation Required field for value added tax only. Not applicable to U.S. and Canadian taxes.
44
+ attr_accessor :vat_registration_number
45
+
40
46
  # Attribute mapping from ruby-style variable name to JSON key.
41
47
  def self.attribute_map
42
48
  {
@@ -47,7 +53,9 @@ module CyberSource
47
53
  :'header_style' => :'headerStyle',
48
54
  :'delivery_language' => :'deliveryLanguage',
49
55
  :'default_currency_code' => :'defaultCurrencyCode',
50
- :'payer_authentication3_ds_version' => :'payerAuthentication3DSVersion'
56
+ :'payer_authentication3_ds_version' => :'payerAuthentication3DSVersion',
57
+ :'show_vat_number' => :'showVatNumber',
58
+ :'vat_registration_number' => :'vatRegistrationNumber'
51
59
  }
52
60
  end
53
61
 
@@ -61,7 +69,9 @@ module CyberSource
61
69
  :'header_style' => :'InvoicingV2InvoiceSettingsGet200ResponseInvoiceSettingsInformationHeaderStyle',
62
70
  :'delivery_language' => :'String',
63
71
  :'default_currency_code' => :'String',
64
- :'payer_authentication3_ds_version' => :'String'
72
+ :'payer_authentication3_ds_version' => :'BOOLEAN',
73
+ :'show_vat_number' => :'BOOLEAN',
74
+ :'vat_registration_number' => :'String'
65
75
  }
66
76
  end
67
77
 
@@ -103,6 +113,18 @@ module CyberSource
103
113
 
104
114
  if attributes.has_key?(:'payerAuthentication3DSVersion')
105
115
  self.payer_authentication3_ds_version = attributes[:'payerAuthentication3DSVersion']
116
+ else
117
+ self.payer_authentication3_ds_version = false
118
+ end
119
+
120
+ if attributes.has_key?(:'showVatNumber')
121
+ self.show_vat_number = attributes[:'showVatNumber']
122
+ else
123
+ self.show_vat_number = false
124
+ end
125
+
126
+ if attributes.has_key?(:'vatRegistrationNumber')
127
+ self.vat_registration_number = attributes[:'vatRegistrationNumber']
106
128
  end
107
129
  end
108
130
 
@@ -150,9 +172,9 @@ module CyberSource
150
172
  end
151
173
 
152
174
  # Custom attribute writer method with validation
153
- # @param [Object] payer_authentication3_ds_version Value to be assigned
154
- def payer_authentication3_ds_version=(payer_authentication3_ds_version)
155
- @payer_authentication3_ds_version = payer_authentication3_ds_version
175
+ # @param [Object] vat_registration_number Value to be assigned
176
+ def vat_registration_number=(vat_registration_number)
177
+ @vat_registration_number = vat_registration_number
156
178
  end
157
179
 
158
180
  # Checks equality by comparing each attribute.
@@ -167,7 +189,9 @@ module CyberSource
167
189
  header_style == o.header_style &&
168
190
  delivery_language == o.delivery_language &&
169
191
  default_currency_code == o.default_currency_code &&
170
- payer_authentication3_ds_version == o.payer_authentication3_ds_version
192
+ payer_authentication3_ds_version == o.payer_authentication3_ds_version &&
193
+ show_vat_number == o.show_vat_number &&
194
+ vat_registration_number == o.vat_registration_number
171
195
  end
172
196
 
173
197
  # @see the `==` method
@@ -179,7 +203,7 @@ module CyberSource
179
203
  # Calculates hash code according to all attributes.
180
204
  # @return [Fixnum] Hash code
181
205
  def hash
182
- [merchant_logo, merchant_display_name, custom_email_message, enable_reminders, header_style, delivery_language, default_currency_code, payer_authentication3_ds_version].hash
206
+ [merchant_logo, merchant_display_name, custom_email_message, enable_reminders, header_style, delivery_language, default_currency_code, payer_authentication3_ds_version, show_vat_number, vat_registration_number].hash
183
207
  end
184
208
 
185
209
  # Builds the object from hash
@@ -37,6 +37,12 @@ module CyberSource
37
37
  # 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`
38
38
  attr_accessor :payer_authentication_in_invoicing
39
39
 
40
+ # Display VAT number on Invoice.
41
+ attr_accessor :show_vat_number
42
+
43
+ # Your government-assigned tax identification number. #### Tax Calculation Required field for value added tax only. Not applicable to U.S. and Canadian taxes.
44
+ attr_accessor :vat_registration_number
45
+
40
46
  # Attribute mapping from ruby-style variable name to JSON key.
41
47
  def self.attribute_map
42
48
  {
@@ -47,7 +53,9 @@ module CyberSource
47
53
  :'header_style' => :'headerStyle',
48
54
  :'delivery_language' => :'deliveryLanguage',
49
55
  :'default_currency_code' => :'defaultCurrencyCode',
50
- :'payer_authentication_in_invoicing' => :'payerAuthenticationInInvoicing'
56
+ :'payer_authentication_in_invoicing' => :'payerAuthenticationInInvoicing',
57
+ :'show_vat_number' => :'showVatNumber',
58
+ :'vat_registration_number' => :'vatRegistrationNumber'
51
59
  }
52
60
  end
53
61
 
@@ -61,7 +69,9 @@ module CyberSource
61
69
  :'header_style' => :'InvoicingV2InvoiceSettingsGet200ResponseInvoiceSettingsInformationHeaderStyle',
62
70
  :'delivery_language' => :'String',
63
71
  :'default_currency_code' => :'String',
64
- :'payer_authentication_in_invoicing' => :'String'
72
+ :'payer_authentication_in_invoicing' => :'String',
73
+ :'show_vat_number' => :'BOOLEAN',
74
+ :'vat_registration_number' => :'String'
65
75
  }
66
76
  end
67
77
 
@@ -104,6 +114,16 @@ module CyberSource
104
114
  if attributes.has_key?(:'payerAuthenticationInInvoicing')
105
115
  self.payer_authentication_in_invoicing = attributes[:'payerAuthenticationInInvoicing']
106
116
  end
117
+
118
+ if attributes.has_key?(:'showVatNumber')
119
+ self.show_vat_number = attributes[:'showVatNumber']
120
+ else
121
+ self.show_vat_number = false
122
+ end
123
+
124
+ if attributes.has_key?(:'vatRegistrationNumber')
125
+ self.vat_registration_number = attributes[:'vatRegistrationNumber']
126
+ end
107
127
  end
108
128
 
109
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -155,6 +175,12 @@ module CyberSource
155
175
  @payer_authentication_in_invoicing = payer_authentication_in_invoicing
156
176
  end
157
177
 
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] vat_registration_number Value to be assigned
180
+ def vat_registration_number=(vat_registration_number)
181
+ @vat_registration_number = vat_registration_number
182
+ end
183
+
158
184
  # Checks equality by comparing each attribute.
159
185
  # @param [Object] Object to be compared
160
186
  def ==(o)
@@ -167,7 +193,9 @@ module CyberSource
167
193
  header_style == o.header_style &&
168
194
  delivery_language == o.delivery_language &&
169
195
  default_currency_code == o.default_currency_code &&
170
- payer_authentication_in_invoicing == o.payer_authentication_in_invoicing
196
+ payer_authentication_in_invoicing == o.payer_authentication_in_invoicing &&
197
+ show_vat_number == o.show_vat_number &&
198
+ vat_registration_number == o.vat_registration_number
171
199
  end
172
200
 
173
201
  # @see the `==` method
@@ -179,7 +207,7 @@ module CyberSource
179
207
  # Calculates hash code according to all attributes.
180
208
  # @return [Fixnum] Hash code
181
209
  def hash
182
- [merchant_logo, merchant_display_name, custom_email_message, enable_reminders, header_style, delivery_language, default_currency_code, payer_authentication_in_invoicing].hash
210
+ [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].hash
183
211
  end
184
212
 
185
213
  # Builds the object from hash
@@ -24,12 +24,15 @@ module CyberSource
24
24
  # Your identifier for the customer. When a subscription or customer profile is being created, the maximum length for this field for most processors is 30. Otherwise, the maximum length is 100. #### Comercio Latino For recurring payments in Mexico, the value is the customer’s contract number. Note Before you request the authorization, you must inform the issuer of the customer contract numbers that will be used for recurring transactions. #### Worldpay VAP For a follow-on credit with Worldpay VAP, CyberSource checks the following locations, in the order given, for a customer account ID value and uses the first value it finds: 1. `customer_account_id` value in the follow-on credit request 2. Customer account ID value that was used for the capture that is being credited 3. Customer account ID value that was used for the original authorization If a customer account ID value cannot be found in any of these locations, then no value is used. For processor-specific information, see the `customer_account_id` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
25
25
  attr_accessor :merchant_customer_id
26
26
 
27
+ attr_accessor :company
28
+
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
28
30
  def self.attribute_map
29
31
  {
30
32
  :'name' => :'name',
31
33
  :'email' => :'email',
32
- :'merchant_customer_id' => :'merchantCustomerId'
34
+ :'merchant_customer_id' => :'merchantCustomerId',
35
+ :'company' => :'company'
33
36
  }
34
37
  end
35
38
 
@@ -38,7 +41,8 @@ module CyberSource
38
41
  {
39
42
  :'name' => :'String',
40
43
  :'email' => :'String',
41
- :'merchant_customer_id' => :'String'
44
+ :'merchant_customer_id' => :'String',
45
+ :'company' => :'Invoicingv2invoicesCustomerInformationCompany'
42
46
  }
43
47
  end
44
48
 
@@ -61,6 +65,10 @@ module CyberSource
61
65
  if attributes.has_key?(:'merchantCustomerId')
62
66
  self.merchant_customer_id = attributes[:'merchantCustomerId']
63
67
  end
68
+
69
+ if attributes.has_key?(:'company')
70
+ self.company = attributes[:'company']
71
+ end
64
72
  end
65
73
 
66
74
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -101,7 +109,8 @@ module CyberSource
101
109
  self.class == o.class &&
102
110
  name == o.name &&
103
111
  email == o.email &&
104
- merchant_customer_id == o.merchant_customer_id
112
+ merchant_customer_id == o.merchant_customer_id &&
113
+ company == o.company
105
114
  end
106
115
 
107
116
  # @see the `==` method
@@ -113,7 +122,7 @@ module CyberSource
113
122
  # Calculates hash code according to all attributes.
114
123
  # @return [Fixnum] Hash code
115
124
  def hash
116
- [name, email, merchant_customer_id].hash
125
+ [name, email, merchant_customer_id, company].hash
117
126
  end
118
127
 
119
128
  # 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 Invoicingv2invoicesCustomerInformationCompany
17
+ # Name of the customer’s company. **CyberSource through VisaNet** Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. For processor-specific information, see the `company_name` field in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
18
+ attr_accessor :name
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'name' => :'name'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'name' => :'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?(:'name')
43
+ self.name = attributes[:'name']
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] name Value to be assigned
62
+ def name=(name)
63
+ @name = name
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
+ name == o.name
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
+ [name].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
@@ -21,11 +21,15 @@ module CyberSource
21
21
  # Flag that indicates whether an order is taxable. This value must be true if the sum of all _lineItems[].taxAmount_ values > 0. If you do not include any `lineItems[].taxAmount` values in your request, CyberSource does not include `invoiceDetails.taxable` in the data it sends to the processor. For processor-specific information, see the `tax_indicator` field in [Level II and Level III Processing Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/Level_2_3_SCMP_API/html) Possible values: - **true** - **false**
22
22
  attr_accessor :taxable
23
23
 
24
+ # Shipping Tax rate applied to the freight amount. **Visa**: Valid range is 0.01 to 0.99 (1% to 99%, with only whole percentage values accepted; values with additional decimal places will be truncated). **Mastercard**: Valid range is 0.00001 to 0.99999 (0.001% to 99.999%).
25
+ attr_accessor :tax_rate
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'amount' => :'amount',
28
- :'taxable' => :'taxable'
31
+ :'taxable' => :'taxable',
32
+ :'tax_rate' => :'taxRate'
29
33
  }
30
34
  end
31
35
 
@@ -33,7 +37,8 @@ module CyberSource
33
37
  def self.swagger_types
34
38
  {
35
39
  :'amount' => :'String',
36
- :'taxable' => :'BOOLEAN'
40
+ :'taxable' => :'BOOLEAN',
41
+ :'tax_rate' => :'String'
37
42
  }
38
43
  end
39
44
 
@@ -52,6 +57,10 @@ module CyberSource
52
57
  if attributes.has_key?(:'taxable')
53
58
  self.taxable = attributes[:'taxable']
54
59
  end
60
+
61
+ if attributes.has_key?(:'taxRate')
62
+ self.tax_rate = attributes[:'taxRate']
63
+ end
55
64
  end
56
65
 
57
66
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -73,13 +82,20 @@ module CyberSource
73
82
  @amount = amount
74
83
  end
75
84
 
85
+ # Custom attribute writer method with validation
86
+ # @param [Object] tax_rate Value to be assigned
87
+ def tax_rate=(tax_rate)
88
+ @tax_rate = tax_rate
89
+ end
90
+
76
91
  # Checks equality by comparing each attribute.
77
92
  # @param [Object] Object to be compared
78
93
  def ==(o)
79
94
  return true if self.equal?(o)
80
95
  self.class == o.class &&
81
96
  amount == o.amount &&
82
- taxable == o.taxable
97
+ taxable == o.taxable &&
98
+ tax_rate == o.tax_rate
83
99
  end
84
100
 
85
101
  # @see the `==` method
@@ -91,7 +107,7 @@ module CyberSource
91
107
  # Calculates hash code according to all attributes.
92
108
  # @return [Fixnum] Hash code
93
109
  def hash
94
- [amount, taxable].hash
110
+ [amount, taxable, tax_rate].hash
95
111
  end
96
112
 
97
113
  # Builds the object from hash
@@ -27,13 +27,33 @@ module CyberSource
27
27
  # Per-item price of the product. This value for this field cannot be negative. You must include either this field or the request-level field `orderInformation.amountDetails.totalAmount` in your request. You can include a decimal point (.), but you cannot include any other special characters. The value is truncated to the correct number of decimal places. #### DCC with a Third-Party Provider Set this field to the converted amount that was returned by the DCC provider. You must include either the 1st line item in the order and this field, or the request-level field `orderInformation.amountDetails.totalAmount` in your request. #### FDMS South If you accept IDR or CLP currencies, see the entry for FDMS South in the [Merchant Descriptors Using the SCMP API Guide.] (https://apps.cybersource.com/library/documentation/dev_guides/Merchant_Descriptors_SCMP_API/html/) #### Tax Calculation Required field for U.S., Canadian, international and value added taxes. #### Zero Amount Authorizations If your processor supports zero amount authorizations, you can set this field to 0 for the authorization to check if the card is lost or stolen. #### Maximum Field Lengths For GPN and JCN Gateway: Decimal (10) All other processors: Decimal (15)
28
28
  attr_accessor :unit_price
29
29
 
30
+ # Discount applied to the item.
31
+ attr_accessor :discount_amount
32
+
33
+ # Rate the item is discounted. Maximum of 2 decimal places. Example 5.25 (=5.25%)
34
+ attr_accessor :discount_rate
35
+
36
+ # Total tax to apply to the product. This value cannot be negative. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. The following example uses a two-exponent currency such as USD: 1. You include each line item in your request. ..- 1st line item has amount=10.00, quantity=1, and taxAmount=0.80 ..- 2nd line item has amount=20.00, quantity=1, and taxAmount=1.60 2. The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included. Optional field. #### Airlines processing Tax portion of the order amount. This value cannot exceed 99999999999999 (fourteen 9s). Format: English characters only. Optional request field for a line item. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. Note if you send this field in your tax request, the value in the field will override the tax engine
37
+ attr_accessor :tax_amount
38
+
39
+ # Tax rate applied to the item. For details, see `tax_rate` field description in the [Level II and Level III Processing Using the SCMP API Guide.](https://apps.cybersource.com/library/documentation/dev_guides/Level_2_3_SCMP_API/html/) **Visa**: Valid range is 0.01 to 0.99 (1% to 99%, with only whole percentage values accepted; values with additional decimal places will be truncated). **Mastercard**: Valid range is 0.00001 to 0.99999 (0.001% to 99.999%).
40
+ attr_accessor :tax_rate
41
+
42
+ # Total amount for the item. Normally calculated as the unit price times quantity. When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the purchase amount total for prepaid gift cards in major units. Example: 123.45 USD = 123
43
+ attr_accessor :total_amount
44
+
30
45
  # Attribute mapping from ruby-style variable name to JSON key.
31
46
  def self.attribute_map
32
47
  {
33
48
  :'product_sku' => :'productSku',
34
49
  :'product_name' => :'productName',
35
50
  :'quantity' => :'quantity',
36
- :'unit_price' => :'unitPrice'
51
+ :'unit_price' => :'unitPrice',
52
+ :'discount_amount' => :'discountAmount',
53
+ :'discount_rate' => :'discountRate',
54
+ :'tax_amount' => :'taxAmount',
55
+ :'tax_rate' => :'taxRate',
56
+ :'total_amount' => :'totalAmount'
37
57
  }
38
58
  end
39
59
 
@@ -43,7 +63,12 @@ module CyberSource
43
63
  :'product_sku' => :'String',
44
64
  :'product_name' => :'String',
45
65
  :'quantity' => :'Integer',
46
- :'unit_price' => :'String'
66
+ :'unit_price' => :'String',
67
+ :'discount_amount' => :'String',
68
+ :'discount_rate' => :'String',
69
+ :'tax_amount' => :'String',
70
+ :'tax_rate' => :'String',
71
+ :'total_amount' => :'String'
47
72
  }
48
73
  end
49
74
 
@@ -70,6 +95,26 @@ module CyberSource
70
95
  if attributes.has_key?(:'unitPrice')
71
96
  self.unit_price = attributes[:'unitPrice']
72
97
  end
98
+
99
+ if attributes.has_key?(:'discountAmount')
100
+ self.discount_amount = attributes[:'discountAmount']
101
+ end
102
+
103
+ if attributes.has_key?(:'discountRate')
104
+ self.discount_rate = attributes[:'discountRate']
105
+ end
106
+
107
+ if attributes.has_key?(:'taxAmount')
108
+ self.tax_amount = attributes[:'taxAmount']
109
+ end
110
+
111
+ if attributes.has_key?(:'taxRate')
112
+ self.tax_rate = attributes[:'taxRate']
113
+ end
114
+
115
+ if attributes.has_key?(:'totalAmount')
116
+ self.total_amount = attributes[:'totalAmount']
117
+ end
73
118
  end
74
119
 
75
120
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -109,6 +154,36 @@ module CyberSource
109
154
  @unit_price = unit_price
110
155
  end
111
156
 
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] discount_amount Value to be assigned
159
+ def discount_amount=(discount_amount)
160
+ @discount_amount = discount_amount
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] discount_rate Value to be assigned
165
+ def discount_rate=(discount_rate)
166
+ @discount_rate = discount_rate
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] tax_amount Value to be assigned
171
+ def tax_amount=(tax_amount)
172
+ @tax_amount = tax_amount
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] tax_rate Value to be assigned
177
+ def tax_rate=(tax_rate)
178
+ @tax_rate = tax_rate
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] total_amount Value to be assigned
183
+ def total_amount=(total_amount)
184
+ @total_amount = total_amount
185
+ end
186
+
112
187
  # Checks equality by comparing each attribute.
113
188
  # @param [Object] Object to be compared
114
189
  def ==(o)
@@ -117,7 +192,12 @@ module CyberSource
117
192
  product_sku == o.product_sku &&
118
193
  product_name == o.product_name &&
119
194
  quantity == o.quantity &&
120
- unit_price == o.unit_price
195
+ unit_price == o.unit_price &&
196
+ discount_amount == o.discount_amount &&
197
+ discount_rate == o.discount_rate &&
198
+ tax_amount == o.tax_amount &&
199
+ tax_rate == o.tax_rate &&
200
+ total_amount == o.total_amount
121
201
  end
122
202
 
123
203
  # @see the `==` method
@@ -129,7 +209,7 @@ module CyberSource
129
209
  # Calculates hash code according to all attributes.
130
210
  # @return [Fixnum] Hash code
131
211
  def hash
132
- [product_sku, product_name, quantity, unit_price].hash
212
+ [product_sku, product_name, quantity, unit_price, discount_amount, discount_rate, tax_amount, tax_rate, total_amount].hash
133
213
  end
134
214
 
135
215
  # Builds the object from hash