spree_vpago 2.1.4.pre.beta2 → 2.1.4.pre.beta3
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: e2751ee764f57d6e508418ca26559d541bc3b96b13d3b7191edf94f500cf0e5c
|
|
4
|
+
data.tar.gz: 8542aa29b54bfd73e825669d3df6c2a2f76a3110119d441f077ef12663b61b62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07a440440c01e69082a4ed486eea234ca4bc55970fc5258b7dc7d846275edfee8cc55f630b8151c7eab09e7218541357bc42257ed4fc015c93596e0c9fa87752
|
|
7
|
+
data.tar.gz: '06864d9808178cd1fb68d978a09e8cea7b32ba15158814a4773c5f4e841c71528c6c96dcf950c248df73ce1613b6729684276f13ff9ddbd229af826dfb56484b'
|
data/Gemfile.lock
CHANGED
|
@@ -9,7 +9,7 @@ module Vpago
|
|
|
9
9
|
:processing_url,
|
|
10
10
|
:success_url,
|
|
11
11
|
:process_payment_url,
|
|
12
|
-
:
|
|
12
|
+
:success_deeplink_url,
|
|
13
13
|
to: :url_constructor
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -73,6 +73,10 @@ module Vpago
|
|
|
73
73
|
def check_payment?
|
|
74
74
|
payment_method.type_check?
|
|
75
75
|
end
|
|
76
|
+
|
|
77
|
+
def can_redirect_to_app?
|
|
78
|
+
payment_method.can_redirect_to_app?
|
|
79
|
+
end
|
|
76
80
|
end
|
|
77
81
|
end
|
|
78
82
|
|
|
@@ -11,7 +11,7 @@ module Vpago
|
|
|
11
11
|
|
|
12
12
|
def self.prepended(base)
|
|
13
13
|
base.preference :icon_name, :string, default: 'cheque'
|
|
14
|
-
base.preference :app_scheme, :string
|
|
14
|
+
base.preference :app_scheme, :string
|
|
15
15
|
base.belongs_to :vendor, class_name: 'Spree::Vendor', optional: true, inverse_of: :payment_methods
|
|
16
16
|
|
|
17
17
|
def base.vpago_payments
|
|
@@ -105,6 +105,10 @@ module Vpago
|
|
|
105
105
|
type == 'Spree::PaymentMethod::Check'
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
def can_redirect_to_app?
|
|
109
|
+
preferred_app_scheme.present?
|
|
110
|
+
end
|
|
111
|
+
|
|
108
112
|
# @return [String] the image asset path, e.g. "payment_logos/payway-abapay-khqr.png"
|
|
109
113
|
def payment_icon_path
|
|
110
114
|
"payment_logos/#{preferred_icon_name.tr('_', ' ').parameterize}.png"
|
|
@@ -11,10 +11,13 @@ module Vpago
|
|
|
11
11
|
|
|
12
12
|
def checkout_url = "#{base_url}/vpago_payments/checkout?#{query}&platform=app"
|
|
13
13
|
def web_checkout_url = "#{base_url}/vpago_payments/checkout?#{query}&platform=web"
|
|
14
|
+
|
|
14
15
|
def processing_url = "#{base_url}/vpago_payments/processing?#{query}"
|
|
16
|
+
|
|
15
17
|
def success_url = "#{base_url}/vpago_payments/success?#{query}"
|
|
18
|
+
def success_deeplink_url = "#{app_scheme}://#{URI(base_url).host}/book/payment?number=#{order.number}&tk=#{order.token}"
|
|
19
|
+
|
|
16
20
|
def process_payment_url = "#{base_url}/vpago_payments/process_payment?#{query}"
|
|
17
|
-
def processing_deeplink_url = "#{app_scheme}#{URI(base_url).host}/vpago_payments/processing?#{query}"
|
|
18
21
|
|
|
19
22
|
def query
|
|
20
23
|
{
|
|
@@ -25,6 +28,7 @@ module Vpago
|
|
|
25
28
|
}.compact.to_query
|
|
26
29
|
end
|
|
27
30
|
|
|
31
|
+
# true money use case
|
|
28
32
|
def offsite_payment?
|
|
29
33
|
payment.payment_method.type_true_money?
|
|
30
34
|
end
|
data/lib/spree_vpago/version.rb
CHANGED
data/lib/vpago/payway_v2/base.rb
CHANGED
|
@@ -105,9 +105,15 @@ module Vpago
|
|
|
105
105
|
# redirect to continue URL, let it handle redirecting to app.
|
|
106
106
|
# allowed override to specific app eg. from tg://t.me
|
|
107
107
|
def return_deeplink_url
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
app_scheme = @payment.payment_method.preferences[:app_scheme]
|
|
109
|
+
|
|
110
|
+
if app_scheme.present?
|
|
111
|
+
uri = URI.parse(continue_success_url)
|
|
112
|
+
uri.scheme = app_scheme
|
|
113
|
+
uri.to_s
|
|
114
|
+
else
|
|
115
|
+
continue_success_url
|
|
116
|
+
end
|
|
111
117
|
end
|
|
112
118
|
|
|
113
119
|
def return_deeplink
|