Skip to content

Instantly share code, notes, and snippets.

@dayhaysoos
Created April 18, 2021 15:56
Show Gist options
  • Save dayhaysoos/09d37eaf14b410e7d86309894c5d1e5a to your computer and use it in GitHub Desktop.
Save dayhaysoos/09d37eaf14b410e7d86309894c5d1e5a to your computer and use it in GitHub Desktop.
require("dotenv").config({ path: "../.env" });
const stripe = require("stripe")(process.env.STRIPE_API_SECRET);
const BASE_URL = process.env.URL;
exports.handler = async () => {
const account = await stripe.accounts.create({
type: "standard",
});
const accountLinks = await stripe.accountLinks.create({
account: account.id,
refresh_url: "https://dayhaysoos.com",
return_url: `${BASE_URL}/stripe-signup-confirmation`,
type: "account_onboarding",
});
return accountLinks;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment