effective_orders 5.2.13 → 5.2.17
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6b400848ddbb8a36cfadf1d89aaa88edf09f21f4e769e0d0c43065071de128a
|
4
|
+
data.tar.gz: 2e6ddefee5a035af6222eb8f96971bf134205cc320a4fcf8e826e65f61ec78bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc4584d1c4739bf175be6bcf85369e3d0e5fd83bdc66b5d132258e2273b9b79cc5bdee8b02bed75ba809d40197058be6b3c75bd541d05bcfaf079ffa1202c1fb
|
7
|
+
data.tar.gz: 596b1c81741d349d0f18c35a63248ab62abd725aae8d5a5748a2a969d371c1e26139712548f13898157d783c39065ba10a0fdd44322cd7b8cd53d6fecd7fad60
|
@@ -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
|
@@ -472,6 +476,14 @@ module Effective
|
|
472
476
|
false
|
473
477
|
end
|
474
478
|
|
479
|
+
# Call this as a way to skip over non consequential orders
|
480
|
+
# And mark some purchasables purchased
|
481
|
+
def mark_as_purchased!
|
482
|
+
purchase!(skip_buyer_validations: true, email: false)
|
483
|
+
skip_qb_sync!
|
484
|
+
true
|
485
|
+
end
|
486
|
+
|
475
487
|
# Effective::Order.new(items: Product.first, user: User.first).purchase!(email: false)
|
476
488
|
def purchase!(payment: 'none', provider: 'none', card: 'none', email: true, skip_buyer_validations: false)
|
477
489
|
# Assign attributes
|
@@ -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.17
|
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-
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|