pay 11.6.0 → 11.6.2

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: 503a2d20ce3d8163cac35c916673cc1cc56d252fc895a292694eaba7dfab2924
4
- data.tar.gz: 03630e69b4b412963703a8bc2649552867de46be58c394885868e330203ef723
3
+ metadata.gz: 82b0246d201ed5b493e730a2620e5ef8b084d25dbd9d2aeb45d376b3515e0500
4
+ data.tar.gz: 7086d1d8ed0c6c999fc6d9e221a4bc7bdbde9a01b07f6c2257dbe3e5ca52bf3b
5
5
  SHA512:
6
- metadata.gz: 4dde8d6ebbbe1b4b212f971491843a3dce19f9335a47e9e3ad85364f1229c3cd93c1e148b36e3f3f37c634fae51212199ca1616619d1ed48fac4fdea9681bf51
7
- data.tar.gz: 67a37ea6b91b289d9f11a1a1258c9e8715d2b80082605810bc48e710f3a0cf1f2e765de4e89b9e151c032094294b4e561ef4ce6d69ac45d7a3961cb18d7b7401
6
+ metadata.gz: b5e2f3c52f8d2fadf7803798ffe98c9dbd2f40d91095548c87374e7a1bebab7cbe60ec18c5357fe19703fdb7761414849554dc988fc45d03c9e762f91742fff7
7
+ data.tar.gz: c32a6bd51f512eeaba0b4689a281b866b2fe246e9ee9d81b7f55491244750f8f6dfea2f400d69473096b27b117aec1e8e48e46688cace5042f9273b804561d14
@@ -36,7 +36,8 @@ module Pay
36
36
  digest = OpenSSL::Digest.new("sha256")
37
37
 
38
38
  hmac = OpenSSL::HMAC.hexdigest(digest, key, data)
39
- hmac == h1
39
+ return false if h1.nil? || hmac.bytesize != h1.bytesize
40
+ ActiveSupport::SecurityUtils.secure_compare(hmac, h1)
40
41
  end
41
42
 
42
43
  def verify_params
@@ -2,7 +2,7 @@ module Pay
2
2
  class UserMailer < Pay.parent_mailer.constantize
3
3
  def receipt
4
4
  if params[:pay_charge].respond_to? :receipt
5
- attachments[params[:pay_charge].filename] = params[:pay_charge].receipt
5
+ attachments[params[:pay_charge].receipt_filename] = params[:pay_charge].receipt
6
6
  end
7
7
 
8
8
  mail mail_arguments
@@ -175,7 +175,7 @@ module Pay
175
175
  }
176
176
 
177
177
  # Hosted (the default) checkout sessions require a success_url and cancel_url
178
- if ["", "hosted"].include? options[:ui_mode].to_s
178
+ if ["", "hosted_page"].include?(options[:ui_mode].to_s)
179
179
  args[:success_url] = merge_session_id_param(options.delete(:success_url) || root_url)
180
180
  args[:cancel_url] = merge_session_id_param(options.delete(:cancel_url) || root_url)
181
181
  end
@@ -334,7 +334,7 @@ module Pay
334
334
 
335
335
  # Retries the latest invoice for a Past Due subscription and attempts to pay it
336
336
  def retry_failed_payment(payment_intent_id: nil)
337
- payment_intent_id ||= api_record.latest_invoice.payment_intent.id
337
+ payment_intent_id ||= api_record.latest_invoice.payments.first.payment.payment_intent
338
338
  payment_intent = ::Stripe::PaymentIntent.retrieve({id: payment_intent_id}, stripe_options)
339
339
 
340
340
  payment_intent = if payment_intent.status == "requires_payment_method"
@@ -3,7 +3,7 @@ module Pay
3
3
  STATUSES = %w[incomplete incomplete_expired trialing active past_due canceled unpaid paused]
4
4
 
5
5
  # Associations
6
- belongs_to :customer
6
+ belongs_to :customer, touch: true
7
7
  belongs_to :payment_method, optional: true, primary_key: :processor_id
8
8
  has_many :charges
9
9
 
data/lib/pay/stripe.rb CHANGED
@@ -115,6 +115,7 @@ module Pay
115
115
  # If a customer's payment source was deleted in Stripe, we should update as well
116
116
  events.subscribe "stripe.payment_method.attached", Pay::Stripe::Webhooks::PaymentMethodAttached.new
117
117
  events.subscribe "stripe.payment_method.updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new
118
+ events.subscribe "stripe.payment_method.automatically_updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new
118
119
  events.subscribe "stripe.payment_method.card_automatically_updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new
119
120
  events.subscribe "stripe.payment_method.detached", Pay::Stripe::Webhooks::PaymentMethodDetached.new
120
121
 
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "11.6.0"
2
+ VERSION = "11.6.2"
3
3
  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: 11.6.0
4
+ version: 11.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes
@@ -173,7 +173,8 @@ files:
173
173
  homepage: https://github.com/pay-rails/pay
174
174
  licenses:
175
175
  - MIT
176
- metadata: {}
176
+ metadata:
177
+ rubygems_mfa_required: 'true'
177
178
  rdoc_options: []
178
179
  require_paths:
179
180
  - lib
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  - !ruby/object:Gem::Version
189
190
  version: '0'
190
191
  requirements: []
191
- rubygems_version: 4.0.9
192
+ rubygems_version: 4.0.15
192
193
  specification_version: 4
193
194
  summary: Payments engine for Ruby on Rails
194
195
  test_files: []