spree_mollie_gateway 1.0.7 → 2.0.0
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/Gemfile +1 -1
- data/README.md +39 -3
- data/app/controllers/spree/api/v1/mollie_controller.rb +8 -1
- data/app/models/spree/gateway/mollie_gateway.rb +55 -26
- data/app/models/spree/mollie_payment_source.rb +7 -3
- data/app/models/spree/payment/processing_decorator.rb +1 -1
- data/app/views/spree/checkout/payment/_molliegateway.html.erb +2 -2
- data/docs/api/methods.md +275 -31
- data/docs/migration_v1_x.md +11 -0
- data/lib/spree_mollie_gateway/version.rb +1 -1
- data/spree_mollie_gateway.gemspec +1 -1
- metadata +5 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d2156752574cb481cd69757a94a6d70d0cf9866842674e12b02c63fcb1363b9
|
4
|
+
data.tar.gz: 41ed49883da8d4ea6e63270e0d0f80eaf2e32616f2df5b6ea4d17d1c281cf945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5a7cf8173bb01270ac9c69cb8f6d236332a9ef6241093a5e7694f8afc894a9a0f66891cb52f8977733d270cab3585c03512c470414134d968a1a0683579cd2
|
7
|
+
data.tar.gz: b71cd573a473148c54cd2da0d1145955212e38fc4e56b407d24673aa189b7cf5275863c1b7daf16d8c6b75094edba8363c2c79ec671fcf139ab7243e2c078626
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -15,11 +15,16 @@ Please go to the [signup page](https://www.mollie.com/signup) to create a new Mo
|
|
15
15
|
3. [Installation](#installation)
|
16
16
|
4. [Configuring Mollie Gateway](#configuring-mollie-gateway)
|
17
17
|
5. [API endpoints](#api-endpoints)
|
18
|
+
6. [Upgrading](#upgrading)
|
19
|
+
6. [API documentation](#api-documentation)
|
20
|
+
6. [Want to help us make our API client even better?](#want-to-help-us-make-our-api-client-even-better)
|
18
21
|
6. [License](#license)
|
22
|
+
7. [Support](#support)
|
19
23
|
|
20
24
|
## Features
|
21
25
|
|
22
26
|
* Support for all available Mollie payment methods.
|
27
|
+
* Multicurrency payments
|
23
28
|
* Support for [one-click payments](https://www.mollie.com/en/features/checkout).
|
24
29
|
* Fast in-house support. You will always be helped by someone who knows our products intimately.
|
25
30
|
* Multiple translations: English and Dutch.
|
@@ -60,9 +65,40 @@ bundle exec rails g spree_mollie_gateway:install
|
|
60
65
|
7. Save and you're done!
|
61
66
|
|
62
67
|
## API endpoints
|
63
|
-
This gateway comes with a couple of API endpoints which seamlessly integrate with the Spree API.
|
68
|
+
This gateway comes with a couple of API endpoints which seamlessly integrate with the [Spree API](https://guides.spreecommerce.org/api/).
|
64
69
|
|
65
|
-
<a href="docs/api">Overview of available API endpoints.</a>
|
70
|
+
- <a href="docs/api">Overview of available API endpoints.</a>
|
71
|
+
|
72
|
+
## Upgrading
|
73
|
+
|
74
|
+
- <a href="docs/migration_v1_x.md">Migration from v1.x</a>
|
75
|
+
|
76
|
+
## API documentation
|
77
|
+
|
78
|
+
If you wish to learn more about our API, please visit the [Mollie API Documentation](https://docs.mollie.com).
|
79
|
+
|
80
|
+
## Want to help us make our API client even better?
|
81
|
+
|
82
|
+
Want to help us make our API client even better? We take [pull requests](https://github.com/mollie/mollie-api-ruby/pulls?utf8=%E2%9C%93&q=is%3Apr), sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. [Check out our vacancies](https://jobs.mollie.com/) or [get in touch](mailto:recruitment@mollie.com).
|
66
83
|
|
67
84
|
## License
|
68
|
-
BSD (Berkeley Software Distribution) License. Copyright (c) 2014-2018, Mollie B.V.
|
85
|
+
[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php). Copyright (c) 2014-2018, Mollie B.V.
|
86
|
+
|
87
|
+
## Support
|
88
|
+
Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20-612 88 55
|
89
|
+
|
90
|
+
+ [More information about iDEAL via Mollie](https://www.mollie.com/en/payments/ideal/)
|
91
|
+
+ [More information about Credit card via Mollie](https://www.mollie.com/en/payments/credit-card/)
|
92
|
+
+ [More information about Bancontact via Mollie](https://www.mollie.com/en/payments/bancontact/)
|
93
|
+
+ [More information about SOFORT Banking via Mollie](https://www.mollie.com/en/payments/sofort/)
|
94
|
+
+ [More information about SEPA Bank transfer via Mollie](https://www.mollie.com/en/payments/bank-transfer/)
|
95
|
+
+ [More information about SEPA Direct debit via Mollie](https://www.mollie.com/en/payments/direct-debit/)
|
96
|
+
+ [More information about Bitcoin via Mollie](https://www.mollie.com/en/payments/bitcoin/)
|
97
|
+
+ [More information about PayPal via Mollie](https://www.mollie.com/en/payments/paypal/)
|
98
|
+
+ [More information about KBC/CBC Payment Button via Mollie](https://www.mollie.com/en/payments/kbc-cbc/)
|
99
|
+
+ [More information about Belfius Direct Net via Mollie](https://www.mollie.com/en/payments/belfius)
|
100
|
+
+ [More information about paysafecard via Mollie](https://www.mollie.com/en/payments/paysafecard/)
|
101
|
+
+ [More information about ING Home’Pay via Mollie](https://www.mollie.com/en/payments/ing-homepay/)
|
102
|
+
+ [More information about Gift cards via Mollie](https://www.mollie.com/en/payments/gift-cards)
|
103
|
+
+ [More information about EPS via Mollie](https://www.mollie.com/en/payments/eps)
|
104
|
+
+ [More information about Giropay via Mollie](https://www.mollie.com/en/payments/giropay)
|
@@ -4,10 +4,17 @@ module Spree
|
|
4
4
|
class MollieController < BaseController
|
5
5
|
def methods
|
6
6
|
mollie = Spree::PaymentMethod.find_by_type 'Spree::Gateway::MollieGateway'
|
7
|
-
payment_methods = mollie.
|
7
|
+
payment_methods = mollie.available_methods(methods_params).map {
|
8
|
+
|method| method.attributes
|
9
|
+
}
|
8
10
|
|
9
11
|
render json: payment_methods
|
10
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
def methods_params
|
16
|
+
params.permit(:amount => [:currency, :value])
|
17
|
+
end
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
@@ -36,18 +36,18 @@ module Spree
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# Create a new Mollie payment.
|
39
|
-
def create_transaction(
|
39
|
+
def create_transaction(money, source, gateway_options)
|
40
40
|
MollieLogger.debug("About to create payment for order #{gateway_options[:order_id]}")
|
41
41
|
|
42
42
|
begin
|
43
43
|
mollie_payment = ::Mollie::Payment.create(
|
44
|
-
prepare_payment_params(
|
44
|
+
prepare_payment_params(money, source, gateway_options)
|
45
45
|
)
|
46
46
|
MollieLogger.debug("Payment #{mollie_payment.id} created for order #{gateway_options[:order_id]}")
|
47
47
|
|
48
48
|
source.status = mollie_payment.status
|
49
49
|
source.payment_id = mollie_payment.id
|
50
|
-
source.payment_url = mollie_payment.
|
50
|
+
source.payment_url = mollie_payment.checkout_url
|
51
51
|
source.save!
|
52
52
|
ActiveMerchant::Billing::Response.new(true, 'Payment created')
|
53
53
|
rescue Mollie::Exception => e
|
@@ -67,14 +67,17 @@ module Spree
|
|
67
67
|
customer
|
68
68
|
end
|
69
69
|
|
70
|
-
def prepare_payment_params(
|
70
|
+
def prepare_payment_params(money, source, gateway_options)
|
71
71
|
spree_routes = ::Spree::Core::Engine.routes.url_helpers
|
72
72
|
order_number = gateway_options[:order_id]
|
73
73
|
customer_id = gateway_options[:customer_id]
|
74
|
-
|
74
|
+
currency = gateway_options[:currency]
|
75
75
|
|
76
76
|
order_params = {
|
77
|
-
amount:
|
77
|
+
amount: {
|
78
|
+
value: money.to_s,
|
79
|
+
currency: currency
|
80
|
+
},
|
78
81
|
description: "Spree Order: #{order_number}",
|
79
82
|
redirectUrl: spree_routes.mollie_validate_payment_mollie_url(
|
80
83
|
order_number: order_number,
|
@@ -84,23 +87,31 @@ module Spree
|
|
84
87
|
order_number: order_number,
|
85
88
|
host: get_preference(:hostname)
|
86
89
|
),
|
87
|
-
method: source.payment_method_name,
|
88
90
|
metadata: {
|
89
91
|
order_id: order_number
|
90
92
|
},
|
91
93
|
api_key: get_preference(:api_key),
|
92
94
|
}
|
93
95
|
|
94
|
-
source.
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
if source.try(:payment_method_name).present?
|
97
|
+
order_params.merge! ({
|
98
|
+
method: source.payment_method_name,
|
99
|
+
})
|
100
|
+
end
|
101
|
+
|
102
|
+
if source.try(:issuer).present?
|
103
|
+
order_params.merge! ({
|
104
|
+
issuer: source.issuer
|
105
|
+
})
|
106
|
+
end
|
98
107
|
|
99
108
|
if customer_id.present?
|
100
|
-
if source.payment_method_name.
|
101
|
-
|
102
|
-
|
103
|
-
|
109
|
+
if source.try(:payment_method_name).present?
|
110
|
+
if source.payment_method_name.match(Regexp.union([::Mollie::Method::BITCOIN, ::Mollie::Method::BANKTRANSFER, ::Mollie::Method::GIFTCARD]))
|
111
|
+
order_params.merge! ({
|
112
|
+
billingEmail: gateway_options[:email]
|
113
|
+
})
|
114
|
+
end
|
104
115
|
end
|
105
116
|
|
106
117
|
if Spree::Gateway::MollieGateway.allow_one_click_payments?
|
@@ -120,18 +131,22 @@ module Spree
|
|
120
131
|
|
121
132
|
# Create a new Mollie refund
|
122
133
|
def credit(credit_cents, payment_id, options)
|
123
|
-
|
134
|
+
order = options[:originator].try(:payment).try(:order)
|
135
|
+
order_number = order.try(:number)
|
136
|
+
order_currency = order.try(:currency)
|
124
137
|
MollieLogger.debug("Starting refund for order #{order_number}")
|
125
138
|
|
126
139
|
begin
|
127
|
-
amount = credit_cents / 100.0
|
128
140
|
Mollie::Payment::Refund.create(
|
129
141
|
payment_id: payment_id,
|
130
|
-
amount:
|
142
|
+
amount: {
|
143
|
+
value: order.display_total.money.to_s,
|
144
|
+
currency: order_currency
|
145
|
+
},
|
131
146
|
description: "Refund Spree Order ID: #{order_number}",
|
132
147
|
api_key: get_preference(:api_key)
|
133
148
|
)
|
134
|
-
MollieLogger.debug("Successfully refunded #{
|
149
|
+
MollieLogger.debug("Successfully refunded #{order.display_total} for order #{order_number}")
|
135
150
|
ActiveMerchant::Billing::Response.new(true, 'Refund successful')
|
136
151
|
rescue Mollie::Exception => e
|
137
152
|
MollieLogger.debug("Refund failed for order #{order_number}: #{e.message}")
|
@@ -139,11 +154,27 @@ module Spree
|
|
139
154
|
end
|
140
155
|
end
|
141
156
|
|
142
|
-
def
|
143
|
-
|
157
|
+
def available_methods(params = nil)
|
158
|
+
method_params = {
|
144
159
|
api_key: get_preference(:api_key),
|
145
|
-
include: 'issuers'
|
146
|
-
|
160
|
+
include: 'issuers',
|
161
|
+
}
|
162
|
+
|
163
|
+
if params.present?
|
164
|
+
method_params.merge! params
|
165
|
+
end
|
166
|
+
|
167
|
+
::Mollie::Method.all(method_params)
|
168
|
+
end
|
169
|
+
|
170
|
+
def available_methods_for_order(order)
|
171
|
+
params = {
|
172
|
+
amount: {
|
173
|
+
currency: order.currency,
|
174
|
+
value: order.display_total.money.to_s
|
175
|
+
}
|
176
|
+
}
|
177
|
+
available_methods(params)
|
147
178
|
end
|
148
179
|
|
149
180
|
def update_payment_status(payment)
|
@@ -164,10 +195,8 @@ module Spree
|
|
164
195
|
payment.complete! unless payment.completed?
|
165
196
|
payment.order.finalize!
|
166
197
|
payment.order.update_attributes(:state => 'complete', :completed_at => Time.now)
|
167
|
-
when '
|
198
|
+
when 'canceled', 'expired', 'failed'
|
168
199
|
payment.failure! unless payment.failed?
|
169
|
-
when 'refunded'
|
170
|
-
payment.void! unless payment.void?
|
171
200
|
else
|
172
201
|
MollieLogger.debug('Unhandled Mollie payment state received. Therefore we did not update the payment state.')
|
173
202
|
end
|
@@ -21,7 +21,7 @@ module Spree
|
|
21
21
|
'iDEAL'
|
22
22
|
when ::Mollie::Method::CREDITCARD then
|
23
23
|
'Credit card'
|
24
|
-
when ::Mollie::Method::
|
24
|
+
when ::Mollie::Method::BANCONTACT then
|
25
25
|
'Bancontact'
|
26
26
|
when ::Mollie::Method::SOFORT then
|
27
27
|
'SOFORT Banking'
|
@@ -37,12 +37,16 @@ module Spree
|
|
37
37
|
'Belfius Pay Button'
|
38
38
|
when ::Mollie::Method::PAYSAFECARD then
|
39
39
|
'paysafecard'
|
40
|
-
when ::Mollie::Method::PODIUMCADEAUKAART then
|
41
|
-
'Podium Cadeaukaart'
|
42
40
|
when ::Mollie::Method::GIFTCARD then
|
43
41
|
'Giftcard'
|
44
42
|
when ::Mollie::Method::INGHOMEPAY then
|
45
43
|
'ING Home\'Pay'
|
44
|
+
when ::Mollie::Method::EPS then
|
45
|
+
'EPS'
|
46
|
+
when ::Mollie::Method::GIROPAY then
|
47
|
+
'Giropay'
|
48
|
+
when ::Mollie::Method::DIRECTDEBIT then
|
49
|
+
'SEPA Direct debit'
|
46
50
|
else
|
47
51
|
'Mollie'
|
48
52
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<ul class="list-group">
|
2
|
-
<% payment_method.
|
2
|
+
<% payment_method.available_methods_for_order(@order).each do |method| %>
|
3
3
|
<% prefix = "payment_source[#{payment_method.id}]" %>
|
4
4
|
<div class="radio list-group-item">
|
5
5
|
|
6
6
|
<label>
|
7
7
|
<%= radio_button(prefix, :payment_method_name, method.id, class: 'js-mollie-payment-method') %>
|
8
|
-
<%= image_tag(method.image['
|
8
|
+
<%= image_tag(method.image['size1x']) %>
|
9
9
|
<%= method.description %>
|
10
10
|
</label>
|
11
11
|
|
data/docs/api/methods.md
CHANGED
@@ -2,8 +2,18 @@
|
|
2
2
|
|
3
3
|
Returns a list of Mollie payment methods (and its issuers) which are enabled for your website profile.
|
4
4
|
|
5
|
+
## Headers
|
6
|
+
|
7
|
+
This endpoint behaves just like very other Spree API endpoint. If your endpoints require authentication, make sure you send the `X-Spree-Token` header.
|
8
|
+
|
5
9
|
## Parameters
|
6
|
-
|
10
|
+
|
11
|
+
If you would like to obtain a list of payment methods for a specific currency, you should send an `amount` object containing value and currency. Only methods that support the `amount` and `currency` are returned.
|
12
|
+
|
13
|
+
| URL Parameter | Required? |
|
14
|
+
| -------------------- | ----------:|
|
15
|
+
| amount[currency] | No |
|
16
|
+
| amount[value] | No |
|
7
17
|
|
8
18
|
## Example request
|
9
19
|
|
@@ -20,40 +30,274 @@ Content-Type: application/json; charset=utf-8
|
|
20
30
|
|
21
31
|
[
|
22
32
|
{
|
23
|
-
"
|
24
|
-
"resource": "method",
|
25
|
-
"id": "ideal",
|
26
|
-
"description": "iDEAL",
|
27
|
-
"amount": {
|
28
|
-
"minimum": "0.01",
|
29
|
-
"maximum": "50000.00"
|
30
|
-
},
|
31
|
-
"image": {
|
32
|
-
"normal": "https://www.mollie.com/images/payscreen/methods/ideal.png",
|
33
|
-
"bigger": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png"
|
34
|
-
},
|
35
|
-
"issuers": [
|
36
|
-
{
|
37
|
-
"resource": "issuer",
|
38
|
-
"id": "ideal_TESTNL99",
|
39
|
-
"name": "TBM Bank",
|
40
|
-
"method": "ideal",
|
41
|
-
"image": {
|
42
|
-
"normal": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TESTNL99.png",
|
43
|
-
"bigger": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TESTNL99%402x.png"
|
44
|
-
}
|
45
|
-
}
|
46
|
-
]
|
47
|
-
},
|
33
|
+
"resource": "method",
|
48
34
|
"id": "ideal",
|
49
35
|
"description": "iDEAL",
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
36
|
+
"image": {
|
37
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
|
38
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png"
|
53
39
|
},
|
40
|
+
"issuers": [
|
41
|
+
{
|
42
|
+
"resource": "issuer",
|
43
|
+
"id": "ideal_ABNANL2A",
|
44
|
+
"name": "ABN AMRO",
|
45
|
+
"image": {
|
46
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png",
|
47
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png"
|
48
|
+
}
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"resource": "issuer",
|
52
|
+
"id": "ideal_ASNBNL21",
|
53
|
+
"name": "ASN Bank",
|
54
|
+
"image": {
|
55
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ASNBNL21.png",
|
56
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ASNBNL21.png"
|
57
|
+
}
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"resource": "issuer",
|
61
|
+
"id": "ideal_BUNQNL2A",
|
62
|
+
"name": "bunq",
|
63
|
+
"image": {
|
64
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/BUNQNL2A.png",
|
65
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/BUNQNL2A.png"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"resource": "issuer",
|
70
|
+
"id": "ideal_INGBNL2A",
|
71
|
+
"name": "ING",
|
72
|
+
"image": {
|
73
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/INGBNL2A.png",
|
74
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/INGBNL2A.png"
|
75
|
+
}
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"resource": "issuer",
|
79
|
+
"id": "ideal_KNABNL2H",
|
80
|
+
"name": "Knab",
|
81
|
+
"image": {
|
82
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/KNABNL2H.png",
|
83
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/KNABNL2H.png"
|
84
|
+
}
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"resource": "issuer",
|
88
|
+
"id": "ideal_MOYONL21",
|
89
|
+
"name": "Moneyou",
|
90
|
+
"image": {
|
91
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/MOYONL21.png",
|
92
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/MOYONL21.png"
|
93
|
+
}
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"resource": "issuer",
|
97
|
+
"id": "ideal_RABONL2U",
|
98
|
+
"name": "Rabobank",
|
99
|
+
"image": {
|
100
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RABONL2U.png",
|
101
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RABONL2U.png"
|
102
|
+
}
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"resource": "issuer",
|
106
|
+
"id": "ideal_RBRBNL21",
|
107
|
+
"name": "RegioBank",
|
108
|
+
"image": {
|
109
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RBRBNL21.png",
|
110
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RBRBNL21.png"
|
111
|
+
}
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"resource": "issuer",
|
115
|
+
"id": "ideal_SNSBNL2A",
|
116
|
+
"name": "SNS Bank",
|
117
|
+
"image": {
|
118
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/SNSBNL2A.png",
|
119
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/SNSBNL2A.png"
|
120
|
+
}
|
121
|
+
},
|
122
|
+
{
|
123
|
+
"resource": "issuer",
|
124
|
+
"id": "ideal_TRIONL2U",
|
125
|
+
"name": "Triodos Bank",
|
126
|
+
"image": {
|
127
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TRIONL2U.png",
|
128
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TRIONL2U.png"
|
129
|
+
}
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"resource": "issuer",
|
133
|
+
"id": "ideal_FVLBNL22",
|
134
|
+
"name": "van Lanschot",
|
135
|
+
"image": {
|
136
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png",
|
137
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png"
|
138
|
+
}
|
139
|
+
}
|
140
|
+
],
|
141
|
+
"_links": {
|
142
|
+
"self": {
|
143
|
+
"href": "https://api.mollie.com/v2/methods/ideal",
|
144
|
+
"type": "application/hal+json"
|
145
|
+
}
|
146
|
+
}
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"resource": "method",
|
150
|
+
"id": "creditcard",
|
151
|
+
"description": "Credit card",
|
152
|
+
"image": {
|
153
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/creditcard.png",
|
154
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/creditcard%402x.png"
|
155
|
+
},
|
156
|
+
"_links": {
|
157
|
+
"self": {
|
158
|
+
"href": "https://api.mollie.com/v2/methods/creditcard",
|
159
|
+
"type": "application/hal+json"
|
160
|
+
}
|
161
|
+
}
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"resource": "method",
|
165
|
+
"id": "paypal",
|
166
|
+
"description": "PayPal",
|
54
167
|
"image": {
|
55
|
-
"
|
56
|
-
"
|
168
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/paypal.png",
|
169
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/paypal%402x.png"
|
170
|
+
},
|
171
|
+
"_links": {
|
172
|
+
"self": {
|
173
|
+
"href": "https://api.mollie.com/v2/methods/paypal",
|
174
|
+
"type": "application/hal+json"
|
175
|
+
}
|
176
|
+
}
|
177
|
+
},
|
178
|
+
{
|
179
|
+
"resource": "method",
|
180
|
+
"id": "bancontact",
|
181
|
+
"description": "Bancontact",
|
182
|
+
"image": {
|
183
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/mistercash.png",
|
184
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/mistercash%402x.png"
|
185
|
+
},
|
186
|
+
"_links": {
|
187
|
+
"self": {
|
188
|
+
"href": "https://api.mollie.com/v2/methods/mistercash",
|
189
|
+
"type": "application/hal+json"
|
190
|
+
}
|
191
|
+
}
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"resource": "method",
|
195
|
+
"id": "banktransfer",
|
196
|
+
"description": "Bank transfer",
|
197
|
+
"image": {
|
198
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/banktransfer.png",
|
199
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/banktransfer%402x.png"
|
200
|
+
},
|
201
|
+
"_links": {
|
202
|
+
"self": {
|
203
|
+
"href": "https://api.mollie.com/v2/methods/banktransfer",
|
204
|
+
"type": "application/hal+json"
|
205
|
+
}
|
206
|
+
}
|
207
|
+
},
|
208
|
+
{
|
209
|
+
"resource": "method",
|
210
|
+
"id": "sofort",
|
211
|
+
"description": "SOFORT Banking",
|
212
|
+
"image": {
|
213
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/sofort.png",
|
214
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/sofort%402x.png"
|
215
|
+
},
|
216
|
+
"_links": {
|
217
|
+
"self": {
|
218
|
+
"href": "https://api.mollie.com/v2/methods/sofort",
|
219
|
+
"type": "application/hal+json"
|
220
|
+
}
|
221
|
+
}
|
222
|
+
},
|
223
|
+
{
|
224
|
+
"resource": "method",
|
225
|
+
"id": "kbc",
|
226
|
+
"description": "KBC/CBC Payment Button",
|
227
|
+
"image": {
|
228
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/kbc.png",
|
229
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/kbc%402x.png"
|
230
|
+
},
|
231
|
+
"issuers": [
|
232
|
+
{
|
233
|
+
"resource": "issuer",
|
234
|
+
"id": "cbc",
|
235
|
+
"name": "CBC",
|
236
|
+
"image": {
|
237
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/cbc.png",
|
238
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/cbc.png"
|
239
|
+
}
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"resource": "issuer",
|
243
|
+
"id": "kbc",
|
244
|
+
"name": "KBC",
|
245
|
+
"image": {
|
246
|
+
"size1x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/kbc.png",
|
247
|
+
"size2x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/kbc.png"
|
248
|
+
}
|
249
|
+
}
|
250
|
+
],
|
251
|
+
"_links": {
|
252
|
+
"self": {
|
253
|
+
"href": "https://api.mollie.com/v2/methods/kbc",
|
254
|
+
"type": "application/hal+json"
|
255
|
+
}
|
256
|
+
}
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"resource": "method",
|
260
|
+
"id": "belfius",
|
261
|
+
"description": "Belfius Pay Button",
|
262
|
+
"image": {
|
263
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/belfius.png",
|
264
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/belfius%402x.png"
|
265
|
+
},
|
266
|
+
"_links": {
|
267
|
+
"self": {
|
268
|
+
"href": "https://api.mollie.com/v2/methods/belfius",
|
269
|
+
"type": "application/hal+json"
|
270
|
+
}
|
271
|
+
}
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"resource": "method",
|
275
|
+
"id": "inghomepay",
|
276
|
+
"description": "ING Home'Pay",
|
277
|
+
"image": {
|
278
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/inghomepay.png",
|
279
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/inghomepay%402x.png"
|
280
|
+
},
|
281
|
+
"_links": {
|
282
|
+
"self": {
|
283
|
+
"href": "https://api.mollie.com/v2/methods/inghomepay",
|
284
|
+
"type": "application/hal+json"
|
285
|
+
}
|
286
|
+
}
|
287
|
+
},
|
288
|
+
{
|
289
|
+
"resource": "method",
|
290
|
+
"id": "bitcoin",
|
291
|
+
"description": "Bitcoin",
|
292
|
+
"image": {
|
293
|
+
"size1x": "https://www.mollie.com/images/payscreen/methods/bitcoin.png",
|
294
|
+
"size2x": "https://www.mollie.com/images/payscreen/methods/bitcoin%402x.png"
|
295
|
+
},
|
296
|
+
"_links": {
|
297
|
+
"self": {
|
298
|
+
"href": "https://api.mollie.com/v2/methods/bitcoin",
|
299
|
+
"type": "application/hal+json"
|
300
|
+
}
|
57
301
|
}
|
58
302
|
}
|
59
303
|
]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Migration from v1.x
|
2
|
+
|
3
|
+
Version 2.x includes support for multicurrency payments and refunds. This feature has been introduced in the Mollie V2 API. Please refer to [Migrating from v1 to v2](https://docs.mollie.com/migrating-v1-to-v2) for a general overview of the switch to Mollie v2 API.
|
4
|
+
|
5
|
+
## Retrieving payment methods using Spree API
|
6
|
+
|
7
|
+
It's recommended to pass a `amount[currency]` and `amount[value]` URL params when fetching the available methods. This call will only return the available payment methods that are available for this currency and amount.
|
8
|
+
|
9
|
+
```bash
|
10
|
+
curl "example.com/api/v1/mollie/methods?amount%5Bcurrency%5D=EUR&amount%5Bvalue%5D=10.00"
|
11
|
+
```
|
@@ -50,5 +50,5 @@ Gem::Specification.new do |spec|
|
|
50
50
|
spec.add_development_dependency 'coffee-rails'
|
51
51
|
spec.add_development_dependency 'database_cleaner'
|
52
52
|
|
53
|
-
spec.add_runtime_dependency 'mollie-api-ruby', '~>
|
53
|
+
spec.add_runtime_dependency 'mollie-api-ruby', '~> 4.0.0'
|
54
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_mollie_gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vernon de Goede
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -272,20 +272,14 @@ dependencies:
|
|
272
272
|
requirements:
|
273
273
|
- - "~>"
|
274
274
|
- !ruby/object:Gem::Version
|
275
|
-
version:
|
276
|
-
- - ">="
|
277
|
-
- !ruby/object:Gem::Version
|
278
|
-
version: 3.1.4
|
275
|
+
version: 4.0.0
|
279
276
|
type: :runtime
|
280
277
|
prerelease: false
|
281
278
|
version_requirements: !ruby/object:Gem::Requirement
|
282
279
|
requirements:
|
283
280
|
- - "~>"
|
284
281
|
- !ruby/object:Gem::Version
|
285
|
-
version:
|
286
|
-
- - ">="
|
287
|
-
- !ruby/object:Gem::Version
|
288
|
-
version: 3.1.4
|
282
|
+
version: 4.0.0
|
289
283
|
description: Mollie payment gateway for Spree Commerce.
|
290
284
|
email:
|
291
285
|
- vernon@mollie.com
|
@@ -324,6 +318,7 @@ files:
|
|
324
318
|
- docs/api/methods.md
|
325
319
|
- docs/api/readme.md
|
326
320
|
- docs/debugging.md
|
321
|
+
- docs/migration_v1_x.md
|
327
322
|
- lib/generators/spree_mollie_gateway/install/install_generator.rb
|
328
323
|
- lib/spree_mollie_gateway.rb
|
329
324
|
- lib/spree_mollie_gateway/engine.rb
|