#gggpound_docs
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1260245697534492742
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
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.
- gggpound_docs, 1 day ago, 12 messages
- gggpound_docs, 6 days ago, 19 messages
- gggpound_docs, 6 days ago, 37 messages
Hi there 👋 is this regarding leveraging our Payment Element? That element typically doesn't display amounts, and instead you would add your own field to the page for showing that to your customers.
The Payment Element does launch some modals where totals may be displayed though, is that what you're asking about?
this is my embed checkout page .and how to display amount ?
That looks like an embedded checkout session where mode is setup, so there isn't an amount to show. Are you trying to process a payment instead of saving payment method details?
Do you provide a realistic amount of control?
Can you clarify what that means?
save payment and payment , all need display amount .
Our Checkout Sessions that are running in setup mode do not show amounts, because we do not know what you plan to charge the customer later. In those cases, you'd want to add your own field for showing the future total you plan to charge your customer to your page where you're embedding the Checkout Session.
how to add my field for showing the future total ?
That depends on the tooling you're using to build your site, and not something I'd be able to offer much guidance on.
should I calculate the amount myself? Instead of getting this amount from stripe?
To clarify, the field I'm referring to adding would not be added inside of the Checkout Session. You would add your own field to the page where you're embedding the Checkout Session, along with any necessary code to retrieve the amount you plan to charge from your server.
what is this page ?
I'm not sure, do you typically rely on Stripe to calculate the amounts your customers pay?
the red border range.
That's a Checkout Session, where mode is payment
i can't find mode attr ,where is ?
Where are you creating the Checkout Session object?
It's a parameter that you can specify in the request to create the Checkout Session:
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-mode
This is how I use it, how should I configure it to display the amount?
like this
None of this code seems to line up. You mentioned embedded checkout, but the second most recent screenshot looks like it's using the Payment Element instead. Then the most recent screenshot doesn't seem to be creating a Checkout Session, but is rather directly creating a Payment Intent (which is then stored in a variable named subscription, which is a little confusing).
Are you following a guide for building this integration?
i use subscription mode ,rather than payment
Does the subscription model show the amount?
Yes it does, which is why I still don't think that's what you're using.
the session is created by server, and is there any work should be doing by front if i want to display amount .
I would recommend starting here. This guide walks through how to build a basic integration that uses an embedded Checkout Session to accept a payment:
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=embedded-form&client=react
It explains which parts need to happen on your server, and which parts are run client-side.
When I use the <Payment> component, does the amount appear, depending on how the session is generated?
What is the <Payment> component you're referring to? That's not a component I recognize as being one we offer.
Ah the PaymentElement component. No the Payment Element does not show an amount.
https://docs.stripe.com/stripe-js/react#element-components
is there any components help me show the amount?
Let's take a step back. What is the flow you're trying to build? Are you wanting to process a single payment, collect payment method details to facilitate the processing of future payments, or are you trying to build a Subscription integration? (or possibly something else?)
build a Subscription integration
Gotcha, and do you already know what you want to use for your frontend component? You asked about embedded checkout initially, but seem to keep drifting to the Payment Element now.
If you haven't, our three most common integration paths for Subscriptions are shown here:
https://docs.stripe.com/billing/subscriptions/build-subscriptions?platform=web&ui=embedded-form
(that link should take you to the embedded checkout flow, you can see the hosted checkout session flow via the Stripe-hosted page tab, or a Payment Element flow via the Custom flow tab)
what the difference of checkout and payment? on the example, it use checkout component, but why the client secret work normal on PaymentElement?
There two different integration styles, the first uses embedded Checkout Sessions, the second uses the Payment Element in conjunction with directly creating the underlying objects.
but why the client secret work normal on PaymentElement?
Can you elaborate on what this means? What code are you running, what behavior are you seeing? Offhand this doesn't sound right or expected.
I understand the difference. Checkou is fully automatic.
Payment element is to put together their own payment element, and finally call their own API to complete the payment
I am using Payment element and I am having trouble displaying the item amount.
、
I don't understand why I'm being so specific, but you don't seem to understand. .
The Payment Element doesn't display an amount, as mentioned in my first message.
If you want to display an amount on your own page where you've embedded the Payment Element, then you will need to add your own field to your page for that, and any the necessary code to retrieve the amount from where you're determining what that is.
If I want to know what the amount is, do I need to return this field on my server and create a new Dom in myself to render it?
Yes, if you want to display amount details for the flow you've described, you need to add your own fields to your page for that and populate them accordingly.
In the second option, I could give up using Payment Element and use Checkout instead? ··
Sure
get,i will try