ultracart_api 3.10.64 → 3.10.65

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e74b7dd569e12d9dc2fa15dab34cc3c7a51e0def27215ae4db499b3ded4d449f
4
- data.tar.gz: f25d0248fbbc32b8f176d02bd6ab7c903e79b59e8c2bd21dd21a6701ae85d952
3
+ metadata.gz: c40eeee0e52a4048d5da0be9aa0bf8e3ed8081125900ef7c548e1f3b7f85a76d
4
+ data.tar.gz: 13968b964e8cbbca5846a9aacda47607c4d2fde6d2b84885686275fb480bdaa8
5
5
  SHA512:
6
- metadata.gz: 8b5cc4db4e89400fd95e036f4aad16c948fdc953715cca0dce887b29d9abffad7cf5a108587b60a34d5b86172110fb685fbd6f4de6be69b3b72869df2514c379
7
- data.tar.gz: a362be05c9cb761584cac40b19d872b9931b9309c91f1a65443db277d6a6903e3247c700130a140e18b70d5bc50453be91cf5a90b5b22b01c0425211ba9aac2c
6
+ metadata.gz: a1d8a223749f59285baef7781831359d02247c9d29fcf08b66698658c61be51c52da8b66ff8444108c823ee52b0d0aa460d2993c27b0529bfe1eb4fd07ac3ffd
7
+ data.tar.gz: 347be067a1bab1af80f91b120e5f7c9e569170643458b66e5b8661c629096e772d91676f3d3b9ae574ef6d12b60369d0458cca3e4c3c82c6a48bfff2773b077f
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 3.10.64
10
+ - Package version: 3.10.65
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-3.10.64.gem
27
+ gem install ./ultracart_api-3.10.65.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.10.64.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.10.65.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'ultracart_api', '~> 3.10.64'
35
+ gem 'ultracart_api', '~> 3.10.65'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -227,6 +227,7 @@ Class | Method | HTTP request | Description
227
227
  *UltracartClient::OrderApi* | [**get_orders_batch**](docs/OrderApi.md#get_orders_batch) | **POST** /order/orders/batch | Retrieve order batch
228
228
  *UltracartClient::OrderApi* | [**get_orders_by_query**](docs/OrderApi.md#get_orders_by_query) | **POST** /order/orders/query | Retrieve orders by query
229
229
  *UltracartClient::OrderApi* | [**insert_order**](docs/OrderApi.md#insert_order) | **POST** /order/orders | Insert an order
230
+ *UltracartClient::OrderApi* | [**is_refundable_order**](docs/OrderApi.md#is_refundable_order) | **GET** /order/orders/{order_id}/refundable | Determine if an order can be refunded
230
231
  *UltracartClient::OrderApi* | [**process_payment**](docs/OrderApi.md#process_payment) | **POST** /order/orders/{order_id}/process_payment | Process payment
231
232
  *UltracartClient::OrderApi* | [**refund_order**](docs/OrderApi.md#refund_order) | **PUT** /order/orders/{order_id}/refund | Refund an order
232
233
  *UltracartClient::OrderApi* | [**replacement**](docs/OrderApi.md#replacement) | **POST** /order/orders/{order_id}/replacement | Replacement order
@@ -1003,6 +1004,7 @@ Class | Method | HTTP request | Description
1003
1004
  - [UltracartClient::OrderQuery](docs/OrderQuery.md)
1004
1005
  - [UltracartClient::OrderQueryBatch](docs/OrderQueryBatch.md)
1005
1006
  - [UltracartClient::OrderQuote](docs/OrderQuote.md)
1007
+ - [UltracartClient::OrderRefundableResponse](docs/OrderRefundableResponse.md)
1006
1008
  - [UltracartClient::OrderReplacement](docs/OrderReplacement.md)
1007
1009
  - [UltracartClient::OrderReplacementItem](docs/OrderReplacementItem.md)
1008
1010
  - [UltracartClient::OrderReplacementResponse](docs/OrderReplacementResponse.md)
@@ -1213,6 +1215,7 @@ Not every change is committed to every SDK.
1213
1215
 
1214
1216
  | Version | Date | Comments |
1215
1217
  | --: | :-: | --- |
1218
+ | 3.10.65 | 11/15/2022 | order api new method is order refundable |
1216
1219
  | 3.10.64 | 11/15/2022 | increase order property length to 10k char |
1217
1220
  | 3.10.63 | 11/14/2022 | conversations - add allowed values for update agent status |
1218
1221
  | 3.10.62 | 11/09/2022 | conversations - add an enum of event typing |
data/docs/OrderApi.md CHANGED
@@ -20,6 +20,7 @@ Method | HTTP request | Description
20
20
  [**get_orders_batch**](OrderApi.md#get_orders_batch) | **POST** /order/orders/batch | Retrieve order batch
21
21
  [**get_orders_by_query**](OrderApi.md#get_orders_by_query) | **POST** /order/orders/query | Retrieve orders by query
22
22
  [**insert_order**](OrderApi.md#insert_order) | **POST** /order/orders | Insert an order
23
+ [**is_refundable_order**](OrderApi.md#is_refundable_order) | **GET** /order/orders/{order_id}/refundable | Determine if an order can be refunded
23
24
  [**process_payment**](OrderApi.md#process_payment) | **POST** /order/orders/{order_id}/process_payment | Process payment
24
25
  [**refund_order**](OrderApi.md#refund_order) | **PUT** /order/orders/{order_id}/refund | Refund an order
25
26
  [**replacement**](OrderApi.md#replacement) | **POST** /order/orders/{order_id}/replacement | Replacement order
@@ -926,6 +927,56 @@ Name | Type | Description | Notes
926
927
 
927
928
 
928
929
 
930
+ # **is_refundable_order**
931
+ > OrderRefundableResponse is_refundable_order(order_id)
932
+
933
+ Determine if an order can be refunded
934
+
935
+ Determine if an order can be refunded based upon payment method and age
936
+
937
+ ### Example
938
+ ```ruby
939
+ # load the gem
940
+ require 'ultracart_api'
941
+
942
+ # Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
943
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
944
+ api_instance = UltracartClient::OrderApi.new_using_api_key(simple_key, false, false)
945
+
946
+
947
+ order_id = 'order_id_example' # String | The order id to check for refundable order.
948
+
949
+
950
+ begin
951
+ #Determine if an order can be refunded
952
+ result = api_instance.is_refundable_order(order_id)
953
+ p result
954
+ rescue UltracartClient::ApiError => e
955
+ puts "Exception when calling OrderApi->is_refundable_order: #{e}"
956
+ end
957
+ ```
958
+
959
+ ### Parameters
960
+
961
+ Name | Type | Description | Notes
962
+ ------------- | ------------- | ------------- | -------------
963
+ **order_id** | **String**| The order id to check for refundable order. |
964
+
965
+ ### Return type
966
+
967
+ [**OrderRefundableResponse**](OrderRefundableResponse.md)
968
+
969
+ ### Authorization
970
+
971
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
972
+
973
+ ### HTTP request headers
974
+
975
+ - **Content-Type**: application/json; charset=UTF-8
976
+ - **Accept**: application/json
977
+
978
+
979
+
929
980
  # **process_payment**
930
981
  > OrderProcessPaymentResponse process_payment(order_id, process_payment_request)
931
982
 
@@ -0,0 +1,12 @@
1
+ # UltracartClient::OrderRefundableResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **error** | [**Error**](Error.md) | | [optional]
7
+ **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional]
8
+ **refundable** | **BOOLEAN** | Whether the order is refundable or not. | [optional]
9
+ **success** | **BOOLEAN** | Indicates if API call was successful | [optional]
10
+ **warning** | [**Warning**](Warning.md) | | [optional]
11
+
12
+
@@ -1037,6 +1037,61 @@ module UltracartClient
1037
1037
  end
1038
1038
  return data, status_code, headers
1039
1039
  end
1040
+ # Determine if an order can be refunded
1041
+ # Determine if an order can be refunded based upon payment method and age
1042
+ # @param order_id The order id to check for refundable order.
1043
+ # @param [Hash] opts the optional parameters
1044
+ # @return [OrderRefundableResponse]
1045
+ def is_refundable_order(order_id, opts = {})
1046
+ data, _status_code, _headers = is_refundable_order_with_http_info(order_id, opts)
1047
+ data
1048
+ end
1049
+
1050
+ # Determine if an order can be refunded
1051
+ # Determine if an order can be refunded based upon payment method and age
1052
+ # @param order_id The order id to check for refundable order.
1053
+ # @param [Hash] opts the optional parameters
1054
+ # @return [Array<(OrderRefundableResponse, Fixnum, Hash)>] OrderRefundableResponse data, response status code and response headers
1055
+ def is_refundable_order_with_http_info(order_id, opts = {})
1056
+ if @api_client.config.debugging
1057
+ @api_client.config.logger.debug 'Calling API: OrderApi.is_refundable_order ...'
1058
+ end
1059
+ # verify the required parameter 'order_id' is set
1060
+ if @api_client.config.client_side_validation && order_id.nil?
1061
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.is_refundable_order"
1062
+ end
1063
+ # resource path
1064
+ local_var_path = '/order/orders/{order_id}/refundable'.sub('{' + 'order_id' + '}', order_id.to_s)
1065
+
1066
+ # query parameters
1067
+ query_params = {}
1068
+
1069
+ # header parameters
1070
+ header_params = {}
1071
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1072
+ # HTTP header 'Accept' (if needed)
1073
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1074
+ # HTTP header 'Content-Type'
1075
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1076
+
1077
+ # form parameters
1078
+ form_params = {}
1079
+
1080
+ # http body (model)
1081
+ post_body = nil
1082
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
1083
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1084
+ :header_params => header_params,
1085
+ :query_params => query_params,
1086
+ :form_params => form_params,
1087
+ :body => post_body,
1088
+ :auth_names => auth_names,
1089
+ :return_type => 'OrderRefundableResponse')
1090
+ if @api_client.config.debugging
1091
+ @api_client.config.logger.debug "API called: OrderApi#is_refundable_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1092
+ end
1093
+ return data, status_code, headers
1094
+ end
1040
1095
  # Process payment
1041
1096
  # Process payment on order
1042
1097
  # @param order_id The order id to process payment on
@@ -0,0 +1,222 @@
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 OrderRefundableResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :metadata
20
+
21
+ # Whether the order is refundable or not.
22
+ attr_accessor :refundable
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'refundable' => :'refundable',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'refundable' => :'BOOLEAN',
46
+ :'success' => :'BOOLEAN',
47
+ :'warning' => :'Warning'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.has_key?(:'error')
60
+ self.error = attributes[:'error']
61
+ end
62
+
63
+ if attributes.has_key?(:'metadata')
64
+ self.metadata = attributes[:'metadata']
65
+ end
66
+
67
+ if attributes.has_key?(:'refundable')
68
+ self.refundable = attributes[:'refundable']
69
+ end
70
+
71
+ if attributes.has_key?(:'success')
72
+ self.success = attributes[:'success']
73
+ end
74
+
75
+ if attributes.has_key?(:'warning')
76
+ self.warning = attributes[:'warning']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ error == o.error &&
99
+ metadata == o.metadata &&
100
+ refundable == o.refundable &&
101
+ success == o.success &&
102
+ warning == o.warning
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [error, metadata, refundable, success, warning].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.swagger_types.each_pair do |key, type|
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ DateTime.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :BOOLEAN
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ temp_model = UltracartClient.const_get(type).new
175
+ temp_model.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ next if value.nil?
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.64'
14
+ VERSION = '3.10.65'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -559,6 +559,7 @@ require 'ultracart_api/models/order_property'
559
559
  require 'ultracart_api/models/order_query'
560
560
  require 'ultracart_api/models/order_query_batch'
561
561
  require 'ultracart_api/models/order_quote'
562
+ require 'ultracart_api/models/order_refundable_response'
562
563
  require 'ultracart_api/models/order_replacement'
563
564
  require 'ultracart_api/models/order_replacement_item'
564
565
  require 'ultracart_api/models/order_replacement_response'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.64
4
+ version: 3.10.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
@@ -777,6 +777,7 @@ files:
777
777
  - docs/OrderQuery.md
778
778
  - docs/OrderQueryBatch.md
779
779
  - docs/OrderQuote.md
780
+ - docs/OrderRefundableResponse.md
780
781
  - docs/OrderReplacement.md
781
782
  - docs/OrderReplacementItem.md
782
783
  - docs/OrderReplacementResponse.md
@@ -1488,6 +1489,7 @@ files:
1488
1489
  - lib/ultracart_api/models/order_query.rb
1489
1490
  - lib/ultracart_api/models/order_query_batch.rb
1490
1491
  - lib/ultracart_api/models/order_quote.rb
1492
+ - lib/ultracart_api/models/order_refundable_response.rb
1491
1493
  - lib/ultracart_api/models/order_replacement.rb
1492
1494
  - lib/ultracart_api/models/order_replacement_item.rb
1493
1495
  - lib/ultracart_api/models/order_replacement_response.rb