zip_money 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/README.md +128 -0
  5. data/Rakefile +8 -0
  6. data/docs/Address.md +15 -0
  7. data/docs/Authority.md +9 -0
  8. data/docs/CaptureChargeRequest.md +8 -0
  9. data/docs/Charge.md +17 -0
  10. data/docs/ChargeCollection.md +8 -0
  11. data/docs/ChargeOrder.md +11 -0
  12. data/docs/ChargesApi.md +307 -0
  13. data/docs/Checkout.md +18 -0
  14. data/docs/CheckoutConfiguration.md +8 -0
  15. data/docs/CheckoutFeatures.md +8 -0
  16. data/docs/CheckoutFeaturesTokenisation.md +8 -0
  17. data/docs/CheckoutOrder.md +13 -0
  18. data/docs/CheckoutsApi.md +119 -0
  19. data/docs/CreateChargeRequest.md +14 -0
  20. data/docs/CreateCheckoutRequest.md +13 -0
  21. data/docs/CreateCheckoutRequestFeatures.md +8 -0
  22. data/docs/CreateCheckoutRequestFeaturesTokenisation.md +8 -0
  23. data/docs/CreateRefundRequest.md +11 -0
  24. data/docs/CreateTokenRequest.md +8 -0
  25. data/docs/Customer.md +15 -0
  26. data/docs/CustomersApi.md +96 -0
  27. data/docs/ErrorResponse.md +8 -0
  28. data/docs/ErrorResponseError.md +10 -0
  29. data/docs/ErrorResponseErrorDetails.md +9 -0
  30. data/docs/InlineResponse200.md +8 -0
  31. data/docs/Metadata.md +7 -0
  32. data/docs/OrderItem.md +16 -0
  33. data/docs/OrderShipping.md +10 -0
  34. data/docs/OrderShippingTracking.md +10 -0
  35. data/docs/Refund.md +13 -0
  36. data/docs/RefundsApi.md +181 -0
  37. data/docs/SettlementsApi.md +96 -0
  38. data/docs/Shopper.md +17 -0
  39. data/docs/ShopperStatistics.md +16 -0
  40. data/docs/Token.md +11 -0
  41. data/docs/TokensApi.md +66 -0
  42. data/lib/zip_money.rb +68 -0
  43. data/lib/zip_money/api/charges_api.rb +301 -0
  44. data/lib/zip_money/api/checkouts_api.rb +120 -0
  45. data/lib/zip_money/api/customers_api.rb +116 -0
  46. data/lib/zip_money/api/refunds_api.rb +181 -0
  47. data/lib/zip_money/api/settlements_api.rb +116 -0
  48. data/lib/zip_money/api/tokens_api.rb +70 -0
  49. data/lib/zip_money/api_client.rb +386 -0
  50. data/lib/zip_money/api_error.rb +31 -0
  51. data/lib/zip_money/configuration.rb +238 -0
  52. data/lib/zip_money/models/address.rb +413 -0
  53. data/lib/zip_money/models/authority.rb +235 -0
  54. data/lib/zip_money/models/capture_charge_request.rb +206 -0
  55. data/lib/zip_money/models/charge.rb +369 -0
  56. data/lib/zip_money/models/charge_collection.rb +188 -0
  57. data/lib/zip_money/models/charge_order.rb +250 -0
  58. data/lib/zip_money/models/checkout.rb +344 -0
  59. data/lib/zip_money/models/checkout_configuration.rb +187 -0
  60. data/lib/zip_money/models/checkout_features.rb +181 -0
  61. data/lib/zip_money/models/checkout_features_tokenisation.rb +184 -0
  62. data/lib/zip_money/models/checkout_order.rb +299 -0
  63. data/lib/zip_money/models/create_charge_request.rb +289 -0
  64. data/lib/zip_money/models/create_checkout_request.rb +272 -0
  65. data/lib/zip_money/models/create_checkout_request_features.rb +181 -0
  66. data/lib/zip_money/models/create_checkout_request_features_tokenisation.rb +189 -0
  67. data/lib/zip_money/models/create_refund_request.rb +246 -0
  68. data/lib/zip_money/models/create_token_request.rb +186 -0
  69. data/lib/zip_money/models/customer.rb +310 -0
  70. data/lib/zip_money/models/error_response.rb +181 -0
  71. data/lib/zip_money/models/error_response_error.rb +211 -0
  72. data/lib/zip_money/models/error_response_error_details.rb +190 -0
  73. data/lib/zip_money/models/inline_response_200.rb +188 -0
  74. data/lib/zip_money/models/metadata.rb +172 -0
  75. data/lib/zip_money/models/order_item.rb +333 -0
  76. data/lib/zip_money/models/order_shipping.rb +200 -0
  77. data/lib/zip_money/models/order_shipping_tracking.rb +247 -0
  78. data/lib/zip_money/models/refund.rb +252 -0
  79. data/lib/zip_money/models/shopper.rb +339 -0
  80. data/lib/zip_money/models/shopper_statistics.rb +295 -0
  81. data/lib/zip_money/models/token.rb +228 -0
  82. data/lib/zip_money/version.rb +8 -0
  83. data/spec/api/charges_api_spec.rb +114 -0
  84. data/spec/api/checkouts_api_spec.rb +54 -0
  85. data/spec/api/customers_api_spec.rb +51 -0
  86. data/spec/api/refunds_api_spec.rb +67 -0
  87. data/spec/api/settlements_api_spec.rb +51 -0
  88. data/spec/api/tokens_api_spec.rb +41 -0
  89. data/spec/api_client_spec.rb +219 -0
  90. data/spec/configuration_spec.rb +50 -0
  91. data/spec/models/address_spec.rb +77 -0
  92. data/spec/models/authority_spec.rb +45 -0
  93. data/spec/models/capture_charge_request_spec.rb +35 -0
  94. data/spec/models/charge_collection_spec.rb +35 -0
  95. data/spec/models/charge_order_spec.rb +53 -0
  96. data/spec/models/charge_spec.rb +93 -0
  97. data/spec/models/checkout_configuration_spec.rb +35 -0
  98. data/spec/models/checkout_features_spec.rb +35 -0
  99. data/spec/models/checkout_features_tokenisation_spec.rb +35 -0
  100. data/spec/models/checkout_order_spec.rb +65 -0
  101. data/spec/models/checkout_spec.rb +103 -0
  102. data/spec/models/create_charge_request_spec.rb +75 -0
  103. data/spec/models/create_checkout_request_features_spec.rb +35 -0
  104. data/spec/models/create_checkout_request_features_tokenisation_spec.rb +35 -0
  105. data/spec/models/create_checkout_request_spec.rb +69 -0
  106. data/spec/models/create_refund_request_spec.rb +53 -0
  107. data/spec/models/create_token_request_spec.rb +35 -0
  108. data/spec/models/customer_spec.rb +81 -0
  109. data/spec/models/error_response_error_details_spec.rb +41 -0
  110. data/spec/models/error_response_error_spec.rb +47 -0
  111. data/spec/models/error_response_spec.rb +35 -0
  112. data/spec/models/inline_response_200_spec.rb +35 -0
  113. data/spec/models/metadata_spec.rb +29 -0
  114. data/spec/models/order_item_spec.rb +87 -0
  115. data/spec/models/order_shipping_spec.rb +47 -0
  116. data/spec/models/order_shipping_tracking_spec.rb +47 -0
  117. data/spec/models/refund_spec.rb +65 -0
  118. data/spec/models/shopper_spec.rb +92 -0
  119. data/spec/models/shopper_statistics_spec.rb +86 -0
  120. data/spec/models/token_spec.rb +52 -0
  121. data/spec/payload_helper.rb +96 -0
  122. data/spec/spec_helper.rb +104 -0
  123. data/zip_money.gemspec +38 -0
  124. metadata +380 -0
@@ -0,0 +1,301 @@
1
+ #Merchant API
2
+ #ZipMoney Merchant API Initial build
3
+ #zipMoney Merchant API version: 2017-03-01
4
+
5
+
6
+ require "uri"
7
+
8
+ module ZipMoney
9
+ class ChargesApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+
16
+ # Cancel a charge
17
+ # Cancels an authorised charge. | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | invalid_state | The charge is not in authorised state |
18
+ # @param id The id of the authorised charge
19
+ # @param [Hash] opts the optional parameters
20
+ # @option opts [String] :idempotency_key The unique idempotency key.
21
+ # @return [Charge]
22
+ def charges_cancel(id, opts = {})
23
+ data, _status_code, _headers = charges_cancel_with_http_info(id, opts)
24
+ return data
25
+ end
26
+
27
+ # Cancel a charge
28
+ # Cancels an authorised charge. | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | invalid_state | The charge is not in authorised state |
29
+ # @param id The id of the authorised charge
30
+ # @param [Hash] opts the optional parameters
31
+ # @option opts [String] :idempotency_key The unique idempotency key.
32
+ # @return [Array<(Charge, Fixnum, Hash)>] Charge data, response status code and response headers
33
+ def charges_cancel_with_http_info(id, opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug "Calling API: ChargesApi.charges_cancel ..."
36
+ end
37
+ # verify the required parameter 'id' is set
38
+ fail ArgumentError, "Missing the required parameter 'id' when calling ChargesApi.charges_cancel" if id.nil?
39
+ # resource path
40
+ local_var_path = "/charges/{id}/cancel".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
41
+
42
+ # query parameters
43
+ query_params = {}
44
+
45
+ # header parameters
46
+ header_params = {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
49
+ # HTTP header 'Content-Type'
50
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
51
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
52
+
53
+ # form parameters
54
+ form_params = {}
55
+
56
+ # http body (model)
57
+ post_body = nil
58
+ auth_names = ['Authorization']
59
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
60
+ :header_params => header_params,
61
+ :query_params => query_params,
62
+ :form_params => form_params,
63
+ :body => post_body,
64
+ :auth_names => auth_names,
65
+ :return_type => 'Charge')
66
+ if @api_client.config.debugging
67
+ @api_client.config.logger.debug "API called: ChargesApi#charges_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
68
+ end
69
+ return data, status_code, headers
70
+ end
71
+
72
+ # Capture a charge
73
+ # | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | amount_invalid | Capture amount greater than authorised amount | | invalid_state | The charge is not in authorised state |
74
+ # @param id The id of the authorised charge
75
+ # @param [Hash] opts the optional parameters
76
+ # @option opts [CaptureChargeRequest] :body
77
+ # @option opts [String] :idempotency_key The unique idempotency key.
78
+ # @return [Charge]
79
+ def charges_capture(id, opts = {})
80
+ data, _status_code, _headers = charges_capture_with_http_info(id, opts)
81
+ return data
82
+ end
83
+
84
+ # Capture a charge
85
+ # | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | amount_invalid | Capture amount greater than authorised amount | | invalid_state | The charge is not in authorised state |
86
+ # @param id The id of the authorised charge
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [CaptureChargeRequest] :body
89
+ # @option opts [String] :idempotency_key The unique idempotency key.
90
+ # @return [Array<(Charge, Fixnum, Hash)>] Charge data, response status code and response headers
91
+ def charges_capture_with_http_info(id, opts = {})
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug "Calling API: ChargesApi.charges_capture ..."
94
+ end
95
+ # verify the required parameter 'id' is set
96
+ fail ArgumentError, "Missing the required parameter 'id' when calling ChargesApi.charges_capture" if id.nil?
97
+ # resource path
98
+ local_var_path = "/charges/{id}/capture".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
99
+
100
+ # query parameters
101
+ query_params = {}
102
+
103
+ # header parameters
104
+ header_params = {}
105
+ # HTTP header 'Accept' (if needed)
106
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
107
+ # HTTP header 'Content-Type'
108
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
109
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
110
+
111
+ # form parameters
112
+ form_params = {}
113
+
114
+ # http body (model)
115
+ post_body = @api_client.object_to_http_body(opts[:'body'])
116
+ auth_names = ['Authorization']
117
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
118
+ :header_params => header_params,
119
+ :query_params => query_params,
120
+ :form_params => form_params,
121
+ :body => post_body,
122
+ :auth_names => auth_names,
123
+ :return_type => 'Charge')
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug "API called: ChargesApi#charges_capture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
126
+ end
127
+ return data, status_code, headers
128
+ end
129
+
130
+ # Create a charge
131
+ # Creates a #model:ehEN48PET29iNdex3 which represents a charge against a customer's account. To execute this endpoint you must first obtain customer approval by implementing the #docTextSection:43C79g2JjeGs8AHWi as a part of your online store. This endpoint will return 201 if successful otherwise 402 with a specific error response. ## Capture or authorisation A charge can be created as either an authorisation or an immediate capture. This can be controlled in the initial request to the charge. In most cases you will want to immediately capture the payment, this will mark the debit for settlement into your account the very same day and will immediately deduct the funds from the customer's account. In some cases you may wish to delay the settlement of funds until a later date, perhaps until the goods are shipped to the customer. In this scenario you should send { capture: false } in the request to the #endpoint:dtmp3HxaHKjewvvGW endpoint and the charge will be created in an authorised state. An authorised charge will place a hold for the specified amount on the customer's account in the form of a pending debit. Once authorised you are guaranteed the funds are available and awaiting a capture request to the #endpoint:wReod3JtbzNutMSXj endpoint, at which point the charge will move to the captured state and the funds will be settled into your account. It is at this point the customer's interest free period will start if applicable for the selected account. ## Specific error responses If a charge was not able to be performed a \"402 - Request Failed\" status code will be returned as detailed in #docTextSection:fJYHM2ZKtEui8RrAM. The error object can contain more specific error reason codes, which are detailed below. | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | account_insufficient_funds | Customer does not have sufficient funds to perform the charge | | account_inoperative | The account is in arrears or closed and cannot be charged | | account_locked | The account is locked | | amount_invalid | The amount provided does not match the approved checkout amount | | fraud_check | Fraud checks resulted in payment failure |
132
+ # @param [Hash] opts the optional parameters
133
+ # @option opts [CreateChargeRequest] :body
134
+ # @option opts [String] :idempotency_key The unique idempotency key.
135
+ # @return [Charge]
136
+ def charges_create(opts = {})
137
+ data, _status_code, _headers = charges_create_with_http_info(opts)
138
+ return data
139
+ end
140
+
141
+ # Create a charge
142
+ # Creates a #model:ehEN48PET29iNdex3 which represents a charge against a customer&#39;s account. To execute this endpoint you must first obtain customer approval by implementing the #docTextSection:43C79g2JjeGs8AHWi as a part of your online store. This endpoint will return 201 if successful otherwise 402 with a specific error response. ## Capture or authorisation A charge can be created as either an authorisation or an immediate capture. This can be controlled in the initial request to the charge. In most cases you will want to immediately capture the payment, this will mark the debit for settlement into your account the very same day and will immediately deduct the funds from the customer&#39;s account. In some cases you may wish to delay the settlement of funds until a later date, perhaps until the goods are shipped to the customer. In this scenario you should send { capture: false } in the request to the #endpoint:dtmp3HxaHKjewvvGW endpoint and the charge will be created in an authorised state. An authorised charge will place a hold for the specified amount on the customer&#39;s account in the form of a pending debit. Once authorised you are guaranteed the funds are available and awaiting a capture request to the #endpoint:wReod3JtbzNutMSXj endpoint, at which point the charge will move to the captured state and the funds will be settled into your account. It is at this point the customer&#39;s interest free period will start if applicable for the selected account. ## Specific error responses If a charge was not able to be performed a \&quot;402 - Request Failed\&quot; status code will be returned as detailed in #docTextSection:fJYHM2ZKtEui8RrAM. The error object can contain more specific error reason codes, which are detailed below. | Error code | Description | |------------------------------------|--------------------------------------------------------------------------------------------------| | account_insufficient_funds | Customer does not have sufficient funds to perform the charge | | account_inoperative | The account is in arrears or closed and cannot be charged | | account_locked | The account is locked | | amount_invalid | The amount provided does not match the approved checkout amount | | fraud_check | Fraud checks resulted in payment failure |
143
+ # @param [Hash] opts the optional parameters
144
+ # @option opts [CreateChargeRequest] :body
145
+ # @option opts [String] :idempotency_key The unique idempotency key.
146
+ # @return [Array<(Charge, Fixnum, Hash)>] Charge data, response status code and response headers
147
+ def charges_create_with_http_info(opts = {})
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "Calling API: ChargesApi.charges_create ..."
150
+ end
151
+ # resource path
152
+ local_var_path = "/charges".sub('{format}','json')
153
+
154
+ # query parameters
155
+ query_params = {}
156
+
157
+ # header parameters
158
+ header_params = {}
159
+ # HTTP header 'Accept' (if needed)
160
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
161
+ # HTTP header 'Content-Type'
162
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
163
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
164
+
165
+ # form parameters
166
+ form_params = {}
167
+
168
+ # http body (model)
169
+ post_body = @api_client.object_to_http_body(opts[:'body'])
170
+ auth_names = ['Authorization']
171
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
172
+ :header_params => header_params,
173
+ :query_params => query_params,
174
+ :form_params => form_params,
175
+ :body => post_body,
176
+ :auth_names => auth_names,
177
+ :return_type => 'Charge')
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug "API called: ChargesApi#charges_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
180
+ end
181
+ return data, status_code, headers
182
+ end
183
+
184
+ # List charges
185
+ # Lists all charges matching search criteria.
186
+ # @param [Hash] opts the optional parameters
187
+ # @option opts [String] :state The state filter
188
+ # @option opts [Integer] :skip Number of items to skip when paging (default to 0)
189
+ # @option opts [Integer] :limit Number of items to retrieve when paging (default to 100)
190
+ # @option opts [String] :expand Allows expanding related entities in the response. Only valid entry is &#39;customer&#39;
191
+ # @return [ChargeCollection]
192
+ def charges_list(opts = {})
193
+ data, _status_code, _headers = charges_list_with_http_info(opts)
194
+ return data
195
+ end
196
+
197
+ # List charges
198
+ # Lists all charges matching search criteria.
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [String] :state The state filter
201
+ # @option opts [Integer] :skip Number of items to skip when paging
202
+ # @option opts [Integer] :limit Number of items to retrieve when paging
203
+ # @option opts [String] :expand Allows expanding related entities in the response. Only valid entry is &#39;customer&#39;
204
+ # @return [Array<(ChargeCollection, Fixnum, Hash)>] ChargeCollection data, response status code and response headers
205
+ def charges_list_with_http_info(opts = {})
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "Calling API: ChargesApi.charges_list ..."
208
+ end
209
+ # resource path
210
+ local_var_path = "/charges".sub('{format}','json')
211
+
212
+ # query parameters
213
+ query_params = {}
214
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
215
+ query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
216
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
217
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
218
+
219
+ # header parameters
220
+ header_params = {}
221
+ # HTTP header 'Accept' (if needed)
222
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
223
+ # HTTP header 'Content-Type'
224
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/javascript'])
225
+
226
+ # form parameters
227
+ form_params = {}
228
+
229
+ # http body (model)
230
+ post_body = nil
231
+ auth_names = ['Authorization']
232
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
233
+ :header_params => header_params,
234
+ :query_params => query_params,
235
+ :form_params => form_params,
236
+ :body => post_body,
237
+ :auth_names => auth_names,
238
+ :return_type => 'ChargeCollection')
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug "API called: ChargesApi#charges_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
241
+ end
242
+ return data, status_code, headers
243
+ end
244
+
245
+ # Retrieve a charge
246
+ # Retrieve details of a previously created charge.
247
+ # @param id The id of the charge
248
+ # @param [Hash] opts the optional parameters
249
+ # @option opts [String] :expand Allows expanding related entities in the response. Only valid entry is &#39;customer&#39;
250
+ # @return [Charge]
251
+ def charges_retrieve(id, opts = {})
252
+ data, _status_code, _headers = charges_retrieve_with_http_info(id, opts)
253
+ return data
254
+ end
255
+
256
+ # Retrieve a charge
257
+ # Retrieve details of a previously created charge.
258
+ # @param id The id of the charge
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [String] :expand Allows expanding related entities in the response. Only valid entry is &#39;customer&#39;
261
+ # @return [Array<(Charge, Fixnum, Hash)>] Charge data, response status code and response headers
262
+ def charges_retrieve_with_http_info(id, opts = {})
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug "Calling API: ChargesApi.charges_retrieve ..."
265
+ end
266
+ # verify the required parameter 'id' is set
267
+ fail ArgumentError, "Missing the required parameter 'id' when calling ChargesApi.charges_retrieve" if id.nil?
268
+ # resource path
269
+ local_var_path = "/charges/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
270
+
271
+ # query parameters
272
+ query_params = {}
273
+ query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
274
+
275
+ # header parameters
276
+ header_params = {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
279
+ # HTTP header 'Content-Type'
280
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/javascript'])
281
+
282
+ # form parameters
283
+ form_params = {}
284
+
285
+ # http body (model)
286
+ post_body = nil
287
+ auth_names = ['Authorization']
288
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
289
+ :header_params => header_params,
290
+ :query_params => query_params,
291
+ :form_params => form_params,
292
+ :body => post_body,
293
+ :auth_names => auth_names,
294
+ :return_type => 'Charge')
295
+ if @api_client.config.debugging
296
+ @api_client.config.logger.debug "API called: ChargesApi#charges_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
297
+ end
298
+ return data, status_code, headers
299
+ end
300
+ end
301
+ end
@@ -0,0 +1,120 @@
1
+ #Merchant API
2
+ #ZipMoney Merchant API Initial build
3
+ #zipMoney Merchant API version: 2017-03-01
4
+
5
+
6
+ require "uri"
7
+
8
+ module ZipMoney
9
+ class CheckoutsApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+
16
+ # Create a checkout
17
+ # Creates a zipMoney checkout. During the checkout process a customer can apply for credit decisioning in real-time. This means the checkout needs to represent a good picture of known customer details along with order information and the checkout entity represents this as a resource. For more information on how to checkout with zipMoney see the #model:Z2QcrzRGHACY8wM6G guide.
18
+ # @param [Hash] opts the optional parameters
19
+ # @option opts [CreateCheckoutRequest] :body
20
+ # @return [Checkout]
21
+ def checkouts_create(opts = {})
22
+ data, _status_code, _headers = checkouts_create_with_http_info(opts)
23
+ return data
24
+ end
25
+
26
+ # Create a checkout
27
+ # Creates a zipMoney checkout. During the checkout process a customer can apply for credit decisioning in real-time. This means the checkout needs to represent a good picture of known customer details along with order information and the checkout entity represents this as a resource. For more information on how to checkout with zipMoney see the #model:Z2QcrzRGHACY8wM6G guide.
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [CreateCheckoutRequest] :body
30
+ # @return [Array<(Checkout, Fixnum, Hash)>] Checkout data, response status code and response headers
31
+ def checkouts_create_with_http_info(opts = {})
32
+ if @api_client.config.debugging
33
+ @api_client.config.logger.debug "Calling API: CheckoutsApi.checkouts_create ..."
34
+ end
35
+ # resource path
36
+ local_var_path = "/checkouts".sub('{format}','json')
37
+
38
+ # query parameters
39
+ query_params = {}
40
+
41
+ # header parameters
42
+ header_params = {}
43
+ # HTTP header 'Accept' (if needed)
44
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
45
+ # HTTP header 'Content-Type'
46
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
47
+
48
+ # form parameters
49
+ form_params = {}
50
+
51
+ # http body (model)
52
+ post_body = @api_client.object_to_http_body(opts[:'body'])
53
+ auth_names = ['Authorization']
54
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
55
+ :header_params => header_params,
56
+ :query_params => query_params,
57
+ :form_params => form_params,
58
+ :body => post_body,
59
+ :auth_names => auth_names,
60
+ :return_type => 'Checkout')
61
+ if @api_client.config.debugging
62
+ @api_client.config.logger.debug "API called: CheckoutsApi#checkouts_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
63
+ end
64
+ return data, status_code, headers
65
+ end
66
+
67
+ # Retrieve a checkout
68
+ # Retrieves a previously created checkout by id.
69
+ # @param id
70
+ # @param [Hash] opts the optional parameters
71
+ # @return [Checkout]
72
+ def checkouts_get(id, opts = {})
73
+ data, _status_code, _headers = checkouts_get_with_http_info(id, opts)
74
+ return data
75
+ end
76
+
77
+ # Retrieve a checkout
78
+ # Retrieves a previously created checkout by id.
79
+ # @param id
80
+ # @param [Hash] opts the optional parameters
81
+ # @return [Array<(Checkout, Fixnum, Hash)>] Checkout data, response status code and response headers
82
+ def checkouts_get_with_http_info(id, opts = {})
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "Calling API: CheckoutsApi.checkouts_get ..."
85
+ end
86
+ # verify the required parameter 'id' is set
87
+ fail ArgumentError, "Missing the required parameter 'id' when calling CheckoutsApi.checkouts_get" if id.nil?
88
+ # resource path
89
+ local_var_path = "/checkouts/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
90
+
91
+ # query parameters
92
+ query_params = {}
93
+
94
+ # header parameters
95
+ header_params = {}
96
+ # HTTP header 'Accept' (if needed)
97
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
98
+ # HTTP header 'Content-Type'
99
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
100
+
101
+ # form parameters
102
+ form_params = {}
103
+
104
+ # http body (model)
105
+ post_body = nil
106
+ auth_names = ['Authorization']
107
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
108
+ :header_params => header_params,
109
+ :query_params => query_params,
110
+ :form_params => form_params,
111
+ :body => post_body,
112
+ :auth_names => auth_names,
113
+ :return_type => 'Checkout')
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug "API called: CheckoutsApi#checkouts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
116
+ end
117
+ return data, status_code, headers
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,116 @@
1
+ #Merchant API
2
+ #ZipMoney Merchant API Initial build
3
+ #zipMoney Merchant API version: 2017-03-01
4
+
5
+
6
+ require "uri"
7
+
8
+ module ZipMoney
9
+ class CustomersApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+
16
+ # Retrieve customer
17
+ # Retrieves the details of a customer by id. This will only return customer details for customers who have transacted previously via the zip Merchant API.
18
+ # @param id
19
+ # @param [Hash] opts the optional parameters
20
+ # @return [nil]
21
+ def customers_get(id, opts = {})
22
+ customers_get_with_http_info(id, opts)
23
+ return nil
24
+ end
25
+
26
+ # Retrieve customer
27
+ # Retrieves the details of a customer by id. This will only return customer details for customers who have transacted previously via the zip Merchant API.
28
+ # @param id
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
31
+ def customers_get_with_http_info(id, opts = {})
32
+ if @api_client.config.debugging
33
+ @api_client.config.logger.debug "Calling API: CustomersApi.customers_get ..."
34
+ end
35
+ # verify the required parameter 'id' is set
36
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.customers_get" if id.nil?
37
+ # resource path
38
+ local_var_path = "/customers/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
39
+
40
+ # query parameters
41
+ query_params = {}
42
+
43
+ # header parameters
44
+ header_params = {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
47
+ # HTTP header 'Content-Type'
48
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/javascript'])
49
+
50
+ # form parameters
51
+ form_params = {}
52
+
53
+ # http body (model)
54
+ post_body = nil
55
+ auth_names = []
56
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
57
+ :header_params => header_params,
58
+ :query_params => query_params,
59
+ :form_params => form_params,
60
+ :body => post_body,
61
+ :auth_names => auth_names)
62
+ if @api_client.config.debugging
63
+ @api_client.config.logger.debug "API called: CustomersApi#customers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
64
+ end
65
+ return data, status_code, headers
66
+ end
67
+
68
+ # List customers
69
+ # Returns a list of all customers who have transacted previously with your merchant account.
70
+ # @param [Hash] opts the optional parameters
71
+ # @return [nil]
72
+ def customers_list(opts = {})
73
+ customers_list_with_http_info(opts)
74
+ return nil
75
+ end
76
+
77
+ # List customers
78
+ # Returns a list of all customers who have transacted previously with your merchant account.
79
+ # @param [Hash] opts the optional parameters
80
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
81
+ def customers_list_with_http_info(opts = {})
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "Calling API: CustomersApi.customers_list ..."
84
+ end
85
+ # resource path
86
+ local_var_path = "/customers".sub('{format}','json')
87
+
88
+ # query parameters
89
+ query_params = {}
90
+
91
+ # header parameters
92
+ header_params = {}
93
+ # HTTP header 'Accept' (if needed)
94
+ header_params['Accept'] = @api_client.select_header_accept(['application/javascript'])
95
+ # HTTP header 'Content-Type'
96
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/javascript'])
97
+
98
+ # form parameters
99
+ form_params = {}
100
+
101
+ # http body (model)
102
+ post_body = nil
103
+ auth_names = []
104
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
105
+ :header_params => header_params,
106
+ :query_params => query_params,
107
+ :form_params => form_params,
108
+ :body => post_body,
109
+ :auth_names => auth_names)
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug "API called: CustomersApi#customers_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
112
+ end
113
+ return data, status_code, headers
114
+ end
115
+ end
116
+ end