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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4223baa916c63136d13cdc1e6a10e0cab90401325df3fde6bcd05e837d28556
|
|
4
|
+
data.tar.gz: ffff5d2363666590557c939385c4d366a81abb05a05dd0b8914590c8e33af5cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dcc8364443a80c55cb2f8b91212bbdf96dd7adf91b80802066bea239a6827759f4201f2f434dc65e1a60ec7106af1bbbafe2b10133cbd1379c704fcf8cf3e4f8
|
|
7
|
+
data.tar.gz: 6675fda061cd27a3b34057a304d5f5f7fb93830ee0698df9d7e0d83435668f59d867d1c6b4af22c638469e0075b96651ab899399ccebcf924f2d7a34f6c141a0
|
data/Gemfile.lock
CHANGED
|
@@ -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 = {
|
|
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
|
-
|
|
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) {
|
data/lib/spree_vpago/version.rb
CHANGED
data/lib/vpago/payway_v2/base.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Vpago
|
|
|
4
4
|
def initialize(payment, options = {})
|
|
5
5
|
@options = options
|
|
6
6
|
@payment = payment
|
|
7
|
-
@
|
|
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
|
-
|
|
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
|
|