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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bf7f502de95f41992227df814d11998e447bfe6f302d5654e09f99240b023db
4
- data.tar.gz: 38e633ffafb01bb31934dcdec4df4a9c6444f1c728e1f1d41a623f2ec9514689
3
+ metadata.gz: bd1e911eb84eec86826be7b64e8d94b6105b1cee6eee6b6850d2629b0fba1eb9
4
+ data.tar.gz: a36fcdaff09f3f3e15db2af4bbec15e1625b6bf36cd41c8a45d4b1c93b51e393
5
5
  SHA512:
6
- metadata.gz: 32dfea7c11e4a71f89a75bd092667c381d48b03611e857a86e3c11930100132c0f8d84a44288883d04c96a88557fe02aad27ce43600db56b93c3967ba2021d98
7
- data.tar.gz: 9a1f8074d43f5feee5b128c8204edb8916f4eb975a0e3463f76e28e5d1a6825b3f79ba261c470a2039c3d1066fe0aa0337e0ea9ffde7e4c96111244316d79828
6
+ metadata.gz: 7e92f44b23f2b004564ad303d0c5f67bd312e5d921c3e61235bd48748486624df87866f5bbba7b128fd626c301bb0778f25b22798d804d397f6f9351fd5af946
7
+ data.tar.gz: 920f697c64fa5290ec1a6bb08a52295365665a86afaa93802a31b91061e8543fd7632c57afd059d0aefc1a8b453798e1e2e11f7c743e2ea81139458965c57eb4
@@ -1,5 +1,5 @@
1
1
  module SpreeGateway
2
2
  def self.version
3
- '3.7.0'
3
+ '3.7.1'
4
4
  end
5
5
  end
@@ -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
- Spree.ready(function() {
62
- Spree.stripePaymentMethod.prepend("<div id='stripeError' class='errorExplanation alert alert-danger' style='display:none'></div>");
63
- return $('#checkout_form_payment [data-hook=buttons]').click(function() {
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
- expiration = $('.cardExpiry:visible').payment('cardExpiryVal');
69
- params = $.extend({
70
- number: $('.cardNumber:visible').val(),
71
- cvc: $('.cardCode:visible').val(),
72
- exp_month: expiration.month || 0,
73
- exp_year: expiration.year || 0
74
- }, Spree.stripeAdditionalInfo);
75
- Stripe.card.createToken(params, stripeResponseHandler);
76
- return false;
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
- Spree.ready(function() {
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
- Spree.stripeElementsPaymentMethod = $('#payment_method_' + <%= payment_method.id %>);
56
+ window.addEventListener('DOMContentLoaded', function () {
57
+ card.mount('#card-element');
59
58
 
60
- Spree.ready(function() {
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.0
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-01-30 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core