#kt_error

1 messages ¡ Page 1 of 1 (latest)

visual flameBOT
#

👋 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/1227637083544227924

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

silver swallowBOT
#

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.

jovial eagle
#

Hello, can you send me the code for how you are setting up your payment element here?

verbal vine
#

sure one sec, also fyi when you click pay it does charge the correct amount so it seems to just be a display issue in that modal

#

just importing the PaymentElement in a React app and returning this:
<PaymentElement className={${isInitialRender ? "opacity-0 max-h-0" : "opacity-100"}} onChange={handleCardChange} onLoaderStart={handleReady} />

jovial eagle
#

Gotcha, and can you send me the code with how you are setting up elements before that?

verbal vine
#

import getStripe from "@utils/stripe/getStripe";
import { Elements } from "@stripe/react-stripe-js";
import { memo, useState } from "react";
import CheckoutForm from "./CheckoutForm";
import { StripeElementsOptions } from "@stripe/stripe-js";

const CardPayment = ({ options, productType }: { options: StripeElementsOptions, productType: checkout.ProductTypes }) => {
const [stripePromise] = useState(() => getStripe());

return (
<div data-cy="card-payment-wrapper">
<Elements
options={options}
stripe={stripePromise}
key={options?.clientSecret} >
<CheckoutForm productType={productType}/>
</Elements>
</div>
);
};

export default memo(CardPayment);

#

the PaymentElement is inside CheckoutForm here

visual flameBOT
verbal vine
#

I'm not sure what in our code would cause the amount to display as $0 in the google modal though? Google obviously knows the price since it charges the correct amount when the user clicks Pay

jovial eagle
#

One last piece, what is StripeElementsOptions here?

verbal vine
#

const newOptions: StripeElementsOptions = { appearance, clientSecret: paymentIntentData?.client_secret || "", locale: locale.language as StripeElementLocale };

sterile crystal
#

Hello! I'm taking over and catching up...

#

Can you give me the ID of the Payment Intent that client secret belongs to?

verbal vine
#

pi_3P42jvAFQUUIWEfk30jMTUkf

#

^ this is someone in prod who saw $0 but was charged the correct amount

#

maybe it's because we're using setup intent instead of payment intent...

sterile crystal
#

A Setup Intent will always be for $0, yeah.

#

To clarify, I want the specific ID of the Intent you're using to test with.

#

I do not want one in live mode that you didn't just create.

verbal vine
#

seti_1P43t1BCxN7wn3LggtSsIVmz

sterile crystal
#

That's a Setup Intent ID, and Setup Intents never have an amount, so the amount shown is going to be $0. That's expected and normal.

#

If you use a Payment Intent you should see the amount associated with that Payment Intent.

verbal vine
sterile crystal
#

That's not currently supported with Google Pay in the Payment Element, no.