Class: Dune::Balanced::Bankaccount::PaymentsController

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

Instance Method Summary collapse

Methods inherited from AccountsController

#new

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/dune/balanced/bankaccount/payments_controller.rb', line 3

def create
  attach_bank_to_customer
  update_customer

  payment = Dune::Balanced::Bankaccount::PaymentGenerator.new(
    customer,
    resource,
    resource_params
  )
  payment.complete

  redirect_to(*checkout_response_params(payment.status))
end

#update_customerObject



17
18
19
# File 'app/controllers/dune/balanced/bankaccount/payments_controller.rb', line 17

def update_customer
  Dune::Balanced::Customer.new(current_user, params).update!
end