Abraham Rodriguez

Add manual payment and payment at as a new attribute

......@@ -3,6 +3,7 @@ class AddVarStatusTo<%=@model_name.pluralize.camelize%> < ActiveRecord::Migratio
add_column :<%=@model_name.pluralize.underscore%>, :var_status, :string, default: 'pending'
add_column :<%=@model_name.pluralize.underscore%>, :var_barcode_url, :string
add_column :<%=@model_name.pluralize.underscore%>, :var_barcode, :string
add_column :<%=@model_name.pluralize.underscore%>, :var_payment, :datetime
add_column :<%=@model_name.pluralize.underscore%>, :var_payment_expires_at, :datetime
add_column :<%=@model_name.pluralize.underscore%>, :var_id, :string
add_column :<%=@model_name.pluralize.underscore%>, :var_service, :string
......
......@@ -113,6 +113,12 @@ module ActsAsChargeable
var_payment_expires_at: Time.at(method.expires_at))
end
def manual_charge
self.update_columns(var_service: 'manual', var_status: 'paid',
var_payment_at: Time.zone.now)
# TODO: Create a new table with transaction
end
# def charge_with_paypal(options)
# if(!options.include? :card)
# error_message = "Paypal needs a card sent as a third paramater"
......
# Var Version
module Var
VERSION = '0.2.11'
VERSION = '0.2.12'
end
......