first_data_gateway 1.0.1
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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +123 -0
- data/Rakefile +8 -0
- data/docs/AccessTokenResponse.md +11 -0
- data/docs/Address.md +14 -0
- data/docs/Airline.md +21 -0
- data/docs/AirlineAncillaryServiceCategory.md +8 -0
- data/docs/AirlineTravelRoute.md +16 -0
- data/docs/Amount.md +10 -0
- data/docs/AmountComponents.md +14 -0
- data/docs/AuthenticationApi.md +68 -0
- data/docs/AuthenticationResponseVerification.md +10 -0
- data/docs/BasketItem.md +11 -0
- data/docs/Billing.md +13 -0
- data/docs/CarRental.md +15 -0
- data/docs/CarRentalExtraCharges.md +8 -0
- data/docs/CardVerificationsTransaction.md +9 -0
- data/docs/ClientLocale.md +9 -0
- data/docs/Contact.md +11 -0
- data/docs/Error.md +10 -0
- data/docs/ErrorDetails.md +9 -0
- data/docs/ErrorResponse.md +11 -0
- data/docs/Expiration.md +9 -0
- data/docs/Frequency.md +9 -0
- data/docs/IndustrySpecificExtensions.md +10 -0
- data/docs/InstallmentOptions.md +10 -0
- data/docs/Lodging.md +12 -0
- data/docs/LodgingExtraCharges.md +8 -0
- data/docs/Order.md +10 -0
- data/docs/OrderApi.md +148 -0
- data/docs/PayPal.md +8 -0
- data/docs/PaymentApi.md +345 -0
- data/docs/PaymentCard.md +15 -0
- data/docs/PaymentCardAuthenticationRequest.md +8 -0
- data/docs/PaymentCardAuthenticationResult.md +12 -0
- data/docs/PaymentMethod.md +11 -0
- data/docs/PaymentSchedulesRequest.md +21 -0
- data/docs/PaymentSchedulesResponse.md +11 -0
- data/docs/PaymentUrlRequest.md +11 -0
- data/docs/PaymentUrlResponse.md +13 -0
- data/docs/PrimaryTransaction.md +18 -0
- data/docs/PrimaryTransactionAdditionalDetails.md +14 -0
- data/docs/ProcessorData.md +10 -0
- data/docs/ResponseType.md +7 -0
- data/docs/SecondaryTransaction.md +9 -0
- data/docs/Sepa.md +12 -0
- data/docs/SepaMandate.md +11 -0
- data/docs/Shipping.md +10 -0
- data/docs/SplitShipment.md +9 -0
- data/docs/StoredCredential.md +11 -0
- data/docs/TransactionErrorResponse.md +28 -0
- data/docs/TransactionResponse.md +27 -0
- data/docs/TransactionResponseAuthenticationRedirect.md +10 -0
- data/docs/TransactionResponseAuthenticationRedirectParams.md +10 -0
- data/docs/TransactionType.md +7 -0
- data/first_data_gateway.gemspec +45 -0
- data/git_push.sh +55 -0
- data/lib/simple/client_context.rb +15 -0
- data/lib/simple/gateway.rb +155 -0
- data/lib/simple/merchant_credentials.rb +10 -0
- data/lib/simple/signature.rb +52 -0
- data/lib/simple_client.rb +4 -0
- data/lib/swagger_client.rb +91 -0
- data/lib/swagger_client/api/authentication_api.rb +111 -0
- data/lib/swagger_client/api/order_api.rb +229 -0
- data/lib/swagger_client/api/payment_api.rb +517 -0
- data/lib/swagger_client/api_client.rb +390 -0
- data/lib/swagger_client/api_error.rb +38 -0
- data/lib/swagger_client/configuration.rb +202 -0
- data/lib/swagger_client/models/access_token_response.rb +252 -0
- data/lib/swagger_client/models/address.rb +361 -0
- data/lib/swagger_client/models/airline.rb +487 -0
- data/lib/swagger_client/models/airline_ancillary_service_category.rb +221 -0
- data/lib/swagger_client/models/airline_travel_route.rb +406 -0
- data/lib/swagger_client/models/amount.rb +217 -0
- data/lib/swagger_client/models/amount_components.rb +242 -0
- data/lib/swagger_client/models/authentication_response_verification.rb +239 -0
- data/lib/swagger_client/models/basket_item.rb +218 -0
- data/lib/swagger_client/models/billing.rb +282 -0
- data/lib/swagger_client/models/car_rental.rb +317 -0
- data/lib/swagger_client/models/car_rental_extra_charges.rb +221 -0
- data/lib/swagger_client/models/card_verifications_transaction.rb +203 -0
- data/lib/swagger_client/models/client_locale.rb +209 -0
- data/lib/swagger_client/models/contact.rb +279 -0
- data/lib/swagger_client/models/error.rb +211 -0
- data/lib/swagger_client/models/error_details.rb +199 -0
- data/lib/swagger_client/models/error_response.rb +218 -0
- data/lib/swagger_client/models/expiration.rb +207 -0
- data/lib/swagger_client/models/frequency.rb +270 -0
- data/lib/swagger_client/models/industry_specific_extensions.rb +206 -0
- data/lib/swagger_client/models/installment_options.rb +259 -0
- data/lib/swagger_client/models/lodging.rb +245 -0
- data/lib/swagger_client/models/lodging_extra_charges.rb +221 -0
- data/lib/swagger_client/models/order.rb +206 -0
- data/lib/swagger_client/models/pay_pal.rb +213 -0
- data/lib/swagger_client/models/payment_card.rb +294 -0
- data/lib/swagger_client/models/payment_card_authentication_request.rb +222 -0
- data/lib/swagger_client/models/payment_card_authentication_result.rb +336 -0
- data/lib/swagger_client/models/payment_method.rb +254 -0
- data/lib/swagger_client/models/payment_schedules_request.rb +398 -0
- data/lib/swagger_client/models/payment_schedules_response.rb +267 -0
- data/lib/swagger_client/models/payment_url_request.rb +232 -0
- data/lib/swagger_client/models/payment_url_response.rb +286 -0
- data/lib/swagger_client/models/primary_transaction.rb +298 -0
- data/lib/swagger_client/models/primary_transaction_additional_details.rb +244 -0
- data/lib/swagger_client/models/processor_data.rb +216 -0
- data/lib/swagger_client/models/response_type.rb +37 -0
- data/lib/swagger_client/models/secondary_transaction.rb +197 -0
- data/lib/swagger_client/models/sepa.rb +321 -0
- data/lib/swagger_client/models/sepa_mandate.rb +321 -0
- data/lib/swagger_client/models/shipping.rb +222 -0
- data/lib/swagger_client/models/split_shipment.rb +201 -0
- data/lib/swagger_client/models/stored_credential.rb +290 -0
- data/lib/swagger_client/models/transaction_error_response.rb +445 -0
- data/lib/swagger_client/models/transaction_response.rb +436 -0
- data/lib/swagger_client/models/transaction_response_authentication_redirect.rb +239 -0
- data/lib/swagger_client/models/transaction_response_authentication_redirect_params.rb +206 -0
- data/lib/swagger_client/models/transaction_type.rb +36 -0
- data/lib/swagger_client/version.rb +15 -0
- data/spec/api/authentication_api_spec.rb +51 -0
- data/spec/api/order_api_spec.rb +73 -0
- data/spec/api/payment_api_spec.rb +126 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_token_response_spec.rb +64 -0
- data/spec/models/address_spec.rb +78 -0
- data/spec/models/airline_ancillary_service_category_spec.rb +46 -0
- data/spec/models/airline_spec.rb +124 -0
- data/spec/models/airline_travel_route_spec.rb +94 -0
- data/spec/models/amount_components_spec.rb +78 -0
- data/spec/models/amount_spec.rb +54 -0
- data/spec/models/authentication_response_verification_spec.rb +58 -0
- data/spec/models/basket_item_spec.rb +60 -0
- data/spec/models/billing_spec.rb +76 -0
- data/spec/models/car_rental_extra_charges_spec.rb +46 -0
- data/spec/models/car_rental_spec.rb +84 -0
- data/spec/models/card_verifications_transaction_spec.rb +48 -0
- data/spec/models/client_locale_spec.rb +48 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/error_details_spec.rb +48 -0
- data/spec/models/error_response_spec.rb +60 -0
- data/spec/models/error_spec.rb +54 -0
- data/spec/models/expiration_spec.rb +48 -0
- data/spec/models/frequency_spec.rb +52 -0
- data/spec/models/industry_specific_extensions_spec.rb +54 -0
- data/spec/models/installment_options_spec.rb +54 -0
- data/spec/models/lodging_extra_charges_spec.rb +46 -0
- data/spec/models/lodging_spec.rb +66 -0
- data/spec/models/order_spec.rb +54 -0
- data/spec/models/pay_pal_spec.rb +42 -0
- data/spec/models/payment_card_authentication_request_spec.rb +46 -0
- data/spec/models/payment_card_authentication_result_spec.rb +78 -0
- data/spec/models/payment_card_spec.rb +88 -0
- data/spec/models/payment_method_spec.rb +64 -0
- data/spec/models/payment_schedules_request_spec.rb +124 -0
- data/spec/models/payment_schedules_response_spec.rb +64 -0
- data/spec/models/payment_url_request_spec.rb +60 -0
- data/spec/models/payment_url_response_spec.rb +76 -0
- data/spec/models/primary_transaction_additional_details_spec.rb +78 -0
- data/spec/models/primary_transaction_spec.rb +102 -0
- data/spec/models/processor_data_spec.rb +54 -0
- data/spec/models/response_type_spec.rb +36 -0
- data/spec/models/secondary_transaction_spec.rb +48 -0
- data/spec/models/sepa_mandate_spec.rb +64 -0
- data/spec/models/sepa_spec.rb +66 -0
- data/spec/models/shipping_spec.rb +54 -0
- data/spec/models/split_shipment_spec.rb +48 -0
- data/spec/models/stored_credential_spec.rb +68 -0
- data/spec/models/transaction_error_response_spec.rb +170 -0
- data/spec/models/transaction_response_authentication_redirect_params_spec.rb +54 -0
- data/spec/models/transaction_response_authentication_redirect_spec.rb +58 -0
- data/spec/models/transaction_response_spec.rb +164 -0
- data/spec/models/transaction_type_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +457 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module SwaggerClient
|
|
16
|
+
|
|
17
|
+
class Shipping
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
attr_accessor :contact
|
|
21
|
+
|
|
22
|
+
attr_accessor :address
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'name' => :'name',
|
|
29
|
+
:'contact' => :'contact',
|
|
30
|
+
:'address' => :'address'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Attribute type mapping.
|
|
35
|
+
def self.swagger_types
|
|
36
|
+
{
|
|
37
|
+
:'name' => :'String',
|
|
38
|
+
:'contact' => :'Contact',
|
|
39
|
+
:'address' => :'Address'
|
|
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?(:'name')
|
|
52
|
+
self.name = attributes[:'name']
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
if attributes.has_key?(:'contact')
|
|
56
|
+
self.contact = attributes[:'contact']
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
if attributes.has_key?(:'address')
|
|
60
|
+
self.address = attributes[:'address']
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
+
# @return Array for valid properties with the reasons
|
|
67
|
+
def list_invalid_properties
|
|
68
|
+
invalid_properties = Array.new
|
|
69
|
+
if !@name.nil? && @name.to_s.length > 96
|
|
70
|
+
invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 96.")
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
return invalid_properties
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Check to see if the all the properties in the model are valid
|
|
77
|
+
# @return true if the model is valid
|
|
78
|
+
def valid?
|
|
79
|
+
return false if !@name.nil? && @name.to_s.length > 96
|
|
80
|
+
return true
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Custom attribute writer method with validation
|
|
84
|
+
# @param [Object] name Value to be assigned
|
|
85
|
+
def name=(name)
|
|
86
|
+
|
|
87
|
+
if !name.nil? && name.to_s.length > 96
|
|
88
|
+
fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 96."
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
@name = name
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
name == o.name &&
|
|
100
|
+
contact == o.contact &&
|
|
101
|
+
address == o.address
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @see the `==` method
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def eql?(o)
|
|
107
|
+
self == o
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Calculates hash code according to all attributes.
|
|
111
|
+
# @return [Fixnum] Hash code
|
|
112
|
+
def hash
|
|
113
|
+
[name, contact, address].hash
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def build_from_hash(attributes)
|
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
|
121
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
122
|
+
if type =~ /\AArray<(.*)>/i
|
|
123
|
+
# check to ensure the input is an array given that the the attribute
|
|
124
|
+
# is documented as an array but the input is not
|
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
127
|
+
end
|
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
self
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Deserializes the data based on type
|
|
137
|
+
# @param string type Data type
|
|
138
|
+
# @param string value Value to be deserialized
|
|
139
|
+
# @return [Object] Deserialized data
|
|
140
|
+
def _deserialize(type, value)
|
|
141
|
+
case type.to_sym
|
|
142
|
+
when :DateTime
|
|
143
|
+
DateTime.parse(value)
|
|
144
|
+
when :Date
|
|
145
|
+
Date.parse(value)
|
|
146
|
+
when :String
|
|
147
|
+
value.to_s
|
|
148
|
+
when :Integer
|
|
149
|
+
value.to_i
|
|
150
|
+
when :Float
|
|
151
|
+
value.to_f
|
|
152
|
+
when :BOOLEAN
|
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
154
|
+
true
|
|
155
|
+
else
|
|
156
|
+
false
|
|
157
|
+
end
|
|
158
|
+
when :Object
|
|
159
|
+
# generic object (usually a Hash), return directly
|
|
160
|
+
value
|
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
|
167
|
+
{}.tap do |hash|
|
|
168
|
+
value.each do |k, v|
|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
else # model
|
|
173
|
+
temp_model = SwaggerClient.const_get(type).new
|
|
174
|
+
temp_model.build_from_hash(value)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Returns the string representation of the object
|
|
179
|
+
# @return [String] String presentation of the object
|
|
180
|
+
def to_s
|
|
181
|
+
to_hash.to_s
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_body
|
|
187
|
+
to_hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
next if value.nil?
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Outputs non-array value in the form of hash
|
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
+
# @param [Object] value Any valid value
|
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
|
206
|
+
def _to_hash(value)
|
|
207
|
+
if value.is_a?(Array)
|
|
208
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
209
|
+
elsif value.is_a?(Hash)
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
+
end
|
|
213
|
+
elsif value.respond_to? :to_hash
|
|
214
|
+
value.to_hash
|
|
215
|
+
else
|
|
216
|
+
value
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module SwaggerClient
|
|
16
|
+
# Split shipment related information, in order to reuse the same authorization
|
|
17
|
+
class SplitShipment
|
|
18
|
+
# Total count of the shipment, can be set at preauth or the first postauth
|
|
19
|
+
attr_accessor :total_count
|
|
20
|
+
|
|
21
|
+
# Whether this is the final shipment
|
|
22
|
+
attr_accessor :final_shipment
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'total_count' => :'totalCount',
|
|
29
|
+
:'final_shipment' => :'finalShipment'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.swagger_types
|
|
35
|
+
{
|
|
36
|
+
:'total_count' => :'Integer',
|
|
37
|
+
:'final_shipment' => :'BOOLEAN'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Initializes the object
|
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
43
|
+
def initialize(attributes = {})
|
|
44
|
+
return unless attributes.is_a?(Hash)
|
|
45
|
+
|
|
46
|
+
# convert string to symbol for hash key
|
|
47
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
48
|
+
|
|
49
|
+
if attributes.has_key?(:'totalCount')
|
|
50
|
+
self.total_count = attributes[:'totalCount']
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if attributes.has_key?(:'finalShipment')
|
|
54
|
+
self.final_shipment = attributes[:'finalShipment']
|
|
55
|
+
else
|
|
56
|
+
self.final_shipment = false
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
62
|
+
# @return Array for valid properties with the reasons
|
|
63
|
+
def list_invalid_properties
|
|
64
|
+
invalid_properties = Array.new
|
|
65
|
+
return invalid_properties
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Check to see if the all the properties in the model are valid
|
|
69
|
+
# @return true if the model is valid
|
|
70
|
+
def valid?
|
|
71
|
+
return true
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Checks equality by comparing each attribute.
|
|
75
|
+
# @param [Object] Object to be compared
|
|
76
|
+
def ==(o)
|
|
77
|
+
return true if self.equal?(o)
|
|
78
|
+
self.class == o.class &&
|
|
79
|
+
total_count == o.total_count &&
|
|
80
|
+
final_shipment == o.final_shipment
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# @see the `==` method
|
|
84
|
+
# @param [Object] Object to be compared
|
|
85
|
+
def eql?(o)
|
|
86
|
+
self == o
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Calculates hash code according to all attributes.
|
|
90
|
+
# @return [Fixnum] Hash code
|
|
91
|
+
def hash
|
|
92
|
+
[total_count, final_shipment].hash
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Builds the object from hash
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
# @return [Object] Returns the model itself
|
|
98
|
+
def build_from_hash(attributes)
|
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
|
100
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
|
103
|
+
# is documented as an array but the input is not
|
|
104
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
105
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
106
|
+
end
|
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
108
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
self
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Deserializes the data based on type
|
|
116
|
+
# @param string type Data type
|
|
117
|
+
# @param string value Value to be deserialized
|
|
118
|
+
# @return [Object] Deserialized data
|
|
119
|
+
def _deserialize(type, value)
|
|
120
|
+
case type.to_sym
|
|
121
|
+
when :DateTime
|
|
122
|
+
DateTime.parse(value)
|
|
123
|
+
when :Date
|
|
124
|
+
Date.parse(value)
|
|
125
|
+
when :String
|
|
126
|
+
value.to_s
|
|
127
|
+
when :Integer
|
|
128
|
+
value.to_i
|
|
129
|
+
when :Float
|
|
130
|
+
value.to_f
|
|
131
|
+
when :BOOLEAN
|
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
133
|
+
true
|
|
134
|
+
else
|
|
135
|
+
false
|
|
136
|
+
end
|
|
137
|
+
when :Object
|
|
138
|
+
# generic object (usually a Hash), return directly
|
|
139
|
+
value
|
|
140
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
141
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
142
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
144
|
+
k_type = Regexp.last_match[:k_type]
|
|
145
|
+
v_type = Regexp.last_match[:v_type]
|
|
146
|
+
{}.tap do |hash|
|
|
147
|
+
value.each do |k, v|
|
|
148
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
else # model
|
|
152
|
+
temp_model = SwaggerClient.const_get(type).new
|
|
153
|
+
temp_model.build_from_hash(value)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the string representation of the object
|
|
158
|
+
# @return [String] String presentation of the object
|
|
159
|
+
def to_s
|
|
160
|
+
to_hash.to_s
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
|
165
|
+
def to_body
|
|
166
|
+
to_hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Returns the object in the form of hash
|
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
|
171
|
+
def to_hash
|
|
172
|
+
hash = {}
|
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
174
|
+
value = self.send(attr)
|
|
175
|
+
next if value.nil?
|
|
176
|
+
hash[param] = _to_hash(value)
|
|
177
|
+
end
|
|
178
|
+
hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Outputs non-array value in the form of hash
|
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
183
|
+
# @param [Object] value Any valid value
|
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
|
185
|
+
def _to_hash(value)
|
|
186
|
+
if value.is_a?(Array)
|
|
187
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
188
|
+
elsif value.is_a?(Hash)
|
|
189
|
+
{}.tap do |hash|
|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
191
|
+
end
|
|
192
|
+
elsif value.respond_to? :to_hash
|
|
193
|
+
value.to_hash
|
|
194
|
+
else
|
|
195
|
+
value
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Payment Gateway API Specification
|
|
3
|
+
|
|
4
|
+
#Payment Gateway API for payment processing.
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: unset
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module SwaggerClient
|
|
16
|
+
# Object for sending visa store credential
|
|
17
|
+
class StoredCredential
|
|
18
|
+
# Indicates if the transaction is first or subsequent. Valid values are 'FIRST' and 'SUBSEQUENT'
|
|
19
|
+
attr_accessor :sequence
|
|
20
|
+
|
|
21
|
+
# Indicates if the transaction is scheduled or part of a installment
|
|
22
|
+
attr_accessor :scheduled
|
|
23
|
+
|
|
24
|
+
# The transaction id received from schemes for the initial transaction. Required if sequence is 'SUBSEQUENT'
|
|
25
|
+
attr_accessor :referenced_scheme_transaction_id
|
|
26
|
+
|
|
27
|
+
# Indicates whether it is a merchant initiated or explicitly consented by card holder. Valid values are 'MERCHANT' and 'CARDHOLDER'
|
|
28
|
+
attr_accessor :initiator
|
|
29
|
+
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'sequence' => :'sequence',
|
|
56
|
+
:'scheduled' => :'scheduled',
|
|
57
|
+
:'referenced_scheme_transaction_id' => :'referencedSchemeTransactionId',
|
|
58
|
+
:'initiator' => :'initiator'
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.swagger_types
|
|
64
|
+
{
|
|
65
|
+
:'sequence' => :'String',
|
|
66
|
+
:'scheduled' => :'BOOLEAN',
|
|
67
|
+
:'referenced_scheme_transaction_id' => :'String',
|
|
68
|
+
:'initiator' => :'String'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
return unless attributes.is_a?(Hash)
|
|
76
|
+
|
|
77
|
+
# convert string to symbol for hash key
|
|
78
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'sequence')
|
|
81
|
+
self.sequence = attributes[:'sequence']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'scheduled')
|
|
85
|
+
self.scheduled = attributes[:'scheduled']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'referencedSchemeTransactionId')
|
|
89
|
+
self.referenced_scheme_transaction_id = attributes[:'referencedSchemeTransactionId']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.has_key?(:'initiator')
|
|
93
|
+
self.initiator = attributes[:'initiator']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
99
|
+
# @return Array for valid properties with the reasons
|
|
100
|
+
def list_invalid_properties
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if @sequence.nil?
|
|
103
|
+
invalid_properties.push("invalid value for 'sequence', sequence cannot be nil.")
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if @scheduled.nil?
|
|
107
|
+
invalid_properties.push("invalid value for 'scheduled', scheduled cannot be nil.")
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if !@referenced_scheme_transaction_id.nil? && @referenced_scheme_transaction_id.to_s.length > 40
|
|
111
|
+
invalid_properties.push("invalid value for 'referenced_scheme_transaction_id', the character length must be smaller than or equal to 40.")
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
return invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
return false if @sequence.nil?
|
|
121
|
+
sequence_validator = EnumAttributeValidator.new('String', ["FIRST", "SUBSEQUENT"])
|
|
122
|
+
return false unless sequence_validator.valid?(@sequence)
|
|
123
|
+
return false if @scheduled.nil?
|
|
124
|
+
return false if !@referenced_scheme_transaction_id.nil? && @referenced_scheme_transaction_id.to_s.length > 40
|
|
125
|
+
initiator_validator = EnumAttributeValidator.new('String', ["MERCHANT", "CARDHOLDER"])
|
|
126
|
+
return false unless initiator_validator.valid?(@initiator)
|
|
127
|
+
return true
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
131
|
+
# @param [Object] sequence Object to be assigned
|
|
132
|
+
def sequence=(sequence)
|
|
133
|
+
validator = EnumAttributeValidator.new('String', ["FIRST", "SUBSEQUENT"])
|
|
134
|
+
unless validator.valid?(sequence)
|
|
135
|
+
fail ArgumentError, "invalid value for 'sequence', must be one of #{validator.allowable_values}."
|
|
136
|
+
end
|
|
137
|
+
@sequence = sequence
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] referenced_scheme_transaction_id Value to be assigned
|
|
142
|
+
def referenced_scheme_transaction_id=(referenced_scheme_transaction_id)
|
|
143
|
+
|
|
144
|
+
if !referenced_scheme_transaction_id.nil? && referenced_scheme_transaction_id.to_s.length > 40
|
|
145
|
+
fail ArgumentError, "invalid value for 'referenced_scheme_transaction_id', the character length must be smaller than or equal to 40."
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@referenced_scheme_transaction_id = referenced_scheme_transaction_id
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
152
|
+
# @param [Object] initiator Object to be assigned
|
|
153
|
+
def initiator=(initiator)
|
|
154
|
+
validator = EnumAttributeValidator.new('String', ["MERCHANT", "CARDHOLDER"])
|
|
155
|
+
unless validator.valid?(initiator)
|
|
156
|
+
fail ArgumentError, "invalid value for 'initiator', must be one of #{validator.allowable_values}."
|
|
157
|
+
end
|
|
158
|
+
@initiator = initiator
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Checks equality by comparing each attribute.
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def ==(o)
|
|
164
|
+
return true if self.equal?(o)
|
|
165
|
+
self.class == o.class &&
|
|
166
|
+
sequence == o.sequence &&
|
|
167
|
+
scheduled == o.scheduled &&
|
|
168
|
+
referenced_scheme_transaction_id == o.referenced_scheme_transaction_id &&
|
|
169
|
+
initiator == o.initiator
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# @see the `==` method
|
|
173
|
+
# @param [Object] Object to be compared
|
|
174
|
+
def eql?(o)
|
|
175
|
+
self == o
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Calculates hash code according to all attributes.
|
|
179
|
+
# @return [Fixnum] Hash code
|
|
180
|
+
def hash
|
|
181
|
+
[sequence, scheduled, referenced_scheme_transaction_id, initiator].hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Builds the object from hash
|
|
185
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
186
|
+
# @return [Object] Returns the model itself
|
|
187
|
+
def build_from_hash(attributes)
|
|
188
|
+
return nil unless attributes.is_a?(Hash)
|
|
189
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
190
|
+
if type =~ /\AArray<(.*)>/i
|
|
191
|
+
# check to ensure the input is an array given that the the attribute
|
|
192
|
+
# is documented as an array but the input is not
|
|
193
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
194
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
195
|
+
end
|
|
196
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
197
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
198
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
self
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Deserializes the data based on type
|
|
205
|
+
# @param string type Data type
|
|
206
|
+
# @param string value Value to be deserialized
|
|
207
|
+
# @return [Object] Deserialized data
|
|
208
|
+
def _deserialize(type, value)
|
|
209
|
+
case type.to_sym
|
|
210
|
+
when :DateTime
|
|
211
|
+
DateTime.parse(value)
|
|
212
|
+
when :Date
|
|
213
|
+
Date.parse(value)
|
|
214
|
+
when :String
|
|
215
|
+
value.to_s
|
|
216
|
+
when :Integer
|
|
217
|
+
value.to_i
|
|
218
|
+
when :Float
|
|
219
|
+
value.to_f
|
|
220
|
+
when :BOOLEAN
|
|
221
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
222
|
+
true
|
|
223
|
+
else
|
|
224
|
+
false
|
|
225
|
+
end
|
|
226
|
+
when :Object
|
|
227
|
+
# generic object (usually a Hash), return directly
|
|
228
|
+
value
|
|
229
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
230
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
231
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
232
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
233
|
+
k_type = Regexp.last_match[:k_type]
|
|
234
|
+
v_type = Regexp.last_match[:v_type]
|
|
235
|
+
{}.tap do |hash|
|
|
236
|
+
value.each do |k, v|
|
|
237
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
else # model
|
|
241
|
+
temp_model = SwaggerClient.const_get(type).new
|
|
242
|
+
temp_model.build_from_hash(value)
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Returns the string representation of the object
|
|
247
|
+
# @return [String] String presentation of the object
|
|
248
|
+
def to_s
|
|
249
|
+
to_hash.to_s
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
253
|
+
# @return [Hash] Returns the object in the form of hash
|
|
254
|
+
def to_body
|
|
255
|
+
to_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Returns the object in the form of hash
|
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
|
260
|
+
def to_hash
|
|
261
|
+
hash = {}
|
|
262
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
263
|
+
value = self.send(attr)
|
|
264
|
+
next if value.nil?
|
|
265
|
+
hash[param] = _to_hash(value)
|
|
266
|
+
end
|
|
267
|
+
hash
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Outputs non-array value in the form of hash
|
|
271
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
272
|
+
# @param [Object] value Any valid value
|
|
273
|
+
# @return [Hash] Returns the value in the form of hash
|
|
274
|
+
def _to_hash(value)
|
|
275
|
+
if value.is_a?(Array)
|
|
276
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
277
|
+
elsif value.is_a?(Hash)
|
|
278
|
+
{}.tap do |hash|
|
|
279
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
280
|
+
end
|
|
281
|
+
elsif value.respond_to? :to_hash
|
|
282
|
+
value.to_hash
|
|
283
|
+
else
|
|
284
|
+
value
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
end
|