Created
April 18, 2021 15:56
-
-
Save dayhaysoos/09d37eaf14b410e7d86309894c5d1e5a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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