question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsure how to create a token

See original GitHub issue

Hello!

I’m migrating over from tipsi-stripe so I think I’m mostly integrated with Stripe already but I cannot for the life of me figure out how to create a token in the way I was doing it before. I would appreciate anyone pointing me in the right direction. I scoured the docs, examples, and issues for the last two days but got very lost/confused and think I might’ve ended up on the wrong site? I tried running the example project to investigate further too but couldn’t get it to work.

In the app I’m working on, we allow users to add cards to use later (it’s a food delivery app so they shouldn’t have to add their card every time, only once). Before, I gathered the card info like this:

const params = {
        number: cardNumber,
        expMonth: Number(month),
        expYear: Number(year),
        cvc: security,
      };

and created a token (type object) like this:

const token = await stripe.createTokenWithCard(params);

I then sent the token to the backend where it talked to stripe which stored the card. The stripe-react-native function that seems to be analogous is createToken, which takes in an object where type is the only required field, and returns a token object and an error. Then what happens? How does createToken create a token that refers to a specific card with only the type (hypothetically) and not the number, cvc, etc? Is there another function that would let me take in my params and return an object with an id, or is this a much more complex problem?

I’m not using expo if that is important. I truly appreciate anyone’s help. I’m still learning so some things aren’t intuitive to me yet.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
gabriellendcommented, Jul 27, 2022

@charliecruzan-stripe I truly thank you for your time!

0reactions
charliecruzan-stripecommented, Aug 4, 2022

Card details not complete

This means CardField isn’t completely filled out. You should disable your Checkout button until the onCardChange callback fires with cardDetails.complete === true

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create a Crypto Token: Ultimate Guide for 2022
1. Many people who come to the crypto industry do not understand what is happening in blockchain technology and simply want to earn...
Read more >
How to Create a BSC Token in 5 Steps - Moralis Web3
Then, select the right-hand tab; 'Custom Token', and paste in your BSC token address in the prompted 'Token Contract Address' box. At this...
Read more >
How to Create an ERC20 Token the Simple Way - Toptal
The humble ERC20 token specification has become the de facto standard for Ethereum tokens. If you come across an Ethereum smart contract, chances...
Read more >
Create a token on Solana - Figment Learn
Create a token on the Solana blockchain with no coding needed. Solana ... which is stored as insecure plain text BIP39 Passphrase (empty...
Read more >
How to create an API token - PredictHQ
Now, give the token a description and select which scopes the token will have access to. If unsure leave all scopes enabled. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found