mollie-api-ruby 2.2.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +7 -0
- data/README.md +37 -8
- data/examples/apis/api_docs.rb +1 -1
- data/examples/apis/chargebacks.rb +17 -0
- data/examples/apis/connect.rb +1 -1
- data/examples/apis/customers.rb +7 -6
- data/examples/apis/invoices.rb +2 -2
- data/examples/apis/issuers.rb +2 -2
- data/examples/apis/mandates.rb +5 -5
- data/examples/apis/methods.rb +2 -2
- data/examples/apis/organizations.rb +1 -1
- data/examples/apis/payments.rb +43 -9
- data/examples/apis/permissions.rb +2 -2
- data/examples/apis/profiles.rb +7 -7
- data/examples/apis/refunds.rb +1 -1
- data/examples/apis/settlements.rb +5 -5
- data/examples/apis/subscriptions.rb +7 -7
- data/examples/config.ru +6 -7
- data/lib/{mollie/api/cacert.pem → cacert.pem} +0 -0
- data/lib/mollie-api-ruby.rb +1 -0
- data/lib/mollie.rb +39 -0
- data/lib/mollie/base.rb +91 -0
- data/lib/mollie/chargeback.rb +36 -0
- data/lib/mollie/client.rb +125 -0
- data/lib/mollie/customer.rb +36 -0
- data/lib/mollie/customer/mandate.rb +33 -0
- data/lib/mollie/customer/payment.rb +6 -0
- data/lib/mollie/customer/subscription.rb +65 -0
- data/lib/mollie/exception.rb +8 -0
- data/lib/mollie/invoice.rb +66 -0
- data/lib/mollie/issuer.rb +5 -0
- data/lib/mollie/list.rb +40 -0
- data/lib/mollie/method.rb +38 -0
- data/lib/mollie/organization.rb +24 -0
- data/lib/mollie/payment.rb +142 -0
- data/lib/mollie/payment/chargeback.rb +6 -0
- data/lib/mollie/payment/refund.rb +6 -0
- data/lib/mollie/permission.rb +26 -0
- data/lib/mollie/profile.rb +78 -0
- data/lib/mollie/profile/api_key.rb +19 -0
- data/lib/mollie/refund.rb +42 -0
- data/lib/mollie/relation.rb +36 -0
- data/lib/mollie/settlement.rb +36 -0
- data/lib/mollie/settlement/chargeback.rb +6 -0
- data/lib/mollie/settlement/payment.rb +6 -0
- data/lib/mollie/settlement/refund.rb +6 -0
- data/lib/mollie/util.rb +57 -0
- data/lib/mollie/version.rb +3 -0
- data/mollie.gemspec +2 -2
- data/test/helper.rb +5 -1
- data/test/mollie/base_test.rb +182 -0
- data/test/mollie/chargeback_test.rb +35 -0
- data/test/mollie/client_test.rb +122 -0
- data/test/mollie/customer/mandate_test.rb +43 -0
- data/test/mollie/customer/payment_test.rb +23 -0
- data/test/mollie/customer/subscription_test.rb +66 -0
- data/test/mollie/customer_test.rb +128 -0
- data/test/mollie/invoice_test.rb +55 -0
- data/test/mollie/issuer_test.rb +19 -0
- data/test/mollie/list_test.rb +40 -0
- data/test/mollie/method_test.rb +29 -0
- data/test/mollie/organization_test.rb +41 -0
- data/test/mollie/payment/chargeback_test.rb +22 -0
- data/test/mollie/payment/refund_test.rb +22 -0
- data/test/mollie/payment_test.rb +161 -0
- data/test/mollie/permission_test.rb +21 -0
- data/test/mollie/profile/apikey_test.rb +31 -0
- data/test/mollie/profile_test.rb +98 -0
- data/test/mollie/refund_test.rb +40 -0
- data/test/mollie/settlement/chargeback_test.rb +22 -0
- data/test/mollie/settlement/payment_test.rb +22 -0
- data/test/mollie/settlement/refund_test.rb +22 -0
- data/test/mollie/settlement_test.rb +156 -0
- data/website-docs/chargebacks/list-all.rb +12 -0
- data/website-docs/connect/authorize.rb +15 -0
- data/website-docs/connect/tokens.rb +14 -0
- data/website-docs/customers/create-payment.rb +13 -0
- data/website-docs/customers/create.rb +12 -0
- data/website-docs/customers/delete.rb +10 -0
- data/website-docs/customers/get.rb +10 -0
- data/website-docs/customers/list-payments.rb +10 -0
- data/website-docs/customers/list.rb +12 -0
- data/website-docs/customers/update.rb +11 -0
- data/website-docs/invoices/get.rb +10 -0
- data/website-docs/invoices/list.rb +12 -0
- data/website-docs/issuers/get.rb +10 -0
- data/website-docs/issuers/list.rb +12 -0
- data/website-docs/mandates/create.rb +16 -0
- data/website-docs/mandates/delete.rb +10 -0
- data/website-docs/mandates/get.rb +10 -0
- data/website-docs/mandates/list.rb +12 -0
- data/website-docs/methods/get.rb +10 -0
- data/website-docs/methods/list.rb +12 -0
- data/website-docs/organisations/get.rb +10 -0
- data/website-docs/payments/create-refund.rb +14 -0
- data/website-docs/payments/create.rb +16 -0
- data/website-docs/payments/delete-refund.rb +13 -0
- data/website-docs/payments/delete.rb +12 -0
- data/website-docs/payments/get-chargeback.rb +11 -0
- data/website-docs/payments/get-refund.rb +11 -0
- data/website-docs/payments/get.rb +10 -0
- data/website-docs/payments/list-chargeback.rb +13 -0
- data/website-docs/payments/list-refunds.rb +13 -0
- data/website-docs/payments/list.rb +12 -0
- data/website-docs/payments/payment-webhook.rb +21 -0
- data/website-docs/permissions/get.rb +10 -0
- data/website-docs/permissions/list.rb +12 -0
- data/website-docs/profiles/create.rb +15 -0
- data/website-docs/profiles/delete.rb +10 -0
- data/website-docs/profiles/get-key.rb +11 -0
- data/website-docs/profiles/get.rb +10 -0
- data/website-docs/profiles/list-keys.rb +13 -0
- data/website-docs/profiles/list.rb +12 -0
- data/website-docs/profiles/reset-key.rb +13 -0
- data/website-docs/profiles/update.rb +12 -0
- data/website-docs/refunds/list.rb +12 -0
- data/website-docs/settlements/get.rb +10 -0
- data/website-docs/settlements/list-chargebacks.rb +13 -0
- data/website-docs/settlements/list-payments.rb +13 -0
- data/website-docs/settlements/list-refunds.rb +13 -0
- data/website-docs/settlements/list.rb +12 -0
- data/website-docs/settlements/next.rb +9 -0
- data/website-docs/settlements/open.rb +9 -0
- data/website-docs/subscriptions/create.rb +14 -0
- data/website-docs/subscriptions/delete.rb +10 -0
- data/website-docs/subscriptions/get.rb +10 -0
- data/website-docs/subscriptions/list.rb +12 -0
- metadata +134 -104
- data/lib/mollie/api/client.rb +0 -161
- data/lib/mollie/api/client/version.rb +0 -7
- data/lib/mollie/api/exception.rb +0 -10
- data/lib/mollie/api/object/base.rb +0 -18
- data/lib/mollie/api/object/customer.rb +0 -28
- data/lib/mollie/api/object/customer/mandate.rb +0 -37
- data/lib/mollie/api/object/customer/subscription.rb +0 -69
- data/lib/mollie/api/object/invoice.rb +0 -70
- data/lib/mollie/api/object/issuer.rb +0 -9
- data/lib/mollie/api/object/list.rb +0 -44
- data/lib/mollie/api/object/method.rb +0 -42
- data/lib/mollie/api/object/organization.rb +0 -28
- data/lib/mollie/api/object/payment.rb +0 -137
- data/lib/mollie/api/object/payment/refund.rb +0 -47
- data/lib/mollie/api/object/permission.rb +0 -12
- data/lib/mollie/api/object/profile.rb +0 -78
- data/lib/mollie/api/object/profile/apikey.rb +0 -23
- data/lib/mollie/api/object/settlement.rb +0 -32
- data/lib/mollie/api/resource/base.rb +0 -53
- data/lib/mollie/api/resource/customers.rb +0 -11
- data/lib/mollie/api/resource/customers/mandates.rb +0 -27
- data/lib/mollie/api/resource/customers/payments.rb +0 -27
- data/lib/mollie/api/resource/customers/subscriptions.rb +0 -27
- data/lib/mollie/api/resource/invoices.rb +0 -11
- data/lib/mollie/api/resource/issuers.rb +0 -11
- data/lib/mollie/api/resource/methods.rb +0 -11
- data/lib/mollie/api/resource/organizations.rb +0 -11
- data/lib/mollie/api/resource/payments.rb +0 -11
- data/lib/mollie/api/resource/payments/refunds.rb +0 -27
- data/lib/mollie/api/resource/permissions.rb +0 -31
- data/lib/mollie/api/resource/profiles.rb +0 -11
- data/lib/mollie/api/resource/profiles/apikeys.rb +0 -33
- data/lib/mollie/api/resource/refunds.rb +0 -11
- data/lib/mollie/api/resource/settlements.rb +0 -19
- data/lib/mollie/api/resource/settlements/payments.rb +0 -27
- data/lib/mollie/api/util.rb +0 -53
- data/test/mollie/api/client_test.rb +0 -111
- data/test/mollie/api/object/base_test.rb +0 -21
- data/test/mollie/api/object/customer/mandate_test.rb +0 -47
- data/test/mollie/api/object/customer/subscription_test.rb +0 -70
- data/test/mollie/api/object/customer_test.rb +0 -35
- data/test/mollie/api/object/invoice_test.rb +0 -59
- data/test/mollie/api/object/issuer_test.rb +0 -23
- data/test/mollie/api/object/list_test.rb +0 -44
- data/test/mollie/api/object/method_test.rb +0 -33
- data/test/mollie/api/object/organization_test.rb +0 -45
- data/test/mollie/api/object/payment/refund_test.rb +0 -46
- data/test/mollie/api/object/payment_test.rb +0 -106
- data/test/mollie/api/object/permission_test.rb +0 -25
- data/test/mollie/api/object/profile/apikey_test.rb +0 -35
- data/test/mollie/api/object/profile_test.rb +0 -72
- data/test/mollie/api/object/settlement_test.rb +0 -140
- data/test/mollie/api/resource/base_test.rb +0 -83
- data/test/mollie/api/resource/customers/mandates_test.rb +0 -23
- data/test/mollie/api/resource/customers/payments_test.rb +0 -23
- data/test/mollie/api/resource/customers/subscriptions_test.rb +0 -23
- data/test/mollie/api/resource/customers_test.rb +0 -13
- data/test/mollie/api/resource/invoices_test.rb +0 -13
- data/test/mollie/api/resource/issuers_test.rb +0 -13
- data/test/mollie/api/resource/methods_test.rb +0 -13
- data/test/mollie/api/resource/organizations_test.rb +0 -13
- data/test/mollie/api/resource/payments/refunds_test.rb +0 -23
- data/test/mollie/api/resource/payments_test.rb +0 -13
- data/test/mollie/api/resource/permissions_test.rb +0 -13
- data/test/mollie/api/resource/profiles/apikeys_test.rb +0 -23
- data/test/mollie/api/resource/profiles_test.rb +0 -13
- data/test/mollie/api/resource/settlements_test.rb +0 -13
- data/test/mollie/api/util_test.rb +0 -47
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'mollie-api-ruby'
|
2
|
+
|
3
|
+
begin
|
4
|
+
offset = 0
|
5
|
+
limit = 50
|
6
|
+
refunds = Mollie::Settlement::Refund.all(
|
7
|
+
offset, limit,
|
8
|
+
settlement_id: "stl_jDk30akdN",
|
9
|
+
api_key: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
|
10
|
+
)
|
11
|
+
rescue Mollie::Exception => e
|
12
|
+
puts 'An error has occurred: ' << e.message
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'mollie-api-ruby'
|
2
|
+
|
3
|
+
begin
|
4
|
+
offset = 0
|
5
|
+
limit = 50
|
6
|
+
settlements = Mollie::Settlement.all(
|
7
|
+
offset, limit,
|
8
|
+
api_key: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
|
9
|
+
)
|
10
|
+
rescue Mollie::Exception => e
|
11
|
+
puts 'An error has occurred: ' << e.message
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'mollie-api-ruby'
|
2
|
+
|
3
|
+
begin
|
4
|
+
subscription = Mollie::Customer::Subscription.create(
|
5
|
+
amount: "20.00",
|
6
|
+
times: 4,
|
7
|
+
interval: "3 months",
|
8
|
+
description: "Quarterly payment",
|
9
|
+
webhook_url: "https://webshop.example.org/payments/webhook/",
|
10
|
+
api_key: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
|
11
|
+
)
|
12
|
+
rescue Mollie::Exception => e
|
13
|
+
puts 'An error has occurred: ' << e.message
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'mollie-api-ruby'
|
2
|
+
|
3
|
+
begin
|
4
|
+
offset = 0
|
5
|
+
limit = 50
|
6
|
+
subscriptions = Mollie::Subscription.all(
|
7
|
+
offset, limit,
|
8
|
+
api_key: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
|
9
|
+
)
|
10
|
+
rescue Mollie::Exception => e
|
11
|
+
puts 'An error has occurred: ' << e.message
|
12
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mollie-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mollie B.V.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- README.md
|
171
171
|
- Rakefile
|
172
172
|
- examples/apis/api_docs.rb
|
173
|
+
- examples/apis/chargebacks.rb
|
173
174
|
- examples/apis/connect.rb
|
174
175
|
- examples/apis/customers.rb
|
175
176
|
- examples/apis/invoices.rb
|
@@ -219,78 +220,116 @@ files:
|
|
219
220
|
- examples/public/stylesheets/screen.css
|
220
221
|
- examples/public/stylesheets/swagger_docs.css
|
221
222
|
- examples/public/stylesheets/typography.css
|
222
|
-
- lib/
|
223
|
-
- lib/mollie
|
224
|
-
- lib/mollie
|
225
|
-
- lib/mollie/
|
226
|
-
- lib/mollie/
|
227
|
-
- lib/mollie/
|
228
|
-
- lib/mollie/
|
229
|
-
- lib/mollie/
|
230
|
-
- lib/mollie/
|
231
|
-
- lib/mollie/
|
232
|
-
- lib/mollie/
|
233
|
-
- lib/mollie/
|
234
|
-
- lib/mollie/
|
235
|
-
- lib/mollie/
|
236
|
-
- lib/mollie/
|
237
|
-
- lib/mollie/
|
238
|
-
- lib/mollie/
|
239
|
-
- lib/mollie/
|
240
|
-
- lib/mollie/
|
241
|
-
- lib/mollie/
|
242
|
-
- lib/mollie/
|
243
|
-
- lib/mollie/
|
244
|
-
- lib/mollie/
|
245
|
-
- lib/mollie/
|
246
|
-
- lib/mollie/
|
247
|
-
- lib/mollie/
|
248
|
-
- lib/mollie/
|
249
|
-
- lib/mollie/
|
250
|
-
- lib/mollie/
|
251
|
-
- lib/mollie/
|
252
|
-
- lib/mollie/api/resource/permissions.rb
|
253
|
-
- lib/mollie/api/resource/profiles.rb
|
254
|
-
- lib/mollie/api/resource/profiles/apikeys.rb
|
255
|
-
- lib/mollie/api/resource/refunds.rb
|
256
|
-
- lib/mollie/api/resource/settlements.rb
|
257
|
-
- lib/mollie/api/resource/settlements/payments.rb
|
258
|
-
- lib/mollie/api/util.rb
|
223
|
+
- lib/cacert.pem
|
224
|
+
- lib/mollie-api-ruby.rb
|
225
|
+
- lib/mollie.rb
|
226
|
+
- lib/mollie/base.rb
|
227
|
+
- lib/mollie/chargeback.rb
|
228
|
+
- lib/mollie/client.rb
|
229
|
+
- lib/mollie/customer.rb
|
230
|
+
- lib/mollie/customer/mandate.rb
|
231
|
+
- lib/mollie/customer/payment.rb
|
232
|
+
- lib/mollie/customer/subscription.rb
|
233
|
+
- lib/mollie/exception.rb
|
234
|
+
- lib/mollie/invoice.rb
|
235
|
+
- lib/mollie/issuer.rb
|
236
|
+
- lib/mollie/list.rb
|
237
|
+
- lib/mollie/method.rb
|
238
|
+
- lib/mollie/organization.rb
|
239
|
+
- lib/mollie/payment.rb
|
240
|
+
- lib/mollie/payment/chargeback.rb
|
241
|
+
- lib/mollie/payment/refund.rb
|
242
|
+
- lib/mollie/permission.rb
|
243
|
+
- lib/mollie/profile.rb
|
244
|
+
- lib/mollie/profile/api_key.rb
|
245
|
+
- lib/mollie/refund.rb
|
246
|
+
- lib/mollie/relation.rb
|
247
|
+
- lib/mollie/settlement.rb
|
248
|
+
- lib/mollie/settlement/chargeback.rb
|
249
|
+
- lib/mollie/settlement/payment.rb
|
250
|
+
- lib/mollie/settlement/refund.rb
|
251
|
+
- lib/mollie/util.rb
|
252
|
+
- lib/mollie/version.rb
|
259
253
|
- mollie.gemspec
|
260
254
|
- test/helper.rb
|
261
|
-
- test/mollie/
|
262
|
-
- test/mollie/
|
263
|
-
- test/mollie/
|
264
|
-
- test/mollie/
|
265
|
-
- test/mollie/
|
266
|
-
- test/mollie/
|
267
|
-
- test/mollie/
|
268
|
-
- test/mollie/
|
269
|
-
- test/mollie/
|
270
|
-
- test/mollie/
|
271
|
-
- test/mollie/
|
272
|
-
- test/mollie/
|
273
|
-
- test/mollie/
|
274
|
-
- test/mollie/
|
275
|
-
- test/mollie/
|
276
|
-
- test/mollie/
|
277
|
-
- test/mollie/
|
278
|
-
- test/mollie/
|
279
|
-
- test/mollie/
|
280
|
-
- test/mollie/
|
281
|
-
- test/mollie/
|
282
|
-
- test/mollie/
|
283
|
-
- test/mollie/
|
284
|
-
- test/mollie/api/resource/methods_test.rb
|
285
|
-
- test/mollie/api/resource/organizations_test.rb
|
286
|
-
- test/mollie/api/resource/payments/refunds_test.rb
|
287
|
-
- test/mollie/api/resource/payments_test.rb
|
288
|
-
- test/mollie/api/resource/permissions_test.rb
|
289
|
-
- test/mollie/api/resource/profiles/apikeys_test.rb
|
290
|
-
- test/mollie/api/resource/profiles_test.rb
|
291
|
-
- test/mollie/api/resource/settlements_test.rb
|
292
|
-
- test/mollie/api/util_test.rb
|
255
|
+
- test/mollie/base_test.rb
|
256
|
+
- test/mollie/chargeback_test.rb
|
257
|
+
- test/mollie/client_test.rb
|
258
|
+
- test/mollie/customer/mandate_test.rb
|
259
|
+
- test/mollie/customer/payment_test.rb
|
260
|
+
- test/mollie/customer/subscription_test.rb
|
261
|
+
- test/mollie/customer_test.rb
|
262
|
+
- test/mollie/invoice_test.rb
|
263
|
+
- test/mollie/issuer_test.rb
|
264
|
+
- test/mollie/list_test.rb
|
265
|
+
- test/mollie/method_test.rb
|
266
|
+
- test/mollie/organization_test.rb
|
267
|
+
- test/mollie/payment/chargeback_test.rb
|
268
|
+
- test/mollie/payment/refund_test.rb
|
269
|
+
- test/mollie/payment_test.rb
|
270
|
+
- test/mollie/permission_test.rb
|
271
|
+
- test/mollie/profile/apikey_test.rb
|
272
|
+
- test/mollie/profile_test.rb
|
273
|
+
- test/mollie/refund_test.rb
|
274
|
+
- test/mollie/settlement/chargeback_test.rb
|
275
|
+
- test/mollie/settlement/payment_test.rb
|
276
|
+
- test/mollie/settlement/refund_test.rb
|
277
|
+
- test/mollie/settlement_test.rb
|
293
278
|
- test/run-test.rb
|
279
|
+
- website-docs/chargebacks/list-all.rb
|
280
|
+
- website-docs/connect/authorize.rb
|
281
|
+
- website-docs/connect/tokens.rb
|
282
|
+
- website-docs/customers/create-payment.rb
|
283
|
+
- website-docs/customers/create.rb
|
284
|
+
- website-docs/customers/delete.rb
|
285
|
+
- website-docs/customers/get.rb
|
286
|
+
- website-docs/customers/list-payments.rb
|
287
|
+
- website-docs/customers/list.rb
|
288
|
+
- website-docs/customers/update.rb
|
289
|
+
- website-docs/invoices/get.rb
|
290
|
+
- website-docs/invoices/list.rb
|
291
|
+
- website-docs/issuers/get.rb
|
292
|
+
- website-docs/issuers/list.rb
|
293
|
+
- website-docs/mandates/create.rb
|
294
|
+
- website-docs/mandates/delete.rb
|
295
|
+
- website-docs/mandates/get.rb
|
296
|
+
- website-docs/mandates/list.rb
|
297
|
+
- website-docs/methods/get.rb
|
298
|
+
- website-docs/methods/list.rb
|
299
|
+
- website-docs/organisations/get.rb
|
300
|
+
- website-docs/payments/create-refund.rb
|
301
|
+
- website-docs/payments/create.rb
|
302
|
+
- website-docs/payments/delete-refund.rb
|
303
|
+
- website-docs/payments/delete.rb
|
304
|
+
- website-docs/payments/get-chargeback.rb
|
305
|
+
- website-docs/payments/get-refund.rb
|
306
|
+
- website-docs/payments/get.rb
|
307
|
+
- website-docs/payments/list-chargeback.rb
|
308
|
+
- website-docs/payments/list-refunds.rb
|
309
|
+
- website-docs/payments/list.rb
|
310
|
+
- website-docs/payments/payment-webhook.rb
|
311
|
+
- website-docs/permissions/get.rb
|
312
|
+
- website-docs/permissions/list.rb
|
313
|
+
- website-docs/profiles/create.rb
|
314
|
+
- website-docs/profiles/delete.rb
|
315
|
+
- website-docs/profiles/get-key.rb
|
316
|
+
- website-docs/profiles/get.rb
|
317
|
+
- website-docs/profiles/list-keys.rb
|
318
|
+
- website-docs/profiles/list.rb
|
319
|
+
- website-docs/profiles/reset-key.rb
|
320
|
+
- website-docs/profiles/update.rb
|
321
|
+
- website-docs/refunds/list.rb
|
322
|
+
- website-docs/settlements/get.rb
|
323
|
+
- website-docs/settlements/list-chargebacks.rb
|
324
|
+
- website-docs/settlements/list-payments.rb
|
325
|
+
- website-docs/settlements/list-refunds.rb
|
326
|
+
- website-docs/settlements/list.rb
|
327
|
+
- website-docs/settlements/next.rb
|
328
|
+
- website-docs/settlements/open.rb
|
329
|
+
- website-docs/subscriptions/create.rb
|
330
|
+
- website-docs/subscriptions/delete.rb
|
331
|
+
- website-docs/subscriptions/get.rb
|
332
|
+
- website-docs/subscriptions/list.rb
|
294
333
|
homepage: https://github.com/mollie/mollie-api-ruby
|
295
334
|
licenses:
|
296
335
|
- BSD
|
@@ -311,42 +350,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
350
|
version: '0'
|
312
351
|
requirements: []
|
313
352
|
rubyforge_project:
|
314
|
-
rubygems_version: 2.4
|
353
|
+
rubygems_version: 2.7.4
|
315
354
|
signing_key:
|
316
355
|
specification_version: 4
|
317
356
|
summary: Official Mollie API Client for Ruby
|
318
357
|
test_files:
|
319
358
|
- test/helper.rb
|
320
|
-
- test/mollie/
|
321
|
-
- test/mollie/
|
322
|
-
- test/mollie/
|
323
|
-
- test/mollie/
|
324
|
-
- test/mollie/
|
325
|
-
- test/mollie/
|
326
|
-
- test/mollie/
|
327
|
-
- test/mollie/
|
328
|
-
- test/mollie/
|
329
|
-
- test/mollie/
|
330
|
-
- test/mollie/
|
331
|
-
- test/mollie/
|
332
|
-
- test/mollie/
|
333
|
-
- test/mollie/
|
334
|
-
- test/mollie/
|
335
|
-
- test/mollie/
|
336
|
-
- test/mollie/
|
337
|
-
- test/mollie/
|
338
|
-
- test/mollie/
|
339
|
-
- test/mollie/
|
340
|
-
- test/mollie/
|
341
|
-
- test/mollie/
|
342
|
-
- test/mollie/
|
343
|
-
- test/mollie/api/resource/methods_test.rb
|
344
|
-
- test/mollie/api/resource/organizations_test.rb
|
345
|
-
- test/mollie/api/resource/payments/refunds_test.rb
|
346
|
-
- test/mollie/api/resource/payments_test.rb
|
347
|
-
- test/mollie/api/resource/permissions_test.rb
|
348
|
-
- test/mollie/api/resource/profiles/apikeys_test.rb
|
349
|
-
- test/mollie/api/resource/profiles_test.rb
|
350
|
-
- test/mollie/api/resource/settlements_test.rb
|
351
|
-
- test/mollie/api/util_test.rb
|
359
|
+
- test/mollie/base_test.rb
|
360
|
+
- test/mollie/chargeback_test.rb
|
361
|
+
- test/mollie/client_test.rb
|
362
|
+
- test/mollie/customer/mandate_test.rb
|
363
|
+
- test/mollie/customer/payment_test.rb
|
364
|
+
- test/mollie/customer/subscription_test.rb
|
365
|
+
- test/mollie/customer_test.rb
|
366
|
+
- test/mollie/invoice_test.rb
|
367
|
+
- test/mollie/issuer_test.rb
|
368
|
+
- test/mollie/list_test.rb
|
369
|
+
- test/mollie/method_test.rb
|
370
|
+
- test/mollie/organization_test.rb
|
371
|
+
- test/mollie/payment/chargeback_test.rb
|
372
|
+
- test/mollie/payment/refund_test.rb
|
373
|
+
- test/mollie/payment_test.rb
|
374
|
+
- test/mollie/permission_test.rb
|
375
|
+
- test/mollie/profile/apikey_test.rb
|
376
|
+
- test/mollie/profile_test.rb
|
377
|
+
- test/mollie/refund_test.rb
|
378
|
+
- test/mollie/settlement/chargeback_test.rb
|
379
|
+
- test/mollie/settlement/payment_test.rb
|
380
|
+
- test/mollie/settlement/refund_test.rb
|
381
|
+
- test/mollie/settlement_test.rb
|
352
382
|
- test/run-test.rb
|
data/lib/mollie/api/client.rb
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
require "json"
|
2
|
-
require "time"
|
3
|
-
require "ostruct"
|
4
|
-
require "bigdecimal"
|
5
|
-
require "net/https"
|
6
|
-
|
7
|
-
["exception",
|
8
|
-
"util",
|
9
|
-
"client/version",
|
10
|
-
"resource/base",
|
11
|
-
"resource/customers",
|
12
|
-
"resource/customers/mandates",
|
13
|
-
"resource/customers/payments",
|
14
|
-
"resource/customers/subscriptions",
|
15
|
-
"resource/invoices",
|
16
|
-
"resource/issuers",
|
17
|
-
"resource/methods",
|
18
|
-
"resource/organizations",
|
19
|
-
"resource/payments",
|
20
|
-
"resource/payments/refunds",
|
21
|
-
"resource/refunds",
|
22
|
-
"resource/permissions",
|
23
|
-
"resource/profiles",
|
24
|
-
"resource/profiles/apikeys",
|
25
|
-
"resource/settlements",
|
26
|
-
"resource/settlements/payments",
|
27
|
-
"object/base",
|
28
|
-
"object/list",
|
29
|
-
"object/customer",
|
30
|
-
"object/customer/mandate",
|
31
|
-
"object/customer/subscription",
|
32
|
-
"object/invoice",
|
33
|
-
"object/issuer",
|
34
|
-
"object/method",
|
35
|
-
"object/organization",
|
36
|
-
"object/payment",
|
37
|
-
"object/payment/refund",
|
38
|
-
"object/permission",
|
39
|
-
"object/profile",
|
40
|
-
"object/profile/apikey",
|
41
|
-
"object/settlement"].each { |file| require File.expand_path file, File.dirname(__FILE__) }
|
42
|
-
|
43
|
-
module Mollie
|
44
|
-
module API
|
45
|
-
class Client
|
46
|
-
API_ENDPOINT = "https://api.mollie.nl"
|
47
|
-
API_VERSION = "v1"
|
48
|
-
|
49
|
-
MODE_TEST = "test"
|
50
|
-
MODE_LIVE = "live"
|
51
|
-
|
52
|
-
attr_accessor :api_key
|
53
|
-
attr_reader :customers, :customers_payments, :customers_mandates, :customers_subscriptions,
|
54
|
-
:issuers, :methods, :organizations, :payments, :payments_refunds, :refunds,
|
55
|
-
:permissions, :profiles, :profiles_api_keys, :settlements, :settlements_payments, :invoices,
|
56
|
-
:api_endpoint
|
57
|
-
|
58
|
-
def initialize(api_key)
|
59
|
-
@customers = Mollie::API::Resource::Customers.new self
|
60
|
-
@customers_payments = Mollie::API::Resource::Customers::Payments.new self
|
61
|
-
@customers_mandates = Mollie::API::Resource::Customers::Mandates.new self
|
62
|
-
@customers_subscriptions = Mollie::API::Resource::Customers::Subscriptions.new self
|
63
|
-
@issuers = Mollie::API::Resource::Issuers.new self
|
64
|
-
@methods = Mollie::API::Resource::Methods.new self
|
65
|
-
@organizations = Mollie::API::Resource::Organizations.new self
|
66
|
-
@payments = Mollie::API::Resource::Payments.new self
|
67
|
-
@payments_refunds = Mollie::API::Resource::Payments::Refunds.new self
|
68
|
-
@refunds = Mollie::API::Resource::Refunds.new self
|
69
|
-
@permissions = Mollie::API::Resource::Permissions.new self
|
70
|
-
@profiles = Mollie::API::Resource::Profiles.new self
|
71
|
-
@profiles_api_keys = Mollie::API::Resource::Profiles::ApiKeys.new self
|
72
|
-
@settlements = Mollie::API::Resource::Settlements.new self
|
73
|
-
@settlements_payments = Mollie::API::Resource::Settlements::Payments.new self
|
74
|
-
@invoices = Mollie::API::Resource::Invoices.new self
|
75
|
-
|
76
|
-
@api_endpoint = API_ENDPOINT
|
77
|
-
@api_key = api_key
|
78
|
-
@version_strings = []
|
79
|
-
|
80
|
-
add_version_string "Mollie/" << VERSION
|
81
|
-
add_version_string "Ruby/" << RUBY_VERSION
|
82
|
-
add_version_string OpenSSL::OPENSSL_VERSION.split(" ").slice(0, 2).join "/"
|
83
|
-
end
|
84
|
-
|
85
|
-
def api_endpoint=(api_endpoint)
|
86
|
-
@api_endpoint = api_endpoint.chomp "/"
|
87
|
-
end
|
88
|
-
|
89
|
-
def add_version_string(version_string)
|
90
|
-
@version_strings << (version_string.gsub /\s+/, "-")
|
91
|
-
end
|
92
|
-
|
93
|
-
def perform_http_call(http_method, api_method, id = nil, http_body = {}, query = {})
|
94
|
-
path = "/#{API_VERSION}/#{api_method}/#{id}".chomp('/')
|
95
|
-
if query.length > 0
|
96
|
-
camelized_query = Util.camelize_keys(query)
|
97
|
-
path += "?#{URI.encode_www_form(camelized_query)}"
|
98
|
-
end
|
99
|
-
|
100
|
-
case http_method
|
101
|
-
when 'GET'
|
102
|
-
request = Net::HTTP::Get.new(path)
|
103
|
-
when 'POST'
|
104
|
-
http_body.delete_if { |k, v| v.nil? }
|
105
|
-
request = Net::HTTP::Post.new(path)
|
106
|
-
request.body = Util.camelize_keys(http_body).to_json
|
107
|
-
when 'DELETE'
|
108
|
-
http_body.delete_if { |k, v| v.nil? }
|
109
|
-
request = Net::HTTP::Delete.new(path)
|
110
|
-
request.body = Util.camelize_keys(http_body).to_json
|
111
|
-
else
|
112
|
-
raise Mollie::API::Exception.new("Invalid HTTP Method: #{http_method}")
|
113
|
-
end
|
114
|
-
|
115
|
-
request['Accept'] = 'application/json'
|
116
|
-
request['Content-Type'] = 'application/json'
|
117
|
-
request['Authorization'] = "Bearer #{@api_key}"
|
118
|
-
request['User-Agent'] = @version_strings.join(" ")
|
119
|
-
|
120
|
-
begin
|
121
|
-
response = client.request(request)
|
122
|
-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
123
|
-
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
124
|
-
raise Mollie::API::Exception.new(e.message)
|
125
|
-
end
|
126
|
-
|
127
|
-
http_code = response.code.to_i
|
128
|
-
case http_code
|
129
|
-
when 200, 201
|
130
|
-
Util.nested_underscore_keys(JSON.parse(response.body))
|
131
|
-
when 204
|
132
|
-
{} # No Content
|
133
|
-
else
|
134
|
-
response = JSON.parse(response.body)
|
135
|
-
if response['error']
|
136
|
-
exception = Mollie::API::Exception.new response['error']['message']
|
137
|
-
exception.field = response['error']['field'] unless response['error']['field'].nil?
|
138
|
-
elsif response['errors']
|
139
|
-
exception = Mollie::API::Exception.new response['errors'].values.join(", ")
|
140
|
-
else
|
141
|
-
exception = Mollie::API::Exception.new response.body
|
142
|
-
end
|
143
|
-
exception.code = http_code
|
144
|
-
raise exception
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
private
|
149
|
-
|
150
|
-
def client
|
151
|
-
return @client if defined? @client
|
152
|
-
uri = URI.parse(@api_endpoint)
|
153
|
-
@client = Net::HTTP.new(uri.host, uri.port)
|
154
|
-
@client.use_ssl = true
|
155
|
-
@client.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
156
|
-
@client.ca_file = (File.expand_path "cacert.pem", File.dirname(__FILE__))
|
157
|
-
@client
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|