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,214 @@
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 PtsV2CreditsPost201Response1ProcessorInformation
17
+ # Authorization code. Returned only when the processor returns this value. The length of this value depends on your processor. Returned by authorization service. #### PIN debit Authorization code that is returned by the processor. Returned by PIN debit credit. #### Elavon Encrypted Account Number Program The returned value is OFFLINE. #### TSYS Acquiring Solutions The returned value for a successful zero amount authorization is 000000.
18
+ attr_accessor :approval_code
19
+
20
+ # For most processors, this is the error message sent directly from the bank. Returned only when the processor returns this value. **Important** Do not use this field to evaluate the result of the authorization. #### PIN debit Response value that is returned by the processor or bank. **Important** Do not use this field to evaluate the results of the transaction request. Returned by PIN debit credit, PIN debit purchase, and PIN debit reversal. #### AIBMS If this value is `08`, you can accept the transaction if the customer provides you with identification. #### Atos This value is the response code sent from Atos and it might also include the response code from the bank. Format: `aa,bb` with the two values separated by a comma and where: - `aa` is the two-digit error message from Atos. - `bb` is the optional two-digit error message from the bank. #### Comercio Latino This value is the status code and the error or response code received from the processor separated by a colon. Format: [status code]:E[error code] or [status code]:R[response code] Example `2:R06` #### JCN Gateway Processor-defined detail error code. The associated response category code is in the `processorInformation.responseCategoryCode` field. String (3)
21
+ attr_accessor :response_code
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'approval_code' => :'approvalCode',
27
+ :'response_code' => :'responseCode'
28
+ }
29
+ end
30
+
31
+ # Attribute mapping from JSON key to ruby-style variable name.
32
+ def self.json_map
33
+ {
34
+ :'approval_code' => :'approval_code',
35
+ :'response_code' => :'response_code'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'approval_code' => :'String',
43
+ :'response_code' => :'String'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
54
+
55
+ if attributes.has_key?(:'approvalCode')
56
+ self.approval_code = attributes[:'approvalCode']
57
+ end
58
+
59
+ if attributes.has_key?(:'responseCode')
60
+ self.response_code = attributes[:'responseCode']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Custom attribute writer method with validation
78
+ # @param [Object] approval_code Value to be assigned
79
+ def approval_code=(approval_code)
80
+ @approval_code = approval_code
81
+ end
82
+
83
+ # Custom attribute writer method with validation
84
+ # @param [Object] response_code Value to be assigned
85
+ def response_code=(response_code)
86
+ @response_code = response_code
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ approval_code == o.approval_code &&
95
+ response_code == o.response_code
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [approval_code, response_code].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = CyberSource.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,207 @@
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 Ptsv2billingagreementsAggregatorInformation
17
+ # Your payment aggregator business name. **American Express Direct**\\ The maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters.\\ #### CyberSource through VisaNet With American Express, the maximum length of the aggregator name depends on the length of the sub-merchant name. The combined length for both values must not exceed 36 characters. The value for this field does not map to the TC 33 capture file5. **FDC Compass**\\ This value must consist of uppercase characters. For processor-specific information, see the aggregator_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
+ attr_accessor :sub_merchant
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'name' => :'name',
26
+ :'sub_merchant' => :'subMerchant'
27
+ }
28
+ end
29
+
30
+ # Attribute mapping from JSON key to ruby-style variable name.
31
+ def self.json_map
32
+ {
33
+ :'name' => :'name',
34
+ :'sub_merchant' => :'sub_merchant'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'name' => :'String',
42
+ :'sub_merchant' => :'Ptsv2paymentsAggregatorInformationSubMerchant'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
53
+
54
+ if attributes.has_key?(:'name')
55
+ self.name = attributes[:'name']
56
+ end
57
+
58
+ if attributes.has_key?(:'subMerchant')
59
+ self.sub_merchant = attributes[:'subMerchant']
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param [Object] name Value to be assigned
78
+ def name=(name)
79
+ @name = name
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ name == o.name &&
88
+ sub_merchant == o.sub_merchant
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [name, sub_merchant].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = CyberSource.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,242 @@
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 Ptsv2billingagreementsConsumerAuthenticationInformation
17
+ # Payer authentication transaction identifier passed to link the validation and authorization calls.
18
+ attr_accessor :authentication_transaction_context_id
19
+
20
+ # Unique identifier generated by the card-issuing bank for Visa, American Express, JCB, Diners Club, and Discover transactions after the customer is authenticated. The value is in base64. When you request the card authorization service, CyberSource automatically converts the value, not the field name, to the format required by your payment processor.
21
+ attr_accessor :cavv
22
+
23
+ # Web based token used to authenticate consumer with Rupay authentication provider.
24
+ attr_accessor :transaction_token
25
+
26
+ # Transaction identifier generated by CyberSource for successful enrollment or validation checks. Use this value, which is in base64, to match an outgoing PAReq with an incoming PARes. CyberSource forwards the XID with the card authorization service to these payment processors in these cases: - Barclays - Streamline (when the **ecommerceIndicator**`=spa`)
27
+ attr_accessor :xid
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'authentication_transaction_context_id' => :'authenticationTransactionContextId',
33
+ :'cavv' => :'cavv',
34
+ :'transaction_token' => :'transactionToken',
35
+ :'xid' => :'xid'
36
+ }
37
+ end
38
+
39
+ # Attribute mapping from JSON key to ruby-style variable name.
40
+ def self.json_map
41
+ {
42
+ :'authentication_transaction_context_id' => :'authentication_transaction_context_id',
43
+ :'cavv' => :'cavv',
44
+ :'transaction_token' => :'transaction_token',
45
+ :'xid' => :'xid'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'authentication_transaction_context_id' => :'String',
53
+ :'cavv' => :'String',
54
+ :'transaction_token' => :'String',
55
+ :'xid' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'authenticationTransactionContextId')
68
+ self.authentication_transaction_context_id = attributes[:'authenticationTransactionContextId']
69
+ end
70
+
71
+ if attributes.has_key?(:'cavv')
72
+ self.cavv = attributes[:'cavv']
73
+ end
74
+
75
+ if attributes.has_key?(:'transactionToken')
76
+ self.transaction_token = attributes[:'transactionToken']
77
+ end
78
+
79
+ if attributes.has_key?(:'xid')
80
+ self.xid = attributes[:'xid']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] authentication_transaction_context_id Value to be assigned
99
+ def authentication_transaction_context_id=(authentication_transaction_context_id)
100
+ @authentication_transaction_context_id = authentication_transaction_context_id
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] cavv Value to be assigned
105
+ def cavv=(cavv)
106
+ @cavv = cavv
107
+ end
108
+
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] transaction_token Value to be assigned
111
+ def transaction_token=(transaction_token)
112
+ @transaction_token = transaction_token
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ authentication_transaction_context_id == o.authentication_transaction_context_id &&
121
+ cavv == o.cavv &&
122
+ transaction_token == o.transaction_token &&
123
+ xid == o.xid
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [authentication_transaction_context_id, cavv, transaction_token, xid].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.swagger_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :BOOLEAN
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ temp_model = CyberSource.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+ end
242
+ end