spree_vpago 2.1.4.pre.beta → 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 +4 -4
- data/Gemfile.lock +3 -3
- data/app/models/spree/gateway/vattanac.rb +0 -9
- data/app/models/vpago/payment_decorator.rb +5 -0
- data/app/models/vpago/payment_method_decorator.rb +5 -0
- data/app/services/vpago/payment_url_constructor.rb +9 -0
- data/app/views/spree/vpago_payments/forms/spree/gateway/_vattanac.html.erb +0 -1
- data/lib/spree_vpago/version.rb +1 -1
- data/lib/vpago/payway_v2/base.rb +9 -3
- data/lib/vpago/vattanac/base.rb +0 -1
- data/lib/vpago/vattanac/checkout.rb +1 -0
- metadata +2 -2
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
spree_vpago (2.1.4.pre.
|
|
4
|
+
spree_vpago (2.1.4.pre.beta3)
|
|
5
5
|
faraday
|
|
6
6
|
google-cloud-firestore
|
|
7
7
|
spree_api (>= 4.5)
|
|
@@ -242,7 +242,7 @@ GEM
|
|
|
242
242
|
gapic-common (~> 1.2)
|
|
243
243
|
google-cloud-errors (~> 1.0)
|
|
244
244
|
google-logging-utils (0.2.0)
|
|
245
|
-
google-protobuf (4.33.0)
|
|
245
|
+
google-protobuf (4.33.0-arm64-darwin)
|
|
246
246
|
bigdecimal
|
|
247
247
|
rake (>= 13)
|
|
248
248
|
googleapis-common-protos (1.9.0)
|
|
@@ -259,7 +259,7 @@ GEM
|
|
|
259
259
|
multi_json (~> 1.11)
|
|
260
260
|
os (>= 0.9, < 2.0)
|
|
261
261
|
signet (>= 0.16, < 2.a)
|
|
262
|
-
grpc (1.76.0)
|
|
262
|
+
grpc (1.76.0-arm64-darwin)
|
|
263
263
|
google-protobuf (>= 3.25, < 5.0)
|
|
264
264
|
googleapis-common-protos-types (~> 1.0)
|
|
265
265
|
hashdiff (1.1.0)
|
|
@@ -8,7 +8,6 @@ module Spree
|
|
|
8
8
|
preference :password, :string
|
|
9
9
|
preference :merchant_id, :string
|
|
10
10
|
preference :payment_type, :string, default: 'GOLF_TICKET'
|
|
11
|
-
preference :open_type, :string, default: 'both'
|
|
12
11
|
|
|
13
12
|
def method_type
|
|
14
13
|
'vattanac'
|
|
@@ -24,7 +23,6 @@ module Spree
|
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
# override
|
|
27
|
-
# purchase is used when pre auth disabled
|
|
28
26
|
def purchase(_amount, _source, gateway_options = {})
|
|
29
27
|
_, payment_number = gateway_options[:order_id].split('-')
|
|
30
28
|
payment = Spree::Payment.find_by(number: payment_number)
|
|
@@ -44,13 +42,6 @@ module Spree
|
|
|
44
42
|
end
|
|
45
43
|
end
|
|
46
44
|
|
|
47
|
-
def vattanac_refund(payment)
|
|
48
|
-
refund_issuer = Vpago::Vattanac::RefundIssuer.new(payment, {})
|
|
49
|
-
refund_issuer.call
|
|
50
|
-
|
|
51
|
-
[refund_issuer.success?, refund_issuer.parsed_response]
|
|
52
|
-
end
|
|
53
|
-
|
|
54
45
|
def cancel(_response_code, _payment)
|
|
55
46
|
# we can use this to send request to payment gateway api to cancel the payment ( void )
|
|
56
47
|
# currently Vattanac does not support to cancel the gateway
|
|
@@ -9,6 +9,7 @@ module Vpago
|
|
|
9
9
|
:processing_url,
|
|
10
10
|
:success_url,
|
|
11
11
|
:process_payment_url,
|
|
12
|
+
:success_deeplink_url,
|
|
12
13
|
to: :url_constructor
|
|
13
14
|
end
|
|
14
15
|
|
|
@@ -72,6 +73,10 @@ module Vpago
|
|
|
72
73
|
def check_payment?
|
|
73
74
|
payment_method.type_check?
|
|
74
75
|
end
|
|
76
|
+
|
|
77
|
+
def can_redirect_to_app?
|
|
78
|
+
payment_method.can_redirect_to_app?
|
|
79
|
+
end
|
|
75
80
|
end
|
|
76
81
|
end
|
|
77
82
|
|
|
@@ -11,6 +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
15
|
base.belongs_to :vendor, class_name: 'Spree::Vendor', optional: true, inverse_of: :payment_methods
|
|
15
16
|
|
|
16
17
|
def base.vpago_payments
|
|
@@ -104,6 +105,10 @@ module Vpago
|
|
|
104
105
|
type == 'Spree::PaymentMethod::Check'
|
|
105
106
|
end
|
|
106
107
|
|
|
108
|
+
def can_redirect_to_app?
|
|
109
|
+
preferred_app_scheme.present?
|
|
110
|
+
end
|
|
111
|
+
|
|
107
112
|
# @return [String] the image asset path, e.g. "payment_logos/payway-abapay-khqr.png"
|
|
108
113
|
def payment_icon_path
|
|
109
114
|
"payment_logos/#{preferred_icon_name.tr('_', ' ').parameterize}.png"
|
|
@@ -11,8 +11,12 @@ 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
21
|
|
|
18
22
|
def query
|
|
@@ -24,12 +28,17 @@ module Vpago
|
|
|
24
28
|
}.compact.to_query
|
|
25
29
|
end
|
|
26
30
|
|
|
31
|
+
# true money use case
|
|
27
32
|
def offsite_payment?
|
|
28
33
|
payment.payment_method.type_true_money?
|
|
29
34
|
end
|
|
30
35
|
|
|
31
36
|
private
|
|
32
37
|
|
|
38
|
+
def app_scheme
|
|
39
|
+
payment.payment_method.preferred_app_scheme
|
|
40
|
+
end
|
|
41
|
+
|
|
33
42
|
def base_url
|
|
34
43
|
order.payment_host
|
|
35
44
|
end
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
const platform = "<%= params[:platform] %>";
|
|
8
8
|
const mobileUrl = "<%= raw(result[:mobile_url]) %>";
|
|
9
9
|
const webUrl = "<%= raw(result[:web_url]) %>";
|
|
10
|
-
|
|
11
10
|
if (platform === "app" && mobileUrl) {
|
|
12
11
|
window.location.href = mobileUrl;
|
|
13
12
|
} else if (platform === "web" && webUrl) {
|
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
|
data/lib/vpago/vattanac/base.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_vpago
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.4.pre.
|
|
4
|
+
version: 2.1.4.pre.beta3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|