effective_orders 5.2.5 → 5.2.9

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: cc1c2f6fea7135b9b7578bef447c14f3485fd68cef06a2c441c17c08fcce5628
4
- data.tar.gz: eedc4248429fafb164669fb64a03b0119ae2bbd806847a8022670c0da947ffc9
3
+ metadata.gz: bc66dfb86e929b29d30edefe87326d4caeae9250f1db593e4c1955eb6fd39c32
4
+ data.tar.gz: 95239c7500bce2fd5d6a48cc9e1c1fe6667ea0af12f3e028820ffa3c52c0843e
5
5
  SHA512:
6
- metadata.gz: 7b7955c3e945f81015f7f3958cd70ccb80dc55fc935c7e29043a4f2b2174c700c42f9bf32dc322b3743cc2ec5d1b1c38682a24dfcf6322cd631315b63d99b049
7
- data.tar.gz: 06e6e17294699a973be1d3b34a6cf0a5d97623e9e9523e9a618113f783bd7ffbefce7d2dd8ec113139feb35d69d120130ca6adb8c917c18f598439adf83012ae
6
+ metadata.gz: a00bb7a4142c5b326412a69d1cfa1c112825933efdd565eecfc422fdb55fc54f06b56e8cde8335705b701dc43403ba4086ababa4c5c6cbeb609cc30eb1e0599e
7
+ data.tar.gz: 2ce6a0d26f8e9a0c3be3b5540ff25e68eb65408c126d38e9d35c89bb79109499e9b125e5ca5e9842b537a1eab4e13c16becc6b71cbfa75fb2b8a233a8e7b0c3e
@@ -103,7 +103,7 @@ module Effective
103
103
  end
104
104
 
105
105
  # User validations -- An admin skips these when working in the admin/ namespace
106
- with_options unless: -> { pending? || skip_buyer_validations? } do
106
+ with_options unless: -> { pending? || skip_buyer_validations? || purchased? } do
107
107
  validates :tax_rate, presence: { message: "can't be determined based on billing address" }
108
108
  validates :tax, presence: true
109
109
 
@@ -318,9 +318,9 @@ module Effective
318
318
  Effective::Order.new(self)
319
319
  end
320
320
 
321
- # For moneris and moneris_checkout. Just a unique value.
321
+ # For moneris and moneris_checkout. Just a unique value. Must be 50 characters or fewer or will raise moneris error.
322
322
  def transaction_id
323
- [to_param, billing_name.to_s.parameterize.presence, Time.zone.now.to_i].compact.join('-')
323
+ [to_param, billing_name.to_s.parameterize.first(20).presence, Time.zone.now.to_i, rand(1000..9999)].compact.join('-')
324
324
  end
325
325
 
326
326
  def billing_first_name
@@ -596,7 +596,7 @@ module Effective
596
596
  end
597
597
 
598
598
  def assign_email
599
- self.email = user&.email
599
+ self.email = user&.email if user&.email.present?
600
600
  end
601
601
 
602
602
  def assign_last_address
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.2.5'.freeze
2
+ VERSION = '5.2.9'.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.5
4
+ version: 5.2.9
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: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2021-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails