mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
adds comments to model reservation
This commit is contained in:
parent
fa64fd7a2e
commit
1344e09f96
@ -144,6 +144,10 @@ class Reservation < ActiveRecord::Base
|
||||
total = invoice.invoice_items.map(&:amount).map(&:to_i).reduce(:+)
|
||||
self.invoice.total = total
|
||||
save!
|
||||
#
|
||||
# IMPORTANT NOTE: here, we don't have to create a stripe::invoice and pay it
|
||||
# because subscription.create (in subscription.rb) will pay all waiting stripe invoice items
|
||||
#
|
||||
else
|
||||
# error handling
|
||||
invoice_items.each(&:delete)
|
||||
@ -163,6 +167,9 @@ class Reservation < ActiveRecord::Base
|
||||
customer.save
|
||||
end
|
||||
end
|
||||
#
|
||||
# IMPORTANT NOTE: here, we have to create an invoice manually and pay it to pay all waiting stripe invoice items
|
||||
#
|
||||
invoice = Stripe::Invoice.create(
|
||||
customer: user.stp_customer_id,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user