mollie-api-ruby 3.1.3 → 3.1.4.pre.beta
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 +4 -4
- data/.travis.yml +1 -1
- data/README.md +70 -1
- data/lib/mollie/method.rb +2 -1
- data/lib/mollie/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79ba856fbd35f684bcf71896ff59891cafab6c4756bcbbd8f666e1b089714ab7
|
4
|
+
data.tar.gz: f3829491d57c187645e2a06862a6b73c2b9cc7a5443725c04265ea395ac3ec15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83b435d5b210e25cb01581838c72e56375572c28fe152571dd37f6b91837debe6a6cbcc4ac4ae5029923b445bfca6a31fee73cb5e41134d7e8ac1bd893eef1d2
|
7
|
+
data.tar.gz: 674dc0b857d09f48e78e82145b0e8bf3e64597349fd9fa2d24bcd291298ddda62f7492724620ecfd431106aa024a7b02e97d659ac8fb9868f7bc285ce564cc62
|
data/.travis.yml
CHANGED
@@ -11,7 +11,7 @@ matrix:
|
|
11
11
|
deploy:
|
12
12
|
provider: rubygems
|
13
13
|
api_key:
|
14
|
-
secure:
|
14
|
+
secure: eBq3/esJILG/1rs9mYwD/6QEybpiElDihqRO6sPH17D9e+lMYVXsaBxrBQutWLB9i7V176mbN/z/VR/fHbj8/xDYEuKzTnFwaROZpckX0dmwp8SRdBA1Lleq/zeQwhjeOLSSAJBxZXTSJcKQ5YQaUvojVIh1ky+rAz20QxyYHV8=
|
15
15
|
on:
|
16
16
|
tags: true
|
17
17
|
rvm: 2.3.0
|
data/README.md
CHANGED
@@ -135,6 +135,75 @@ You can then browse the swagger documentation on [http://localhost:9292](http://
|
|
135
135
|
|
136
136
|
If you wish to learn more about our API, please visit the [Mollie Developer Portal](https://www.mollie.com/developer/). API Documentation is available in both Dutch and English.
|
137
137
|
|
138
|
+
## Migration from v2.2.x ##
|
139
|
+
|
140
|
+
The version 2.2.x used a client that contained methods to call API methods on the mollie servers.
|
141
|
+
The responses were converted in to Mollie objects and attributes could be retrieved.
|
142
|
+
Version 3.1.x uses a more Resource oriented approach that fits better with the Active Record principle.
|
143
|
+
Instead of calling the methods on the client, you now use the Resource class or instance to call the API methods.
|
144
|
+
|
145
|
+
You can now require the mollie client by using the gem name.
|
146
|
+
If you are using bundler and Rails you don't even need to require it anymore
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
# require 'mollie/api/client'
|
150
|
+
require 'mollie-api-ruby'
|
151
|
+
```
|
152
|
+
|
153
|
+
Instead of creating a client with an API key, the client is now stored as a threadsafe singleton object.
|
154
|
+
Configuration can now be simplified by adding a global configure block in a Rails initializer or a Rack loader file.
|
155
|
+
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
# mollie = Mollie::API::Client.new('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
|
159
|
+
|
160
|
+
# config/initializers/mollie.rb or in your app.rb
|
161
|
+
Mollie::Client.configure do |config|
|
162
|
+
config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
|
163
|
+
end
|
164
|
+
|
165
|
+
# You may also pass a specific API key in the params for each request.
|
166
|
+
payment = Mollie::Payment.get(api_key: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
|
167
|
+
|
168
|
+
# Or in a Rails around filter
|
169
|
+
around_action :set_mollie_key
|
170
|
+
|
171
|
+
def set_mollie_key
|
172
|
+
Mollie::Client.with_api_key('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM') do
|
173
|
+
yield
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
```
|
178
|
+
|
179
|
+
Change the client calls to Resource calls
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
# mollie = Mollie::API::Client.new('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
|
183
|
+
# payment = mollie.payments.create(
|
184
|
+
# amount: 10.00,
|
185
|
+
# description: 'My first API payment',
|
186
|
+
# redirect_url: 'https://webshop.example.org/order/12345/',
|
187
|
+
# webhook_url: 'https://webshop.example.org/mollie-webhook/'
|
188
|
+
#)
|
189
|
+
|
190
|
+
payment = Mollie::Payment.create(
|
191
|
+
amount: 10.00,
|
192
|
+
description: 'My first API payment',
|
193
|
+
redirect_url: 'https://webshop.example.org/order/12345/',
|
194
|
+
webhook_url: 'https://webshop.example.org/mollie-webhook/'
|
195
|
+
)
|
196
|
+
```
|
197
|
+
|
198
|
+
The resources created are similar to the old resources but have an extra option to retrieve nested resources
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
# payment = mollie.payments.get(payment.id)
|
202
|
+
# refund = mollie.payments_refunds.with(payment).create
|
203
|
+
payment = Mollie::Payment.get("id")
|
204
|
+
refund = payment.refunds.create
|
205
|
+
```
|
206
|
+
|
138
207
|
## License ##
|
139
208
|
[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php).
|
140
209
|
Copyright (c) 2014-2017, Mollie B.V.
|
@@ -153,4 +222,4 @@ Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20
|
|
153
222
|
+ [More information about KBC/CBC Payment Button via Mollie](https://www.mollie.com/kbccbc/)
|
154
223
|
+ [More information about Belfius Direct Net via Mollie](https://www.mollie.com/belfiusdirectnet/)
|
155
224
|
+ [More information about paysafecard via Mollie](https://www.mollie.com/paysafecard/)
|
156
|
-
+ [More information about ING Home’Pay via Mollie](https://www.mollie.com/ing-homepay/)
|
225
|
+
+ [More information about ING Home’Pay via Mollie](https://www.mollie.com/ing-homepay/)
|
data/lib/mollie/method.rb
CHANGED
data/lib/mollie/version.rb
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.4.pre.beta
|
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: 2018-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -345,12 +345,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
345
345
|
version: 2.0.0
|
346
346
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
347
347
|
requirements:
|
348
|
-
- - "
|
348
|
+
- - ">"
|
349
349
|
- !ruby/object:Gem::Version
|
350
|
-
version:
|
350
|
+
version: 1.3.1
|
351
351
|
requirements: []
|
352
352
|
rubyforge_project:
|
353
|
-
rubygems_version: 2.7.
|
353
|
+
rubygems_version: 2.7.6
|
354
354
|
signing_key:
|
355
355
|
specification_version: 4
|
356
356
|
summary: Official Mollie API Client for Ruby
|