Failed to add credit card to Stripe Managed Account

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 
+8
ruby ruby-on-rails stripe-payments credit-card
source share
2 answers

Stripe accounts are payment recipients β€” they can receive funds but not provide them.

( Customers are sources of payments, that is, they provide funds.)

At present, Stripe accounts can use two different types of external accounts as payment methods (i.e., to withdraw funds):

  • bank accounts
  • debit cards (US only)

Thus, you can add a debit card as an external account to a US user account, but not a credit card, since they cannot be used to receive funds.

To use a debit card as a payment method, you need to create a token using Stripe.js using the currency parameter. Since this is only possible for US accounts, the value for the currency parameter should be "usd" . Here is a simple example of a Stripe.js form that uses the currency parameter: https://jsfiddle.net/ywain/rprufyg5/

In test mode, you will need to use one of the debit number of test cards , for example. 4000 0566 5566 5556 or 5200 8282 8282 8210 .

+12
source share

I have the same problem. I contacted them and found a solution for me. I generate a token using the iOS Stripe SDK. It worked for me.

Stripe currently only supports US dollar debit cards for external cards. The way to add a currency parameter to your token is to add a direct call to

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

after initializing STPPaymentCardTextField in your payment controller, for example:

 // 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]; 
+1
source share

All Articles