Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createToken function returns null for currency field for token object #1012

Closed
alxndr777 opened this issue Jun 23, 2022 · 2 comments
Closed

Comments

@alxndr777
Copy link

Describe the bug
React Native.
@stripe/stripe-react-native

I am trying to add a debit card for payout method for connect account in test mode.
I am using cards from here: https://stripe.com/docs/connect/testing#test-debit-card-numbers

When I submit the token to Stripe API I get this error in response:

{
"error": {
"message": "You must provide a card that has the 'currency' field set when adding a card to a Stripe account.",
"param": "external_account",
"type": "invalid_request_error"
}
}

That means that I don't send a currency field in request. For creating a token I am using createToken function.

const token_prep = {...card, currency: 'usd'}

console.log(token_prep); //Object {
"brand": "MasterCard",
"complete": true,
"currency": "usd",
"expiryMonth": 12,
"expiryYear": 24,
"last4": "8210",
"postalCode": "06514",
"validCVC": undefined,
"validExpiryDate": undefined,
"validNumber": undefined,
}

const { token, error } = await createToken(token_prep);

console.log(token); //Object {
"bankAccount": null,
"card": Object {
"address": Object {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postalCode": null,
"state": null,
},
"brand": "MasterCard",
"country": "US",
"currency": null,
"expMonth": 12,
"expYear": 2024,
"funding": "Debit",
"last4": "8210",
"name": null,
},
"created": "1655960704000",
"id": "tok_1LDiE0DEHw6rr3PAtTHtGVMt",
"livemode": false,
"type": "Card",
}

As you can see after passing card info and currency field to createToken function it returns null for currency field for token object which is causing error from Stripe. Can you please help me with this issue?

Thank you.

@charliecruzan-stripe
Copy link
Collaborator

This was fixed in #862, please upgrade to at least v0.5.0 to get the fix :)

@alxndr777
Copy link
Author

alxndr777 commented Jun 23, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants