#inderjit-janjua_code
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/1290575582211346497
đ 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.
- inderjit-janjua_api, 5 days ago, 14 messages
- inderjit-janjua_api, 5 days ago, 10 messages
Sorry I need to make an update
The code is this
<Elements
stripe={stripePromise}
// options={{
// clientSecret: clientSecret, // Pass the client secret here
// }}
options={{
mode: "payment",
amount: convertToSubcurrency(amount), // Convert amount to subcurrency
currency: currency, // Set the currency
}}
>
<CheckoutComponent
paymentIntentId={paymentIntentId} // Pass the payment intent ID
clientSecret={clientSecret} // Pass the client secret for authentication
amount={amount} // Pass the original amount
connectedAccountId={connectedAccountId} // Pass the connected account ID to the component
/>
</Elements>
The create payment intent call is made on the connected account as expected
The confirm payment intent call isn't (I'll provide the code soon)
/ Submit the PaymentElement and confirm the payment
const { error } = await stripe.confirmPayment({
elements,
clientSecret, // Pass the client secret here
confirmParams: {
return_url: `${getBaseUrl()}/payment/payment-success?amount=${amount}`,
},
});
Have you added connected account ID to stripeAccount when initialising stripe instance? https://docs.stripe.com/connect/authentication#adding-the-connected-account-id-to-a-client-side-application
Its because i'm passing in the client secret
That might be it
Let me test
What does this do
const stripe = useStripe();
This is the stripe hook to get the stripe instance that has already been initialised
I'd recommend following this Direct Charges guide for the payments made on connected account: https://docs.stripe.com/connect/direct-charges?platform=web&ui=elements&client=react