#zyondev-reactnative
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- zyondev, 10 hours ago, 4 messages
- zyondev-default-pm, 16 hours ago, 36 messages
- zyondev, 18 hours ago, 10 messages
- zyondev-payment-sheet, 19 hours ago, 15 messages
hello, what guide are you following? I see you've had quite a few questions over the last day so want to make sure I'm setting you up on the right track so you don't have further confusion
one sec
so the integration you want is what we call "deferred integration"
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=react-native&type=payment
in this, you have PaymentSheet create a PaymentMethod first, which you then confirm on your server
have a look at that and after completing step 4, you'll have the PaymentMethod
@jolly lake let us know if you have questions, otherwise we'll archive this thread
are you using CardField or PaymentSheet?
ignore "tokens" entirely, the new object is PaymentMethod
I’m using both in different places
there's a function in stripe iOS SDK called createPaymentMethod to which you pass an instance of STPPaymentMethodParams obtained from CardField
and the CardField has a cardParams property: https://stripe.dev/stripe-ios/stripepaymentsui/documentation/stripepaymentsui/stppaymentcardtextfield/cardparams
For PaymentSheet, I need to forget about tokens right?
for both
Tokens are no longer relevant
both CardField and PaymentSheet create PaymentMethods
which you use with SetupIntents or PaymentIntents or Subscriptions
Tokens are only relevant for PCI compliant methods?
Or are token’s completely deprecated system wide?
PaymentMethods are (better) Tokens basically
What’s about sources?
Tokens and Sources are deprecated, PaymentMethods does what both did
Got it. Thanks
let us kow if there's any more questions, otherwise we'll archive the thread
Ok
It’s says this one is deprecated
and the CardField has a cardParams property: https://stripe.dev/stripe-ios/stripepaymentsui/documentation/stripepaymentsui/stppaymentcardtextfield/cardparams
👋 hoppoing in here since hmunoz has to head out
Hey
Are you asking whether you can still use cardParams? Is there a reason you don't want to use paymentMethodParams?
sorry, I recommended that, that's what zyondev is flagging
my mistake, yes paymentMethodParams is the right param to use
Ok all of this works with react native?
Yes, it should work with react native - you'd use createPaymentMethod (https://stripe.dev/stripe-react-native/api-reference/index.html#createPaymentMethod) with PaymentMethod.CreateParams (https://stripe.dev/stripe-react-native/api-reference/modules/PaymentMethod.html#CreateParams)
ok let me try
ok i got it
so for connected accounts...
do i still need a token for... const connectedAccount = await stripe.accounts.createExternalAccount(stripeConnectedAccountId, { external_account: tokenId });
how do i handle stripe.accounts.createExternalAccount?
Do i just use paymentMethodId with paymentIntent to send a connected user a payout?
No, for payouts w/ connect you'd still want a token (which we need to create the external account)
zyondev-reactnative
so how can i get token from payment method object? previously i was generating token from raw card data
You wouldn't get a token from a payment method object. Instead, you'd use createToken (https://stripe.dev/stripe-react-native/api-reference/index.html#createToken) just for the external accounts flow
Documentation for @stripe/stripe-react-native
so for external accounts flow, i can pass raw card data to my api server?
or do i can createToken instead of calling createPaymentMethod on client side?
It'd be client-side. You really shouldn' t be passing raw card details to your server at all unless you're prepared to deal with PCI compliance
ok ill call createToken instead of createPaymentMethod
Yes - again, this should jsut be for your external account creation flow. For payments you'll still want createPaymentMethod
ok so i can call both if i wanted to
?
for payments...createPaymentMethod
for payouts... createToken
yup
cool