effective_orders 5.2.12 → 5.2.16
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: f39960e8a8f551838180f27b80909a6aaeab1b2188ed64940dc3fe35a97a44a7
|
4
|
+
data.tar.gz: 7910cdfe509ba84be703aad6bc452bfd53e9b8760027cc17e1bac280b9d373ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a550796efef35f0175625db99570302027b6f091cb5fdea1510b3a3d4c7691c26c947e6a0e6e4dc95b11bc683fc333fa3590605b5313b527df64186b77c26a
|
7
|
+
data.tar.gz: 1b73bd83140864c0fbb70ee9bbbe684f5e36abdeb2ecb68cd10ba4bbebc7cc4c83d34673760c2e2fc15484d678b651b563293881ee0449eb5f09eb72639d20f0
|
@@ -333,8 +333,12 @@ module Effective
|
|
333
333
|
else payment_card.to_s
|
334
334
|
end unless payment_provider == 'free'
|
335
335
|
|
336
|
+
last4 = if payment[:active_card] && payment[:active_card].include?('**** **** ****')
|
337
|
+
payment[:active_card][15,4]
|
338
|
+
end
|
339
|
+
|
336
340
|
# stripe, moneris, moneris_checkout
|
337
|
-
last4
|
341
|
+
last4 ||= (payment['f4l4'] || payment['first6last4']).to_s.last(4)
|
338
342
|
|
339
343
|
[card, '-', last4].compact.join(' ')
|
340
344
|
end
|
@@ -484,7 +488,7 @@ module Effective
|
|
484
488
|
self.payment = payment_to_h(payment) if self.payment.blank?
|
485
489
|
|
486
490
|
begin
|
487
|
-
|
491
|
+
Effective::Order.transaction do
|
488
492
|
run_purchasable_callbacks(:before_purchase)
|
489
493
|
|
490
494
|
save!
|
@@ -493,7 +497,7 @@ module Effective
|
|
493
497
|
run_purchasable_callbacks(:after_purchase)
|
494
498
|
end
|
495
499
|
rescue => e
|
496
|
-
|
500
|
+
Effective::Order.transaction do
|
497
501
|
save!(validate: false)
|
498
502
|
update_purchasables_purchased_order!
|
499
503
|
end
|
@@ -533,7 +537,7 @@ module Effective
|
|
533
537
|
skip_buyer_validations: true
|
534
538
|
)
|
535
539
|
|
536
|
-
|
540
|
+
Effective::Order.transaction do
|
537
541
|
begin
|
538
542
|
run_purchasable_callbacks(:before_decline)
|
539
543
|
save!(validate: validate)
|
@@ -665,11 +669,19 @@ module Effective
|
|
665
669
|
|
666
670
|
def run_purchasable_callbacks(name)
|
667
671
|
order_items.select { |item| item.purchasable.respond_to?(name) }.each do |item|
|
668
|
-
|
672
|
+
if item.class.respond_to?(:transaction)
|
673
|
+
item.class.transaction { item.purchasable.public_send(name, self, item) }
|
674
|
+
else
|
675
|
+
item.purchasable.public_send(name, self, item)
|
676
|
+
end
|
669
677
|
end
|
670
678
|
|
671
679
|
if parent.respond_to?(name)
|
672
|
-
|
680
|
+
if parent.class.respond_to?(:transaction)
|
681
|
+
parent.class.transaction { parent.public_send(name, self) }
|
682
|
+
else
|
683
|
+
parent.public_send(name, self)
|
684
|
+
end
|
673
685
|
end
|
674
686
|
|
675
687
|
true
|
@@ -68,7 +68,7 @@ module Effective
|
|
68
68
|
# first or build
|
69
69
|
def qb_item_name
|
70
70
|
raise('expected EffectiveQbSync gem') unless defined?(EffectiveQbSync)
|
71
|
-
(qb_order_item || build_qb_order_item(name: purchasable
|
71
|
+
(qb_order_item || build_qb_order_item(name: purchasable&.qb_item_name)).name
|
72
72
|
end
|
73
73
|
|
74
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|