pay 6.8.0 → 6.8.1

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: de3a99204ee0e081f59774da0369b8e820a8d1fb33d810871dbc62ec009012c1
4
- data.tar.gz: 19bbcd3c80230b270b2fc60338d410d6ceb37e2dc9466d1674f8552ecbdf46e9
3
+ metadata.gz: bcbe66e7978f3f589514c71a54b0f7450b41b57ddcd7025ce17e93130e42e1dd
4
+ data.tar.gz: e6168b5908003c44a5bf494d93590c4eaed7e2777178e66aa3303c72e2ffea2a
5
5
  SHA512:
6
- metadata.gz: 0f504f26b84e856d1fd241e61537f1203539b76f58f9af69a768316e97e710ff24b5a79ac2179a1c335d5691283dc9e097476e696b1551ec212046f8dd97f026
7
- data.tar.gz: 87e4ae3cc89868ed3faa76e3a73b0aaba568c87d33e7c1c003619c4fc69887edcce7fab67f3c40cb57924423a4f9c0b2328cebf1491164ae975c79f586fa7cb9
6
+ metadata.gz: 3c5ed3d8be3d803c66091d647957a8dc115c298de1daa4a8f53a69aae55ff7a8df406835718feafe231437f842a1770dedadac1cf9b8ac81a9494ee31e1ccc8e
7
+ data.tar.gz: 2571ba9c847b47ad74fe3996b159bac179b553dc1bc1d673f52194fbd6a17f381a27ebace5668254f13c17dd288a6bba0d6f93d51c809d0474ac28b68f0f42b4
@@ -15,12 +15,16 @@ module Pay
15
15
  def self.sync(charge_id, object: nil, stripe_account: nil, try: 0, retries: 1)
16
16
  # Skip loading the latest charge details from the API if we already have it
17
17
  object ||= ::Stripe::Charge.retrieve({id: charge_id, expand: ["invoice.total_discount_amounts.discount", "invoice.total_tax_amounts.tax_rate", "refunds"]}, {stripe_account: stripe_account}.compact)
18
-
19
- # Ignore charges without a Customer
20
- return if object.customer.blank?
18
+ if object.customer.blank?
19
+ Rails.logger.debug "Stripe Charge #{object.id} does not have a customer"
20
+ return
21
+ end
21
22
 
22
23
  pay_customer = Pay::Customer.find_by(processor: :stripe, processor_id: object.customer)
23
- return unless pay_customer
24
+ if pay_customer.blank?
25
+ Rails.logger.debug "Pay::Customer #{object.customer} is not in the database while syncing Stripe Charge #{object.id}"
26
+ return
27
+ end
24
28
 
25
29
  refunds = []
26
30
  object.refunds.auto_paging_each { |refund| refunds << refund }
@@ -28,9 +28,16 @@ module Pay
28
28
  # Syncs PaymentMethod objects from Stripe
29
29
  def self.sync(id, object: nil, stripe_account: nil, try: 0, retries: 1)
30
30
  object ||= ::Stripe::PaymentMethod.retrieve(id, {stripe_account: stripe_account}.compact)
31
+ if object.customer.blank?
32
+ Rails.logger.debug "Stripe PaymentMethod #{object.id} does not have a customer"
33
+ return
34
+ end
31
35
 
32
36
  pay_customer = Pay::Customer.find_by(processor: :stripe, processor_id: object.customer)
33
- return unless pay_customer
37
+ if pay_customer.blank?
38
+ Rails.logger.debug "Pay::Customer #{object.customer} is not in the database while syncing Stripe PaymentMethod #{object.id}"
39
+ return
40
+ end
34
41
 
35
42
  default_payment_method_id = pay_customer.customer.invoice_settings.default_payment_method
36
43
  default = (id == default_payment_method_id)
@@ -31,9 +31,16 @@ module Pay
31
31
  def self.sync(subscription_id, object: nil, name: nil, stripe_account: nil, try: 0, retries: 1)
32
32
  # Skip loading the latest subscription details from the API if we already have it
33
33
  object ||= ::Stripe::Subscription.retrieve({id: subscription_id}.merge(expand_options), {stripe_account: stripe_account}.compact)
34
+ if object.customer.blank?
35
+ Rails.logger.debug "Stripe Subscription #{object.id} does not have a customer"
36
+ return
37
+ end
34
38
 
35
39
  pay_customer = Pay::Customer.find_by(processor: :stripe, processor_id: object.customer)
36
- return unless pay_customer
40
+ if pay_customer.blank?
41
+ Rails.logger.debug "Pay::Customer #{object.customer} is not in the database while syncing Stripe Subscription #{object.id}"
42
+ return
43
+ end
37
44
 
38
45
  attributes = {
39
46
  application_fee_percent: object.application_fee_percent,
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "6.8.0"
2
+ VERSION = "6.8.1"
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.8.0
4
+ version: 6.8.1
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-08-22 00:00:00.000000000 Z
13
+ date: 2023-09-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails