pay 10.0.1 → 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 +4 -4
- data/app/models/pay/paddle_billing/subscription.rb +1 -1
- data/lib/pay/receipts.rb +5 -5
- data/lib/pay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d100fe3b67eb40c0099ad4875c9aed063da3a57d6ddd84f7d3ccd572d53bbcd
|
4
|
+
data.tar.gz: 8c62540416d2089e12dabb3cb5b2780201088d7c793bad92adfa839e14363c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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,7 +31,7 @@ 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
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
|
|
@@ -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