#schroder-paymentintent-connect

1 messages · Page 1 of 1 (latest)

errant mortarBOT
fallen wind
#

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,
            });```
steel dagger
#

schroder-paymentintent-connect

#

When you do this, you need to make sure that client-side you also use the Stripe-Account header for this

fallen wind
#

Let me check 2 sec

#

ok, so it is this is: acct_1NYW3MPDlktRMU8r?

steel dagger
#

stripeAccount: reffered_account.stripe_id,

#

you have this in your server-side code

#

you pass the same id client-side

fallen wind
#

ok, nice thanks for the help

steel dagger
#

sure thing! Try it first to make sure it works and let me know if not!

fallen wind
#

ok, ill let you know very soon

steel dagger
#

no rush, I'm here to help!