pay 6.2.3 → 6.2.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pay might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38b66c0598271a99f2293bf71a7c44e8877a98d45e06540597ae81c3de9e2d53
4
- data.tar.gz: c95b9e20ad640bc614fb293f708034e4ca4339868abf89def91eb245ce3c3f21
3
+ metadata.gz: c8e011241e3e5ad2aab2e5384bb155277b2f3795d9296e1fc2199ae7d2a3c758
4
+ data.tar.gz: 6476845b1fb2e8a118eb44462b30af9381fd7ad8f1bffe14e276be369dee0988
5
5
  SHA512:
6
- metadata.gz: 8b72f9b22b361d10f9693009f48395474f3b93b46e9031faaa3e109eeb16f2a3e2645cd54084d948f04a5d249cc07568b351ad40e25cb3a2b23c4a82a44c0a60
7
- data.tar.gz: 0a2135703836be6edfcd5994035d8c7b57d866365b381b66646b03347134b3a87b8506aa19981966124611aaf2cf2b6889c9f3fad415a7344737a28097dcc77c
6
+ metadata.gz: 52efd6d5f1e5c9ae46eb65636c11cb654cb6954e729be3de1864f4edf149c0e34e9f515247a425a5a7aef1edc30926ff6f7bfb2056bee803ebebadc6769af3e6
7
+ data.tar.gz: '0658c17acef2b2bf63d0b35cab1e3a335a41444a9ba8e603c3d4c686eba5d4c3c613e1a5e759f6924c90ef1f4d1fa87a6e1436c982b3204e11434d2d6312e6d7'
@@ -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
- attrs[:subscription] = pay_subscription
182
- attrs[:metadata] = pay_subscription.metadata
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
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "6.2.3"
2
+ VERSION = "6.2.4"
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: 6.2.3
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-05 00:00:00.000000000 Z
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.26
223
+ rubygems_version: 3.4.3
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Payments engine for Ruby on Rails