-
Notifications
You must be signed in to change notification settings - Fork 263
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
Unsure how to create a token #1059
Comments
createToken actually takes a couple different input options. But for cards, it relies on the CardField or CardForm components and pulls card data directly from there. This way, you aren't handling card data yourself and thus saves you a lot of time and effort around PCI compliance :) so I highly recommend going that route Basically- render CardField and when the user fills that out, then you can create the token with |
@charliecruzan-stripe |
Totally baked in, you don't need to worry about it :) And yes- you have to change your UI to incorporate CardField. Sorry for that, but it's definitely going to end up saving you lots of time in the long run since it makes your PCI approval process much easier: https://stripe.com/guides/pci-compliance. (Basically your requirements are far fewer) |
@charliecruzan-stripe I truly thank you for your time! |
@charliecruzan-stripe I'm not getting the token. I don't know what i'm doing wrong here. below is my code. I'm trying to integrate stripe in my react-native app.
below function will run on press button
I'm getting below error when i press checkout button:
|
This means CardField isn't completely filled out. You should disable your |
currently i am facing same issue you faced. can you please help , how you solved this. |
@shashigit107 I added the
And then a button below that:
I call
|
@gabriellend @charliecruzan-stripe not working for me, tried both approached I tried multiple options as mentioned here is my code
#1594 |
Is there an example of this for Swift/SwiftUI? I'm trying to create a token but I can only get the last four from STPPaymentMethod and it seems I need the full card number to create a token. cc @charliecruzan-stripe |
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:
and created a token (type object) like this:
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 wheretype
is the only required field, and returns a token object and an error. Then what happens? How doescreateToken
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.
The text was updated successfully, but these errors were encountered: