pay 4.0.2 → 4.0.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: cd5f149f88ae66352491ff4da889e6e252d491fa37467a1a7a05d635ef855f61
4
- data.tar.gz: 970ca6f6183aba7795368d5b2b78c3ddb932498bd54af20567c467d126246e10
3
+ metadata.gz: 6659a95f47cd229375f090cb734b440ca8484cd9672b88bd482dede070fa6819
4
+ data.tar.gz: 408ef1cbfd3364d30d7e7bbfd78c58b585034c54e65346db92f1e9a7cf3ab279
5
5
  SHA512:
6
- metadata.gz: e7fd623efada808362cef4f67d1a66919a2a74103c69cf16c859d854dc5e4ef8aed9e58cccd6addc1b2328b663824d7fa0830144ec44bceff3c2fde32a6f7131
7
- data.tar.gz: 27cad2d3b9a1fb239c5dc68282f728fadf07451b2a9c9aa29d77274077d52b608865a39f90de5d3416f69c418f75493a545f4f41f00b58bccf722a52dcfabf3e
6
+ metadata.gz: 8ffbc4d1d685f994a1dc3e45d8b7f20a4a4d4f8852cd3ca7d349d2af5cc22445c2c526eef8906305aa80b8d37ae82c6f0101b271a121b66d4bc4624f82446480
7
+ data.tar.gz: 12332883526b3e321e70e8b30445b40dfa85715f3a7a7bfece32940fb857f8f747b586d48245f760b9e3866a54d2532d9ca9dce8b0da55441f3b619cec14072f
data/lib/pay/receipts.rb CHANGED
@@ -60,7 +60,8 @@ module Pay
60
60
 
61
61
  # Tax rates
62
62
  Array.wrap(total_tax_amounts).each do |tax_amount|
63
- items << [nil, nil, tax_description(tax_amount), Pay::Currency.format(tax, currency: currency)]
63
+ next if tax_amount["amount"].zero?
64
+ items << [nil, nil, tax_description(tax_amount), Pay::Currency.format(tax_amount["amount"], currency: currency)]
64
65
  end
65
66
 
66
67
  items << [nil, nil, I18n.t("pay.line_items.total"), Pay::Currency.format(amount, currency: currency)]
@@ -104,7 +104,7 @@ module Pay
104
104
  def subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options)
105
105
  quantity = options.delete(:quantity)
106
106
  opts = {
107
- expand: ["pending_setup_intent", "latest_invoice.payment_intent", "latest_invoice.charge.invoice"],
107
+ expand: ["pending_setup_intent", "latest_invoice.payment_intent", "latest_invoice.charge"],
108
108
  items: [plan: plan, quantity: quantity],
109
109
  off_session: true
110
110
  }.merge(options)
@@ -84,7 +84,7 @@ module Pay
84
84
 
85
85
  # Sync the latest charge if we already have it loaded (like during subscrbe), otherwise, let webhooks take care of creating it
86
86
  if (charge = object.try(:latest_invoice).try(:charge)) && charge.try(:status) == "succeeded"
87
- Pay::Stripe::Charge.sync(charge.id, object: charge)
87
+ Pay::Stripe::Charge.sync(charge.id, stripe_account: pay_subscription.stripe_account)
88
88
  end
89
89
 
90
90
  pay_subscription
@@ -100,7 +100,7 @@ module Pay
100
100
 
101
101
  # Common expand options for all requests that create, retrieve, or update a Stripe Subscription
102
102
  def self.expand_options
103
- {expand: ["pending_setup_intent", "latest_invoice.payment_intent", "latest_invoice.charge.invoice"]}
103
+ {expand: ["pending_setup_intent", "latest_invoice.payment_intent", "latest_invoice.charge"]}
104
104
  end
105
105
 
106
106
  def initialize(pay_subscription)
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "4.0.2"
2
+ VERSION = "4.0.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: 4.0.2
4
+ version: 4.0.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: 2022-07-27 00:00:00.000000000 Z
12
+ date: 2022-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails