pay 10.1.3 → 10.1.5
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 +4 -4
- data/app/controllers/pay/payments_controller.rb +1 -1
- data/app/models/pay/customer.rb +1 -1
- data/app/models/pay/fake_processor/customer.rb +4 -0
- data/app/models/pay/stripe/subscription.rb +1 -1
- data/lib/pay/attributes.rb +2 -2
- data/lib/pay/stripe/webhooks/payment_action_required.rb +5 -3
- data/lib/pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 740b4dafabcbd3a2fdffa9cf0e34ca0f22e4b6c4f74da849d3b2087267439fa1
|
4
|
+
data.tar.gz: 6f59c38d8a5302a0793f22d558795136a1bac2d7d453e6076502a95ff7cf5512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a8190510febace01505e5aab44f1cb3747254ebf8fd41b7450ed33a434941c601bea6470b37d7f50d82ecda529696d5ba5cb7a94f651001130921d4d32c7d93
|
7
|
+
data.tar.gz: 3c9db926c7b0520ff8e24cc5a8ec106e2b478a11e3fb8ea435c48d25758af196727b720cdab564c30bc1a543ce4df6310e4280db54e79cae3f4745be1549c716
|
data/app/models/pay/customer.rb
CHANGED
@@ -20,7 +20,7 @@ module Pay
|
|
20
20
|
store_accessor :data, :invoice_credit_balance
|
21
21
|
store_accessor :data, :currency
|
22
22
|
|
23
|
-
delegate :email, to: :owner
|
23
|
+
delegate :email, to: :owner, allow_nil: true
|
24
24
|
|
25
25
|
%w[stripe braintree paddle_billing paddle_classic lemon_squeezy fake_processor].each do |processor_name|
|
26
26
|
scope processor_name, -> { where(processor: processor_name) }
|
@@ -297,7 +297,7 @@ module Pay
|
|
297
297
|
)
|
298
298
|
|
299
299
|
# Validate that swap was successful and handle SCA if needed
|
300
|
-
if (payment_intent_id = @api_record.latest_invoice.payments.first
|
300
|
+
if (payment_intent_id = @api_record.latest_invoice.payments.first&.payment&.payment_intent)
|
301
301
|
Pay::Payment.from_id(payment_intent_id).validate
|
302
302
|
end
|
303
303
|
|
data/lib/pay/attributes.rb
CHANGED
@@ -35,7 +35,7 @@ module Pay
|
|
35
35
|
klass = "Pay::#{processor_name.to_s.classify}::Customer".constantize
|
36
36
|
raise ArgumentError, "not a valid payment processor" if klass.ancestors.exclude?(Pay::Customer)
|
37
37
|
|
38
|
-
|
38
|
+
with_lock do
|
39
39
|
pay_customers.update_all(default: false)
|
40
40
|
pay_customer = pay_customers.active.where(processor: processor_name, type: klass.name).first_or_initialize
|
41
41
|
pay_customer.update!(attributes.merge(default: true))
|
@@ -81,7 +81,7 @@ module Pay
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def set_merchant_processor(processor_name, **attributes)
|
84
|
-
|
84
|
+
with_lock do
|
85
85
|
pay_merchants.update_all(default: false)
|
86
86
|
pay_merchant = pay_merchants.where(processor: processor_name, type: "Pay::#{processor_name.to_s.classify}::Merchant").first_or_initialize
|
87
87
|
pay_merchant.update!(attributes.merge(default: true))
|
@@ -13,11 +13,13 @@ module Pay
|
|
13
13
|
pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe, subscription_id)
|
14
14
|
return if pay_subscription.nil? || pay_subscription.status == "incomplete"
|
15
15
|
|
16
|
-
|
16
|
+
invoice_payment = ::Stripe::InvoicePayment.list({invoice: invoice.id, status: :open}).first
|
17
|
+
|
18
|
+
if invoice_payment && Pay.send_email?(:payment_action_required, pay_subscription)
|
17
19
|
Pay.mailer.with(
|
18
20
|
pay_customer: pay_subscription.customer,
|
19
|
-
|
20
|
-
|
21
|
+
pay_subscription: pay_subscription,
|
22
|
+
payment_intent_id: invoice_payment.payment.payment_intent
|
21
23
|
).payment_action_required.deliver_later
|
22
24
|
end
|
23
25
|
end
|
data/lib/pay/version.rb
CHANGED
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: 10.1.
|
4
|
+
version: 10.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.6.
|
183
|
+
rubygems_version: 3.6.9
|
184
184
|
specification_version: 4
|
185
185
|
summary: Payments engine for Ruby on Rails
|
186
186
|
test_files: []
|