import stripe using node js + typescript

You can refer to the repo on GitHub:
https://github.com/stripe/stripe-node

import Stripe from 'stripe';

const stripe = new Stripe('sk_test_...', {
  apiVersion: '2020-08-27',
});

const createCustomer = async () => {
  const params: Stripe.CustomerCreateParams = {
    description: 'test customer',
  };

  const customer: Stripe.Customer = await stripe.customers.create(params);

  console.log(customer.id);
};
createCustomer();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)