Class: StripeWrapper::ChargesController
Instance Method Summary
collapse
#main_app_current_user
#stripe_get_amount, #stripe_pay, #stripe_set_amount, #stripe_wrapper_path
Instance Method Details
#index ⇒ Object
20
21
22
|
# File 'app/controllers/stripe_wrapper/charges_controller.rb', line 20
def index
@charges = Charge.all.order("ID DESC")
end
|
#process_payment ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/stripe_wrapper/charges_controller.rb', line 6
def process_payment
@user = main_app_current_user
token = params[:stripe_token]
@amount = stripe_get_amount
redirect_url = params[:redirect_path]
@customer = Customer.find_or_create_customer(token,@user)
@charge = @customer.process_new_charge(@amount)
return redirect_to redirect_url+"?charge_id=#{@charge.id}"
end
|