spree_mollie_gateway 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c3104359f48abe0dcb7db00826c17206542222d6d80b62d2d0ef8081eead29f
|
4
|
+
data.tar.gz: 58910be28e0110c2a44d45bac658c5bec286b012b5de0210430c579463300a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77c93445e60c74a96fed738943d6a74e1c3e40af4f8ffe8f4abf341e76d25bf4bc1bee1e114e6e845dd578059fd22bb58522ff73df341512868467bafc62da70
|
7
|
+
data.tar.gz: 85b2c58031bc8f588d9eb55b85f136990daaadabacc84db745af0ae4e327d86e377ba09aeb9b736700068d0b904800778db7d20fb81bfb54320ecf7781464361
|
@@ -1,5 +1,23 @@
|
|
1
1
|
Spree::Payment::Processing.module_eval do
|
2
2
|
def process!(amount = nil)
|
3
|
+
if payment_method.is_a? Spree::Gateway::MollieGateway
|
4
|
+
process_with_mollie
|
5
|
+
else
|
6
|
+
process_with_spree
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def process_with_spree
|
13
|
+
if payment_method && payment_method.auto_capture?
|
14
|
+
purchase!
|
15
|
+
else
|
16
|
+
authorize!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def process_with_mollie
|
3
21
|
amount ||= money.money.cents
|
4
22
|
started_processing!
|
5
23
|
response = payment_method.create_transaction(
|
@@ -9,4 +27,4 @@ Spree::Payment::Processing.module_eval do
|
|
9
27
|
)
|
10
28
|
handle_response(response, :pend, :failure)
|
11
29
|
end
|
12
|
-
end
|
30
|
+
end
|
@@ -5,6 +5,7 @@ Spree.user_class.class_eval do
|
|
5
5
|
# Don't create Mollie customers if spree_auth_devise is not installed.
|
6
6
|
return unless defined? Spree::User
|
7
7
|
mollie_gateway = Spree::PaymentMethod.find_by_type 'Spree::Gateway::MollieGateway'
|
8
|
+
return unless mollie_gateway.present?
|
8
9
|
mollie_customer = mollie_gateway.create_customer(self)
|
9
10
|
update mollie_customer_id: mollie_customer.id
|
10
11
|
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: 1.0.
|
4
|
+
version: 1.0.6
|
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-06-
|
11
|
+
date: 2018-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|