pay 6.3.4 → 6.5.0

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: 8df23f145c680d1eef4c172c1b54e59969a4c7b051e134e61562fb1bc87c9019
4
- data.tar.gz: d0bfe3631e4595fc2c87b262b041a23fc238d52f78bd4dae8bfb53f0c7983193
3
+ metadata.gz: 8f418566efec491866a28f3bb47fde5658eb5350bfcbf249b50e388282ea6d31
4
+ data.tar.gz: 3c6f258c34022ac7ee10b826b416dfd8b367de2aa84e5f826b2395ec4e43f0c6
5
5
  SHA512:
6
- metadata.gz: b703ca249cc4edfc782efe7c7aaa3f184ca12e8a92f6d16ce672309d8e0d240c36ee9b980d543680ef9f627a48f66ac5b837f4efdf6481fa4db8de6bf6e9dfbf
7
- data.tar.gz: 03cc1dfaa8aebbafe97c2f5772e4cebc81be24c3c28b0051a7de2bebb3958f89795da6b7d28b6fe6f533837e072648f349d67b536504a90e282dc67de4594162
6
+ metadata.gz: 6309fcbec95c89a45cf364037df4f6efb9596e7e13e0068afb9ef98f30773e8c0ce4429c427ab197005a17e1879e0a2a32e2ccf4bd2087d664073500bc8be8d4
7
+ data.tar.gz: 983933113b7ee85e01e8d582d5bff735c0f27781e7005b65bc03537efd8d6e83f17f63401c36efd6c50af037ae5cab8fc0e90a4e95f31a75ad42efac753815d2
data/lib/pay/engine.rb CHANGED
@@ -17,6 +17,10 @@ module Pay
17
17
  end
18
18
  end
19
19
 
20
+ config.after_initialize do
21
+ ActiveSupport.run_load_hooks(:pay, Pay)
22
+ end
23
+
20
24
  # Add webhook subscribers before app initializers define extras
21
25
  # This keeps the processing in order so that changes have happened before user-defined webhook processors
22
26
  config.before_initialize do
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "6.3.4"
2
+ VERSION = "6.5.0"
3
3
  end
data/lib/pay.rb CHANGED
@@ -57,6 +57,9 @@ module Pay
57
57
  mattr_accessor :enabled_processors
58
58
  @@enabled_processors = [:stripe, :braintree, :paddle]
59
59
 
60
+ mattr_accessor :send_emails
61
+ @@send_emails = true
62
+
60
63
  mattr_accessor :emails
61
64
  @@emails = ActiveSupport::OrderedOptions.new
62
65
  @@emails.payment_action_required = true
@@ -111,12 +114,19 @@ module Pay
111
114
  end
112
115
 
113
116
  def self.send_email?(email_option, *remaining_args)
114
- config_option = emails.send(email_option)
117
+ if resolve_option(send_emails, *remaining_args)
118
+ email_config_option_enabled = emails.send(email_option)
119
+ resolve_option(email_config_option_enabled, *remaining_args)
120
+ else
121
+ false
122
+ end
123
+ end
115
124
 
116
- if config_option.respond_to?(:call)
117
- config_option.call(*remaining_args)
125
+ def self.resolve_option(option, *remaining_args)
126
+ if option.respond_to?(:call)
127
+ option.call(*remaining_args)
118
128
  else
119
- config_option
129
+ option
120
130
  end
121
131
  end
122
132
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.4
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-05-02 00:00:00.000000000 Z
13
+ date: 2023-05-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.4.12
171
+ rubygems_version: 3.4.10
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Payments engine for Ruby on Rails