Created
November 19, 2020 06:43
-
-
Save OmarKhattab/4380dc0b83660cd009fdd1d060793e20 to your computer and use it in GitHub Desktop.
charge customer and transfer money to connected account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paymentMethods = await stripe.paymentMethods.list({ | |
customer: stripeCustomerID, | |
type: "card", | |
}); | |
const payment_method = paymentMethods.data[0].id; | |
const paymentIntent = await stripe.paymentIntents.create({ | |
payment_method_types: ["card"], | |
amount: 1000, | |
customer: stripeCustomerID, | |
payment_method, | |
currency: "usd", | |
application_fee_amount: 123, | |
confirm: true, | |
transfer_data: { | |
destination: stripeConnectID, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment