Class: Dune::Balanced::Bankaccount::ConfirmationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/dune/balanced/bankaccount/confirmations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/dune/balanced/bankaccount/confirmations_controller.rb', line 12

def create
  verification.confirm(params[:confirmation][:amount_1],
                       params[:confirmation][:amount_2])

  flash.notice = t('.messages.success')
  redirect_to main_app.payments_user_path(current_user)
rescue Balanced::BankAccountVerificationFailure
  # Balanced does not decrease BankAccountVerification#attempts_remaining
  # after a failure
  @attempts_remaining = verification.attempts_remaining - 1
  flash.alert = t('.messages.unable_to_verify')
  check_for_attempts_remaining
  redirect_to new_confirmation_path
end

#newObject



6
7
8
9
10
# File 'app/controllers/dune/balanced/bankaccount/confirmations_controller.rb', line 6

def new
  @verification  = verification
  @contributions = current_user.contributions.with_state(:waiting_confirmation)
  render layout: 'application'
end