mollie-api-ruby 3.1.5 → 4.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +0 -3
- data/CHANGELOG.md +6 -0
- data/README.md +63 -119
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/docs/migration_v2_2_x.md +67 -0
- data/docs/migration_v3_x.md +227 -0
- data/examples/chargebacks/get.rb +4 -0
- data/examples/chargebacks/list.rb +1 -0
- data/{website-docs → examples}/connect/authorize.rb +3 -2
- data/{website-docs → examples}/connect/tokens.rb +1 -1
- data/examples/customers/create-payment.rb +6 -0
- data/examples/customers/create.rb +5 -0
- data/examples/customers/delete.rb +1 -0
- data/examples/customers/get.rb +1 -0
- data/examples/customers/list-payments.rb +1 -0
- data/examples/customers/list.rb +1 -0
- data/examples/customers/update.rb +4 -0
- data/examples/invoices/get.rb +1 -0
- data/examples/invoices/list.rb +1 -0
- data/examples/mandates/create.rb +9 -0
- data/examples/mandates/delete.rb +1 -0
- data/examples/mandates/get.rb +1 -0
- data/examples/mandates/list.rb +1 -0
- data/examples/methods/get.rb +4 -0
- data/examples/methods/list.rb +4 -0
- data/examples/organisations/get-current.rb +1 -0
- data/examples/organisations/get.rb +1 -0
- data/examples/payments/create.rb +9 -0
- data/examples/payments/delete.rb +1 -0
- data/examples/payments/get-customer.rb +2 -0
- data/examples/payments/get-mandate.rb +2 -0
- data/examples/payments/get-settlement.rb +2 -0
- data/examples/payments/get-subscription.rb +2 -0
- data/examples/payments/get.rb +1 -0
- data/examples/payments/list.rb +1 -0
- data/examples/payments/webhook.rb +12 -0
- data/examples/permissions/get.rb +1 -0
- data/examples/permissions/list.rb +1 -0
- data/examples/profiles/create.rb +8 -0
- data/examples/profiles/delete.rb +1 -0
- data/examples/profiles/get.rb +1 -0
- data/examples/profiles/list-chargebacks.rb +2 -0
- data/examples/profiles/list-methods.rb +2 -0
- data/examples/profiles/list-payments.rb +2 -0
- data/examples/profiles/list-refunds.rb +2 -0
- data/examples/profiles/list.rb +1 -0
- data/examples/profiles/update.rb +5 -0
- data/examples/refunds/create.rb +5 -0
- data/examples/refunds/delete.rb +4 -0
- data/examples/refunds/get-payment.rb +2 -0
- data/examples/refunds/get.rb +4 -0
- data/examples/refunds/list.rb +1 -0
- data/examples/settlements/get.rb +1 -0
- data/examples/settlements/list-chargebacks.rb +1 -0
- data/examples/settlements/list-payments.rb +1 -0
- data/examples/settlements/list-refunds.rb +1 -0
- data/examples/settlements/list.rb +1 -0
- data/examples/settlements/next.rb +1 -0
- data/examples/settlements/open.rb +1 -0
- data/examples/subscriptions/create.rb +8 -0
- data/examples/subscriptions/delete.rb +4 -0
- data/examples/subscriptions/get.rb +4 -0
- data/examples/subscriptions/list.rb +1 -0
- data/examples/subscriptions/update.rb +5 -0
- data/lib/cacert.pem +168 -48
- data/lib/mollie.rb +1 -3
- data/lib/mollie/amount.rb +20 -0
- data/lib/mollie/base.rb +9 -8
- data/lib/mollie/chargeback.rb +25 -15
- data/lib/mollie/client.rb +33 -13
- data/lib/mollie/customer.rb +9 -14
- data/lib/mollie/customer/mandate.rb +17 -5
- data/lib/mollie/customer/subscription.rb +14 -15
- data/lib/mollie/exception.rb +15 -3
- data/lib/mollie/invoice.rb +30 -26
- data/lib/mollie/list.rb +27 -18
- data/lib/mollie/method.rb +17 -25
- data/lib/mollie/organization.rb +5 -11
- data/lib/mollie/payment.rb +89 -61
- data/lib/mollie/permission.rb +0 -1
- data/lib/mollie/profile.rb +18 -13
- data/lib/mollie/refund.rb +27 -7
- data/lib/mollie/settlement.rb +50 -9
- data/lib/mollie/util.rb +11 -0
- data/lib/mollie/version.rb +1 -1
- data/mollie-api-ruby.gemspec +0 -7
- data/test/mollie/amount_test.rb +30 -0
- data/test/mollie/base_test.rb +44 -44
- data/test/mollie/chargeback_test.rb +78 -17
- data/test/mollie/client_test.rb +29 -12
- data/test/mollie/customer/mandate_test.rb +85 -9
- data/test/mollie/customer/payment_test.rb +2 -2
- data/test/mollie/customer/subscription_test.rb +71 -20
- data/test/mollie/customer_test.rb +17 -89
- data/test/mollie/invoice_test.rb +40 -24
- data/test/mollie/list_test.rb +62 -18
- data/test/mollie/method_test.rb +2 -8
- data/test/mollie/organization_test.rb +28 -23
- data/test/mollie/payment/chargeback_test.rb +2 -3
- data/test/mollie/payment/refund_test.rb +2 -3
- data/test/mollie/payment_test.rb +272 -86
- data/test/mollie/permission_test.rb +0 -2
- data/test/mollie/profile_test.rb +129 -35
- data/test/mollie/refund_test.rb +90 -10
- data/test/mollie/settlement/chargeback_test.rb +2 -4
- data/test/mollie/settlement/payment_test.rb +2 -2
- data/test/mollie/settlement/refund_test.rb +2 -3
- data/test/mollie/settlement_test.rb +199 -98
- data/test/mollie/util_test.rb +31 -0
- metadata +96 -239
- data/examples/apis/api_docs.rb +0 -37
- data/examples/apis/chargebacks.rb +0 -17
- data/examples/apis/connect.rb +0 -58
- data/examples/apis/customers.rb +0 -116
- data/examples/apis/invoices.rb +0 -38
- data/examples/apis/issuers.rb +0 -35
- data/examples/apis/mandates.rb +0 -83
- data/examples/apis/methods.rb +0 -50
- data/examples/apis/organizations.rb +0 -16
- data/examples/apis/payments.rb +0 -174
- data/examples/apis/permissions.rb +0 -32
- data/examples/apis/profiles.rb +0 -126
- data/examples/apis/refunds.rb +0 -17
- data/examples/apis/settlements.rb +0 -84
- data/examples/apis/subscriptions.rb +0 -165
- data/examples/config.ru +0 -57
- data/examples/public/images/collapse.gif +0 -0
- data/examples/public/images/expand.gif +0 -0
- data/examples/public/images/explorer_icons.png +0 -0
- data/examples/public/images/favicon-16x16.png +0 -0
- data/examples/public/images/favicon-32x32.png +0 -0
- data/examples/public/images/favicon.ico +0 -0
- data/examples/public/images/logo_small.png +0 -0
- data/examples/public/images/pet_store_api.png +0 -0
- data/examples/public/images/throbber.gif +0 -0
- data/examples/public/images/wordnik_api.png +0 -0
- data/examples/public/index.html +0 -101
- data/examples/public/javascripts/lib/backbone-min.js +0 -1
- data/examples/public/javascripts/lib/es5-shim.js +0 -1
- data/examples/public/javascripts/lib/handlebars-4.0.5.js +0 -3
- data/examples/public/javascripts/lib/highlight.9.1.0.pack.js +0 -1
- data/examples/public/javascripts/lib/highlight.9.1.0.pack_extended.js +0 -1
- data/examples/public/javascripts/lib/jquery-1.8.0.min.js +0 -3
- data/examples/public/javascripts/lib/jquery.ba-bbq.min.js +0 -1
- data/examples/public/javascripts/lib/jquery.slideto.min.js +0 -1
- data/examples/public/javascripts/lib/jquery.wiggle.min.js +0 -1
- data/examples/public/javascripts/lib/js-yaml.min.js +0 -2
- data/examples/public/javascripts/lib/jsoneditor.min.js +0 -5
- data/examples/public/javascripts/lib/lodash.min.js +0 -2
- data/examples/public/javascripts/lib/marked.js +0 -1
- data/examples/public/javascripts/lib/object-assign-pollyfill.js +0 -1
- data/examples/public/javascripts/lib/sanitize-html.min.js +0 -4
- data/examples/public/javascripts/lib/swagger-oauth.js +0 -1
- data/examples/public/javascripts/swagger-ui.js +0 -25378
- data/examples/public/javascripts/swagger-ui.min.js +0 -15
- data/examples/public/javascripts/swagger_docs.js +0 -14
- data/examples/public/o2c.html +0 -20
- data/examples/public/stylesheets/reset.css +0 -1
- data/examples/public/stylesheets/screen.css +0 -1545
- data/examples/public/stylesheets/swagger_docs.css +0 -4
- data/examples/public/stylesheets/typography.css +0 -0
- data/lib/mollie/issuer.rb +0 -5
- data/lib/mollie/profile/api_key.rb +0 -19
- data/lib/mollie/relation.rb +0 -36
- data/test/mollie/issuer_test.rb +0 -19
- data/test/mollie/profile/apikey_test.rb +0 -31
- data/website-docs/chargebacks/list-all.rb +0 -12
- data/website-docs/customers/create-payment.rb +0 -13
- data/website-docs/customers/create.rb +0 -12
- data/website-docs/customers/delete.rb +0 -10
- data/website-docs/customers/get.rb +0 -10
- data/website-docs/customers/list-payments.rb +0 -10
- data/website-docs/customers/list.rb +0 -12
- data/website-docs/customers/update.rb +0 -11
- data/website-docs/invoices/get.rb +0 -10
- data/website-docs/invoices/list.rb +0 -12
- data/website-docs/issuers/get.rb +0 -10
- data/website-docs/issuers/list.rb +0 -12
- data/website-docs/mandates/create.rb +0 -16
- data/website-docs/mandates/delete.rb +0 -10
- data/website-docs/mandates/get.rb +0 -10
- data/website-docs/mandates/list.rb +0 -12
- data/website-docs/methods/get.rb +0 -10
- data/website-docs/methods/list.rb +0 -12
- data/website-docs/organisations/get.rb +0 -10
- data/website-docs/payments/create-refund.rb +0 -14
- data/website-docs/payments/create.rb +0 -16
- data/website-docs/payments/delete-refund.rb +0 -13
- data/website-docs/payments/delete.rb +0 -12
- data/website-docs/payments/get-chargeback.rb +0 -11
- data/website-docs/payments/get-refund.rb +0 -11
- data/website-docs/payments/get.rb +0 -10
- data/website-docs/payments/list-chargeback.rb +0 -13
- data/website-docs/payments/list-refunds.rb +0 -13
- data/website-docs/payments/list.rb +0 -12
- data/website-docs/payments/payment-webhook.rb +0 -21
- data/website-docs/permissions/get.rb +0 -10
- data/website-docs/permissions/list.rb +0 -12
- data/website-docs/profiles/create.rb +0 -15
- data/website-docs/profiles/delete.rb +0 -10
- data/website-docs/profiles/get-key.rb +0 -11
- data/website-docs/profiles/get.rb +0 -10
- data/website-docs/profiles/list-keys.rb +0 -13
- data/website-docs/profiles/list.rb +0 -12
- data/website-docs/profiles/reset-key.rb +0 -13
- data/website-docs/profiles/update.rb +0 -12
- data/website-docs/refunds/list.rb +0 -12
- data/website-docs/settlements/get.rb +0 -10
- data/website-docs/settlements/list-chargebacks.rb +0 -13
- data/website-docs/settlements/list-payments.rb +0 -13
- data/website-docs/settlements/list-refunds.rb +0 -13
- data/website-docs/settlements/list.rb +0 -12
- data/website-docs/settlements/next.rb +0 -9
- data/website-docs/settlements/open.rb +0 -9
- data/website-docs/subscriptions/create.rb +0 -14
- data/website-docs/subscriptions/delete.rb +0 -10
- data/website-docs/subscriptions/get.rb +0 -10
- data/website-docs/subscriptions/list.rb +0 -12
data/examples/apis/payments.rb
DELETED
@@ -1,174 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_schema :PaymentRequest do
|
3
|
-
property :amount, type: :decimal, description: 'Amount of money', example: 10.0
|
4
|
-
property :description, type: :string, description: 'Description', example: "My first payment"
|
5
|
-
property :redirect_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/order/12345/"
|
6
|
-
property :webhook_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/payments/webhook/"
|
7
|
-
property :metadata, type: :object, description: 'Extra info', example: { "order_id" => "12345" }
|
8
|
-
property :profileId, type: :object, description: 'ProfileId (Connect api only)', example: "pfl_FxPFwdxxJf"
|
9
|
-
property :testmode, type: :boolean, description: '(Connect api only)', example: true
|
10
|
-
end
|
11
|
-
|
12
|
-
swagger_schema :RefundRequest do
|
13
|
-
property :amount, type: :decimal, description: 'Amount of money', example: 10.0
|
14
|
-
property :description, type: :string, description: 'Description', example: "My first payment"
|
15
|
-
property :testmode, type: :boolean, description: 'Testmode', example: true
|
16
|
-
end
|
17
|
-
|
18
|
-
swagger_path '/v1/payments' do
|
19
|
-
operation :post, description: 'Create payment https://www.mollie.com/en/docs/reference/payments/create', tags: ['Payments'] do
|
20
|
-
security api_key: []
|
21
|
-
parameter name: :payment, in: 'body', description: 'PaymentRequest params', schema: { '$ref' => '#/definitions/PaymentRequest' }
|
22
|
-
response 200, description: 'Successful response'
|
23
|
-
response 500, description: 'Unexpected error'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
swagger_path '/v1/payments/{id}' do
|
28
|
-
operation :get, description: 'Get payment https://www.mollie.com/en/docs/reference/payments/get', tags: ['Payments'] do
|
29
|
-
parameter name: :id, in: 'path', description: 'Payment id', type: :string
|
30
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
31
|
-
security api_key: []
|
32
|
-
response 200, description: 'Successful response'
|
33
|
-
response 500, description: 'Unexpected error'
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
swagger_path '/v1/payments' do
|
38
|
-
operation :get, description: 'List payments https://www.mollie.com/en/docs/reference/payments/list', tags: ['Payments'] do
|
39
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
40
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
41
|
-
parameter name: :profile_id, in: 'query', description: 'Profile ID', type: :string
|
42
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
43
|
-
security api_key: []
|
44
|
-
response 200, description: 'Successful response'
|
45
|
-
response 500, description: 'Unexpected error'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
swagger_path '/v1/payments/{payment_id}/refunds' do
|
50
|
-
operation :post, description: 'Create payment https://www.mollie.com/nl/docs/reference/refunds/create', tags: ['Payments'] do
|
51
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
52
|
-
security api_key: []
|
53
|
-
parameter name: :refund, in: 'body', description: 'RefundRequest params', schema: { '$ref' => '#/definitions/RefundRequest' }
|
54
|
-
response 200, description: 'Successful response'
|
55
|
-
response 500, description: 'Unexpected error'
|
56
|
-
end
|
57
|
-
|
58
|
-
operation :get, description: 'List payment refunds https://www.mollie.com/en/docs/reference/refunds/list', tags: ['Payments'] do
|
59
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
60
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
61
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
62
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
63
|
-
security api_key: []
|
64
|
-
response 200, description: 'Successful response'
|
65
|
-
response 500, description: 'Unexpected error'
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
swagger_path '/v1/payments/{payment_id}/refunds/{id}' do
|
70
|
-
operation :get, description: 'Get refund https://www.mollie.com/nl/docs/reference/refunds/get', tags: ['Payments'] do
|
71
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
72
|
-
parameter name: :id, in: 'path', description: 'Refund id', type: :string
|
73
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
74
|
-
security api_key: []
|
75
|
-
response 200, description: 'Successful response'
|
76
|
-
response 500, description: 'Unexpected error'
|
77
|
-
end
|
78
|
-
|
79
|
-
operation :delete, description: 'Delete refund https://www.mollie.com/nl/docs/reference/refunds/delete', tags: ['Payments'] do
|
80
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
81
|
-
parameter name: :id, in: 'path', description: 'Refund id', type: :string
|
82
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
83
|
-
security api_key: []
|
84
|
-
response 204, description: 'Successful response'
|
85
|
-
response 500, description: 'Unexpected error'
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
swagger_path '/v1/payments/{payment_id}/chargebacks' do
|
90
|
-
operation :get, description: 'List payment chargebacks https://www.mollie.com/en/docs/reference/chargebacks/list', tags: ['Payments'] do
|
91
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
92
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
93
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
94
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
95
|
-
security api_key: []
|
96
|
-
response 200, description: 'Successful response'
|
97
|
-
response 500, description: 'Unexpected error'
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
swagger_path '/v1/payments/{payment_id}/chargebacks/{id}' do
|
102
|
-
operation :get, description: 'Get chargeback https://www.mollie.com/nl/docs/reference/chargebacks/get', tags: ['Payments'] do
|
103
|
-
parameter name: :payment_id, in: 'path', description: 'Payment id', type: :string
|
104
|
-
parameter name: :id, in: 'path', description: 'Refund id', type: :string
|
105
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
106
|
-
security api_key: []
|
107
|
-
response 200, description: 'Successful response'
|
108
|
-
response 500, description: 'Unexpected error'
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
get '/v1/payments' do
|
113
|
-
payments = Mollie::Payment.all(params[:offset], params[:count],
|
114
|
-
profile_id: params[:profile_id],
|
115
|
-
testmode: params[:testmode]
|
116
|
-
)
|
117
|
-
|
118
|
-
JSON.pretty_generate(payments.attributes)
|
119
|
-
end
|
120
|
-
|
121
|
-
get '/v1/payments/:id' do
|
122
|
-
payment = Mollie::Payment.get(params[:id], testmode: params[:testmode])
|
123
|
-
JSON.pretty_generate(payment.attributes)
|
124
|
-
end
|
125
|
-
|
126
|
-
post '/v1/payments' do
|
127
|
-
payment = Mollie::Payment.create(
|
128
|
-
amount: json_params['amount'],
|
129
|
-
description: json_params['description'],
|
130
|
-
redirect_url: json_params['redirect_url'],
|
131
|
-
webhook_url: json_params['webhook_url'],
|
132
|
-
metadata: json_params['metadata'],
|
133
|
-
profileId: json_params['profileId'],
|
134
|
-
testmode: json_params['testmode'],
|
135
|
-
)
|
136
|
-
JSON.pretty_generate(payment.attributes)
|
137
|
-
end
|
138
|
-
|
139
|
-
post '/v1/payments/:payment_id/refunds' do
|
140
|
-
refund = Mollie::Payment::Refund.create(
|
141
|
-
payment_id: params[:payment_id],
|
142
|
-
amount: json_params['amount'],
|
143
|
-
description: json_params['description'],
|
144
|
-
testmode: json_params['testmode']
|
145
|
-
)
|
146
|
-
JSON.pretty_generate(refund.attributes)
|
147
|
-
end
|
148
|
-
|
149
|
-
get '/v1/payments/:payment_id/refunds/:id' do
|
150
|
-
refund = Mollie::Payment::Refund.get(params[:id], testmode: params[:testmode], payment_id: params[:payment_id])
|
151
|
-
JSON.pretty_generate(refund.attributes)
|
152
|
-
end
|
153
|
-
|
154
|
-
delete '/v1/payments/:payment_id/refunds/:id' do
|
155
|
-
Mollie::Payment::Refund.delete(params[:id], testmode: params[:testmode], payment_id: params[:payment_id])
|
156
|
-
"deleted"
|
157
|
-
end
|
158
|
-
|
159
|
-
get '/v1/payments/:payment_id/refunds' do
|
160
|
-
refunds = Mollie::Payment::Refund.all(params[:offset], params[:count], testmode: params[:testmode], payment_id: params[:payment_id])
|
161
|
-
JSON.pretty_generate(refunds.attributes)
|
162
|
-
end
|
163
|
-
|
164
|
-
get '/v1/payments/:payment_id/chargebacks/:id' do
|
165
|
-
chargeback = Mollie::Payment::Chargeback.get(params[:id], testmode: params[:testmode], payment_id: params[:payment_id])
|
166
|
-
JSON.pretty_generate(chargeback.attributes)
|
167
|
-
end
|
168
|
-
|
169
|
-
get '/v1/payments/:payment_id/chargebacks' do
|
170
|
-
chargebacks = Mollie::Payment::Chargeback.all(params[:offset], params[:count], testmode: params[:testmode], payment_id: params[:payment_id])
|
171
|
-
JSON.pretty_generate(chargebacks.attributes)
|
172
|
-
end
|
173
|
-
|
174
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_path '/v1/permissions' do
|
3
|
-
operation :get, description: 'List permissions https://www.mollie.com/en/docs/reference/permissions/list', tags: ['Permissions'] do
|
4
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
5
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
6
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
7
|
-
security api_key: []
|
8
|
-
response 200, description: 'Successful response'
|
9
|
-
response 500, description: 'Unexpected error'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
swagger_path '/v1/permissions/{id}' do
|
14
|
-
operation :get, description: 'Get permission https://www.mollie.com/en/docs/reference/permissions/get', tags: ['Permissions'] do
|
15
|
-
parameter name: :id, in: 'path', description: 'Permission id', type: :string
|
16
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
17
|
-
security api_key: []
|
18
|
-
response 200, description: 'Successful response'
|
19
|
-
response 500, description: 'Unexpected error'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
get '/v1/permissions' do
|
24
|
-
permissions = Mollie::Permission.all(params[:offset], params[:count], testmode: params[:testmode])
|
25
|
-
JSON.pretty_generate(permissions.attributes)
|
26
|
-
end
|
27
|
-
|
28
|
-
get '/v1/permissions/:id' do
|
29
|
-
permission = Mollie::Permission.get(params[:id], testmode: params[:testmode])
|
30
|
-
JSON.pretty_generate(permission.attributes)
|
31
|
-
end
|
32
|
-
end
|
data/examples/apis/profiles.rb
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_schema :ProfileRequest do
|
3
|
-
property :name, type: :string, description: 'Name', example: "My website name"
|
4
|
-
property :website, type: :string, description: 'Website', example: "#{Ngrok::Tunnel.ngrok_url_https}"
|
5
|
-
property :email, type: :string, description: 'Email', example: "info@mywebsite.com"
|
6
|
-
property :phone, type: :string, description: 'Phone', example: "31123456789"
|
7
|
-
property :categoryCode, type: :integer, description: 'Category code', example: "5399"
|
8
|
-
property :mode, type: :string, description: 'Mode (live or test)', example: "test"
|
9
|
-
end
|
10
|
-
|
11
|
-
swagger_path '/v1/profiles' do
|
12
|
-
operation :post, description: 'https://www.mollie.com/en/docs/reference/profiles/create', tags: ['Profiles'] do
|
13
|
-
security api_key: []
|
14
|
-
parameter name: :profile, in: 'body', description: 'ProfileRequest params', schema: { '$ref' => '#/definitions/ProfileRequest' }
|
15
|
-
response 200, description: 'Successful response'
|
16
|
-
response 500, description: 'Unexpected error'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
swagger_path '/v1/profiles' do
|
21
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/profiles/list', tags: ['Profiles'] do
|
22
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
23
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
24
|
-
security api_key: []
|
25
|
-
response 200, description: 'Successful response'
|
26
|
-
response 500, description: 'Unexpected error'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
swagger_path '/v1/profiles/{id}' do
|
31
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/profiles/get', tags: ['Profiles'] do
|
32
|
-
parameter name: :id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
33
|
-
security api_key: []
|
34
|
-
response 200, description: 'Successful response'
|
35
|
-
response 500, description: 'Unexpected error'
|
36
|
-
end
|
37
|
-
operation :patch, description: 'https://www.mollie.com/en/docs/reference/profiles/create', tags: ['Profiles'] do
|
38
|
-
parameter name: :id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
39
|
-
security api_key: []
|
40
|
-
parameter name: :profile, in: 'body', description: 'ProfileRequest params', schema: { '$ref' => '#/definitions/ProfileRequest' }
|
41
|
-
response 200, description: 'Successful response'
|
42
|
-
response 500, description: 'Unexpected error'
|
43
|
-
end
|
44
|
-
operation :delete, description: 'https://www.mollie.com/en/docs/reference/profiles/delete', tags: ['Profiles'] do
|
45
|
-
parameter name: :id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
46
|
-
security api_key: []
|
47
|
-
response 200, description: 'Successful response'
|
48
|
-
response 500, description: 'Unexpected error'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
swagger_path '/v1/profiles/{profile_id}/apikeys' do
|
53
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/profiles/api-keys/list', tags: ['Profiles'] do
|
54
|
-
parameter name: :profile_id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
55
|
-
security api_key: []
|
56
|
-
response 200, description: 'Successful response'
|
57
|
-
response 500, description: 'Unexpected error'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
swagger_path '/v1/profiles/{profile_id}/apikeys/{mode}' do
|
62
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/profiles/api-keys/list', tags: ['Profiles'] do
|
63
|
-
parameter name: :profile_id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
64
|
-
parameter name: :mode, in: 'path', description: 'Mode (live or test)', type: :string, default: 'test'
|
65
|
-
security api_key: []
|
66
|
-
response 200, description: 'Successful response'
|
67
|
-
response 500, description: 'Unexpected error'
|
68
|
-
end
|
69
|
-
operation :post, description: 'https://www.mollie.com/en/docs/reference/profiles/api-keys/reset', tags: ['Profiles'] do
|
70
|
-
parameter name: :profile_id, in: 'path', description: 'Profile id', type: :string, default: 'pfl_v9hTwCvYqw'
|
71
|
-
parameter name: :mode, in: 'path', description: 'Mode (live or test)', type: :string, default: 'test'
|
72
|
-
security api_key: []
|
73
|
-
response 200, description: 'Successful response'
|
74
|
-
response 500, description: 'Unexpected error'
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
get '/v1/profiles' do
|
79
|
-
profiles = Mollie::Profile.all(params[:offset], params[:count])
|
80
|
-
JSON.pretty_generate(profiles.attributes)
|
81
|
-
end
|
82
|
-
|
83
|
-
get '/v1/profiles/:id' do
|
84
|
-
profile = Mollie::Profile.get(params[:id])
|
85
|
-
JSON.pretty_generate(profile.attributes)
|
86
|
-
end
|
87
|
-
|
88
|
-
post '/v1/profiles' do
|
89
|
-
profile = Mollie::Profile.create(
|
90
|
-
name: json_params['name'],
|
91
|
-
website: json_params['website'],
|
92
|
-
email: json_params['email'],
|
93
|
-
phone: json_params['phone'],
|
94
|
-
categoryCode: json_params['categoryCode'],
|
95
|
-
mode: json_params['mode'],
|
96
|
-
)
|
97
|
-
JSON.pretty_generate(profile.attributes)
|
98
|
-
end
|
99
|
-
|
100
|
-
patch '/v1/profiles/:id' do
|
101
|
-
profile = Mollie::Profile.update(params[:id],
|
102
|
-
name: json_params['name'],
|
103
|
-
website: json_params['website'],
|
104
|
-
email: json_params['email'],
|
105
|
-
phone: json_params['phone'],
|
106
|
-
categoryCode: json_params['categoryCode'],
|
107
|
-
mode: json_params['mode'],
|
108
|
-
)
|
109
|
-
JSON.pretty_generate(profile.attributes)
|
110
|
-
end
|
111
|
-
|
112
|
-
get '/v1/profiles/:profile_id/apikeys' do
|
113
|
-
api_keys = Mollie::Profile::ApiKey.all(profile_id: params[:profile_id])
|
114
|
-
JSON.pretty_generate(api_keys.attributes)
|
115
|
-
end
|
116
|
-
|
117
|
-
get '/v1/profiles/:profile_id/apikeys/:mode' do
|
118
|
-
api_key = Mollie::Profile::ApiKey.get(params[:mode], profile_id: params[:profile_id])
|
119
|
-
JSON.pretty_generate(api_key.attributes)
|
120
|
-
end
|
121
|
-
|
122
|
-
post '/v1/profiles/:profile_id/apikeys/:mode' do
|
123
|
-
payment = Mollie::Profile::ApiKey.create(params[:mode], profile_id: params[:profile_id])
|
124
|
-
JSON.pretty_generate(payment.attributes)
|
125
|
-
end
|
126
|
-
end
|
data/examples/apis/refunds.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_path '/v1/refunds' do
|
3
|
-
operation :get, description: 'List refunds https://www.mollie.com/en/docs/reference/refunds/list', tags: ['Refunds'] do
|
4
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
5
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
6
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
7
|
-
security api_key: []
|
8
|
-
response 200, description: 'Successful response'
|
9
|
-
response 500, description: 'Unexpected error'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
get '/v1/refunds' do
|
14
|
-
refunds = Mollie::Refund.all(params[:offset], params[:limit], testmode: params[:test_mode])
|
15
|
-
JSON.pretty_generate(refunds.attributes)
|
16
|
-
end
|
17
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_path '/v1/settlements' do
|
3
|
-
operation :get, description: 'List settlements https://www.mollie.com/en/docs/reference/settlements/list', tags: ['Settlements'] do
|
4
|
-
parameter name: :reference, in: 'query', description: 'Issuer id', type: :string, example: "1182161.1506.02"
|
5
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
6
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
7
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
8
|
-
security api_key: []
|
9
|
-
response 200, description: 'Successful response'
|
10
|
-
response 500, description: 'Unexpected error'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
swagger_path '/v1/settlements/{id}' do
|
15
|
-
operation :get, description: 'Get settlement https://www.mollie.com/en/docs/reference/settlements/get', tags: ['Settlements'] do
|
16
|
-
parameter name: :id, in: 'path', description: 'Issuer id', type: :string, example: "stl_jDk30akdN"
|
17
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
18
|
-
security api_key: []
|
19
|
-
response 200, description: 'Successful response'
|
20
|
-
response 500, description: 'Unexpected error'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
swagger_path '/v1/settlements/next' do
|
25
|
-
operation :get, description: 'Next settlement https://www.mollie.com/en/docs/reference/settlements/next', tags: ['Settlements'] do
|
26
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
27
|
-
security api_key: []
|
28
|
-
response 200, description: 'Successful response'
|
29
|
-
response 500, description: 'Unexpected error'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
swagger_path '/v1/settlements/open' do
|
34
|
-
operation :get, description: 'Open settlement https://www.mollie.com/en/docs/reference/settlements/open', tags: ['Settlements'] do
|
35
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
36
|
-
security api_key: []
|
37
|
-
response 200, description: 'Successful response'
|
38
|
-
response 500, description: 'Unexpected error'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
swagger_path '/v1/settlements/{settlement_id}/payments' do
|
43
|
-
operation :get, description: 'List settlement payments https://www.mollie.com/nl/docs/reference/settlements/list-payments', tags: ['Settlements'] do
|
44
|
-
parameter name: :settlement_id, in: 'path', description: 'Settlement id', type: :string, example: "stl_jDk30akdN"
|
45
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
46
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
47
|
-
parameter name: :testmode, in: 'query', description: 'Test mode', type: :boolean
|
48
|
-
security api_key: []
|
49
|
-
response 200, description: 'Successful response'
|
50
|
-
response 500, description: 'Unexpected error'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
get '/v1/settlements' do
|
55
|
-
settlements = Mollie::Settlement.all(params[:offset], params[:count],
|
56
|
-
reference: params[:reference],
|
57
|
-
testmode: params[:testmode]
|
58
|
-
)
|
59
|
-
JSON.pretty_generate(settlements.attributes)
|
60
|
-
end
|
61
|
-
|
62
|
-
get '/v1/settlements/:id' do
|
63
|
-
settlement = Mollie::Settlement.get(params[:id], testmode: params[:testmode])
|
64
|
-
JSON.pretty_generate(settlement.attributes)
|
65
|
-
end
|
66
|
-
|
67
|
-
get '/v1/settlements/next' do
|
68
|
-
settlement = Mollie::Settlement.next(testmode: params[:testmode])
|
69
|
-
JSON.pretty_generate(settlement.attributes)
|
70
|
-
end
|
71
|
-
|
72
|
-
get '/v1/settlements/open' do
|
73
|
-
settlement = Mollie::Settlement.open(testmode: params[:testmode])
|
74
|
-
JSON.pretty_generate(settlement.attributes)
|
75
|
-
end
|
76
|
-
|
77
|
-
|
78
|
-
get '/v1/settlements/:settlement_id/payments' do
|
79
|
-
payments = Mollie::Settlement::Payment.all(params[:offset], params[:count], testmode: params[:testmode], settlement_id: params[:settlement_id])
|
80
|
-
JSON.pretty_generate(payments.attributes)
|
81
|
-
end
|
82
|
-
|
83
|
-
|
84
|
-
end
|
@@ -1,165 +0,0 @@
|
|
1
|
-
class Application < Sinatra::Application
|
2
|
-
swagger_schema :FirstPaymentRequest do
|
3
|
-
property :amount, type: :decimal, description: 'Amount of money', example: 0.01
|
4
|
-
property :customer_id, type: :string, description: 'Customer id', example: "cst_GUvJFqwVCD"
|
5
|
-
property :description, type: :string, description: 'Description', example: "My first payment"
|
6
|
-
property :recurring_type, type: :string, description: 'Recurring type', example: "first"
|
7
|
-
property :redirect_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/order/12345/"
|
8
|
-
property :webhook_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/payments/webhook/"
|
9
|
-
property :metadata, type: :object, description: 'Extra info', example: { "order_id" => "12345" }
|
10
|
-
property :testmode, type: :boolean, description: '(Connect api only)', example: true
|
11
|
-
end
|
12
|
-
|
13
|
-
swagger_schema :OnDemandPaymentRequest do
|
14
|
-
property :amount, type: :decimal, description: 'Amount of money', example: 25.0
|
15
|
-
property :customer_id, type: :string, description: 'Customer id', example: "cst_GUvJFqwVCD"
|
16
|
-
property :description, type: :string, description: 'Description', example: "Monthly payment"
|
17
|
-
property :recurring_type, type: :string, description: 'Recurring type', example: "recurring"
|
18
|
-
property :redirect_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/order/12345/"
|
19
|
-
property :webhook_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/payments/webhook/"
|
20
|
-
property :metadata, type: :object, description: 'Extra info', example: { "order_id" => "12345" }
|
21
|
-
property :testmode, type: :boolean, description: '(Connect api only)', example: true
|
22
|
-
end
|
23
|
-
|
24
|
-
swagger_schema :SubscriptionRequest do
|
25
|
-
property :amount, type: :decimal, description: 'Amount of money', example: 25.0
|
26
|
-
property :times, type: :integer, description: 'Times', example: "10"
|
27
|
-
property :interval, type: :string, description: 'Interval', example: "1 month"
|
28
|
-
property :start_date, type: :string, description: 'Start date', example: Time.now.strftime("%Y-%m-%d")
|
29
|
-
property :description, type: :string, description: 'Description', example: "Monthly subscription"
|
30
|
-
property :method, type: :object, description: 'Method', example: "directdebit"
|
31
|
-
property :webhook_url, type: :string, description: 'URL for redirection', example: "https://webshop.example.org/payments/webhook/"
|
32
|
-
property :testmode, type: :boolean, description: '(Connect api only)', example: true
|
33
|
-
end
|
34
|
-
|
35
|
-
swagger_path '/v1/subscriptions/first_payment' do
|
36
|
-
operation :post, description: 'https://www.mollie.com/en/docs/recurring#first-payment', tags: ['Subscriptions'] do
|
37
|
-
security api_key: []
|
38
|
-
parameter name: :payment, in: 'body', description: 'PaymentRequest params', schema: { '$ref' => '#/definitions/OnDemandPaymentRequest' }
|
39
|
-
response 200, description: 'Successful response'
|
40
|
-
response 500, description: 'Unexpected error'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
swagger_path '/v1/subscriptions/mandates/{customer_id}' do
|
45
|
-
operation :get, description: 'List mandates', tags: ['Subscriptions'] do
|
46
|
-
parameter name: :customer_id, in: 'path', description: 'Customer id', type: :string, default: 'cst_GUvJFqwVCD'
|
47
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
48
|
-
security api_key: []
|
49
|
-
response 200, description: 'Successful response'
|
50
|
-
response 500, description: 'Unexpected error'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
swagger_path '/v1/subscriptions/on_demand' do
|
55
|
-
operation :post, description: 'https://www.mollie.com/en/docs/recurring#on-demand', tags: ['Subscriptions'] do
|
56
|
-
parameter name: :payment, in: 'body', description: 'PaymentRequest params', schema: { '$ref' => '#/definitions/OnDemandPaymentRequest' }
|
57
|
-
security api_key: []
|
58
|
-
response 200, description: 'Successful response'
|
59
|
-
response 500, description: 'Unexpected error'
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
swagger_path '/v1/customers/{customer_id}/subscriptions' do
|
64
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/subscriptions/get', tags: ['Subscriptions'] do
|
65
|
-
parameter name: :customer_id, in: 'path', description: 'Customer id', type: :string, default: 'cst_GUvJFqwVCD'
|
66
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
67
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
68
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
69
|
-
security api_key: []
|
70
|
-
response 200, description: 'Successful response'
|
71
|
-
response 500, description: 'Unexpected error'
|
72
|
-
end
|
73
|
-
|
74
|
-
operation :post, description: 'https://www.mollie.com/en/docs/recurring#subscriptions', tags: ['Subscriptions'] do
|
75
|
-
parameter name: :customer_id, in: 'path', description: 'Customer id', type: :string, default: 'cst_GUvJFqwVCD'
|
76
|
-
parameter name: :payment, in: 'body', description: 'PaymentRequest params', schema: { '$ref' => '#/definitions/SubscriptionRequest' }
|
77
|
-
security api_key: []
|
78
|
-
response 200, description: 'Successful response'
|
79
|
-
response 500, description: 'Unexpected error'
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
swagger_path '/v1/customers/{customer_id}/subscriptions/{id}' do
|
84
|
-
operation :get, description: 'https://www.mollie.com/en/docs/reference/subscriptions/get', tags: ['Subscriptions'] do
|
85
|
-
parameter name: :customer_id, in: 'path', description: 'Customer id', type: :string, default: 'cst_GUvJFqwVCD'
|
86
|
-
parameter name: :id, in: 'path', description: 'Subscription id', type: :string, default: 'sub_qte7Jyfc5B'
|
87
|
-
parameter name: :offset, in: 'query', description: 'Offset', type: :integer
|
88
|
-
parameter name: :count, in: 'query', description: 'Count', type: :integer
|
89
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
90
|
-
security api_key: []
|
91
|
-
response 200, description: 'Successful response'
|
92
|
-
response 500, description: 'Unexpected error'
|
93
|
-
end
|
94
|
-
operation :delete, description: 'https://www.mollie.com/en/docs/reference/subscriptions/delete', tags: ['Subscriptions'] do
|
95
|
-
parameter name: :customer_id, in: 'path', description: 'Customer id', type: :string, default: 'cst_GUvJFqwVCD'
|
96
|
-
parameter name: :id, in: 'path', description: 'Subscription id', type: :string, default: 'sub_qte7Jyfc5B'
|
97
|
-
parameter name: :testmode, in: 'query', description: 'Testmode', type: :boolean, default: true
|
98
|
-
security api_key: []
|
99
|
-
response 200, description: 'Successful response'
|
100
|
-
response 500, description: 'Unexpected error'
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
post '/v1/subscriptions/first_payment' do
|
105
|
-
payment = Mollie::Payment.create(
|
106
|
-
amount: json_params['amount'],
|
107
|
-
customer_id: json_params['customer_id'],
|
108
|
-
description: json_params['description'],
|
109
|
-
redirect_url: json_params['redirect_url'],
|
110
|
-
recurring_type: "first",
|
111
|
-
webhook_url: json_params['webhook_url'],
|
112
|
-
metadata: json_params['metadata'],
|
113
|
-
testmode: json_params['testmode'],
|
114
|
-
)
|
115
|
-
JSON.pretty_generate(payment.attributes)
|
116
|
-
end
|
117
|
-
|
118
|
-
get '/v1/subscriptions/mandates/:customer_id' do
|
119
|
-
mandates = Mollie::Customer::Mandates.all(customer_id: params[:customer_id])
|
120
|
-
JSON.pretty_generate(mandates.attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
post '/v1/subscriptions/on_demand' do
|
124
|
-
payment = Mollie::Payment.create(
|
125
|
-
amount: json_params['amount'],
|
126
|
-
customer_id: json_params['customer_id'],
|
127
|
-
description: json_params['description'],
|
128
|
-
redirect_url: json_params['redirect_url'],
|
129
|
-
recurring_type: "recurring",
|
130
|
-
webhook_url: json_params['webhook_url'],
|
131
|
-
metadata: json_params['metadata'],
|
132
|
-
testmode: json_params['testmode'],
|
133
|
-
)
|
134
|
-
JSON.pretty_generate(payment.attributes)
|
135
|
-
end
|
136
|
-
|
137
|
-
get '/v1/customers/:customer_id/subscriptions' do
|
138
|
-
subscriptions = Mollie::Customer::Subscription.all(params[:offset], params[:count], testmode: params[:testmode], customer_id: params[:customer_id])
|
139
|
-
JSON.pretty_generate(subscriptions.attributes)
|
140
|
-
end
|
141
|
-
|
142
|
-
get '/v1/customers/:customer_id/subscriptions/:id' do
|
143
|
-
payment = Mollie::Customer::Subscription.get(params[:id], testmode: params[:testmode], customer_id: params[:customer_id])
|
144
|
-
JSON.pretty_generate(payment.attributes)
|
145
|
-
end
|
146
|
-
|
147
|
-
post '/v1/customers/:customer_id/subscriptions' do
|
148
|
-
subscription = Mollie::Customer::Subscription.create(
|
149
|
-
amount: json_params['amount'],
|
150
|
-
times: json_params['times'],
|
151
|
-
interval: json_params['interval'],
|
152
|
-
start_date: json_params['start_date'],
|
153
|
-
description: json_params["description"],
|
154
|
-
method: json_params['method'],
|
155
|
-
webhook_url: json_params['webhook_url'],
|
156
|
-
testmode: json_params['testmode'],
|
157
|
-
)
|
158
|
-
JSON.pretty_generate(subscription.attributes)
|
159
|
-
end
|
160
|
-
|
161
|
-
delete '/v1/customers/:customer_id/subscriptions/:id' do
|
162
|
-
Mollie::Customer::Subscription.delete(params[:id], testmode: params[:testmode], customer_id: params[:customer_id])
|
163
|
-
"deleted"
|
164
|
-
end
|
165
|
-
end
|