Skip to content

Instantly share code, notes, and snippets.

View zmachuca's full-sized avatar
🎯
Focusing

Zach Machuca zmachuca

🎯
Focusing
View GitHub Profile
Started POST "/users" for 127.0.0.1 at 2015-02-14 20:22:50 -0500
Processing by UsersController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"nRReeEX9o8l5PNoH3qQ3iEU60qfypfbdGl7762Gls2k=", "user"=>{"name"=>"Test", "address"=>"Test", "city"=>"Test", "state"=>"Test", "zip"=>"Test", "country"=>"Test", "design"=>"1", "email"=>"[email protected]"}, "stripeToken"=>"tok_15WH7TBNN9wwQpAWRHkqYxRH", "stripeTokenType"=>"card", "stripeEmail"=>"[email protected]"}
(0.2ms) begin transaction
SQL (0.6ms) INSERT INTO "users" ("address", "city", "country", "created_at", "design", "email", "name", "state", "updated_at", "zip") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["address", "Test"], ["city", "Test"], ["country", "Test"], ["created_at", "2015-02-15 01:22:50.461395"], ["design", "1"], ["email", "[email protected]"], ["name", "Test"], ["state", "Test"], ["updated_at", "2015-02-15 01:22:50.461395"], ["zip", "Test"]]
(1.1ms) commit transaction
STRIPE API KEY: "sk_test_GaiwqF1sasWHuf6NZAu
def create
@user = User.new(user_params)
if @user.save
begin
Rails.logger.error("STRIPE API KEY: #{Stripe.api_key.inspect}")
@amount = 999
customer = Stripe::Customer.create(
:email => '[email protected]',
:card => params[:stripeToken]
def create
@user = User.new(user_params)
if @user.save
ExampleMailer.purchase_email(@user).deliver
ExampleMailer.sale_email(@user).deliver
begin
Rails.logger.error("STRIPE API KEY: #{Stripe.api_key.inspect}")
@amount = 999
def create
@user = User.new(user_params)
if @user.save
ExampleMailer.purchase_email(@user).deliver
ExampleMailer.sale_email(@user).deliver
begin
Rails.logger.error("STRIPE API KEY: #{Stripe.api_key.inspect}")
@amount = 999
customer = Stripe::Customer.create(
def create
@user = User.new(user_params)
if @user.save
ExampleMailer.purchase_email(@user).deliver
ExampleMailer.sale_email(@user).deliver
redirect_to root_path, notice: "Your Purchase Was Successful! You should recieve an email shortly."
else
render action: "new"
end
class ChargesController < ApplicationController
before_action :set_charge, only: [:show, :update]
def new
end
def create
# Amount in cents
@amount = 999