1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-02 13:24:20 +01:00
fab-manager/app/services/reservations/reserve.rb

18 lines
417 B
Ruby
Raw Normal View History

2018-12-11 15:07:21 +01:00
module Reservations
class Reserve
attr_accessor :user_id
def initialize(user_id)
@user_id = user_id
end
def pay_and_save(reservation, payment_method, coupon)
reservation.user_id = user_id
if payment_method == :local
reservation.save_with_local_payment(coupon)
elsif payment_method == :stripe
reservation.save_with_payment(coupon)
end
end
end
end