Commits

xrd  committed 266710f

Add payment processing

  • Participants
  • Parent commits 6706bbc

Comments (0)

Files changed (4)

File app/controllers/payment_controller.rb

   def payment_received
     loan = Loan.find_by_code params[:code]
     if loan
-      cents = params['order']['total_native']['cents'].to_i
-      loan.payment!( cents/100, params["order"]["transaction"]["id"] )
+      cents = params[:order][:total_native][:cents].to_i
+      loan.payment!( cents/100, params[:order][:transaction][:id] )
     end
-    render json: loan
+    render json: loan.reload
   end
   
   def button

File app/views/loan_mailer/notify.html.erb

   <body>
     <h1>Donation received</h1>
     <p>
-      <%= progress %>% of the loan is covered by donations.
+      <%= @progress %>% of the loan is covered by donations.
     </p>
     <p>
-      $<%= amount %> was just donated.
+      $<%= @amount %> was just donated.
     </p>
   </body>
 </html>

File app/views/welcome/_problem.html.haml

 
 .item 
   Is there an alternative?
-  %strong Bitcoin
-  is an open source peer-to-peer currency. 
   %strong Coinbase
   has zero transaction fees for bitcoin exchange, which stands in stark contrast to the 
   payday loan companies which charge anywhere from 10% - 20% for cashing a check with 
   an offer for support to the person in need.
   %strong Donors on Sharkbit
   make small loans in bitcoin to help guarantee payday loans. Once a loan has been repaid to the sponsor, the bitcoin
-  are returned to the donor. And, in case a payday loan is not repaid, the sponsor is not left with a large
+  are returned to the donors. And, in case a payday loan is not repaid, the sponsor is not left with a large
   financial burden themselves.
 
 .item

File db/migrate/20140316073541_add_transaction_id.rb~

-class AddTransactionId < ActiveRecord::Migration
-  def change
-  end
-end