spree_vpago 2.1.3.pre.beta → 2.1.4.pre.beta

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: 050cbc236c6ee73efa288a53ccb9ed0d997d5056a364c329cc1d6fdf943c2588
4
- data.tar.gz: '09dac79729125ce876a4865bc17b9dc58fc37f4153bcf803014f5ed17afc06b3'
3
+ metadata.gz: d8e5d1ebc75ade2a4d140a91ff3b3502fb8109420692dbae8151e32c3b1d68f0
4
+ data.tar.gz: 16dc1a6c62f143417432dd9aefd1be3c247ff0279e204da8dda0d73a436c6c65
5
5
  SHA512:
6
- metadata.gz: b1b906c102871367972b3deff873c39bc5bdc0c2e6748c2324f00e0e0b7db946699b9e2984b8364050c4ff6f929d3dd36473605ee06904141213cb9957b10517
7
- data.tar.gz: 8b9392064584a88fbb22f0554680c90ba2b3943764e08b8123548d20112946b356e23b7b5fbca533d983e64865c37dcab38af7f03e7b280485c78453f1d99b2e
6
+ metadata.gz: 4574565cf96154a08f4bcc8918331715daf9364b455f8d34f1a38327239d278909f0af91a20be819c69fe63f7bbb461ffd2de4ea4bf057ed293acab850f1594a
7
+ data.tar.gz: aba7990821991e66322ba01fee2d955c3faa76e7564c3bd327b80381aec9827f8557137b1699a968633b5802e443e8249ab2b39041836b83e139df6bc6b9cf0f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.1.3.pre.beta)
4
+ spree_vpago (2.1.4.pre.beta)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -228,21 +228,21 @@ GEM
228
228
  base64 (~> 0.2)
229
229
  faraday (>= 1.0, < 3.a)
230
230
  google-cloud-errors (1.5.0)
231
- google-cloud-firestore (3.1.0)
231
+ google-cloud-firestore (3.1.1)
232
232
  bigdecimal (~> 3.0)
233
233
  concurrent-ruby (~> 1.0)
234
234
  google-cloud-core (~> 1.7)
235
235
  google-cloud-firestore-v1 (~> 2.0)
236
236
  rbtree (~> 0.4.2)
237
- google-cloud-firestore-v1 (2.2.0)
237
+ google-cloud-firestore-v1 (2.2.1)
238
238
  gapic-common (~> 1.2)
239
239
  google-cloud-errors (~> 1.0)
240
240
  google-cloud-location (~> 1.0)
241
- google-cloud-location (1.2.0)
241
+ google-cloud-location (1.2.1)
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-arm64-darwin)
245
+ google-protobuf (4.33.0)
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-arm64-darwin)
262
+ grpc (1.76.0)
263
263
  google-protobuf (>= 3.25, < 5.0)
264
264
  googleapis-common-protos-types (~> 1.0)
265
265
  hashdiff (1.1.0)
@@ -276,7 +276,7 @@ GEM
276
276
  inline_svg (1.10.0)
277
277
  activesupport (>= 3.0)
278
278
  nokogiri (>= 1.6)
279
- jquery-rails (4.6.0)
279
+ jquery-rails (4.6.1)
280
280
  rails-dom-testing (>= 1, < 3)
281
281
  railties (>= 4.2.0)
282
282
  thor (>= 0.14, < 2.0)
@@ -409,9 +409,9 @@ GEM
409
409
  redis-client (0.14.1)
410
410
  connection_pool
411
411
  regexp_parser (2.8.0)
412
- responders (3.1.1)
413
- actionpack (>= 5.2)
414
- railties (>= 5.2)
412
+ responders (3.2.0)
413
+ actionpack (>= 7.0)
414
+ railties (>= 7.0)
415
415
  rexml (3.2.5)
416
416
  rspec-activemodel-mocks (1.1.0)
417
417
  activemodel (>= 3.0)
@@ -1,31 +1,18 @@
1
1
  <%
2
2
  checkout = Vpago::Vattanac::Checkout.new(@payment)
3
3
  result = checkout.create
4
- payment_url = params[:platform] == 'app' ? result[:mobile_url] : result[:web_url]
5
- open_type = @payment.payment_method.preferred_open_type
6
4
  %>
7
5
 
8
6
  <script>
9
- const openType = "<%= open_type %>";
7
+ const platform = "<%= params[:platform] %>";
10
8
  const mobileUrl = "<%= raw(result[:mobile_url]) %>";
11
9
  const webUrl = "<%= raw(result[:web_url]) %>";
12
10
 
13
- if (openType === "both") {
14
- if (mobileUrl) {
15
- window.location.href = mobileUrl;
16
- setTimeout(() => {
17
- window.location.href = webUrl;
18
- }, 1500);
19
- } else {
20
- alert("Mobile payment URL not available.");
21
- }
11
+ if (platform === "app" && mobileUrl) {
12
+ window.location.href = mobileUrl;
13
+ } else if (platform === "web" && webUrl) {
14
+ window.location.href = webUrl;
22
15
  } else {
23
- const paymentUrl = "<%= raw(payment_url) %>";
24
- if (paymentUrl) {
25
- window.location.href = paymentUrl;
26
- } else {
27
- alert("Failed to create payment link.");
28
- }
16
+ console.error("Failed to create payment link:", { mobileUrl, webUrl });
29
17
  }
30
18
  </script>
31
-
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.1.3-beta'.freeze
4
+ VERSION = '2.1.4-beta'.freeze
5
5
 
6
6
  def version
7
7
  Gem::Version.new VERSION
@@ -71,20 +71,17 @@ module Vpago
71
71
 
72
72
  def fetch_access_token
73
73
  response = Faraday.post(access_token_url, { username: username, password: password }.to_json, { 'Content-Type' => CONTENT_TYPE_JSON })
74
+
74
75
  raise "Access Token Error: #{response.status} - #{response.body}" unless response.success?
75
76
 
76
77
  parse_json(response.body).dig('data', 'accessToken') || raise('Missing accessToken in response')
77
78
  end
78
79
 
79
80
  def post(url, body)
81
+
80
82
  response = Faraday.post(url, body.to_json, default_headers)
81
83
  parse_json(response.body)
82
84
  end
83
-
84
- def get(url, params)
85
- response = Faraday.get(url, params, default_headers)
86
- parse_json(response.body)['data'] || {}
87
- end
88
85
  end
89
86
  end
90
87
  end
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.3.pre.beta
4
+ version: 2.1.4.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-31 00:00:00.000000000 Z
11
+ date: 2025-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday