I want to charge a customer using a connected account. Here's my flow
I get customer: null
in charge
response and the customer is not charged however the transaction goes through.
I'm creating token on the server-side using Customer ID. https://stripe.com/docs/connect/shared-customers
app.post('/custToken', (req, res) => {
stripe.tokens
.create(
{
customer: 'cus_CLpvRC6cGQRjpZ'
},
{
stripe_account: 'acct_1BxTzKEVtlEQzJtB'
}
)
.then(function(token) {
stripe.charges
.create(
{
amount: 1000,
currency: 'usd',
source: token.id
},
{
stripe_account: 'acct_1BxTzKEVtlEQzJtB'
}
)
.then(function(charge) {
});
});