diff options
author | claucece <soficeli0@gmail.com> | 2015-09-16 00:13:01 -0500 |
---|---|---|
committer | claucece <soficeli0@gmail.com> | 2015-10-05 22:34:21 -0500 |
commit | 234cb9af5f11953f93910e79143fcb842e924248 (patch) | |
tree | 1aa27a027b13c43df1634d405f562ea2d2316b73 /engines/billing/app/controllers | |
parent | 0a8b671803c9517ea06d1f6c003db3bf16aed1d2 (diff) |
added payment_info, _customer_form, sucess instances
Diffstat (limited to 'engines/billing/app/controllers')
-rw-r--r-- | engines/billing/app/controllers/payments_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/billing/app/controllers/payments_controller.rb b/engines/billing/app/controllers/payments_controller.rb index ece967b..7c2b2d3 100644 --- a/engines/billing/app/controllers/payments_controller.rb +++ b/engines/billing/app/controllers/payments_controller.rb @@ -6,11 +6,16 @@ class PaymentsController < BillingBaseController end def confirm - result = Braintree::Transaction.sale( + @result = Braintree::Transaction.sale( amount: params[:amount], - payment_method_nonce: params[:payment_method_nonce] + payment_method_nonce: params[:payment_method_nonce], ) - redirect_to action: :new, flash: { success: "done" } + if @result.success? == true + redirect_to action: :new, notice: "Congraulations! Your transaction has been successfully!" + else + flash[:alert] = "Something went wrong while processing your donation. Please try again!" + redirect_to action: :new + end end def index |