#gggpound_docs

1 messages · Page 1 of 1 (latest)

fading dewBOT
#

👋 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.

south pumiceBOT
#

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.

vestal ether
#

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?

loud adder
#

this is my embed checkout page .and how to display amount ?

vestal ether
#

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?

loud adder
#

Do you provide a realistic amount of control?

vestal ether
#

Can you clarify what that means?

loud adder
#

save payment and payment , all need display amount .

vestal ether
#

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.

loud adder
#

how to add my field for showing the future total ?

vestal ether
#

That depends on the tooling you're using to build your site, and not something I'd be able to offer much guidance on.

loud adder
#

should I calculate the amount myself? Instead of getting this amount from stripe?

vestal ether
#

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.

loud adder
#

what is this page ?

vestal ether
loud adder
#

the red border range.

vestal ether
#

That's a Checkout Session, where mode is payment

loud adder
vestal ether
#

Where are you creating the Checkout Session object?

loud adder
#

This is how I use it, how should I configure it to display the amount?

vestal ether
#

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?

loud adder
#

i use subscription mode ,rather than payment

#

Does the subscription model show the amount?

vestal ether
#

Yes it does, which is why I still don't think that's what you're using.

loud adder
#

the session is created by server, and is there any work should be doing by front if i want to display amount .

vestal ether
loud adder
#

When I use the <Payment> component, does the amount appear, depending on how the session is generated?

vestal ether
#

What is the <Payment> component you're referring to? That's not a component I recognize as being one we offer.

loud adder
vestal ether
#

Ah the PaymentElement component. No the Payment Element does not show an amount.

loud adder
vestal ether
#

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?)

loud adder
#

build a Subscription integration

vestal ether
#

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)

Create and manage subscriptions to accept recurring payments.

loud adder
#

what the difference of checkout and payment? on the example, it use checkout component, but why the client secret work normal on PaymentElement?

vestal ether
#

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.

loud adder
#

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. .

vestal ether
#

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.

loud adder
#

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?

vestal ether
#

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.

loud adder
#

In the second option, I could give up using Payment Element and use Checkout instead? ··

vestal ether
#

Sure

fading dewBOT
loud adder
#

get,i will try