pay 11.3.0 → 11.3.1
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/stripe/charge.rb +3 -2
- data/lib/pay/receipts.rb +2 -2
- data/lib/pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebe9b67692268353c8f1f898d83ed6836cc22e82f040b7465d32d81fc8dc2540
|
|
4
|
+
data.tar.gz: 7b1f8b4b41cd8bdb7947573c10fdd718d3fc9241819e08d9d91365429bf3b85d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9b0bb4400a27d811f692152b7300490d2ad1db8d941586d13f8c825971ce2c7bf1f0a49934ab32e0d791453cb6228896658e9df14395cd69ef41635f7a4a391
|
|
7
|
+
data.tar.gz: 8933680fcf6be0cec427990d3a3a3e7701c26edb81a839c116d3194f68308cfbd7ad18e2e62cd421b3e4b4e94c296ece51763bf70aa530ad64b627ed27fb271e
|
|
@@ -48,8 +48,9 @@ module Pay
|
|
|
48
48
|
|
|
49
49
|
# Associate charge with subscription if we can
|
|
50
50
|
if object.payment_intent.present?
|
|
51
|
-
invoice_payments = ::Stripe::InvoicePayment.list({payment: {type: :payment_intent, payment_intent: object.payment_intent}, status: :paid
|
|
52
|
-
if invoice_payments.any?
|
|
51
|
+
invoice_payments = ::Stripe::InvoicePayment.list({payment: {type: :payment_intent, payment_intent: object.payment_intent}, status: :paid}, {stripe_account: stripe_account}.compact)
|
|
52
|
+
if invoice_payments.any?
|
|
53
|
+
invoice = ::Stripe::Invoice.retrieve({id: invoice_payments.first.invoice, expand: ["total_discount_amounts.discount.source.coupon"]}, {stripe_account: stripe_account}.compact)
|
|
53
54
|
attrs[:stripe_invoice] = invoice.to_hash
|
|
54
55
|
attrs[:subtotal] = invoice.subtotal
|
|
55
56
|
attrs[:tax] = invoice.total - invoice.total_excluding_tax.to_i
|
data/lib/pay/receipts.rb
CHANGED
|
@@ -70,8 +70,8 @@ module Pay
|
|
|
70
70
|
items
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
def discount_description(
|
|
74
|
-
coupon = discount.discount.coupon
|
|
73
|
+
def discount_description(total_discount_amount)
|
|
74
|
+
coupon = total_discount_amount.discount.try(:source).try(:coupon) || total_discount_amount.discount.try(:coupon)
|
|
75
75
|
name = coupon.name
|
|
76
76
|
|
|
77
77
|
if (percent = coupon.percent_off)
|
data/lib/pay/version.rb
CHANGED
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.3.
|
|
4
|
+
version: 11.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Charnes
|
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
187
187
|
- !ruby/object:Gem::Version
|
|
188
188
|
version: '0'
|
|
189
189
|
requirements: []
|
|
190
|
-
rubygems_version: 3.7.
|
|
190
|
+
rubygems_version: 3.7.2
|
|
191
191
|
specification_version: 4
|
|
192
192
|
summary: Payments engine for Ruby on Rails
|
|
193
193
|
test_files: []
|