1
0
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:
Nicolas Florentin 2016-04-08 16:59:09 +02:00
parent fa64fd7a2e
commit 1344e09f96

View File

@ -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,
)