cybersource_rest_client 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/payments_api.rb +71 -0
  3. data/lib/cybersource_rest_client/api/push_funds_api.rb +131 -0
  4. data/lib/cybersource_rest_client/models/invoicingv2invoices_order_information_amount_details_tax_details.rb +2 -2
  5. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +262 -0
  6. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_risk_information_providers_provider_name.rb → pts_v2_payments_post201_response_1_order_information.rb} +14 -19
  7. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_bill_to.rb +344 -0
  8. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information_ship_to.rb +318 -0
  9. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information.rb +201 -0
  10. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_risk_information_providers.rb → pts_v2_payments_post201_response_1_payment_information_bank.rb} +8 -10
  11. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_bank_account.rb +184 -0
  12. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_payment_type.rb +183 -0
  13. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_payment_information_payment_type_method.rb +184 -0
  14. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +238 -0
  15. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information_avs.rb +190 -0
  16. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information_seller_protection.rb +184 -0
  17. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +22 -4
  18. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_risk_information.rb +5 -2
  19. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +1 -1
  20. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_client_reference_information.rb +226 -0
  21. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_refund_amount_details.rb +17 -1
  22. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_aggregator_information.rb +215 -0
  23. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_aggregator_information_sub_merchant.rb +318 -0
  24. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_client_reference_information.rb +238 -0
  25. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_defined_information.rb +206 -0
  26. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_information.rb +225 -0
  27. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_merchant_information_merchant_descriptor.rb +270 -0
  28. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information.rb +208 -0
  29. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information_amount_details.rb +224 -0
  30. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_order_information_surcharge.rb +190 -0
  31. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_point_of_service_information.rb +236 -0
  32. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +297 -0
  33. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information_payouts_options.rb +206 -0
  34. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information_recurring_options.rb +184 -0
  35. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options.rb +183 -0
  36. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options_funding_options.rb +183 -0
  37. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_options_funding_options_initiator.rb +190 -0
  38. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information.rb +384 -0
  39. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information.rb +183 -0
  40. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card.rb +281 -0
  41. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_customer.rb +190 -0
  42. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_instrument_identifier.rb +190 -0
  43. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_payment_information_card_payment_instrument.rb +190 -0
  44. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_recipient_information_personal_identification.rb +206 -0
  45. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information.rb +425 -0
  46. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_account.rb +206 -0
  47. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_payment_information.rb +183 -0
  48. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_payment_information_card.rb +270 -0
  49. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_sender_information_personal_identification.rb +222 -0
  50. data/lib/cybersource_rest_client/models/ptsv2payments_device_information.rb +11 -1
  51. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +17 -1
  52. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_tax_details.rb +2 -2
  53. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +30 -4
  54. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +21 -1
  55. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +20 -4
  56. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type.rb +2 -12
  57. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_payment_type_method.rb +15 -5
  58. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +12 -2
  59. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information.rb +63 -4
  60. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information_personal_identification.rb +190 -0
  61. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_bill_to.rb +65 -1
  62. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_client_reference_information.rb +297 -0
  63. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +2 -2
  64. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_bank.rb +14 -4
  65. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +36 -4
  66. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_e_wallet.rb +190 -0
  67. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_payment_type.rb +203 -0
  68. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_payment_type_method.rb +184 -0
  69. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +35 -4
  70. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information_refund_options.rb +184 -0
  71. data/lib/cybersource_rest_client/models/ptsv2paymentsidvoids_payment_information.rb +1 -1
  72. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_agreement_information.rb +184 -0
  73. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_client_reference_information.rb +206 -0
  74. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_payment_information.rb +192 -0
  75. data/lib/cybersource_rest_client/models/{tss_v2_transactions_post201_response__embedded_payment_information_customer.rb → ptsv2refreshpaymentstatusid_payment_information_customer.rb} +1 -1
  76. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_payment_information_payment_type.rb +193 -0
  77. data/lib/cybersource_rest_client/models/ptsv2refreshpaymentstatusid_processing_information.rb +186 -0
  78. data/lib/cybersource_rest_client/models/push_funds201_response.rb +301 -0
  79. data/lib/cybersource_rest_client/models/push_funds201_response__links.rb +210 -0
  80. data/lib/cybersource_rest_client/models/push_funds201_response__links_customer.rb +195 -0
  81. data/lib/cybersource_rest_client/models/push_funds201_response__links_instrument_identifier.rb +195 -0
  82. data/lib/cybersource_rest_client/models/push_funds201_response__links_payment_instrument.rb +195 -0
  83. data/lib/cybersource_rest_client/models/push_funds201_response__links_self.rb +195 -0
  84. data/lib/cybersource_rest_client/models/push_funds201_response_client_reference_information.rb +206 -0
  85. data/lib/cybersource_rest_client/models/push_funds201_response_error_information.rb +217 -0
  86. data/lib/cybersource_rest_client/models/push_funds201_response_error_information_details.rb +206 -0
  87. data/lib/cybersource_rest_client/models/push_funds201_response_merchant_information.rb +183 -0
  88. data/lib/cybersource_rest_client/models/push_funds201_response_merchant_information_merchant_descriptor.rb +222 -0
  89. data/lib/cybersource_rest_client/models/push_funds201_response_order_information.rb +183 -0
  90. data/lib/cybersource_rest_client/models/push_funds201_response_order_information_amount_details.rb +247 -0
  91. data/lib/cybersource_rest_client/models/push_funds201_response_processor_information.rb +264 -0
  92. data/lib/cybersource_rest_client/models/push_funds201_response_recipient_information.rb +183 -0
  93. data/lib/cybersource_rest_client/models/push_funds201_response_recipient_information_card.rb +206 -0
  94. data/lib/cybersource_rest_client/models/push_funds400_response.rb +247 -0
  95. data/lib/cybersource_rest_client/models/push_funds400_response_details.rb +194 -0
  96. data/lib/cybersource_rest_client/models/push_funds401_response.rb +226 -0
  97. data/lib/cybersource_rest_client/models/push_funds404_response.rb +226 -0
  98. data/lib/cybersource_rest_client/models/push_funds502_response.rb +236 -0
  99. data/lib/cybersource_rest_client/models/push_funds_request.rb +264 -0
  100. data/lib/cybersource_rest_client/models/refresh_payment_status_request.rb +210 -0
  101. data/lib/cybersource_rest_client/models/refund_capture_request.rb +1 -1
  102. data/lib/cybersource_rest_client/models/refund_payment_request.rb +1 -1
  103. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +1 -1
  104. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information.rb +1 -1
  105. data/lib/cybersource_rest_client.rb +77 -3
  106. metadata +79 -5
@@ -0,0 +1,217 @@
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 PushFunds201ResponseErrorInformation
17
+ # The reason of the status. Possible values: - CONTACT_PROCESSOR - INVALID_MERCHANT_CONFIGURATION - STOLEN_LOST_CARD - PROCESSOR_DECLINED - PARTIAL_APPROVAL - PAYMENT_REFUSED - INVALID_ACCOUNT - ISSUER_UNAVAILABLE - INSUFFICIENT_FUND - EXPIRED_CARD - INVALID_PIN - UNAUTHORIZED_CARD - EXCEEDS_CREDIT_LIMIT - DEBIT_CARD_USAGE_LIMIT_EXCEEDED - CVN_NOT_MATCH - DUPLICATE_REQUEST - GENERAL_DECLINE - BLACKLISTED_CUSTOMER - GATEWAY_TIMEOUT - INVALID_DATA - SYSTEM_ERROR - SERVICE_UNAVAILABLE - GATEWAY_TIMEOUT
18
+ attr_accessor :reason
19
+
20
+ # The detail message related to the status and reason listed above.
21
+ attr_accessor :message
22
+
23
+ attr_accessor :details
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'reason' => :'reason',
29
+ :'message' => :'message',
30
+ :'details' => :'details'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'reason' => :'String',
38
+ :'message' => :'String',
39
+ :'details' => :'Array<PushFunds201ResponseErrorInformationDetails>'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'reason')
52
+ self.reason = attributes[:'reason']
53
+ end
54
+
55
+ if attributes.has_key?(:'message')
56
+ self.message = attributes[:'message']
57
+ end
58
+
59
+ if attributes.has_key?(:'details')
60
+ if (value = attributes[:'details']).is_a?(Array)
61
+ self.details = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Custom attribute writer method with validation
80
+ # @param [Object] reason Value to be assigned
81
+ def reason=(reason)
82
+ @reason = reason
83
+ end
84
+
85
+ # Custom attribute writer method with validation
86
+ # @param [Object] message Value to be assigned
87
+ def message=(message)
88
+ @message = message
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ reason == o.reason &&
97
+ message == o.message &&
98
+ details == o.details
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
109
+ def hash
110
+ [reason, message, details].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.swagger_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ temp_model = CyberSource.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,206 @@
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 PushFunds201ResponseErrorInformationDetails
17
+ # This is the flattened JSON object field name/path that is either missing or invalid.
18
+ attr_accessor :field
19
+
20
+ # Possible reasons for the status Possible values: - MISSING_FIELD - INVALID_DATA
21
+ attr_accessor :reason
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'field' => :'field',
27
+ :'reason' => :'reason'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'field' => :'String',
35
+ :'reason' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'field')
48
+ self.field = attributes[:'field']
49
+ end
50
+
51
+ if attributes.has_key?(:'reason')
52
+ self.reason = attributes[:'reason']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Custom attribute writer method with validation
70
+ # @param [Object] field Value to be assigned
71
+ def field=(field)
72
+ @field = field
73
+ end
74
+
75
+ # Custom attribute writer method with validation
76
+ # @param [Object] reason Value to be assigned
77
+ def reason=(reason)
78
+ @reason = reason
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ field == o.field &&
87
+ reason == o.reason
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [field, reason].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = CyberSource.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,183 @@
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 PushFunds201ResponseMerchantInformation
17
+ attr_accessor :merchant_descriptor
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'merchant_descriptor' => :'merchantDescriptor'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'merchant_descriptor' => :'PushFunds201ResponseMerchantInformationMerchantDescriptor'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'merchantDescriptor')
42
+ self.merchant_descriptor = attributes[:'merchantDescriptor']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ invalid_properties
51
+ end
52
+
53
+ # Check to see if the all the properties in the model are valid
54
+ # @return true if the model is valid
55
+ def valid?
56
+ true
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(o)
62
+ return true if self.equal?(o)
63
+ self.class == o.class &&
64
+ merchant_descriptor == o.merchant_descriptor
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(o)
70
+ self == o
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Fixnum] Hash code
75
+ def hash
76
+ [merchant_descriptor].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ self.class.swagger_types.each_pair do |key, type|
85
+ if type =~ /\AArray<(.*)>/i
86
+ # check to ensure the input is an array given that the the attribute
87
+ # is documented as an array but the input is not
88
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
89
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
90
+ end
91
+ elsif !attributes[self.class.attribute_map[key]].nil?
92
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+
96
+ self
97
+ end
98
+
99
+ # Deserializes the data based on type
100
+ # @param string type Data type
101
+ # @param string value Value to be deserialized
102
+ # @return [Object] Deserialized data
103
+ def _deserialize(type, value)
104
+ case type.to_sym
105
+ when :DateTime
106
+ DateTime.parse(value)
107
+ when :Date
108
+ Date.parse(value)
109
+ when :String
110
+ value.to_s
111
+ when :Integer
112
+ value.to_i
113
+ when :Float
114
+ value.to_f
115
+ when :BOOLEAN
116
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
+ true
118
+ else
119
+ false
120
+ end
121
+ when :Object
122
+ # generic object (usually a Hash), return directly
123
+ value
124
+ when /\AArray<(?<inner_type>.+)>\z/
125
+ inner_type = Regexp.last_match[:inner_type]
126
+ value.map { |v| _deserialize(inner_type, v) }
127
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
128
+ k_type = Regexp.last_match[:k_type]
129
+ v_type = Regexp.last_match[:v_type]
130
+ {}.tap do |hash|
131
+ value.each do |k, v|
132
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
133
+ end
134
+ end
135
+ else # model
136
+ temp_model = CyberSource.const_get(type).new
137
+ temp_model.build_from_hash(value)
138
+ end
139
+ end
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # to_body is an alias to to_hash (backward compatibility)
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_body
150
+ to_hash
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ next if value.nil?
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+ end
183
+ end