cybersource_rest_client 0.0.53 → 0.0.55

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/http/GetSignatureParameter.rb +2 -2
  3. data/lib/AuthenticationSDK/authentication/http/HttpSignatureHeader.rb +6 -6
  4. data/lib/AuthenticationSDK/core/MerchantConfig.rb +6 -0
  5. data/lib/AuthenticationSDK/util/Cache.rb +15 -1
  6. data/lib/AuthenticationSDK/util/Constants.rb +1 -1
  7. data/lib/AuthenticationSDK/util/JWEUtility.rb +14 -0
  8. data/lib/cybersource_rest_client/api/batches_api.rb +12 -12
  9. data/lib/cybersource_rest_client/api/billing_agreements_api.rb +231 -0
  10. data/lib/cybersource_rest_client/api/decision_manager_api.rb +142 -0
  11. data/lib/cybersource_rest_client/api/invoice_settings_api.rb +2 -2
  12. data/lib/cybersource_rest_client/api/invoices_api.rb +6 -6
  13. data/lib/cybersource_rest_client/api/keymanagement_api.rb +3 -3
  14. data/lib/cybersource_rest_client/api/payments_api.rb +2 -2
  15. data/lib/cybersource_rest_client/api/plans_api.rb +32 -32
  16. data/lib/cybersource_rest_client/api/subscriptions_api.rb +32 -32
  17. data/lib/cybersource_rest_client/api/void_api.rb +2 -2
  18. data/lib/cybersource_rest_client/models/access_token_response.rb +244 -244
  19. data/lib/cybersource_rest_client/models/activate_deactivate_plan_response.rb +239 -0
  20. data/lib/cybersource_rest_client/models/{inline_response_200_9.rb → activate_subscription_response.rb} +2 -2
  21. data/lib/cybersource_rest_client/models/{inline_response_200_9_subscription_information.rb → activate_subscription_response_subscription_information.rb} +1 -1
  22. data/lib/cybersource_rest_client/models/bad_request_error.rb +192 -192
  23. data/lib/cybersource_rest_client/models/{inline_response_202_1.rb → cancel_subscription_response.rb} +2 -2
  24. data/lib/cybersource_rest_client/models/{inline_response_202_subscription_information.rb → cancel_subscription_response_subscription_information.rb} +1 -1
  25. data/lib/cybersource_rest_client/models/case_management_actions_request.rb +200 -0
  26. data/lib/cybersource_rest_client/models/case_management_comments_request.rb +206 -0
  27. data/lib/cybersource_rest_client/models/create_access_token_request.rb +254 -254
  28. data/lib/cybersource_rest_client/models/{inline_response_200_14.rb → create_billing_agreement.rb} +65 -88
  29. data/lib/cybersource_rest_client/models/create_bundled_decision_manager_case_request.rb +15 -5
  30. data/lib/cybersource_rest_client/models/create_plan_response.rb +239 -0
  31. data/lib/cybersource_rest_client/models/{inline_response_201_plan_information.rb → create_plan_response_plan_information.rb} +1 -1
  32. data/lib/cybersource_rest_client/models/create_subscription_request.rb +1 -1
  33. data/lib/cybersource_rest_client/models/{inline_response_201_1.rb → create_subscription_response.rb} +3 -3
  34. data/lib/cybersource_rest_client/models/{inline_response_201_1__links.rb → create_subscription_response__links.rb} +1 -1
  35. data/lib/cybersource_rest_client/models/{inline_response_201_1_subscription_information.rb → create_subscription_response_subscription_information.rb} +1 -1
  36. data/lib/cybersource_rest_client/models/delete_plan_response.rb +202 -0
  37. data/lib/cybersource_rest_client/models/{inline_response_202_2.rb → get_all_plans_response.rb} +31 -18
  38. data/lib/cybersource_rest_client/models/{inline_response_200__links.rb → get_all_plans_response__links.rb} +1 -1
  39. data/lib/cybersource_rest_client/models/{inline_response_200_order_information.rb → get_all_plans_response_order_information.rb} +2 -2
  40. data/lib/cybersource_rest_client/models/{inline_response_200_order_information_amount_details.rb → get_all_plans_response_order_information_amount_details.rb} +1 -1
  41. data/lib/cybersource_rest_client/models/{inline_response_200_plan_information.rb → get_all_plans_response_plan_information.rb} +3 -3
  42. data/lib/cybersource_rest_client/models/{inline_response_200_plan_information_billing_cycles.rb → get_all_plans_response_plan_information_billing_cycles.rb} +1 -1
  43. data/lib/cybersource_rest_client/models/{inline_response_200_plan_information_billing_period.rb → get_all_plans_response_plan_information_billing_period.rb} +1 -1
  44. data/lib/cybersource_rest_client/models/{inline_response_200_plans.rb → get_all_plans_response_plans.rb} +3 -3
  45. data/lib/cybersource_rest_client/models/{inline_response_200_6.rb → get_all_subscriptions_response.rb} +3 -3
  46. data/lib/cybersource_rest_client/models/{inline_response_200_6__links.rb → get_all_subscriptions_response__links.rb} +1 -1
  47. data/lib/cybersource_rest_client/models/get_all_subscriptions_response_order_information.rb +200 -0
  48. data/lib/cybersource_rest_client/models/{inline_response_200_6_order_information_bill_to.rb → get_all_subscriptions_response_order_information_bill_to.rb} +1 -1
  49. data/lib/cybersource_rest_client/models/{inline_response_200_6_payment_information.rb → get_all_subscriptions_response_payment_information.rb} +2 -2
  50. data/lib/cybersource_rest_client/models/{inline_response_200_6_payment_information_customer.rb → get_all_subscriptions_response_payment_information_customer.rb} +1 -1
  51. data/lib/cybersource_rest_client/models/{inline_response_200_6_plan_information.rb → get_all_subscriptions_response_plan_information.rb} +3 -3
  52. data/lib/cybersource_rest_client/models/{inline_response_200_6_plan_information_billing_cycles.rb → get_all_subscriptions_response_plan_information_billing_cycles.rb} +1 -1
  53. data/lib/cybersource_rest_client/models/{inline_response_200_6_subscription_information.rb → get_all_subscriptions_response_subscription_information.rb} +1 -1
  54. data/lib/cybersource_rest_client/models/{inline_response_200_6_subscriptions.rb → get_all_subscriptions_response_subscriptions.rb} +6 -6
  55. data/lib/cybersource_rest_client/models/{inline_response_200_5.rb → get_plan_code_response.rb} +1 -1
  56. data/lib/cybersource_rest_client/models/get_plan_response.rb +238 -0
  57. data/lib/cybersource_rest_client/models/{inline_response_200_10.rb → get_subscription_code_response.rb} +1 -1
  58. data/lib/cybersource_rest_client/models/{inline_response_200_7.rb → get_subscription_response.rb} +6 -6
  59. data/lib/cybersource_rest_client/models/inline_response_200.rb +30 -25
  60. data/lib/cybersource_rest_client/models/inline_response_200_1.rb +50 -40
  61. data/lib/cybersource_rest_client/models/{inline_response_200_11_keys.rb → inline_response_200_1_keys.rb} +1 -1
  62. data/lib/cybersource_rest_client/models/inline_response_200_2.rb +67 -17
  63. data/lib/cybersource_rest_client/models/{inline_response_200_12__embedded.rb → inline_response_200_2__embedded.rb} +2 -2
  64. data/lib/cybersource_rest_client/models/{inline_response_200_12__embedded__links.rb → inline_response_200_2__embedded__links.rb} +2 -2
  65. data/lib/cybersource_rest_client/models/{inline_response_200_12__embedded__links_reports.rb → inline_response_200_2__embedded__links_reports.rb} +1 -1
  66. data/lib/cybersource_rest_client/models/{inline_response_200_12__embedded_batches.rb → inline_response_200_2__embedded_batches.rb} +3 -3
  67. data/lib/cybersource_rest_client/models/{inline_response_200_12__embedded_totals.rb → inline_response_200_2__embedded_totals.rb} +1 -1
  68. data/lib/cybersource_rest_client/models/{inline_response_200_12__links.rb → inline_response_200_2__links.rb} +1 -1
  69. data/lib/cybersource_rest_client/models/inline_response_200_3.rb +81 -29
  70. data/lib/cybersource_rest_client/models/{inline_response_200_13__links.rb → inline_response_200_3__links.rb} +3 -3
  71. data/lib/cybersource_rest_client/models/{inline_response_202_2__links_status.rb → inline_response_200_3__links_report.rb} +1 -1
  72. data/lib/cybersource_rest_client/models/{inline_response_200_13_billing.rb → inline_response_200_3_billing.rb} +1 -1
  73. data/lib/cybersource_rest_client/models/inline_response_200_4.rb +96 -42
  74. data/lib/cybersource_rest_client/models/{inline_response_200_14_records.rb → inline_response_200_4_records.rb} +3 -3
  75. data/lib/cybersource_rest_client/models/{inline_response_200_14_response_record.rb → inline_response_200_4_response_record.rb} +2 -2
  76. data/lib/cybersource_rest_client/models/{inline_response_200_14_response_record_additional_updates.rb → inline_response_200_4_response_record_additional_updates.rb} +1 -1
  77. data/lib/cybersource_rest_client/models/{inline_response_200_14_source_record.rb → inline_response_200_4_source_record.rb} +1 -1
  78. data/lib/cybersource_rest_client/models/inline_response_200__embedded.rb +201 -0
  79. data/lib/cybersource_rest_client/models/inline_response_200__embedded_capture.rb +202 -0
  80. data/lib/cybersource_rest_client/models/inline_response_200__embedded_capture__links.rb +191 -0
  81. data/lib/cybersource_rest_client/models/inline_response_200__embedded_capture__links_self.rb +203 -0
  82. data/lib/cybersource_rest_client/models/inline_response_200__embedded_reversal.rb +202 -0
  83. data/lib/cybersource_rest_client/models/inline_response_200__embedded_reversal__links.rb +191 -0
  84. data/lib/cybersource_rest_client/models/inline_response_200__embedded_reversal__links_self.rb +203 -0
  85. data/lib/cybersource_rest_client/models/inline_response_201.rb +7 -27
  86. data/lib/cybersource_rest_client/models/inline_response_202.rb +17 -45
  87. data/lib/cybersource_rest_client/models/{inline_response_202_2__links.rb → inline_response_202__links.rb} +2 -2
  88. data/lib/cybersource_rest_client/models/{inline_response_200_13__links_report.rb → inline_response_202__links_status.rb} +1 -1
  89. data/lib/cybersource_rest_client/models/inline_response_400_1.rb +3 -3
  90. data/lib/cybersource_rest_client/models/inline_response_400_2.rb +1 -1
  91. data/lib/cybersource_rest_client/models/inline_response_400_3.rb +37 -60
  92. data/lib/cybersource_rest_client/models/inline_response_400_4.rb +61 -37
  93. data/lib/cybersource_rest_client/models/{inline_response_400_3_fields.rb → inline_response_400_4_fields.rb} +1 -1
  94. data/lib/cybersource_rest_client/models/inline_response_400_5.rb +10 -11
  95. data/lib/cybersource_rest_client/models/inline_response_400_6.rb +35 -75
  96. data/lib/cybersource_rest_client/models/inline_response_400_7.rb +276 -0
  97. data/lib/cybersource_rest_client/models/{inline_response_400_6_details.rb → inline_response_400_7_details.rb} +1 -1
  98. data/lib/cybersource_rest_client/models/inline_response_403_1.rb +236 -0
  99. data/lib/cybersource_rest_client/models/inline_response_422.rb +236 -0
  100. data/lib/cybersource_rest_client/models/inline_response_500_1.rb +20 -8
  101. data/lib/cybersource_rest_client/models/inline_response_500_2.rb +224 -0
  102. data/lib/cybersource_rest_client/models/inline_response_502.rb +13 -12
  103. data/lib/cybersource_rest_client/models/inline_response_502_1.rb +235 -0
  104. data/lib/cybersource_rest_client/models/inline_response_503.rb +236 -0
  105. data/lib/cybersource_rest_client/models/{inline_response_200_12.rb → intimate_billing_agreement.rb} +37 -59
  106. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response.rb +1 -1
  107. data/lib/cybersource_rest_client/models/modify_billing_agreement.rb +270 -0
  108. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_1.rb +239 -0
  109. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_1_installment_information.rb +197 -0
  110. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_1_processor_information.rb +214 -0
  111. data/lib/cybersource_rest_client/models/ptsv2billingagreements_aggregator_information.rb +207 -0
  112. data/lib/cybersource_rest_client/models/ptsv2billingagreements_consumer_authentication_information.rb +242 -0
  113. data/lib/cybersource_rest_client/models/ptsv2billingagreements_device_information.rb +231 -0
  114. data/lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb +327 -0
  115. data/lib/cybersource_rest_client/models/ptsv2billingagreements_merchant_information.rb +235 -0
  116. data/lib/cybersource_rest_client/models/ptsv2billingagreements_merchant_information_merchant_descriptor.rb +242 -0
  117. data/lib/cybersource_rest_client/models/{inline_response_200_6_order_information.rb → ptsv2billingagreements_order_information.rb} +3 -3
  118. data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information_bill_to.rb +401 -0
  119. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information.rb +200 -0
  120. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_card.rb +259 -0
  121. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_tokenized_card.rb +276 -0
  122. data/lib/cybersource_rest_client/models/ptsv2billingagreements_processing_information.rb +210 -0
  123. data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +12 -1
  124. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +16 -5
  125. data/lib/cybersource_rest_client/models/rbsv1plans_plan_information.rb +1 -1
  126. data/lib/cybersource_rest_client/models/rbsv1plansid_plan_information.rb +1 -1
  127. data/lib/cybersource_rest_client/models/rbsv1subscriptions_plan_information.rb +1 -1
  128. data/lib/cybersource_rest_client/models/resource_not_found_error.rb +192 -192
  129. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_consumer_authentication_information.rb +1 -1
  130. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_token_information.rb +22 -5
  131. data/lib/cybersource_rest_client/models/riskv1decisions_order_information.rb +12 -1
  132. data/lib/cybersource_rest_client/models/riskv1decisions_processing_information.rb +1 -1
  133. data/lib/cybersource_rest_client/models/riskv1decisions_token_information.rb +197 -0
  134. data/lib/cybersource_rest_client/models/riskv1decisionsidactions_decision_information.rb +208 -0
  135. data/lib/cybersource_rest_client/models/riskv1decisionsidactions_processing_information.rb +193 -0
  136. data/lib/cybersource_rest_client/models/suspend_subscription_response.rb +239 -0
  137. data/lib/cybersource_rest_client/models/{inline_response_202_1_subscription_information.rb → suspend_subscription_response_subscription_information.rb} +1 -1
  138. data/lib/cybersource_rest_client/models/unauthorized_client_error.rb +192 -192
  139. data/lib/cybersource_rest_client/models/update_plan_request.rb +1 -1
  140. data/lib/cybersource_rest_client/models/update_plan_response.rb +239 -0
  141. data/lib/cybersource_rest_client/models/{inline_response_200_3_plan_information.rb → update_plan_response_plan_information.rb} +1 -1
  142. data/lib/cybersource_rest_client/models/{inline_response_200_8.rb → update_subscription_response.rb} +3 -3
  143. data/lib/cybersource_rest_client/models/validate_request.rb +15 -5
  144. data/lib/cybersource_rest_client/utilities/jwe_utility.rb +12 -0
  145. data/lib/cybersource_rest_client.rb +95 -54
  146. metadata +112 -57
  147. data/lib/cybersource_rest_client/models/inline_response_200_11.rb +0 -248
  148. data/lib/cybersource_rest_client/models/inline_response_200_13.rb +0 -291
@@ -0,0 +1,231 @@
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 Ptsv2billingagreementsDeviceInformation
17
+ # Value of the Accept header sent by the customer’s web browser. **Note** If the customer’s browser provides a value, you must include it in your request.
18
+ attr_accessor :http_accept_browser_value
19
+
20
+ # IP address of the customer. #### Used by **Authorization, Capture, and Credit** Optional field.
21
+ attr_accessor :ip_address
22
+
23
+ # Value of the User-Agent header sent by the customer’s web browser. Note If the customer’s browser provides a value, you must include it in your request.
24
+ attr_accessor :user_agent_browser_value
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'http_accept_browser_value' => :'httpAcceptBrowserValue',
30
+ :'ip_address' => :'ipAddress',
31
+ :'user_agent_browser_value' => :'userAgentBrowserValue'
32
+ }
33
+ end
34
+
35
+ # Attribute mapping from JSON key to ruby-style variable name.
36
+ def self.json_map
37
+ {
38
+ :'http_accept_browser_value' => :'http_accept_browser_value',
39
+ :'ip_address' => :'ip_address',
40
+ :'user_agent_browser_value' => :'user_agent_browser_value'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'http_accept_browser_value' => :'String',
48
+ :'ip_address' => :'String',
49
+ :'user_agent_browser_value' => :'String'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ if attributes.has_key?(:'httpAcceptBrowserValue')
62
+ self.http_accept_browser_value = attributes[:'httpAcceptBrowserValue']
63
+ end
64
+
65
+ if attributes.has_key?(:'ipAddress')
66
+ self.ip_address = attributes[:'ipAddress']
67
+ end
68
+
69
+ if attributes.has_key?(:'userAgentBrowserValue')
70
+ self.user_agent_browser_value = attributes[:'userAgentBrowserValue']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Custom attribute writer method with validation
88
+ # @param [Object] http_accept_browser_value Value to be assigned
89
+ def http_accept_browser_value=(http_accept_browser_value)
90
+ @http_accept_browser_value = http_accept_browser_value
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] ip_address Value to be assigned
95
+ def ip_address=(ip_address)
96
+ @ip_address = ip_address
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param [Object] user_agent_browser_value Value to be assigned
101
+ def user_agent_browser_value=(user_agent_browser_value)
102
+ @user_agent_browser_value = user_agent_browser_value
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ http_accept_browser_value == o.http_accept_browser_value &&
111
+ ip_address == o.ip_address &&
112
+ user_agent_browser_value == o.user_agent_browser_value
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Fixnum] Hash code
123
+ def hash
124
+ [http_accept_browser_value, ip_address, user_agent_browser_value].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.swagger_types.each_pair do |key, type|
133
+ if type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ DateTime.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ temp_model = CyberSource.const_get(type).new
185
+ temp_model.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ next if value.nil?
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end
@@ -0,0 +1,327 @@
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 Ptsv2billingagreementsInstallmentInformation
17
+ # Applicable only for SI. Required in case the authentication is initiated for SI registration. Valid Values: - `SMS` - `EMAIL` - `BOTH`
18
+ attr_accessor :alert_preference
19
+
20
+ # Date of the first installment payment. Format: YYMMDD. When you do not include this field, CyberSource sends a string of six zeros (000000) to the processor. For details, see \"Installment Payments on CyberSource through VisaNet\" in the [Credit Card Services Using the SCMP API Guide.](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/) This field is supported only for Crediario installment payments in Brazil on CyberSource through VisaNet. The value for this field corresponds to the following data in the TC 33 capture file: - Record: CP01 TCR9 - Position: 42-47 - Field: Date of First Installment
21
+ attr_accessor :first_installment_date
22
+
23
+ # Standing Instruction/Installment identifier.
24
+ attr_accessor :identifier
25
+
26
+ # End date of the SI transactions. Cannot be later than card expiry date. Ideally this can be set to expiry date. Required in case the authentication is initiated for SI registration.
27
+ attr_accessor :last_installment_date
28
+
29
+ # Maximum Amount for which SI can be initiated. Required in case the authentication is initiated for SI registration.
30
+ attr_accessor :max_amount
31
+
32
+ # Minimum Amount for which SI can be initiated. Required in case the authentication is initiated for SI registration.
33
+ attr_accessor :min_amount
34
+
35
+ # Payment plan for the installments. Possible values: - 0 (default): Regular installment. This value is not allowed for airline transactions. - 1: Installment payment with down payment. - 2: Installment payment without down payment. This value is supported only for airline transactions. - 3: Installment payment; down payment and boarding fee will follow. This value is supported only for airline transactions. - 4: Down payment only; regular installment payment will follow. - 5: Boarding fee only. This value is supported only for airline transactions. This field is supported only for installment payments with Visa on CyberSource through VisaNet in Brazil. For details, see \"Installment Payments on CyberSource through VisaNet\" in the [Credit Card Services Using the SCMP API Guide.](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/) The value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR1 - Position: 9 - Field: Merchant Installment Supporting Information
36
+ attr_accessor :payment_type
37
+
38
+ # Preferred date for initiating the SI transaction every month. This field need not be sent in case the SI has to be initiated as and when required, e.g., topping up the wallet, etc.
39
+ attr_accessor :preferred_day
40
+
41
+ # Installment number when making payments in installments. Used along with `totalCount` to track which payment is being processed. For example, the second of 5 payments would be passed to CyberSource as `sequence` = 2 and `totalCount` = 5. For details, see \"Installment Payments\" in the [Credit Card Services Using the SCMP API Guide](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/) #### Chase Paymentech Solutions and FDC Compass This field is optional because this value is required in the merchant descriptors. For details, see \"Chase Paymentech Solutions Merchant Descriptors\" and \"FDC Compass Merchant Descriptors\" in the [Merchant Descriptors Using the SCMP API] (https://apps.cybersource.com/library/documentation/dev_guides/Merchant_Descriptors_SCMP_API/html/) #### CyberSource through VisaNet When you do not include this field in a request for a Crediario installment payment, CyberSource sends a value of 0 to the processor. For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP01 TCR9 - Position: 38-40 - Field: Installment Payment Number * The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant’s acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies.
42
+ attr_accessor :sequence
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'alert_preference' => :'alertPreference',
48
+ :'first_installment_date' => :'firstInstallmentDate',
49
+ :'identifier' => :'identifier',
50
+ :'last_installment_date' => :'lastInstallmentDate',
51
+ :'max_amount' => :'maxAmount',
52
+ :'min_amount' => :'minAmount',
53
+ :'payment_type' => :'paymentType',
54
+ :'preferred_day' => :'preferredDay',
55
+ :'sequence' => :'sequence'
56
+ }
57
+ end
58
+
59
+ # Attribute mapping from JSON key to ruby-style variable name.
60
+ def self.json_map
61
+ {
62
+ :'alert_preference' => :'alert_preference',
63
+ :'first_installment_date' => :'first_installment_date',
64
+ :'identifier' => :'identifier',
65
+ :'last_installment_date' => :'last_installment_date',
66
+ :'max_amount' => :'max_amount',
67
+ :'min_amount' => :'min_amount',
68
+ :'payment_type' => :'payment_type',
69
+ :'preferred_day' => :'preferred_day',
70
+ :'sequence' => :'sequence'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'alert_preference' => :'String',
78
+ :'first_installment_date' => :'String',
79
+ :'identifier' => :'String',
80
+ :'last_installment_date' => :'String',
81
+ :'max_amount' => :'String',
82
+ :'min_amount' => :'String',
83
+ :'payment_type' => :'String',
84
+ :'preferred_day' => :'String',
85
+ :'sequence' => :'Integer'
86
+ }
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ return unless attributes.is_a?(Hash)
93
+
94
+ # convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
96
+
97
+ if attributes.has_key?(:'alertPreference')
98
+ self.alert_preference = attributes[:'alertPreference']
99
+ end
100
+
101
+ if attributes.has_key?(:'firstInstallmentDate')
102
+ self.first_installment_date = attributes[:'firstInstallmentDate']
103
+ end
104
+
105
+ if attributes.has_key?(:'identifier')
106
+ self.identifier = attributes[:'identifier']
107
+ end
108
+
109
+ if attributes.has_key?(:'lastInstallmentDate')
110
+ self.last_installment_date = attributes[:'lastInstallmentDate']
111
+ end
112
+
113
+ if attributes.has_key?(:'maxAmount')
114
+ self.max_amount = attributes[:'maxAmount']
115
+ end
116
+
117
+ if attributes.has_key?(:'minAmount')
118
+ self.min_amount = attributes[:'minAmount']
119
+ end
120
+
121
+ if attributes.has_key?(:'paymentType')
122
+ self.payment_type = attributes[:'paymentType']
123
+ end
124
+
125
+ if attributes.has_key?(:'preferredDay')
126
+ self.preferred_day = attributes[:'preferredDay']
127
+ end
128
+
129
+ if attributes.has_key?(:'sequence')
130
+ self.sequence = attributes[:'sequence']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] alert_preference Value to be assigned
149
+ def alert_preference=(alert_preference)
150
+ @alert_preference = alert_preference
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] first_installment_date Value to be assigned
155
+ def first_installment_date=(first_installment_date)
156
+ @first_installment_date = first_installment_date
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] last_installment_date Value to be assigned
161
+ def last_installment_date=(last_installment_date)
162
+ @last_installment_date = last_installment_date
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] max_amount Value to be assigned
167
+ def max_amount=(max_amount)
168
+ @max_amount = max_amount
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] min_amount Value to be assigned
173
+ def min_amount=(min_amount)
174
+ @min_amount = min_amount
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] payment_type Value to be assigned
179
+ def payment_type=(payment_type)
180
+ @payment_type = payment_type
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] preferred_day Value to be assigned
185
+ def preferred_day=(preferred_day)
186
+ @preferred_day = preferred_day
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] sequence Value to be assigned
191
+ def sequence=(sequence)
192
+ @sequence = sequence
193
+ end
194
+
195
+ # Checks equality by comparing each attribute.
196
+ # @param [Object] Object to be compared
197
+ def ==(o)
198
+ return true if self.equal?(o)
199
+ self.class == o.class &&
200
+ alert_preference == o.alert_preference &&
201
+ first_installment_date == o.first_installment_date &&
202
+ identifier == o.identifier &&
203
+ last_installment_date == o.last_installment_date &&
204
+ max_amount == o.max_amount &&
205
+ min_amount == o.min_amount &&
206
+ payment_type == o.payment_type &&
207
+ preferred_day == o.preferred_day &&
208
+ sequence == o.sequence
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Fixnum] Hash code
219
+ def hash
220
+ [alert_preference, first_installment_date, identifier, last_installment_date, max_amount, min_amount, payment_type, preferred_day, sequence].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ self.class.swagger_types.each_pair do |key, type|
229
+ if type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
233
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
234
+ end
235
+ elsif !attributes[self.class.attribute_map[key]].nil?
236
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
237
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
238
+ end
239
+
240
+ self
241
+ end
242
+
243
+ # Deserializes the data based on type
244
+ # @param string type Data type
245
+ # @param string value Value to be deserialized
246
+ # @return [Object] Deserialized data
247
+ def _deserialize(type, value)
248
+ case type.to_sym
249
+ when :DateTime
250
+ DateTime.parse(value)
251
+ when :Date
252
+ Date.parse(value)
253
+ when :String
254
+ value.to_s
255
+ when :Integer
256
+ value.to_i
257
+ when :Float
258
+ value.to_f
259
+ when :BOOLEAN
260
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
261
+ true
262
+ else
263
+ false
264
+ end
265
+ when :Object
266
+ # generic object (usually a Hash), return directly
267
+ value
268
+ when /\AArray<(?<inner_type>.+)>\z/
269
+ inner_type = Regexp.last_match[:inner_type]
270
+ value.map { |v| _deserialize(inner_type, v) }
271
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
272
+ k_type = Regexp.last_match[:k_type]
273
+ v_type = Regexp.last_match[:v_type]
274
+ {}.tap do |hash|
275
+ value.each do |k, v|
276
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
277
+ end
278
+ end
279
+ else # model
280
+ temp_model = CyberSource.const_get(type).new
281
+ temp_model.build_from_hash(value)
282
+ end
283
+ end
284
+
285
+ # Returns the string representation of the object
286
+ # @return [String] String presentation of the object
287
+ def to_s
288
+ to_hash.to_s
289
+ end
290
+
291
+ # to_body is an alias to to_hash (backward compatibility)
292
+ # @return [Hash] Returns the object in the form of hash
293
+ def to_body
294
+ to_hash
295
+ end
296
+
297
+ # Returns the object in the form of hash
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_hash
300
+ hash = {}
301
+ self.class.attribute_map.each_pair do |attr, param|
302
+ value = self.send(attr)
303
+ next if value.nil?
304
+ hash[param] = _to_hash(value)
305
+ end
306
+ hash
307
+ end
308
+
309
+ # Outputs non-array value in the form of hash
310
+ # For object, use to_hash. Otherwise, just return the value
311
+ # @param [Object] value Any valid value
312
+ # @return [Hash] Returns the value in the form of hash
313
+ def _to_hash(value)
314
+ if value.is_a?(Array)
315
+ value.compact.map { |v| _to_hash(v) }
316
+ elsif value.is_a?(Hash)
317
+ {}.tap do |hash|
318
+ value.each { |k, v| hash[k] = _to_hash(v) }
319
+ end
320
+ elsif value.respond_to? :to_hash
321
+ value.to_hash
322
+ else
323
+ value
324
+ end
325
+ end
326
+ end
327
+ end