spree_gateway 3.7.4 → 3.7.5

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: 8ab0991265fe493eef93a0ee098892bd46682c56ab554ae773831ae2b154115b
4
- data.tar.gz: ea290e80beadd38e792c4218180bad4a65505ac038e7c5b21e19f0a18d63cb24
3
+ metadata.gz: 2b9d8d20653e071378252663b95cfdafd7bb5dfcd6611e7b558888109fb776fa
4
+ data.tar.gz: 79ab6d2ed89462c48aa23bc649d368bcd77f8c411949ae6b4d202854a1b79950
5
5
  SHA512:
6
- metadata.gz: 0ce78bd6a8b62af2de0ac1e73abb6844ea16385d3ff121c033070b6c965f1e87e52d7a3eced0d35ced01d127eef3057dd8132f561555ac89780363b179e2e40f
7
- data.tar.gz: 9a0ac382a6aa612965f0ad22950ec96a907c069c71a06e8f319987582ad64691cb718bbda349ddd7b7d6accb9bc23f548e43908fb157b692c13395d468c8f96c
6
+ metadata.gz: adaf238270f0c8c9d0bf447d595e56b9d606ecd9e6a538509c38c995a74e44923569e18a055f7c4863370cd3ae45e2cf7c1df3e7e2436cf6ed135522dd6c8968
7
+ data.tar.gz: f25c7958e583b13e936aa01e23f23d30810346cf1da2ae8cea4414ecb7bd6e74c1d18411ec29703cc90ad528219378361489cf0e2edfd3c102c80b06dfa1df08
@@ -1,5 +1,5 @@
1
1
  module SpreeGateway
2
2
  def self.version
3
- '3.7.4'
3
+ '3.7.5'
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ <%= render "spree/admin/payments/source_views/gateway", payment: payment %>
@@ -9,7 +9,6 @@
9
9
  <script>
10
10
  var stripeApplePay = Stripe("<%= payment_method.preferred_publishable_key %>");
11
11
  var elements = stripeApplePay.elements();
12
-
13
12
  var paymentRequest = stripeApplePay.paymentRequest({
14
13
  country: '<%= payment_method.preferred_country_code.try(:upcase) %>',
15
14
  currency: '<%= @order.currency.downcase %>',
@@ -64,6 +63,15 @@
64
63
  form.appendChild(hiddenInput);
65
64
  };
66
65
 
66
+ function hideApplePayRadioButtonForNonAppleDevices() {
67
+ var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);
68
+ var isiOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
69
+
70
+ if (!isSafari && !isiOS) {
71
+ $('input[name$="order[payments_attributes][][payment_method_id]"][value="<%= payment_method.id %>"]').closest('li').hide()
72
+ }
73
+ }
74
+
67
75
  paymentRequest.on('token', function(ev) {
68
76
  var form = document.getElementById('checkout_form_payment');
69
77
  var token = ev.token;
@@ -83,6 +91,7 @@
83
91
 
84
92
  window.addEventListener('DOMContentLoaded', function() {
85
93
  Spree.stripeApplePayPaymentMethod = $('#payment_method_' + <%= payment_method.id %>);
94
+ hideApplePayRadioButtonForNonAppleDevices();
86
95
 
87
96
  prButton.on('ready', function () {
88
97
  Spree.stripeApplePayPaymentMethod.prepend("<div id='stripeApplePayError' class='errorExplanation alert alert-danger' style='display:none'></div>");
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
4
+ version: 3.7.5
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-03-09 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -424,8 +424,10 @@ files:
424
424
  - lib/views/backend/spree/admin/log_entries/_stripe.html.erb
425
425
  - lib/views/backend/spree/admin/payments/source_forms/_quickcheckout.html.erb
426
426
  - lib/views/backend/spree/admin/payments/source_forms/_stripe.html.erb
427
+ - lib/views/backend/spree/admin/payments/source_forms/_stripe_apple_pay.html.erb
427
428
  - lib/views/backend/spree/admin/payments/source_forms/_stripe_elements.html.erb
428
429
  - lib/views/backend/spree/admin/payments/source_views/_stripe.html.erb
430
+ - lib/views/backend/spree/admin/payments/source_views/_stripe_apple_pay.html.erb
429
431
  - lib/views/backend/spree/admin/payments/source_views/_stripe_elements.html.erb
430
432
  - lib/views/frontend/spree/checkout/payment/_stripe.html.erb
431
433
  - lib/views/frontend/spree/checkout/payment/_stripe_additional_info.html.erb
@@ -485,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
485
487
  version: '0'
486
488
  requirements:
487
489
  - none
488
- rubygems_version: 3.0.2
490
+ rubygems_version: 3.0.6
489
491
  signing_key:
490
492
  specification_version: 4
491
493
  summary: Additional Payment Gateways for Spree Commerce