// Require the Stripe library with a test secret key.
const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment intent to start a purchase flow.
let paymentIntent = await stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
description: 'My first payment',
});
// Complete the payment using a test card.
paymentIntent = await stripe.paymentIntents.confirm(paymentIntent.id, {
payment_method: 'pm_card_visa',
});
// Click “▶ run” to try this code live and create your first payment.
// Require the Stripe library with a test secret key.
const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment intent to start a purchase flow.
let paymentIntent = await stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
description: 'My first payment',
});
// Complete the payment using a test card.
paymentIntent = await stripe.paymentIntents.confirm(paymentIntent.id, {
payment_method: 'pm_card_visa',
});
// Click “▶ run” to try this code live and create your first payment.
Text Goes Here