pay 10.0.0 → 10.0.2

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: 2cb13ff6c749505948794eb9208f18c23c4039f8f4a7669f5c0a3b20de896208
4
- data.tar.gz: 9333e7733e05f6c911c4a83511ecbd5f3fe50af0a81e1fb8148390480f61f3b0
3
+ metadata.gz: 5d100fe3b67eb40c0099ad4875c9aed063da3a57d6ddd84f7d3ccd572d53bbcd
4
+ data.tar.gz: 8c62540416d2089e12dabb3cb5b2780201088d7c793bad92adfa839e14363c06
5
5
  SHA512:
6
- metadata.gz: baeb8674f52419544fe9e81488cec59019d810e5b30d93aa3376c47fac7c63d4827ab92a0a7ac11f160da6b786264b1c2fe2124dfbb0fc3701a7e8908003c6fa
7
- data.tar.gz: bf45ca550a463359b1322e31514fe3d86cdedde5b5ea5974a54d1e11302bec6745b0ac19621cc46aeb8833463093923e2c7917151497354e0a280e8a53ac732d
6
+ metadata.gz: 3ab2f514dcb11ffcdfac4dbeef8ef88673c2ba9f63d6fe47927953ce9508dd1eabc337dcc47224264a7a843242af830a921cc090c892860edbf972bca877e388
7
+ data.tar.gz: 69c039a1ad0732ee7f62113515ee8d1f7d351766a859ccf5a457fb1c8fabde8d06531ea1682f7ff42102cb85956c36971db0aff571b8b30ab4caa47e8e6ca451
@@ -89,7 +89,7 @@ module Pay
89
89
 
90
90
  response = ::Paddle::Subscription.cancel(
91
91
  id: processor_id,
92
- effective_from: options.fetch(:effective_from, (paused? ? "immediately" : "next_billing_period"))
92
+ effective_from: options.fetch(:effective_from, paused? ? "immediately" : "next_billing_period")
93
93
  )
94
94
  update(
95
95
  status: response.status,
data/lib/pay/receipts.rb CHANGED
@@ -31,9 +31,9 @@ module Pay
31
31
  ]
32
32
  ]
33
33
 
34
- if stripe_invoice
34
+ if try(:stripe_invoice)
35
35
  stripe_invoice.lines.auto_paging_each do |line|
36
- items << [line.description, line.quantity, Pay::Currency.format(line.unit_amount_excluding_tax, currency: line.currency), Pay::Currency.format(line.amount, currency: line.currency)]
36
+ items << [line.description, line.quantity, Pay::Currency.format(line.pricing.unit_amount_decimal, currency: line.currency), Pay::Currency.format(line.amount, currency: line.currency)]
37
37
 
38
38
  line.discounts.each do |discount_id|
39
39
  discount = stripe_invoice.total_discount_amounts.find { |d| d.discount.id == discount_id }
@@ -45,21 +45,21 @@ module Pay
45
45
  end
46
46
 
47
47
  # If no subtotal, we will display the total
48
- items << [nil, nil, I18n.t("pay.line_items.subtotal"), Pay::Currency.format(stripe_invoice&.subtotal || amount, currency: currency)]
48
+ items << [nil, nil, I18n.t("pay.line_items.subtotal"), Pay::Currency.format(try(:stripe_invoice)&.subtotal || amount, currency: currency)]
49
49
 
50
50
  # Discounts on the invoice
51
- stripe_invoice&.discounts&.each do |discount_id|
51
+ try(:stripe_invoice)&.discounts&.each do |discount_id|
52
52
  discount = stripe_invoice.total_discount_amounts.find { |d| d.discount.id == discount_id }
53
53
  items << [nil, nil, discount_description(discount), Pay::Currency.format(-discount.amount, currency: currency)]
54
54
  end
55
55
 
56
56
  # Total excluding tax
57
- if stripe_invoice
57
+ if try(:stripe_invoice)
58
58
  items << [nil, nil, I18n.t("pay.line_items.total"), Pay::Currency.format(stripe_invoice.total_excluding_tax, currency: currency)]
59
59
  end
60
60
 
61
61
  # Tax rates
62
- stripe_invoice&.total_taxes&.each do |tax|
62
+ try(:stripe_invoice)&.total_taxes&.each do |tax|
63
63
  next if tax.amount.zero?
64
64
  # tax_rate = ::Stripe::TaxRate.retrieve(tax.tax_rate_details.tax_rate)
65
65
  items << [nil, nil, I18n.t("pay.line_items.tax"), Pay::Currency.format(tax.amount, currency: currency)]
data/lib/pay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pay
2
- VERSION = "10.0.0"
2
+ VERSION = "10.0.2"
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: 10.0.0
4
+ version: 10.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Charnes