#schroder-paymentintent-connect
1 messages · Page 1 of 1 (latest)
This is the code: ```const reffered_account = await usersController.getRefferedCustomer(req.oidc.user.email);
let paymentIntent;
console.log(reffered_account);
if (!reffered_account.error) {
paymentIntent = await stripe.paymentIntents.create({
amount: parseInt((result.estimate.result.costs.total * 100).toFixed(0)),
currency: "usd",
automatic_payment_methods: {
enabled: true,
},
application_fee_amount: parseInt((result.estimate.result.costs.total * 100).toFixed(0)) - parseInt((result.estimate.result.costs.surplus * (100 - (100 * reffered_account.percentage))).toFixed(0)),
metadata: { payment_intents_id: id.result }
}, {
stripeAccount: reffered_account.stripe_id,
});```
schroder-paymentintent-connect
@fallen wind I assume you are using Direct Charge https://stripe.com/docs/connect/direct-charges where you create the PaymentIntent on the connected account with the Stripe-Account header based on your code
When you do this, you need to make sure that client-side you also use the Stripe-Account header for this
yes, correct
you likely missed this step: https://stripe.com/docs/connect/authentication#adding-the-connected-account-id-to-a-client-side-application
stripeAccount: reffered_account.stripe_id,
you have this in your server-side code
you pass the same id client-side
ok, nice thanks for the help
sure thing! Try it first to make sure it works and let me know if not!
ok, ill let you know very soon
no rush, I'm here to help!