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: 3ee6f41ea9ce0cfac7925305431dbbe362e436288d427744245fc6dbc915c554
4
- data.tar.gz: 35cbbbe657adcb8c2d7c823600f9b8c01f9e7a8de4a54a2eec4279413db035e7
3
+ metadata.gz: f6b400848ddbb8a36cfadf1d89aaa88edf09f21f4e769e0d0c43065071de128a
4
+ data.tar.gz: 2e6ddefee5a035af6222eb8f96971bf134205cc320a4fcf8e826e65f61ec78bb
5
5
  SHA512:
6
- metadata.gz: bf9913f68f1018d10eaf8a3602c410bf0d6e5a733e211bbc0e9b16066458c7bf305e522350ec02083a1cead2dcc228846b894f14c699fcaa0af5d8f62077946d
7
- data.tar.gz: 5e1b5b09d51db9180f14ef8665e1dae2b34ad7f20d8f9031d96a8f1c75405ddcb6e9a2bd12f3a735fd894e55c53c7ef0698ddf375ddadf6c8edd061493bb0826
6
+ metadata.gz: fc4584d1c4739bf175be6bcf85369e3d0e5fd83bdc66b5d132258e2273b9b79cc5bdee8b02bed75ba809d40197058be6b3c75bd541d05bcfaf079ffa1202c1fb
7
+ data.tar.gz: 596b1c81741d349d0f18c35a63248ab62abd725aae8d5a5748a2a969d371c1e26139712548f13898157d783c39065ba10a0fdd44322cd7b8cd53d6fecd7fad60
@@ -65,7 +65,7 @@ module EffectiveMonerisCheckoutHelper
65
65
 
66
66
  def moneris_checkout_scrub(value)
67
67
  return value unless value.kind_of?(String)
68
- value.gsub(SCRUB, '')
68
+ value.gsub(SCRUB, '').first(50)
69
69
  end
70
70
 
71
71
  end
@@ -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 = (payment[:active_card] || payment['f4l4'] || payment['first6last4']).to_s.last(4)
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.qb_item_name)).name
71
+ (qb_order_item || build_qb_order_item(name: purchasable&.qb_item_name)).name
72
72
  end
73
73
 
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.2.13'.freeze
2
+ VERSION = '5.2.17'.freeze
3
3
  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.13
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-01-07 00:00:00.000000000 Z
11
+ date: 2022-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails