spree_vpago 2.2.2.pre.pre36 → 2.2.2.pre.pre38

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: 63c041b11de487a906751960209807c501c1c1e2b9fa7be4c902cedc6e566d47
4
- data.tar.gz: a619fb9e96d513f5a6d462c56827b9cfce1742a511b5638bb6b81878bcda7606
3
+ metadata.gz: 6f928f176e0a9faa7c833f8a84357ef1b47b54e90317a746572e82990ec2fb70
4
+ data.tar.gz: 2575d2d9ed15e63f58efa5ab80efe48a82f21cadef0b42e0277d59b64adfe98e
5
5
  SHA512:
6
- metadata.gz: be88c1bc4337844f6bb84afa307b78e2e247b4bb89ecdf3a4429878d66184c840652e96ab4715040db92e019915690523c5a84423df4ea8195f04d107fa21be7
7
- data.tar.gz: 579c3d7d20e0a19d96e664cd9294435b14a95512490c50b53f5cae93760056285b3bb28b838da89e0758da19040ce5989fc10a2ac6a8685a44b4c22e9df8c204
6
+ metadata.gz: 1c783db7c54b8692924880f17c19e589e7b0ed097031fd93778e701364e5520c341e02ae1c2bf957ae4c014450d9411bfee35a14e73c27327ce6418e2d903c42
7
+ data.tar.gz: aa2a7c19225b123ef6e6c1dd1531cef9402fe67c7fbf04da3aa035ab54f46a5214501fbcbb4bf2393f84a602ba813fdf4cbe60910a1aa0937f126c9619a58572
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.2.2.pre.pre36)
4
+ spree_vpago (2.2.2.pre.pre38)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.5)
@@ -128,7 +128,7 @@ GEM
128
128
  babel-source (>= 4.0, < 6)
129
129
  execjs (~> 2.0)
130
130
  base64 (0.3.0)
131
- bcrypt (3.1.21)
131
+ bcrypt (3.1.22)
132
132
  bigdecimal (3.1.8)
133
133
  bootstrap (4.6.2.1)
134
134
  autoprefixer-rails (>= 9.1.0)
@@ -176,7 +176,7 @@ GEM
176
176
  rainbow (>= 2.1.0)
177
177
  diff-lcs (1.5.0)
178
178
  docile (1.4.0)
179
- doorkeeper (5.8.2)
179
+ doorkeeper (5.9.0)
180
180
  railties (>= 5)
181
181
  erubi (1.12.0)
182
182
  execjs (2.10.0)
@@ -188,7 +188,7 @@ GEM
188
188
  faraday-http-cache (2.5.0)
189
189
  faraday (>= 0.8)
190
190
  faraday-net_http (3.0.2)
191
- faraday-retry (2.3.2)
191
+ faraday-retry (2.4.0)
192
192
  faraday (~> 2.0)
193
193
  ffaker (2.21.0)
194
194
  ffi (1.15.5)
@@ -198,7 +198,7 @@ GEM
198
198
  flatpickr (4.6.13.1)
199
199
  friendly_id (5.5.0)
200
200
  activerecord (>= 4.0.0)
201
- gapic-common (1.2.0)
201
+ gapic-common (1.3.0)
202
202
  faraday (>= 1.9, < 3.a)
203
203
  faraday-retry (>= 1.0, < 3.a)
204
204
  google-cloud-env (~> 2.2)
@@ -227,7 +227,7 @@ GEM
227
227
  google-cloud-env (2.3.1)
228
228
  base64 (~> 0.2)
229
229
  faraday (>= 1.0, < 3.a)
230
- google-cloud-errors (1.5.0)
230
+ google-cloud-errors (1.6.0)
231
231
  google-cloud-firestore (3.1.1)
232
232
  bigdecimal (~> 3.0)
233
233
  concurrent-ruby (~> 1.0)
@@ -238,11 +238,11 @@ GEM
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.1)
241
+ google-cloud-location (1.3.0)
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.4)
245
+ google-protobuf (4.33.6)
246
246
  bigdecimal
247
247
  rake (>= 13)
248
248
  googleapis-common-protos (1.9.0)
@@ -251,7 +251,7 @@ GEM
251
251
  grpc (~> 1.41)
252
252
  googleapis-common-protos-types (1.22.0)
253
253
  google-protobuf (~> 4.26)
254
- googleauth (1.16.1)
254
+ googleauth (1.16.2)
255
255
  faraday (>= 1.0, < 3.a)
256
256
  google-cloud-env (~> 2.2)
257
257
  google-logging-utils (~> 0.1)
@@ -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.78.1)
263
263
  google-protobuf (>= 3.25, < 5.0)
264
264
  googleapis-common-protos-types (~> 1.0)
265
265
  hashdiff (1.1.0)
@@ -593,9 +593,8 @@ GEM
593
593
  actionmailer
594
594
  spree_core (>= 4.5.3)
595
595
  sprockets (>= 4.0)
596
- spree_extension (0.1.0)
597
- activerecord (>= 4.2)
598
- spree_core
596
+ spree_extension (1.0.2)
597
+ thor (~> 1.0)
599
598
  spree_multi_vendor (2.4.1)
600
599
  deface (~> 1.0)
601
600
  spree (>= 4.3.0.rc1)
@@ -2,11 +2,11 @@ module Spree
2
2
  module Admin
3
3
  class PaymentPaywayQueriersController < PaymentPaywayBaseController
4
4
  include Spree::Backend::Callbacks
5
+
5
6
  around_action :set_writing_role, only: %i[show]
6
7
 
7
8
  def show
8
- tran_status = transaction_status_service.new(@payment)
9
- tran_status.call
9
+ tran_status = @payment.payment_method.check_transaction(@payment)
10
10
 
11
11
  if tran_status.success?
12
12
  @payment.update_column(:gateway_status, true)
@@ -19,14 +19,6 @@ module Spree
19
19
  redirect_to admin_order_payment_path(order_id: @payment.order.number, id: @payment.number)
20
20
  end
21
21
 
22
- def transaction_status_service
23
- if @payment.payment_method.type_payway_v2?
24
- Vpago::PaywayV2::TransactionStatus
25
- elsif @payment.payment_method.type_payway?
26
- Vpago::Payway::TransactionStatus
27
- end
28
- end
29
-
30
22
  private
31
23
 
32
24
  def set_writing_role
@@ -159,7 +159,7 @@ module Spree
159
159
  # ABA requires the use of the v2 API, but it does not yet support payout responses.
160
160
  # Until v2 fully supports payouts, we fall back to v1 when payouts are enabled.
161
161
  # Otherwise, we use v2 by default.
162
- checker = if payment.payouts.any?
162
+ checker = if payment.preload_payout_ids.any?
163
163
  Vpago::PaywayV2::TransactionStatus.new(payment)
164
164
  else
165
165
  Vpago::PaywayV2::TransactionStatusV2.new(payment)
@@ -33,6 +33,15 @@ module Vpago
33
33
  end
34
34
  end
35
35
 
36
+ def preload_payout_ids=(ids)
37
+ self.private_metadata ||= {}
38
+ self.private_metadata['preload_payout_ids'] = ids
39
+ end
40
+
41
+ def preload_payout_ids
42
+ self.private_metadata&.fetch('preload_payout_ids', []) || []
43
+ end
44
+
36
45
  # override
37
46
  def process!
38
47
  reset_for_retry! if failed?
@@ -39,7 +39,7 @@ module Vpago
39
39
 
40
40
  # If any payouts were rounded, the total may increase slightly.
41
41
  # Update the payment amount to match the sum of payouts to avoid mismatch errors.
42
- payment.update(amount: payouts.map(&:amount).sum)
42
+ payment.update(amount: payouts.map(&:amount).sum, preload_payout_ids: payouts.map(&:id))
43
43
 
44
44
  payouts
45
45
  end
@@ -35,7 +35,11 @@
35
35
  redirectContainer.style.removeProperty('display');
36
36
  }
37
37
 
38
- if (abapayKhqrDeeplink) {
38
+ function submitForm() {
39
+ document.getElementById("aba_merchant_request").submit();
40
+ }
41
+
42
+ function submitFormViaJs(){
39
43
  var formData = new FormData(document.getElementById("aba_merchant_request"));
40
44
  var checkoutUrl = document.getElementById("aba_merchant_request").action;
41
45
 
@@ -74,9 +78,11 @@
74
78
  .catch(function(error) {
75
79
  console.error("Payment request failed:", error);
76
80
  });
81
+ }
82
+
83
+ if (abapayKhqrDeeplink) {
84
+ submitFormViaJs();
77
85
  } else {
78
- document.addEventListener("DOMContentLoaded", function () {
79
- document.getElementById("aba_merchant_request").submit();
80
- });
86
+ submitForm();
81
87
  }
82
88
  </script>
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.2.2-pre36'.freeze
4
+ VERSION = '2.2.2-pre38'.freeze
5
5
 
6
6
  def version
7
7
  Gem::Version.new VERSION
@@ -52,9 +52,7 @@ module Vpago
52
52
  end
53
53
 
54
54
  def check_payway_status
55
- trans_status = Vpago::PaywayV2::TransactionStatus.new(@payment)
56
- trans_status.call
57
- trans_status
55
+ @payment.payment_method.check_transaction(@payment)
58
56
  end
59
57
 
60
58
  def items_eligible?
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.pre36
4
+ version: 2.2.2.pre.pre38
5
5
  platform: ruby
6
6
  authors:
7
7
  - You