pay 11.2.1 → 11.2.3

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: 9358229d8dd4dc100b6c458b89403abe439d63fe8b278618f42337748dd712a6
4
- data.tar.gz: e9b408771b2eedda31bbc24d02645a1986502e5c3ecb672c919a2b9e5173121b
3
+ metadata.gz: 71299748a825cda0c189c61f051f666840c413df3e33e177d126dffa9feaa2fe
4
+ data.tar.gz: 3d6ad655b364d9fea688fbeae0e1f013bd6966e796559ec4cf1e2d5cb181dda0
5
5
  SHA512:
6
- metadata.gz: 71dfd9b37dac9e1959460a3f1dac220dbc3d9e988609ad8ea2c407c48327bc0b666a635919a67629ba25297bd0646bd634ae1c9d4856c8bd053d6730b300b729
7
- data.tar.gz: e6a70eb1734a76bb7e6ed39875cb6c9213616efb0bd2d9cff7c8562267d87e492a30c7e885b30103487e3343cf577a2895106adfe99edd1c16616ea7e0895fdb
6
+ metadata.gz: 530ea9ae04118c33c7aa91e17bb945cb752b22d175b3bdc32eef915e7e304f97f2017409eb53c3adb4ebeb319abf5e9c698ffa618167065d230c548d64ac23df
7
+ data.tar.gz: a39c4b305ce5083fcf44fdd8813de11292938bd2439a6288039d0f737e6f134b0ed869c61a06b99d1db4b105207e017de805c5a6cc86cbf9c2230add37dc69da
@@ -28,7 +28,7 @@ module Pay
28
28
  # - Finds or creates a Pay::Customer for the process and marks it as default
29
29
  # - Removes the default flag from all other Pay::Customers
30
30
  # - Removes the default flag from all Pay::PaymentMethods
31
- def set_payment_processor(processor_name, allow_fake: false, **attributes)
31
+ def set_payment_processor(processor_name, allow_fake: false, stripe_account: nil, **attributes)
32
32
  raise Pay::Error, "Processor `#{processor_name}` is not allowed" if processor_name.to_s == "fake_processor" && !allow_fake
33
33
 
34
34
  # Safety check to make sure this is a valid Pay processor
@@ -37,7 +37,7 @@ module Pay
37
37
 
38
38
  with_lock do
39
39
  pay_customers.update_all(default: false)
40
- pay_customer = pay_customers.active.where(processor: processor_name, type: klass.name).first_or_initialize
40
+ pay_customer = pay_customers.active.where(processor: processor_name, type: klass.name, stripe_account: stripe_account).first_or_initialize
41
41
  pay_customer.update!(attributes.merge(default: true))
42
42
  end
43
43
 
@@ -45,14 +45,14 @@ module Pay
45
45
  reload_payment_processor
46
46
  end
47
47
 
48
- def add_payment_processor(processor_name, allow_fake: false, **attributes)
48
+ def add_payment_processor(processor_name, allow_fake: false, stripe_account: nil, **attributes)
49
49
  raise Pay::Error, "Processor `#{processor_name}` is not allowed" if processor_name.to_s == "fake_processor" && !allow_fake
50
50
 
51
51
  # Safety check to make sure this is a valid Pay processor
52
52
  klass = "Pay::#{processor_name.to_s.classify}::Customer".constantize
53
53
  raise ArgumentError, "not a valid payment processor" if klass.ancestors.exclude?(Pay::Customer)
54
54
 
55
- pay_customer = pay_customers.active.where(processor: processor_name, type: klass.name).first_or_initialize
55
+ pay_customer = pay_customers.active.where(processor: processor_name, type: klass.name, stripe_account: stripe_account).first_or_initialize
56
56
  pay_customer.update!(attributes)
57
57
  pay_customer
58
58
  end
@@ -15,7 +15,7 @@ module Pay
15
15
  return unless pay_subscription
16
16
 
17
17
  # Stripe subscription items all have the same interval
18
- price = ::Stripe::Price.retrieve(invoice.lines.first.pricing.price_details.price)
18
+ price = ::Stripe::Price.retrieve({id: invoice.lines.first.pricing.price_details.price}, {stripe_account: event.try(:account)}.compact)
19
19
 
20
20
  # For collection_method=send_invoice, Stripe will send an email and next_payment_attempt will be null
21
21
  # https://docs.stripe.com/api/invoices/object#invoice_object-collection_method
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "11.2.1"
2
+ VERSION = "11.2.3"
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.2.1
4
+ version: 11.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes