pay 6.2.3 → 6.2.4
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.
Potentially problematic release.
This version of pay might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/models/pay/charge.rb +1 -1
- data/lib/pay/braintree/billable.rb +7 -2
- data/lib/pay/braintree/subscription.rb +3 -0
- data/lib/pay/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e011241e3e5ad2aab2e5384bb155277b2f3795d9296e1fc2199ae7d2a3c758
|
4
|
+
data.tar.gz: 6476845b1fb2e8a118eb44462b30af9381fd7ad8f1bffe14e276be369dee0988
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52efd6d5f1e5c9ae46eb65636c11cb654cb6954e729be3de1864f4edf149c0e34e9f515247a425a5a7aef1edc30926ff6f7bfb2056bee803ebebadc6769af3e6
|
7
|
+
data.tar.gz: '0658c17acef2b2bf63d0b35cab1e3a335a41444a9ba8e603c3d4c686eba5d4c3c613e1a5e759f6924c90ef1f4d1fa87a6e1436c982b3204e11434d2d6312e6d7'
|
data/app/models/pay/charge.rb
CHANGED
@@ -50,7 +50,7 @@ module Pay
|
|
50
50
|
customer.processor == processor_name
|
51
51
|
end
|
52
52
|
|
53
|
-
scope processor_name, -> { where(processor: processor_name) }
|
53
|
+
scope processor_name, -> { joins(:customer).where(pay_customers: {processor: processor_name}) }
|
54
54
|
end
|
55
55
|
|
56
56
|
delegate :capture, :credit_note!, :credit_notes, to: :payment_processor
|
@@ -174,12 +174,17 @@ module Pay
|
|
174
174
|
attrs[:metadata] = transaction.custom_fields
|
175
175
|
attrs[:currency] = transaction.currency_iso_code
|
176
176
|
attrs[:application_fee_amount] = transaction.service_fee_amount
|
177
|
+
attrs[:created_at] = transaction.created_at
|
177
178
|
|
178
179
|
# Associate charge with subscription if we can
|
179
180
|
if transaction.subscription_id
|
180
181
|
pay_subscription = pay_customer.subscriptions.find_by(processor_id: transaction.subscription_id)
|
181
|
-
|
182
|
-
|
182
|
+
pay_subscription ||= Pay::Braintree::Subscription.sync(transaction.subscription_id)
|
183
|
+
|
184
|
+
if pay_subscription
|
185
|
+
attrs[:subscription] = pay_subscription
|
186
|
+
attrs[:metadata] = pay_subscription.metadata
|
187
|
+
end
|
183
188
|
end
|
184
189
|
|
185
190
|
charge = pay_customer.charges.find_or_initialize_by(processor_id: transaction.id)
|
@@ -28,6 +28,9 @@ module Pay
|
|
28
28
|
pay_customer = Pay::Customer.find_by(processor: :braintree, processor_id: payment_method.customer_id)
|
29
29
|
return unless pay_customer
|
30
30
|
|
31
|
+
# Sync the PaymentMethod since we've got it
|
32
|
+
pay_customer.save_payment_method(payment_method, default: payment_method.default?)
|
33
|
+
|
31
34
|
attributes = {
|
32
35
|
created_at: object.created_at,
|
33
36
|
current_period_end: object.billing_period_end_date,
|
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: 6.2.
|
4
|
+
version: 6.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-01-
|
12
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.3
|
223
|
+
rubygems_version: 3.4.3
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Payments engine for Ruby on Rails
|