ultracart_api 3.2.15 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -4
  3. data/docs/ConfigurationApi.md +756 -0
  4. data/docs/DelayAutoOrdersResponse.md +12 -0
  5. data/docs/PaymentsConfiguration.md +23 -0
  6. data/docs/PaymentsConfigurationAffirm.md +15 -0
  7. data/docs/PaymentsConfigurationAmazon.md +15 -0
  8. data/docs/PaymentsConfigurationCOD.md +13 -0
  9. data/docs/PaymentsConfigurationCash.md +9 -0
  10. data/docs/PaymentsConfigurationCheck.md +25 -0
  11. data/docs/PaymentsConfigurationCreditCard.md +16 -0
  12. data/docs/PaymentsConfigurationLoanHero.md +12 -0
  13. data/docs/PaymentsConfigurationPayPal.md +36 -0
  14. data/docs/PaymentsConfigurationPurchaseOrder.md +11 -0
  15. data/docs/PaymentsConfigurationQuoteRequest.md +10 -0
  16. data/docs/PaymentsConfigurationResponse.md +12 -0
  17. data/docs/PaymentsConfigurationRestrictions.md +19 -0
  18. data/docs/PaymentsConfigurationSezzle.md +15 -0
  19. data/docs/PaymentsConfigurationWePay.md +35 -0
  20. data/docs/PaymentsConfigurationWireTransfer.md +18 -0
  21. data/docs/PaymentsThemeTransactionType.md +10 -0
  22. data/docs/PaymentsWepayEnroll.md +22 -0
  23. data/docs/RotatingTransactionGateway.md +50 -0
  24. data/docs/RtgCurrency.md +10 -0
  25. data/docs/RtgDayOfMonthRestriction.md +9 -0
  26. data/docs/RtgDayOfWeekRestriction.md +10 -0
  27. data/docs/RtgThemeRestriction.md +10 -0
  28. data/docs/ScreenRecordingPageViewEvent.md +1 -0
  29. data/docs/SingleSignOnAuthorizeRequest.md +9 -0
  30. data/docs/SingleSignOnAuthorizeResponse.md +9 -0
  31. data/docs/SingleSignOnTokenRequest.md +9 -0
  32. data/docs/SingleSignOnTokenResponse.md +10 -0
  33. data/docs/SsoApi.md +201 -0
  34. data/docs/StripeConnectResponse.md +12 -0
  35. data/docs/TransactionGateway.md +71 -0
  36. data/docs/TransactionGatewaysRequest.md +10 -0
  37. data/docs/TransactionGatewaysResponse.md +12 -0
  38. data/lib/ultracart_api.rb +34 -0
  39. data/lib/ultracart_api/api/configuration_api.rb +843 -0
  40. data/lib/ultracart_api/api/sso_api.rb +243 -0
  41. data/lib/ultracart_api/models/delay_auto_orders_response.rb +221 -0
  42. data/lib/ultracart_api/models/payments_configuration.rb +319 -0
  43. data/lib/ultracart_api/models/payments_configuration_affirm.rb +247 -0
  44. data/lib/ultracart_api/models/payments_configuration_amazon.rb +247 -0
  45. data/lib/ultracart_api/models/payments_configuration_cash.rb +193 -0
  46. data/lib/ultracart_api/models/payments_configuration_check.rb +337 -0
  47. data/lib/ultracart_api/models/payments_configuration_cod.rb +229 -0
  48. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +256 -0
  49. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +220 -0
  50. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +436 -0
  51. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +211 -0
  52. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +202 -0
  53. data/lib/ultracart_api/models/payments_configuration_response.rb +221 -0
  54. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +283 -0
  55. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +247 -0
  56. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +427 -0
  57. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +274 -0
  58. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +239 -0
  59. data/lib/ultracart_api/models/payments_wepay_enroll.rb +310 -0
  60. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +665 -0
  61. data/lib/ultracart_api/models/rtg_currency.rb +205 -0
  62. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +195 -0
  63. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +205 -0
  64. data/lib/ultracart_api/models/rtg_theme_restriction.rb +239 -0
  65. data/lib/ultracart_api/models/screen_recording_page_view_event.rb +10 -1
  66. data/lib/ultracart_api/models/single_sign_on_authorize_request.rb +195 -0
  67. data/lib/ultracart_api/models/single_sign_on_authorize_response.rb +195 -0
  68. data/lib/ultracart_api/models/single_sign_on_token_request.rb +195 -0
  69. data/lib/ultracart_api/models/single_sign_on_token_response.rb +205 -0
  70. data/lib/ultracart_api/models/stripe_connect_response.rb +221 -0
  71. data/lib/ultracart_api/models/transaction_gateway.rb +823 -0
  72. data/lib/ultracart_api/models/transaction_gateways_request.rb +242 -0
  73. data/lib/ultracart_api/models/transaction_gateways_response.rb +223 -0
  74. data/lib/ultracart_api/version.rb +1 -1
  75. metadata +70 -2
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module UltracartClient
16
+ class SsoApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
24
+ api_config = Configuration.new
25
+ api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
26
+ api_config.api_version = '2017-03-01'
27
+ api_config.verify_ssl = verify_ssl
28
+
29
+ api_client = ApiClient.new(api_config)
30
+ api_client.config.debugging = debugging
31
+
32
+ UltracartClient::SsoApi.new(api_client)
33
+ end
34
+
35
+ # Get single sign on session user
36
+ # This is the equivalent of logging out of the single sign on session
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [User]
39
+ def get_sso_session_user(opts = {})
40
+ data, _status_code, _headers = get_sso_session_user_with_http_info(opts)
41
+ data
42
+ end
43
+
44
+ # Get single sign on session user
45
+ # This is the equivalent of logging out of the single sign on session
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
48
+ def get_sso_session_user_with_http_info(opts = {})
49
+ if @api_client.config.debugging
50
+ @api_client.config.logger.debug 'Calling API: SsoApi.get_sso_session_user ...'
51
+ end
52
+ # resource path
53
+ local_var_path = '/sso/session/user'
54
+
55
+ # query parameters
56
+ query_params = {}
57
+
58
+ # header parameters
59
+ header_params = {}
60
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+ # HTTP header 'Content-Type'
64
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
65
+
66
+ # form parameters
67
+ form_params = {}
68
+
69
+ # http body (model)
70
+ post_body = nil
71
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => 'User')
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: SsoApi#get_sso_session_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+ # Authorize a single sign on session
85
+ # Starts the process of authorizing a single sign on session.
86
+ # @param authorization_request Authorization request
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [SingleSignOnAuthorizeResponse]
89
+ def sso_authorize(authorization_request, opts = {})
90
+ data, _status_code, _headers = sso_authorize_with_http_info(authorization_request, opts)
91
+ data
92
+ end
93
+
94
+ # Authorize a single sign on session
95
+ # Starts the process of authorizing a single sign on session.
96
+ # @param authorization_request Authorization request
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(SingleSignOnAuthorizeResponse, Fixnum, Hash)>] SingleSignOnAuthorizeResponse data, response status code and response headers
99
+ def sso_authorize_with_http_info(authorization_request, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: SsoApi.sso_authorize ...'
102
+ end
103
+ # verify the required parameter 'authorization_request' is set
104
+ if @api_client.config.client_side_validation && authorization_request.nil?
105
+ fail ArgumentError, "Missing the required parameter 'authorization_request' when calling SsoApi.sso_authorize"
106
+ end
107
+ # resource path
108
+ local_var_path = '/sso/authorize'
109
+
110
+ # query parameters
111
+ query_params = {}
112
+
113
+ # header parameters
114
+ header_params = {}
115
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
118
+ # HTTP header 'Content-Type'
119
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
120
+
121
+ # form parameters
122
+ form_params = {}
123
+
124
+ # http body (model)
125
+ post_body = @api_client.object_to_http_body(authorization_request)
126
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
127
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :form_params => form_params,
131
+ :body => post_body,
132
+ :auth_names => auth_names,
133
+ :return_type => 'SingleSignOnAuthorizeResponse')
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug "API called: SsoApi#sso_authorize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
136
+ end
137
+ return data, status_code, headers
138
+ end
139
+ # Revoke single sign on session
140
+ # This is the equivalent of logging out of the single sign on session
141
+ # @param [Hash] opts the optional parameters
142
+ # @return [nil]
143
+ def sso_session_revoke(opts = {})
144
+ sso_session_revoke_with_http_info(opts)
145
+ nil
146
+ end
147
+
148
+ # Revoke single sign on session
149
+ # This is the equivalent of logging out of the single sign on session
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
152
+ def sso_session_revoke_with_http_info(opts = {})
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug 'Calling API: SsoApi.sso_session_revoke ...'
155
+ end
156
+ # resource path
157
+ local_var_path = '/sso/session/revoke'
158
+
159
+ # query parameters
160
+ query_params = {}
161
+
162
+ # header parameters
163
+ header_params = {}
164
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
165
+ # HTTP header 'Accept' (if needed)
166
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
167
+ # HTTP header 'Content-Type'
168
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
169
+
170
+ # form parameters
171
+ form_params = {}
172
+
173
+ # http body (model)
174
+ post_body = nil
175
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
176
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
177
+ :header_params => header_params,
178
+ :query_params => query_params,
179
+ :form_params => form_params,
180
+ :body => post_body,
181
+ :auth_names => auth_names)
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: SsoApi#sso_session_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
187
+ # Exchange a single sign on code for a simple key token
188
+ # Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with
189
+ # @param token_request Token request
190
+ # @param [Hash] opts the optional parameters
191
+ # @return [SingleSignOnTokenResponse]
192
+ def sso_token(token_request, opts = {})
193
+ data, _status_code, _headers = sso_token_with_http_info(token_request, opts)
194
+ data
195
+ end
196
+
197
+ # Exchange a single sign on code for a simple key token
198
+ # Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with
199
+ # @param token_request Token request
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(SingleSignOnTokenResponse, Fixnum, Hash)>] SingleSignOnTokenResponse data, response status code and response headers
202
+ def sso_token_with_http_info(token_request, opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: SsoApi.sso_token ...'
205
+ end
206
+ # verify the required parameter 'token_request' is set
207
+ if @api_client.config.client_side_validation && token_request.nil?
208
+ fail ArgumentError, "Missing the required parameter 'token_request' when calling SsoApi.sso_token"
209
+ end
210
+ # resource path
211
+ local_var_path = '/sso/token'
212
+
213
+ # query parameters
214
+ query_params = {}
215
+
216
+ # header parameters
217
+ header_params = {}
218
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
221
+ # HTTP header 'Content-Type'
222
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
223
+
224
+ # form parameters
225
+ form_params = {}
226
+
227
+ # http body (model)
228
+ post_body = @api_client.object_to_http_body(token_request)
229
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
230
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => 'SingleSignOnTokenResponse')
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug "API called: SsoApi#sso_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ return data, status_code, headers
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class DelayAutoOrdersResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :message
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'message' => :'message',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'message' => :'String',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'message')
63
+ self.message = attributes[:'message']
64
+ end
65
+
66
+ if attributes.has_key?(:'metadata')
67
+ self.metadata = attributes[:'metadata']
68
+ end
69
+
70
+ if attributes.has_key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ error == o.error &&
98
+ message == o.message &&
99
+ metadata == o.metadata &&
100
+ success == o.success &&
101
+ warning == o.warning
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
+ [error, message, metadata, success, warning].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 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 = UltracartClient.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
+ end