#kt_error
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/1227637083544227924
đ Have more to share? Add more 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.
- kt_error, 17 hours ago, 6 messages
Hello, can you send me the code for how you are setting up your payment element here?
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} />
Gotcha, and can you send me the code with how you are setting up elements before that?
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
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
One last piece, what is StripeElementsOptions here?
const newOptions: StripeElementsOptions = { appearance, clientSecret: paymentIntentData?.client_secret || "", locale: locale.language as StripeElementLocale };
Hello! I'm taking over and catching up...
Can you give me the ID of the Payment Intent that client secret belongs to?
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...
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.
seti_1P43t1BCxN7wn3LggtSsIVmz
I see similar issues here: https://github.com/flutter-stripe/flutter_stripe/issues/1250 and here: https://github.com/stripe/stripe-react-native/issues/1436
it seems like it is fixable? I updated all of our stripe package versions locally and am still seeing the same behavior
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.
it seems like there's an option to add a label and amount to the google pay modal with stripe for android using setup intents https://github.com/stripe/stripe-android/pull/7191, is there no way this could be added for stripe web?
That's not currently supported with Google Pay in the Payment Element, no.