const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment of $100, and automatically split funds between
// your platform and the seller.
const paymentIntent = await stripe.paymentIntents.create({
amount: 10000,
currency: 'usd',
description: 'Payment',
payment_method: 'pm_card_bypassPending',
off_session: true,
confirm: true,
transfer_data: {
// Send $80 to the seller after collecting a 20% platform fee.
amount: 8000,
// The destination of this charge is the seller's Stripe account.
destination: account.id
}
});