spree_vpago 2.2.2.pre.pre27 → 2.2.2.pre.pre28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 476c4860c0894a7c700356ffa0b13dab89d7acc84c181747e5ff2db708fe9bd4
4
- data.tar.gz: ca1ad0fabdac23c21a27cb3f8e893ac1df94ef614ca8e0d82faacdf3dffa68d9
3
+ metadata.gz: f4223baa916c63136d13cdc1e6a10e0cab90401325df3fde6bcd05e837d28556
4
+ data.tar.gz: ffff5d2363666590557c939385c4d366a81abb05a05dd0b8914590c8e33af5cc
5
5
  SHA512:
6
- metadata.gz: 30ac51ec124c828bcb706d56419d17de1dee46c234a11908258ef7cbe5274c1e56bba102683cac1e0e2ae797ab60d0cf718a7809c9359a2d8b874c31f23f8c85
7
- data.tar.gz: 60875cae684fb890c347f30a2595d2157f7cb9597effe135429a84d003bd9ed95cd4231fa8892cb1cfd2fa037a534479067f90e7f6f90ca66cbbf791e2e5388a
6
+ metadata.gz: dcc8364443a80c55cb2f8b91212bbdf96dd7adf91b80802066bea239a6827759f4201f2f434dc65e1a60ec7106af1bbbafe2b10133cbd1379c704fcf8cf3e4f8
7
+ data.tar.gz: 6675fda061cd27a3b34057a304d5f5f7fb93830ee0698df9d7e0d83435668f59d867d1c6b4af22c638469e0075b96651ab899399ccebcf924f2d7a34f6c141a0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.2.2.pre.pre27)
4
+ spree_vpago (2.2.2.pre.pre28)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -22,32 +22,8 @@ module Vpago
22
22
  render partial: processing_script_partial_path if lookup_context.exists?(processing_script_partial_path, [], true)
23
23
  end
24
24
 
25
- # when return nil, each payment method should use their default URL.
26
- # eg. PayWayV2 will use the continue_success_url as deeplink back URL.
27
- def custom_return_deeplink_url
28
- if telegram_user_agent?
29
- 'tg://'
30
- elsif facebook_user_agent?
31
- 'fb://'
32
- elsif messenger_user_agent?
33
- 'fb-messenger://'
34
- end
35
- end
36
-
37
25
  def mobile_user_agent?
38
26
  request.user_agent.to_s.downcase.match?(/android|iphone|ipad|ipod/)
39
27
  end
40
-
41
- def telegram_user_agent?
42
- request.user_agent.to_s.downcase.include?('telegram')
43
- end
44
-
45
- def facebook_user_agent?
46
- request.user_agent.to_s.downcase.include?('fban') || request.user_agent.to_s.downcase.include?('facebook')
47
- end
48
-
49
- def messenger_user_agent?
50
- request.user_agent.to_s.downcase.include?('messenger')
51
- end
52
28
  end
53
29
  end
@@ -1,4 +1,4 @@
1
- <% @checkout_options = { custom_return_deeplink_url: custom_return_deeplink_url } %>
1
+ <% @checkout_options = { disable_return_deeplink: params[:platform] == 'web' } %>
2
2
  <% @checkout = ::Vpago::PaywayV2::Checkout.new(@payment, @checkout_options) %>
3
3
 
4
4
  <form method="POST" action="<%= @checkout.checkout_url %>" id="aba_merchant_request">
@@ -8,7 +8,6 @@
8
8
  </form>
9
9
 
10
10
  <script>
11
- const isTelegram = <%= telegram_user_agent? %>;
12
11
  const isMobile = <%= mobile_user_agent? %>;
13
12
 
14
13
  const abapayKhqrDeeplink = <%= @payment.payment_method.abapay_khqr_deeplink? %>;
@@ -16,11 +15,7 @@
16
15
  const shouldOpenCheckoutUrl = <%= @payment.payment_method.open_checkout_url? %>;
17
16
 
18
17
  function openDeeplinkUrl(deeplinkUrl) {
19
- if(isTelegram){
20
- window.open(deeplinkUrl, '_blank');
21
- } else {
22
- window.location.href = deeplinkUrl;
23
- }
18
+ window.location.href = deeplinkUrl;
24
19
  }
25
20
 
26
21
  function openUrl(url, delay = 0) {
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.2.2-pre27'.freeze
4
+ VERSION = '2.2.2-pre28'.freeze
5
5
 
6
6
  def version
7
7
  Gem::Version.new VERSION
@@ -4,7 +4,7 @@ module Vpago
4
4
  def initialize(payment, options = {})
5
5
  @options = options
6
6
  @payment = payment
7
- @custom_return_deeplink_url = options[:custom_return_deeplink_url]
7
+ @disable_return_deeplink = options[:disable_return_deeplink] || false
8
8
  end
9
9
 
10
10
  def req_time
@@ -102,10 +102,10 @@ module Vpago
102
102
  end
103
103
  end
104
104
 
105
- # redirect to continue URL, let it handle redirecting to app.
106
- # allowed override to specific app eg. from tg://t.me
107
105
  def return_deeplink_url
108
- return @custom_return_deeplink_url if @custom_return_deeplink_url.present?
106
+ # for some cases opening from telegram webview, fb, messenger webview, deeplink back to app doesn't work.
107
+ # so, return nil will ensure ABA won't return back to wrong app, for android, it will auto pop which to previous app and correct behavior, for ios, it will stuck, user can click back button to go back to app.
108
+ return nil if @disable_return_deeplink
109
109
 
110
110
  app_scheme = @payment.payment_method.preferences[:app_scheme]
111
111
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_vpago
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2.pre.pre27
4
+ version: 2.2.2.pre.pre28
5
5
  platform: ruby
6
6
  authors:
7
7
  - You