mollie-api-ruby 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +92 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +1 -1
- data/Gemfile +1 -1
- data/Rakefile +1 -2
- data/bin/console +4 -4
- data/docs/migration_v2_2_x.md +1 -1
- data/docs/migration_v3_x.md +2 -2
- data/examples/chargebacks/get.rb +2 -2
- data/examples/customers/create-payment.rb +4 -4
- data/examples/customers/create.rb +3 -3
- data/examples/customers/delete.rb +1 -1
- data/examples/customers/get.rb +1 -1
- data/examples/customers/list-payments.rb +1 -1
- data/examples/customers/update.rb +2 -2
- data/examples/invoices/get.rb +1 -1
- data/examples/mandates/create.rb +7 -7
- data/examples/mandates/delete.rb +1 -1
- data/examples/mandates/get.rb +1 -1
- data/examples/mandates/list.rb +1 -1
- data/examples/methods/get.rb +2 -2
- data/examples/organisations/get.rb +1 -1
- data/examples/payments/delete.rb +1 -1
- data/examples/payments/get-customer.rb +1 -1
- data/examples/payments/get-mandate.rb +1 -1
- data/examples/payments/get-settlement.rb +1 -1
- data/examples/payments/get-subscription.rb +1 -1
- data/examples/payments/get.rb +1 -1
- data/examples/payments/webhook.rb +1 -1
- data/examples/permissions/get.rb +1 -1
- data/examples/profiles/create.rb +6 -6
- data/examples/profiles/delete.rb +1 -1
- data/examples/profiles/get.rb +1 -1
- data/examples/profiles/list-chargebacks.rb +1 -1
- data/examples/profiles/list-methods.rb +1 -1
- data/examples/profiles/list-payments.rb +1 -1
- data/examples/profiles/list-refunds.rb +1 -1
- data/examples/profiles/update.rb +3 -3
- data/examples/refunds/create.rb +3 -3
- data/examples/refunds/delete.rb +2 -2
- data/examples/refunds/get.rb +2 -2
- data/examples/settlements/get.rb +1 -1
- data/examples/settlements/list-chargebacks.rb +1 -1
- data/examples/settlements/list-payments.rb +1 -1
- data/examples/settlements/list-refunds.rb +1 -1
- data/examples/subscriptions/create.rb +5 -5
- data/examples/subscriptions/delete.rb +2 -2
- data/examples/subscriptions/get.rb +2 -2
- data/examples/subscriptions/list.rb +1 -1
- data/examples/subscriptions/update.rb +1 -1
- data/lib/cacert.pem +2 -26
- data/lib/mollie.rb +0 -1
- data/lib/mollie/amount.rb +1 -1
- data/lib/mollie/base.rb +8 -8
- data/lib/mollie/chargeback.rb +12 -6
- data/lib/mollie/client.rb +17 -17
- data/lib/mollie/customer/mandate.rb +10 -6
- data/lib/mollie/customer/subscription.rb +15 -7
- data/lib/mollie/exception.rb +1 -1
- data/lib/mollie/invoice.rb +14 -6
- data/lib/mollie/list.rb +9 -13
- data/lib/mollie/method.rb +15 -15
- data/lib/mollie/organization.rb +1 -1
- data/lib/mollie/payment.rb +36 -16
- data/lib/mollie/permission.rb +18 -17
- data/lib/mollie/profile.rb +11 -7
- data/lib/mollie/refund.rb +12 -8
- data/lib/mollie/settlement.rb +17 -9
- data/lib/mollie/util.rb +8 -8
- data/lib/mollie/version.rb +1 -1
- data/mollie-api-ruby.gemspec +5 -4
- data/test/helper.rb +1 -1
- data/test/mollie/amount_test.rb +1 -1
- data/test/mollie/base_test.rb +72 -72
- data/test/mollie/chargeback_test.rb +36 -37
- data/test/mollie/client_test.rb +49 -49
- data/test/mollie/customer/mandate_test.rb +40 -40
- data/test/mollie/customer/payment_test.rb +5 -6
- data/test/mollie/customer/subscription_test.rb +45 -45
- data/test/mollie/customer_test.rb +12 -12
- data/test/mollie/invoice_test.rb +29 -29
- data/test/mollie/list_test.rb +23 -23
- data/test/mollie/method_test.rb +8 -8
- data/test/mollie/organization_test.rb +9 -9
- data/test/mollie/payment/chargeback_test.rb +4 -4
- data/test/mollie/payment/refund_test.rb +4 -4
- data/test/mollie/payment_test.rb +111 -111
- data/test/mollie/profile_test.rb +41 -42
- data/test/mollie/refund_test.rb +39 -39
- data/test/mollie/settlement/chargeback_test.rb +4 -4
- data/test/mollie/settlement/payment_test.rb +5 -5
- data/test/mollie/settlement/refund_test.rb +4 -4
- data/test/mollie/settlement_test.rb +53 -53
- data/test/mollie/util_test.rb +9 -11
- data/test/run-test.rb +4 -4
- metadata +46 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc0a692631f366a82801cfacbddd3a374feb23c4246cad015f5d5d28442bbe6f
|
4
|
+
data.tar.gz: 13bab05f6eee4826daaf8147e696fc1c5b8fd828a35e3dd56697ef756e97ac77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eca2506d8f26e6de42661531956513f04292d59f87711ac8b26e584b9fd61d8c905bfaa68da20c96a7b2d08eedf8edfc955f7b9cc4658cbe3e663611f66bfde
|
7
|
+
data.tar.gz: 2d9c0f92e0349014398dae906afe85cc32ecf32d8a8c2fe739bbbae2d0ad85f8563bdc0b56f357e1f238cf1f0f4424f0d95c5110555d67f3d0b20e3b816b945d
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-08-19 13:42:13 +0200 using RuboCop version 0.58.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'mollie-api-ruby.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 45
|
17
|
+
Lint/DuplicateMethods:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/mollie/amount.rb'
|
20
|
+
- 'lib/mollie/chargeback.rb'
|
21
|
+
- 'lib/mollie/client.rb'
|
22
|
+
- 'lib/mollie/customer.rb'
|
23
|
+
- 'lib/mollie/customer/mandate.rb'
|
24
|
+
- 'lib/mollie/customer/subscription.rb'
|
25
|
+
- 'lib/mollie/invoice.rb'
|
26
|
+
- 'lib/mollie/organization.rb'
|
27
|
+
- 'lib/mollie/payment.rb'
|
28
|
+
- 'lib/mollie/profile.rb'
|
29
|
+
- 'lib/mollie/refund.rb'
|
30
|
+
- 'lib/mollie/settlement.rb'
|
31
|
+
|
32
|
+
# Offense count: 15
|
33
|
+
Metrics/AbcSize:
|
34
|
+
Max: 227
|
35
|
+
|
36
|
+
# Offense count: 7
|
37
|
+
# Configuration parameters: CountComments.
|
38
|
+
Metrics/ClassLength:
|
39
|
+
Max: 295
|
40
|
+
|
41
|
+
# Offense count: 1
|
42
|
+
Metrics/CyclomaticComplexity:
|
43
|
+
Max: 13
|
44
|
+
|
45
|
+
# Offense count: 37
|
46
|
+
# Configuration parameters: CountComments.
|
47
|
+
Metrics/MethodLength:
|
48
|
+
Max: 140
|
49
|
+
|
50
|
+
# Offense count: 1
|
51
|
+
Metrics/PerceivedComplexity:
|
52
|
+
Max: 10
|
53
|
+
|
54
|
+
# Offense count: 1
|
55
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
56
|
+
# AllowedNames: io, id, to, by, on, in, at
|
57
|
+
Naming/UncommunicativeMethodParamName:
|
58
|
+
Exclude:
|
59
|
+
- 'lib/mollie/client.rb'
|
60
|
+
|
61
|
+
# Offense count: 3
|
62
|
+
# Cop supports --auto-correct.
|
63
|
+
# Configuration parameters: EnforcedStyle.
|
64
|
+
# SupportedStyles: braces, no_braces, context_dependent
|
65
|
+
Style/BracesAroundHashParameters:
|
66
|
+
Exclude:
|
67
|
+
- 'test/mollie/client_test.rb'
|
68
|
+
|
69
|
+
# Offense count: 21
|
70
|
+
Style/Documentation:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
# Offense count: 2
|
74
|
+
Style/DoubleNegation:
|
75
|
+
Exclude:
|
76
|
+
- 'lib/mollie/base.rb'
|
77
|
+
- 'lib/mollie/chargeback.rb'
|
78
|
+
|
79
|
+
# Offense count: 4
|
80
|
+
# Cop supports --auto-correct.
|
81
|
+
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
82
|
+
# SupportedStyles: slashes, percent_r, mixed
|
83
|
+
Style/RegexpLiteral:
|
84
|
+
Exclude:
|
85
|
+
- 'lib/mollie/util.rb'
|
86
|
+
- 'test/mollie/client_test.rb'
|
87
|
+
|
88
|
+
# Offense count: 164
|
89
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
90
|
+
# URISchemes: http, https
|
91
|
+
Metrics/LineLength:
|
92
|
+
Max: 157
|
data/.travis.yml
CHANGED
@@ -6,9 +6,11 @@ rvm:
|
|
6
6
|
- 2.3.0
|
7
7
|
matrix:
|
8
8
|
deploy:
|
9
|
+
gem: mollie-api-ruby
|
9
10
|
provider: rubygems
|
10
11
|
api_key:
|
11
|
-
secure:
|
12
|
+
secure: "JdYKjK+AZNNviyAW92ta16Kk/u1gLTyvUVjoiSrGchsMmx8pN107MERpn5klFzOTKcnmMn+h3eA0RzhsuA+eFBfd5X58kNlXzXzKzKvOKmjrH69jiUWAJ5PmepacvsKMCAovOOtkskFzifKUUkrkPv87KO1J97wsZ4ASX6q3MRs="
|
12
13
|
on:
|
13
14
|
tags: true
|
15
|
+
repo: mollie/mollie-api-ruby
|
14
16
|
rvm: 2.3.0
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.
|
|
7
7
|
#### 4.0 - 2018-07-23
|
8
8
|
|
9
9
|
- Migrated to the v2 API
|
10
|
-
|
10
|
+
- Refer to the [migration guide](/docs/migration_v3_x.md) for a complete list of changes
|
11
11
|
- Dropped Ruby 2.0.0 support.
|
12
12
|
|
13
13
|
#### 3.1.0 - ....
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'mollie'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,6 +10,6 @@ require "mollie"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
14
|
-
require
|
13
|
+
require 'irb'
|
14
|
+
require 'pp'
|
15
15
|
IRB.start(__FILE__)
|
data/docs/migration_v2_2_x.md
CHANGED
@@ -50,7 +50,7 @@ Change the client calls to Resource calls
|
|
50
50
|
#)
|
51
51
|
|
52
52
|
payment = Mollie::Payment.create(
|
53
|
-
amount: {
|
53
|
+
amount: { value: '10.00', currency: 'EUR' },
|
54
54
|
description: 'My first API payment',
|
55
55
|
redirect_url: 'https://webshop.example.org/order/12345/',
|
56
56
|
webhook_url: 'https://webshop.example.org/mollie-webhook/'
|
data/docs/migration_v3_x.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Migration from v3.x
|
2
2
|
|
3
|
-
Please refer to [Migrating from v1 to v2](https://docs.mollie.com/migrating-v1-to-v2)
|
4
|
-
for a general overview of the
|
3
|
+
Version 4.x of the Ruby client uses the v2 Mollie API. Please refer to [Migrating from v1 to v2](https://docs.mollie.com/migrating-v1-to-v2)
|
4
|
+
for a general overview of the changes introduced by the new Mollie API.
|
5
5
|
|
6
6
|
Code examples can be found in the [/examples](/examples) folder.
|
7
7
|
|
data/examples/chargebacks/get.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
payment = Mollie::Customer::Payment.create(
|
2
|
-
customer_id:
|
3
|
-
amount: { value:
|
4
|
-
description:
|
5
|
-
redirect_url:
|
2
|
+
customer_id: 'cst_8wmqcHMN4U',
|
3
|
+
amount: { value: '10.00', currency: 'EUR' },
|
4
|
+
description: 'First payment',
|
5
|
+
redirect_url: 'https://webshop.example.org/order/12345/'
|
6
6
|
)
|
@@ -1 +1 @@
|
|
1
|
-
Mollie::Customer.delete(
|
1
|
+
Mollie::Customer.delete('cst_8wmqcHMN4U')
|
data/examples/customers/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
customer = Mollie::Customer.get(
|
1
|
+
customer = Mollie::Customer.get('cst_8wmqcHMN4U')
|
@@ -1 +1 @@
|
|
1
|
-
payments = Mollie::Customer::Payment.all(customer_id:
|
1
|
+
payments = Mollie::Customer::Payment.all(customer_id: 'cst_8wmqcHMN4U')
|
data/examples/invoices/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
invoice = Mollie::Invoice.get(
|
1
|
+
invoice = Mollie::Invoice.get('inv_xBEbP9rvAq')
|
data/examples/mandates/create.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
mandate = Mollie::Customer::Mandate.create(
|
2
|
-
customer_id:
|
3
|
-
method:
|
4
|
-
consumer_name:
|
5
|
-
consumer_account:
|
6
|
-
consumer_bic:
|
7
|
-
signature_date:
|
8
|
-
mandate_reference:
|
2
|
+
customer_id: 'cst_4qqhO89gsT',
|
3
|
+
method: 'directdebit',
|
4
|
+
consumer_name: 'John Doe',
|
5
|
+
consumer_account: 'NL55INGB0000000000',
|
6
|
+
consumer_bic: 'INGBNL2A',
|
7
|
+
signature_date: '2018-05-07',
|
8
|
+
mandate_reference: 'YOUR-COMPANY-MD13804'
|
9
9
|
)
|
data/examples/mandates/delete.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Mollie::Customer::Mandate.delete(
|
1
|
+
Mollie::Customer::Mandate.delete('mdt_h3gAaD5zP', customer_id: 'cst_4qqhO89gsT')
|
data/examples/mandates/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
mandate = Mollie::Customer::Mandate.get(
|
1
|
+
mandate = Mollie::Customer::Mandate.get('mdt_h3gAaD5zP', customer_id: 'cst_4qqhO89gsT')
|
data/examples/mandates/list.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
mandates = Mollie::Customer::Mandate.all(customer_id:
|
1
|
+
mandates = Mollie::Customer::Mandate.all(customer_id: 'cst_4qqhO89gsT')
|
data/examples/methods/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
organization = Mollie::Organization.get(
|
1
|
+
organization = Mollie::Organization.get('org_1234567')
|
data/examples/payments/delete.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Mollie::Payment.delete(
|
1
|
+
Mollie::Payment.delete('tr_7UhSN1zuXS')
|
@@ -1,2 +1,2 @@
|
|
1
|
-
payment = Mollie::Payment.get(
|
1
|
+
payment = Mollie::Payment.get('tr_7UhSN1zuXS')
|
2
2
|
customer = payment.customer
|
@@ -1,2 +1,2 @@
|
|
1
|
-
payment = Mollie::Payment.get(
|
1
|
+
payment = Mollie::Payment.get('tr_7UhSN1zuXS')
|
2
2
|
mandate = payment.mandate
|
@@ -1,2 +1,2 @@
|
|
1
|
-
payment = Mollie::Payment.get(
|
1
|
+
payment = Mollie::Payment.get('tr_7UhSN1zuXS')
|
2
2
|
settlement = payment.settlement
|
@@ -1,2 +1,2 @@
|
|
1
|
-
payment = Mollie::Payment.get(
|
1
|
+
payment = Mollie::Payment.get('tr_7UhSN1zuXS')
|
2
2
|
subscription = payment.subscription
|
data/examples/payments/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
payment = Mollie::Payment.get(
|
1
|
+
payment = Mollie::Payment.get('tr_7UhSN1zuXS')
|
data/examples/permissions/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
permission = Mollie::Permission.get(
|
1
|
+
permission = Mollie::Permission.get('payments.read')
|
data/examples/profiles/create.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
profile = Mollie::Profile.create(
|
2
|
-
name:
|
3
|
-
website:
|
4
|
-
email:
|
5
|
-
phone:
|
6
|
-
categoryCode:
|
7
|
-
mode:
|
2
|
+
name: 'My website name',
|
3
|
+
website: 'https://www.mywebsite.com',
|
4
|
+
email: 'info@mywebsite.com',
|
5
|
+
phone: '+31208202070',
|
6
|
+
categoryCode: '5399',
|
7
|
+
mode: 'live'
|
8
8
|
)
|
data/examples/profiles/delete.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Mollie::Profile.delete(
|
1
|
+
Mollie::Profile.delete('pfl_v9hTwCvYqw')
|
data/examples/profiles/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
profile = Mollie::Profile.get(
|
1
|
+
profile = Mollie::Profile.get('pfl_v9hTwCvYqw')
|
@@ -1,2 +1,2 @@
|
|
1
|
-
profile = Profile.get(
|
1
|
+
profile = Profile.get('pfl_v9hTwCvYqw')
|
2
2
|
chargebacks = profile.chargebacks
|
@@ -1,2 +1,2 @@
|
|
1
|
-
profile = Profile.get(
|
1
|
+
profile = Profile.get('pfl_v9hTwCvYqw')
|
2
2
|
methods = profile.methods
|
@@ -1,2 +1,2 @@
|
|
1
|
-
profile = Profile.get(
|
1
|
+
profile = Profile.get('pfl_v9hTwCvYqw')
|
2
2
|
payments = profile.payments
|
@@ -1,2 +1,2 @@
|
|
1
|
-
profile = Profile.get(
|
1
|
+
profile = Profile.get('pfl_v9hTwCvYqw')
|
2
2
|
refunds = profile.refunds
|
data/examples/profiles/update.rb
CHANGED
data/examples/refunds/create.rb
CHANGED
data/examples/refunds/delete.rb
CHANGED
data/examples/refunds/get.rb
CHANGED
data/examples/settlements/get.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
settlement = Mollie::Settlement.get(
|
1
|
+
settlement = Mollie::Settlement.get('stl_jDk30akdN')
|
@@ -1 +1 @@
|
|
1
|
-
chargebacks = Mollie::Settlement::Chargeback.all(settlement_id:
|
1
|
+
chargebacks = Mollie::Settlement::Chargeback.all(settlement_id: 'stl_jDk30akdN')
|
@@ -1 +1 @@
|
|
1
|
-
payments = Mollie::Settlement::Payment.all(settlement_id:
|
1
|
+
payments = Mollie::Settlement::Payment.all(settlement_id: 'stl_jDk30akdN')
|
@@ -1 +1 @@
|
|
1
|
-
refunds = Mollie::Settlement::Refund.all(settlement_id:
|
1
|
+
refunds = Mollie::Settlement::Refund.all(settlement_id: 'stl_jDk30akdN')
|
@@ -1,8 +1,8 @@
|
|
1
1
|
subscription = Mollie::Customer::Subscription.create(
|
2
|
-
customer_id:
|
3
|
-
amount: { value:
|
2
|
+
customer_id: 'cst_5a2pPrwaWy',
|
3
|
+
amount: { value: '20.00', currency: 'EUR' },
|
4
4
|
times: 4,
|
5
|
-
interval:
|
6
|
-
description:
|
7
|
-
webhook_url:
|
5
|
+
interval: '3 months',
|
6
|
+
description: 'Quarterly payment',
|
7
|
+
webhook_url: 'https://webshop.example.org/payments/webhook/'
|
8
8
|
)
|