Abraham Rodriguez

Add manual payment and payment at as a new attribute

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