10

I'm working with Stripe managed accounts, I can create and retrieve Accounts without problem, but I can not add credit cards to any Stripe Account. I'm using Stripe.js to deal with the card creation process, so in the views I collect the card fields and let Stripe.js do the dirty job of validation and processing. If everything is ok, I receive a stripeToken from Stripe which is used in my controller to finally associate the managed account and the credit card.

However I receive 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 assumed I needed to add the currency field in the Card form, 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 search the error, but somehow there are no real references or previous answers.

Does anyone know how I can resolve this problem?

Thanks in advance!


Details

Since I'm testing on my local machine, I'm using Stripe's test Card number: 4242424242424242 which accepts any expiration date and CVC

Here is some code:

This is how I create my managed account:

def create_account(email)
  Stripe::Account.create(
    {
      :country => "US",
      :managed => true,
      :email => email,
      :default_currency => "USD"
    }
  )
end

This is how I add the card token to the accounts (based on the 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
Ywain
  • 16,854
  • 4
  • 51
  • 67
mcKain
  • 437
  • 5
  • 16

2 Answers2

22

Stripe accounts are payment destinations -- they can receive funds, but not provide them.

(Customers are payments sources, i.e. they provide funds.)

Currently, Stripe accounts can use two different sorts of external accounts as payout methods (i.e. to retrieve their funds):

  • bank accounts
  • debit cards (only in the US)

So you can add a debit card as an external account to a US custom account, but not a credit card as those cannot be used to receive funds.

In order to use a debit card as a payout method, the card token must have been created with Stripe.js, using the currency parameter. Since this is only possible for US accounts at the moment, the value for the currency parameter must be "usd". Here's a simple example of a Stripe.js form that uses the currency parameter: https://jsfiddle.net/ywain/rprufyg5/

In test mode, you would need to use one of the debit testing card numbers, e.g. 4000 0566 5566 5556 or 5200 8282 8282 8210.

Ywain
  • 16,854
  • 4
  • 51
  • 67
2

I have the same issue. I have contacted them i found some solution for me. I am generating token using iOS Stripe SDK. Its worked for me.

At this time Stripe only supports US-based USD debit cards for card external_accounts. The way you can add the currency parameter to your token is by adding a direct call to

self.paymentTextField.cardParams.currency = @"usd"; 

after initializing the STPPaymentCardTextField in your PaymentViewController, like such:

// Setup payment view
STPPaymentCardTextField *paymentTextField = [[STPPaymentCardTextField alloc] init];
paymentTextField.delegate = self;
paymentTextField.cursorColor = [UIColor purpleColor];
self.paymentTextField = paymentTextField;
self.paymentTextField.cardParams.currency = @"usd";
[self.view addSubview:paymentTextField];
Piyushkumar
  • 418
  • 4
  • 10