spree_gateway 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spree_gateway/version.rb +1 -1
- data/lib/views/frontend/spree/checkout/payment/_stripe.html.erb +22 -19
- data/lib/views/frontend/spree/checkout/payment/_stripe_apple_pay.html.erb +1 -1
- data/lib/views/frontend/spree/checkout/payment/_stripe_elements.html.erb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1e911eb84eec86826be7b64e8d94b6105b1cee6eee6b6850d2629b0fba1eb9
|
4
|
+
data.tar.gz: a36fcdaff09f3f3e15db2af4bbec15e1625b6bf36cd41c8a45d4b1c93b51e393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e92f44b23f2b004564ad303d0c5f67bd312e5d921c3e61235bd48748486624df87866f5bbba7b128fd626c301bb0778f25b22798d804d397f6f9351fd5af946
|
7
|
+
data.tar.gz: 920f697c64fa5290ec1a6bb08a52295365665a86afaa93802a31b91061e8543fd7632c57afd059d0aefc1a8b453798e1e2e11f7c743e2ea81139458965c57eb4
|
@@ -55,27 +55,30 @@
|
|
55
55
|
}
|
56
56
|
};
|
57
57
|
|
58
|
-
window.addEventListener('DOMContentLoaded', function() {
|
58
|
+
window.addEventListener('DOMContentLoaded', function () {
|
59
59
|
Spree.stripePaymentMethod = $('#payment_method_' + <%= payment_method.id %>);
|
60
|
+
Spree.stripePaymentMethod.prepend("<div id='stripeError' class='errorExplanation alert alert-danger' style='display:none'></div>");
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
62
|
+
$('#checkout_form_payment [data-hook=buttons]').click(function (e) {
|
63
|
+
|
64
|
+
var expiration, params;
|
65
|
+
$('#stripeError').hide();
|
66
|
+
Spree.stripePaymentMethod.find('#card_number, #card_expiry, #card_code').removeClass('error');
|
67
|
+
if (Spree.stripePaymentMethod.is(':visible')) {
|
68
|
+
e.preventDefault();
|
69
|
+
|
70
|
+
expiration = $('.cardExpiry:visible').payment('cardExpiryVal');
|
71
|
+
params = $.extend({
|
72
|
+
number: $('.cardNumber:visible').val(),
|
73
|
+
cvc: $('.cardCode:visible').val(),
|
74
|
+
exp_month: expiration.month || 0,
|
75
|
+
exp_year: expiration.year || 0
|
76
|
+
}, Spree.stripeAdditionalInfo);
|
77
|
+
|
78
|
+
Stripe.card.createToken(params, stripeResponseHandler);
|
79
|
+
|
80
|
+
return false;
|
81
|
+
}
|
79
82
|
});
|
80
83
|
});
|
81
84
|
</script>
|
@@ -84,7 +84,7 @@
|
|
84
84
|
window.addEventListener('DOMContentLoaded', function() {
|
85
85
|
Spree.stripeApplePayPaymentMethod = $('#payment_method_' + <%= payment_method.id %>);
|
86
86
|
|
87
|
-
|
87
|
+
prButton.on('ready', function () {
|
88
88
|
Spree.stripeApplePayPaymentMethod.prepend("<div id='stripeApplePayError' class='errorExplanation alert alert-danger' style='display:none'></div>");
|
89
89
|
var form = document.getElementById('checkout_form_payment');
|
90
90
|
form.addEventListener('submit', function(e) {
|
@@ -52,14 +52,15 @@
|
|
52
52
|
empty: 'is-empty',
|
53
53
|
},
|
54
54
|
});
|
55
|
-
card.mount('#card-element');
|
56
55
|
|
57
|
-
window.addEventListener('DOMContentLoaded', function() {
|
58
|
-
|
56
|
+
window.addEventListener('DOMContentLoaded', function () {
|
57
|
+
card.mount('#card-element');
|
59
58
|
|
60
|
-
|
59
|
+
card.on('ready', function () {
|
60
|
+
Spree.stripeElementsPaymentMethod = $('#payment_method_' + <%= payment_method.id %>);
|
61
61
|
Spree.stripeElementsPaymentMethod.prepend("<div id='stripeElementsError' class='errorExplanation alert alert-danger' style='display:none'></div>");
|
62
62
|
var form = document.getElementById('checkout_form_payment');
|
63
|
+
|
63
64
|
form.addEventListener('submit', function(e) {
|
64
65
|
if (Spree.stripeElementsPaymentMethod.is(':visible')) {
|
65
66
|
$('#stripeElementsError').hide();
|
@@ -67,6 +68,11 @@
|
|
67
68
|
createStripeElementsToken();
|
68
69
|
}
|
69
70
|
});
|
71
|
+
card.addEventListener('change', function(event) {
|
72
|
+
if (!event.error) {
|
73
|
+
$(form).find('input[type="submit"]').prop('disabled', false)
|
74
|
+
}
|
75
|
+
});
|
70
76
|
});
|
71
77
|
});
|
72
78
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spree Commerce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|