Skip to content

Instantly share code, notes, and snippets.

@ademcan
Created October 21, 2019 08:39
Show Gist options
  • Save ademcan/c985df4d3f9c3065afa5a96557e22db7 to your computer and use it in GitHub Desktop.
Save ademcan/c985df4d3f9c3065afa5a96557e22db7 to your computer and use it in GitHub Desktop.
stripe.paymentMethods.create({
customer: 'cus_XXXXXXX',
payment_method: 'pm_XXXXXXX',
},{
stripe_account: 'acct_XXXXXXX',
}).then(function(paymentMet) {
stripe.paymentIntents.create({
amount: 1000,
currency: 'chf',
application_fee_amount: 123,
payment_method: paymentMet.id,
confirm: false,
capture_method: 'manual'
},{
stripe_account: 'acct_XXXXXXX',
}, function(err, paymentIntent) {
// send client_secret to the front-end
console.log(err)
res.json({paymentIntent.client_secret})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment