#syoxiss.-connect-react
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
Hi again, you need to provide a return_url, that's how you indicate to use that you want to manually handle the 3DS redirect yourself.
Is it possible to just let the front-end handle the confirmation if I create the the payment intent on the back-end that's on behalf of a merchant connected account, and attached the paymentMethodId that I cloned into that merchant connected account?
Yup, you use the stripeAccount option to initialize stripe.js as your Connected Account:
https://docs.stripe.com/js/initializing#init_stripe_js-options-stripeAccount
I tried it that way, but when I confirmed on my front-end that's using my platform's publishable key I got the error of No such payment_intent: 'pi_3Olvjl4gPM0BfUTk057jQtZ9'
Below is my code for the paymentIntent:
const paymentIntent = await this.stripe.paymentIntents.create({
amount: totalAmountInCents,
currency: 'aud',
payment_method: paymentMethodId,
confirm: false,
automatic_payment_methods: {
enabled: true,
allow_redirects: 'never',
},
metadata: {
email: decryptedCustomerEmail,
order_id: order_id,
vendor_id: connectedVendorAccountId,
referral_code: referralToken,
},
}, {
stripeAccount: connectedVendorAccountId,
});
Can you show me how you initialized stripe.js when you saw that behavior?
in the front-end or back-end?
Back-end code:
StripeConnectService,
{
provide: 'STRIPE',
useFactory: () => {
return new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2023-10-16',
});
},
},
],
Front-end:
const STRIPE_KEY = process.env.REACT_APP_STRIPE_KEY || '';
const stripePromise = loadStripe(STRIPE_KEY);
when render to screen
<Elements stripe={stripePromise}>
{children}
</Elements>
We don't have access to our merchant's Publishable key
So do we just confirm it in the back-end?
You don't need their publishable key, you use your platform's key and the stripeAccount option
how do I do that ? Can you give me a sample code in the front-end?
You pass stripeAccount when calling loadStripe, and set that to the ID of your Connected Account (the same ID you use when creating the intent from your backend)
I'll try it
syoxiss.-connect-react