#arjun_intent-integration
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/1282703374436929608
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello
Hi there ๐ sorry, but I'm not sure I'm grasping what you're trying to ask. Can you elaborate more on what you're trying to accomplish?
This my old code with stripe Card element
This is my update code with implementation with stripe paymentElement
in new code when i click on Continue to payment always it redirect into payment failure url
const { error: paymentError } = await stripe.confirmPayment
It throw me catch block why this happen??
i have payment flow
Sorry for the delay, the server is quite busy right now. Working on reviewing what you shared.
What is the error that is being caught?
CheckoutForm.js:554 Error creating token: IntegrationError: Invalid value for stripe.confirmPayment(): elements should have a mounted Payment Element or Express Checkout Element.
That makes it sound like the elements variable you pass to confirmPayment is empty or the Payment Element it holds isn't mounted.
Is the button you're referring to clicking one that is on the page of your second screenshot?
Since this is React, my suspicion is that some state is changing which is causing your component which renders the Payment Element to be refreshed, removing the Payment Element that you had mounted.
Yes
when i click on continue to payment btn whole thing are submited with client profile details with promocode based payment update
Okay, then I'd suggest adding logging to your code to figure out when the Payment Element is being unmounted, or when the component rendering it is being re-rendered. It sounds like something in your code is causing the Payment Element to be destroyed before it's used.
how can i will check it with help of console??
๐ stepping in here
Are you trying to use the intent-first flow here? Where you create your PaymentIntent before you render Payment Element and pass that to your Elements Component?
Or the deferred-intent flow where you create your PaymentIntent upon your customer clicking pay?
I want deferred-intent flow please give doc for reference
now as per my requierment i want
Are you trying to use the intent-first flow here? Where you create your PaymentIntent before you render Payment Element and pass that to your Elements Component?
for that pls refer a doc
arjun_intent-integration
pls review my given code and give me suggestion where i have to make a mistake for implementation payment element if i want to achieve same functionality which was present in my old code with use of stripe cardElement
@frosty lark that's not how we work. We're not freelancers you hire to fix your code. We're happy to help answer clear questions that you have but we're not your debuggers
sorry, respected member i does not meaning that
I'm happy to help but I can't debug hundreds of lines of code you wrote/control The first step is to understand what exact integration path you are using and what is not working
my intent to successfully implemetation of stripe in my website
I'm sorry but this doesn't really give me anything. I know you're trying to make things work
My advice is to pause and try to implement PaymentElement on its own first. Not in your entire complex React application that will be impossible to debug
ok i understand i work as per you suggest
in paymentElement always i want to make payment intent for displaying paymentElement??
It's a choice, that's exactly what my colleague was explaining earlier
https://docs.stripe.com/payments/accept-a-payment-deferred is the canonical doc if you don't want to create a PaymentIntent upfront
boc clientsecret key is required for paymentElement render which is i got after a calling backend server payment intent creation api
no it's not required, it's optional depending on your integration path. So you are supposed to choose how you want to integrate first and then follow along that exact doc end to end
ok first i go through given refference
Than client secret key is must required for displaying paymentElement in my ui??
I don't know what that mean "given reference".
I'm sorry we explained 3 times now that this is optional
If you create a PaymentIntent upfront follow: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements
If you do not create a PaymentIntent upfront follow: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
ok i underStand but when i render payment element with getting clientSecret key in clientside it do not display payment element ui
So my question is that when i goes to checkout page without createing payment intent and client secret key
it is possible to display stripe paymentElement??
I'm sorry you say you understand but you ask the same question over and over ๐ฆ
You can render PaymentElement without a client_secret by reading the specific docs for this: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
i facing below error
{
"type": "validation_error",
"message": "No valid payment method types for this configuration. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods) and that the amount (1) is not lower than the currency (usd) minimum: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts."
}
the error message seems extremely clear. Have you read it? And did you read the docs associated with it?
yes but in doc says that byDefault set card element as a default element than why this error is occured?
the amount is 1. That means 1 cent. The docs linked clearly explain there's a minimum amount we support of 50 cents. Sorry I'm pushing because you do need to take a few minutes to read the docs we link you to