Skip to content

Instantly share code, notes, and snippets.

@thomasstr
Created March 13, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasstr/5153722 to your computer and use it in GitHub Desktop.
Save thomasstr/5153722 to your computer and use it in GitHub Desktop.
def credit
render :action => 'index' and return unless @cc.valid?
@response = paypal_gateway.purchase(BILL_AMOUNT, @cc,
:ip => request.remote_ip,
:billing_address => params[:billing_address])
if @response.success?
@purchase = Purchase.create(:response => @response)
redirect_to :action => "complete", :id => @purchase
else
paypal_error(@response)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment