#hayfee_code

1 messages ¡ Page 1 of 1 (latest)

steel wolfBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293740852715454504

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

hidden goblet
cursive bobcat
#

Excellent I will read through this. Thank you!

#

the picures show a 'Continue' button and a checkbox to save the card data for future patments. Will I be able to change the text on he button to 'Add card' and remove the checkbox? They don't really make much sense for a view that is exclusively concerned with registering a card.

#

Also this line in the docs:
"This integration assumes that your checkout screen has two buttons: a Payment Method button that presents the PaymentSheet to collect payment details, and a Save button that saves the payment method."

is really confusing.

#

If they register a card they should be no situation where the user is concerned with selecting a payment method after the fact in my app.

hidden goblet
#

are you using iOS, Android or React Native?

cursive bobcat
#

react native

hidden goblet
#

gimme a second to take a look

cursive bobcat
#

Appreciate it. Basically I just want to create a sensible view that is concerned with registering a credit card for a customer. I plan on creating the customer on the backend when the user creates and account. And then on another day the user can click a button to initiate a transaction.

#

knowing that they already registered their card prior.

hidden goblet
#

so you won't be able to change the button Continue from what I can see. However, you won't see the save for future payment checkbox. That screenshot in our docs isn't correct

cursive bobcat
#

ok it's good the checkbox wont be there.

hidden goblet
#

if you only offer adding a card, this as an example, is what I'm seeing

cursive bobcat
#

nice

#

when the user hits continue is a token returned in the response that I can then send to the backend and store in my database?

hidden goblet
cursive bobcat
#

Ok I have a enough to work with at this point. Huge help. Thanks

cursive bobcat
#

OK I'm back

#

https://docs.stripe.com/payments/accept-a-payment-deferred?platform=react-native&integration=paymentsheet-flowcontroller

If I understand correctly, there's a lot of information in there that isn't relevant to rendering that form that yo showed above.

Step 3 seems like something that is only relevant in a web brower, right?

step 4 I plan on doing on the backend when the user created an account. Is that not advisable in thie workflow? Should I create the customer with javascript on the front end..

step 5: mentions "When a customer taps Payment Method, call presentPaymentSheet to collect payment details. When this completes, update your UI again with the paymentOption property."

const { error, paymentOption } = await presentPaymentSheet();

If simply call
initializePaymentSheet();
and
const { error, paymentOption } = await presentPaymentSheet();

will that display the form you showed me above?

it feels like these docs are lacking a lot of context

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

hidden goblet
#

Step 3 seems like something that is only relevant in a web brower, right?

No, Step 3 is actually relevant - iOS requires a return URL to be set to be able to display payment methods that require a redirect. It's probably not as relevant for you if you are only planning to offer card payments

#

step 4 I plan on doing on the backend when the user created an account. Is that not advisable in thie workflow? Should I create the customer with javascript on the front end..

Can you elaborate more on what specifically you're trying to do here? Are you trying to create a Customer?

cursive bobcat
#

I"m trying to piece things together at this point. Here is what I would like to achieve.

  1. user creates account on mobile app

  2. backend create accounts record in my database and upon success I reach out to stripe to create a stripe customer record and I store the response data in my data base so that I later user it when executing a purchase transaction.

  3. user arrives at a form in my app to register credit card. (All I need is the code that is relevant to successfully initializing the form, rendering it and submitting it)

  4. User clicks a purchase button in my app and I execute a transaction on my backend by hitting stripes api. (I believe I need a payment method token to be stored in my database before this happens to that I can sucessfully make the payment call) I'm hoping the setup_intent.succeeded webhook that I listen for on my backend provides this token to me after the user has successful credit card submission.

hidden goblet
#

alright that sounds fine. Specifically regarding your question of creating a Customer - that can only be done via the backend since it needs a secret key

#

regarding step 5, i'll suggest trying to build a PoC then you can see how it works in detail. the presentPaymentSheet() should display the form I showed