I work with Stripe-managed accounts , I can create and receive accounts without problems, but I canβt add credit cards to any Account band. I use Stripe.js to handle the map creation process, so in the views I collect map fields and let Stripe.js do the dirty work of checking and processing. If everything is in order, I get the stripeToken from Stripe, which is used in my controller, to finally bind the managed account and the credit card.
However, I get this error:
Error creating card: (Status 400) You must provide a card that has the 'currency' field set when adding a card to a Stripe account.
Therefore, I suggested that I need to add a currency field in the form of a map, so I tried again, and then I had this error:
This card doesn't appear to be a debit card. (when submitting currency from views)
I already tried to look for an error, but for some reason there are no real links or previous answers.
Does anyone know how I can solve this problem?
Thanks in advance!
More details
Since I am testing my local machine, I use the Stripe card number: 4242424242424242 , which accepts any expiration date and CVC
Here is the code:
This is how I create a managed account:
def create_account(email) Stripe::Account.create( { :country => "US", :managed => true, :email => email, :default_currency => "USD" } ) end
This is how I add a map token to my accounts (based on API docs ):
def add_card_to_account(account_id, card_token) account = get_account(account_id) account.external_accounts.create(:external_account => card_token) end
ruby ruby-on-rails stripe-payments credit-card
mcKain
source share