#hayfee_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
hello! I believe this is the tab you would want to look at instead (note that type=setup in the URL ) https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=setup
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.
are you using iOS, Android or React Native?
react native
gimme a second to take a look
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.
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
ok it's good the checkbox wont be there.
if you only offer adding a card, this as an example, is what I'm seeing
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?
the PaymentMethod id isn't returned in the response on the frontend for mobile. You'll receive a result response but that doesn't have the PaymentMethod id. You should ideally listen for the webhook event : https://docs.stripe.com/api/events/types#event_types-setup_intent.succeeded and process it in your backend
Ok I have a enough to work with at this point. Huge help. Thanks
OK I'm back
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
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?
I"m trying to piece things together at this point. Here is what I would like to achieve.
-
user creates account on mobile app
-
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.
-
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)
-
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.
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