Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update stripe-connect.ts

Kiran Kb2cec77a9076
diff --git a/apps/web/scripts/stripe-connect.ts b/apps/web/scripts/stripe-connect.ts
index a82b9e51a2..3d36d97ebe 100644
--- a/apps/web/scripts/stripe-connect.ts
+++ b/apps/web/scripts/stripe-connect.ts
@@ -12,60 +12,16 @@ export const stripe = new Stripe(`${process.env.STRIPE_SECRET_KEY}`, {
},
});
-const partner = {
- stripeCustomerId: "cus_RNro3sEDvvLA1h",
-};
-
-const affiliate = {
- country: "US",
- firstName: "Affiliate",
- lastName: "Mac",
- email: "[email protected]",
- connectedAccountId: "acct_1PxvAwFZTaDk8h7W",
-};
-
-const payout = {
- amount: 1500,
- currency: "usd",
-};
-
async function main() {
// await createExpressAccount();
- // await createLoginLink();
- // await createPayout();
- // await createCustomer();
-
- try {
- const account = await stripe.accounts.update("acct_1QVUkdPJLmUm0iMu", {
- email: "[email protected]",
- });
-
- console.log("Updated account", account);
-
- // const account = await createConnectedAccount({
- // name: "Kiran US",
- // email: "[email protected]",
- // country: "US",
- // });
-
- // const account = await createConnectedAccount({
- // name: "Kiran IN",
- // email: "[email protected]",
- // country: "IN",
- // });
-
- console.log("Created connected account", account);
- } catch (error) {
- console.error(error);
- }
}
const createExpressAccount = async () => {
const account = await stripe.accounts.create({
type: "express",
business_type: "individual",
- country: affiliate.country,
- email: affiliate.email,
+ country: "US",
+ email: "[email protected]",
capabilities: {
transfers: {
requested: true,
@@ -75,48 +31,13 @@ const createExpressAccount = async () => {
},
},
individual: {
- first_name: affiliate.firstName,
- last_name: affiliate.lastName,
- email: affiliate.email,
+ first_name: "Kiran",
+ last_name: "Krishnan",
+ email: "[email protected]",
},
});
- console.log("Created express account for affiliate", account);
-};
-
-const createLoginLink = async () => {
- const loginLink = await stripe.accounts.createLoginLink(
- affiliate.connectedAccountId,
- );
-
- console.log("Login link", loginLink);
-};
-
-const createPayout = async () => {
- const result = await stripe.paymentIntents.create({
- amount: payout.amount,
- currency: payout.currency,
- description: "Payout for affiliate from Dub Partners",
- customer: partner.stripeCustomerId, // Partner's Stripe Customer ID
- payment_method: "pm_1QV6ZKFacAXKeDpJQJa2tLc8", // Partner's Stripe Payment Method ID
- confirm: true,
- confirmation_method: "automatic",
- transfer_data: {
- destination: affiliate.connectedAccountId, // To where the payout is sent
- },
- application_fee_amount: 100, // 1% fee from Dub
- });
-
- console.log("Created payout for affiliate", result);
-};
-
-const createCustomer = async () => {
- const customer = await stripe.customers.create({
- email: "[email protected]",
- name: "Kiran Krishnan",
- });
-
- console.log("Created customer for partner", customer);
+ console.log("Express account created", account);
};
main();