spree_vpago 2.1.1 → 2.1.2

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: 0a01d3dcdc6c3ced08df846438e83619a55e7ae1ef61a2062b8d92cb5563fc09
4
- data.tar.gz: 9c3c06510f3dcfc46c8dda76e951675931e91d96b473b3372849610aa38e8de2
3
+ metadata.gz: e82b6ed2c52fdcd372da38e034ab404db96e14054311146497f22e16e8b0b7cb
4
+ data.tar.gz: 97deb457994a42b61a6ad0583336d4d0b0b52d14594b4990ee74700754d5a8e3
5
5
  SHA512:
6
- metadata.gz: 1244b21a9ba3d2eb6dd345e7d5cc7ce318a867d8744a7c8bb40789f77d2be7b85a9c8b4339eec6aa5c732ba5ab31fd756dbe4fd97518b3ab39fd23df1b749a96
7
- data.tar.gz: d6b2cc2a7eeb0a9eeb39f1b4d5c6d0d5f9ae09e7c3f2372498a3d2f411f0205076243dbc0d1813a4b2b4c2b15133b2e7cb4cf7645222053df4572070f776e4d2
6
+ metadata.gz: 2c53f7fbac300190cfe294852eecc82f67f047b2e66021e2f4f3330f80ea5b7632b9aee6543dd6199bef7c17b9a420e537ff1e5cb8174056b5cd567f004aef02
7
+ data.tar.gz: 7484172952f36a0b0802836dbcec0e9d487535605f16340fd3b4a246c0e8b583cce7a5f36feac1b46edc4886f5cef4fea3771298056076e29660fcf246a60aa2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_vpago (2.1.1)
4
+ spree_vpago (2.1.2)
5
5
  faraday
6
6
  google-cloud-firestore
7
7
  spree_api (>= 4.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.0.1)
201
+ gapic-common (1.1.0)
202
202
  faraday (>= 1.9, < 3.a)
203
203
  faraday-retry (>= 1.0, < 3.a)
204
204
  google-cloud-env (~> 2.2)
@@ -242,7 +242,7 @@ GEM
242
242
  gapic-common (~> 1.0)
243
243
  google-cloud-errors (~> 1.0)
244
244
  google-logging-utils (0.2.0)
245
- google-protobuf (4.31.1)
245
+ google-protobuf (4.32.0)
246
246
  bigdecimal
247
247
  rake (>= 13)
248
248
  googleapis-common-protos (1.8.0)
@@ -251,15 +251,15 @@ GEM
251
251
  grpc (~> 1.41)
252
252
  googleapis-common-protos-types (1.20.0)
253
253
  google-protobuf (>= 3.18, < 5.a)
254
- googleauth (1.14.0)
254
+ googleauth (1.15.0)
255
255
  faraday (>= 1.0, < 3.a)
256
256
  google-cloud-env (~> 2.2)
257
257
  google-logging-utils (~> 0.1)
258
- jwt (>= 1.4, < 3.0)
258
+ jwt (>= 1.4, < 4.0)
259
259
  multi_json (~> 1.11)
260
260
  os (>= 0.9, < 2.0)
261
261
  signet (>= 0.16, < 2.a)
262
- grpc (1.74.1-arm64-darwin)
262
+ grpc (1.74.1)
263
263
  google-protobuf (>= 3.25, < 5.0)
264
264
  googleapis-common-protos-types (~> 1.0)
265
265
  hashdiff (1.1.0)
@@ -479,10 +479,10 @@ GEM
479
479
  websocket (~> 1.0)
480
480
  shoulda-matchers (6.2.0)
481
481
  activesupport (>= 5.2.0)
482
- signet (0.20.0)
482
+ signet (0.21.0)
483
483
  addressable (~> 2.8)
484
484
  faraday (>= 0.17.5, < 3.a)
485
- jwt (>= 1.5, < 3.0)
485
+ jwt (>= 1.5, < 4.0)
486
486
  multi_json (~> 1.10)
487
487
  simplecov (0.22.0)
488
488
  docile (~> 1.1)
@@ -52,17 +52,18 @@ module Vpago
52
52
  end
53
53
 
54
54
  def latest_private_metadata
55
- private_metadata ||= {}
56
-
57
- private_metadata[:subtotal] = subtotal.to_f
58
- private_metadata[:commission_rate] = commission_rate.to_f
59
- private_metadata[:commission_amount] = commission_amount.to_f
60
- private_metadata[:vendor_pre_tax_amount] = vendor_pre_tax_amount.to_f
61
- private_metadata[:pre_commission_amount] = pre_commission_amount.to_f
62
- private_metadata[:vendor_tax_total] = vendor_tax_total.to_f
63
- private_metadata[:vendor_adjustments_total_excluding_tax] = vendor_adjustments_total_excluding_tax.to_f
64
-
65
- private_metadata
55
+ # Preserve existing metadata and merge with new financial data
56
+ updated_private_metadata = (private_metadata || {}).dup
57
+
58
+ updated_private_metadata[:subtotal] = subtotal.to_f
59
+ updated_private_metadata[:commission_rate] = commission_rate.to_f
60
+ updated_private_metadata[:commission_amount] = commission_amount.to_f
61
+ updated_private_metadata[:vendor_pre_tax_amount] = vendor_pre_tax_amount.to_f
62
+ updated_private_metadata[:pre_commission_amount] = pre_commission_amount.to_f
63
+ updated_private_metadata[:vendor_tax_total] = vendor_tax_total.to_f
64
+ updated_private_metadata[:vendor_adjustments_total_excluding_tax] = vendor_adjustments_total_excluding_tax.to_f
65
+
66
+ updated_private_metadata
66
67
  end
67
68
 
68
69
  # generate metadata for financial reports.
@@ -64,6 +64,10 @@ module Vpago
64
64
  def vattanac_mini_app_payment?
65
65
  payment_method.type_vattanac_mini_app?
66
66
  end
67
+
68
+ def check_payment?
69
+ payment_method.type_check?
70
+ end
67
71
  end
68
72
  end
69
73
 
@@ -97,6 +97,15 @@ module Vpago
97
97
  def type_true_money?
98
98
  type == Spree::PaymentMethod::TYPE_TRUE_MONEY
99
99
  end
100
+
101
+ def type_check?
102
+ type == 'Spree::PaymentMethod::Check'
103
+ end
104
+
105
+ # @return [String] the image asset path, e.g. "payment_logos/payway-abapay-khqr.png"
106
+ def payment_icon_path
107
+ "payment_logos/#{preferred_icon_name.tr('_', ' ').parameterize}.png"
108
+ end
100
109
  end
101
110
  end
102
111
 
@@ -39,9 +39,10 @@ module Vpago
39
39
  }.compact
40
40
 
41
41
  payment.source = payment_method.payment_source_class.new(source_attributes)
42
- payment.save!
43
42
  end
44
43
 
44
+ payment.save!
45
+
45
46
  return failure(payment) if payment.errors.any?
46
47
 
47
48
  success(order: order)
@@ -1,7 +1,7 @@
1
1
  module SpreeVpago
2
2
  module_function
3
3
 
4
- VERSION = '2.1.1'.freeze
4
+ VERSION = '2.1.2'.freeze
5
5
 
6
6
  def version
7
7
  Gem::Version.new VERSION
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.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-11 00:00:00.000000000 Z
11
+ date: 2025-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -132,6 +132,18 @@ files:
132
132
  - app/.gitkeep
133
133
  - app/assets/config/spree_vpago_manifest.js
134
134
  - app/assets/images/backend-process.svg
135
+ - app/assets/images/payment_logos/acleda-cards.png
136
+ - app/assets/images/payment_logos/acleda-khqr.png
137
+ - app/assets/images/payment_logos/acleda.png
138
+ - app/assets/images/payment_logos/cheque.png
139
+ - app/assets/images/payment_logos/payway-abapay-khqr.png
140
+ - app/assets/images/payment_logos/payway-abapay.png
141
+ - app/assets/images/payment_logos/payway-alipay.png
142
+ - app/assets/images/payment_logos/payway-cards.png
143
+ - app/assets/images/payment_logos/payway-wechat.png
144
+ - app/assets/images/payment_logos/true-money.png
145
+ - app/assets/images/payment_logos/vattanac-mini-app.png
146
+ - app/assets/images/payment_logos/wingpay.png
135
147
  - app/assets/images/vpago/payway/abapay.png
136
148
  - app/assets/images/vpago/payway/cards.png
137
149
  - app/assets/javascripts/vpago/vpago_payments/payment_processing_listener.js