I'm building an app in ruby on rails within which the merchant provides his bank account info and his payments are supposed to be processes monthly.

I'd like to achieve this using stripe. How do i add/create a bank account associated with a stripe customer?

First we need to find the stripe customer and after that we can add a new bank account in that customer account. You can refer this code for more details

# Add bank account data on stripe for patient users
def add_bank_account
  customer = Stripe::Customer.retrieve(stripe_customer_id)
  customer.sources.create({:source => {:object => "bank_account", :account_number => bank_account_number,  :country => country,  :currency => "USD", :account_holder_name => account_holder_name, :account_holder_type => account_holder_type, :routing_number => routing_number }})
end

account_holder_type can be company or individual

In order to start the payment process you need to verify new bank account

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.