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,195 @@
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
+ # A GET link to the payment instrument supplied in the OCT
17
+ class PushFunds201ResponseLinksPaymentInstrument
18
+ # This is the endpoint of the resource that was created by the successful request.
19
+ attr_accessor :href
20
+
21
+ # `method` refers to the HTTP method that you can send to the `self` endpoint to retrieve details of the resource.
22
+ attr_accessor :method
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'href' => :'href',
28
+ :'method' => :'method'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'href' => :'String',
36
+ :'method' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'href')
49
+ self.href = attributes[:'href']
50
+ end
51
+
52
+ if attributes.has_key?(:'method')
53
+ self.method = attributes[:'method']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ href == o.href &&
76
+ method == o.method
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [href, method].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CyberSource.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+ end
195
+ end
@@ -0,0 +1,195 @@
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
+ # A GET link to the OCT
17
+ class PushFunds201ResponseLinksSelf
18
+ # This is the endpoint of the resource that was created by the successful request.
19
+ attr_accessor :href
20
+
21
+ # `method` refers to the HTTP method that you can send to the `self` endpoint to retrieve details of the resource.
22
+ attr_accessor :method
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'href' => :'href',
28
+ :'method' => :'method'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'href' => :'String',
36
+ :'method' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'href')
49
+ self.href = attributes[:'href']
50
+ end
51
+
52
+ if attributes.has_key?(:'method')
53
+ self.method = attributes[:'method']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ href == o.href &&
76
+ method == o.method
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [href, method].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CyberSource.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+ end
195
+ 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 PushFunds201ResponseClientReferenceInformation
17
+ # Merchant-generated order reference or tracking number. It is recommended that you send a unique value for each transaction so that you can perform meaningful searches for the transaction.
18
+ attr_accessor :code
19
+
20
+ # Date and time at your physical location. Format: YYYYMMDDhhmmss, where YYYY = year, MM = month, DD = day, hh = hour, mm = minutes ss = seconds
21
+ attr_accessor :submit_local_date_time
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'code' => :'code',
27
+ :'submit_local_date_time' => :'submitLocalDateTime'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'code' => :'String',
35
+ :'submit_local_date_time' => :'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?(:'code')
48
+ self.code = attributes[:'code']
49
+ end
50
+
51
+ if attributes.has_key?(:'submitLocalDateTime')
52
+ self.submit_local_date_time = attributes[:'submitLocalDateTime']
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] code Value to be assigned
71
+ def code=(code)
72
+ @code = code
73
+ end
74
+
75
+ # Custom attribute writer method with validation
76
+ # @param [Object] submit_local_date_time Value to be assigned
77
+ def submit_local_date_time=(submit_local_date_time)
78
+ @submit_local_date_time = submit_local_date_time
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
+ code == o.code &&
87
+ submit_local_date_time == o.submit_local_date_time
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
+ [code, submit_local_date_time].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