-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- reworked the dashboard so it's less overwhelming. it now has tabs for each "category" of thing you are looking at. - added front-end for editing stripe's business name (aka doing business as) - made the default for new connect accounts to have their business name as their discord username
- Loading branch information
Showing
6 changed files
with
255 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,6 +292,7 @@ export async function createStripeConnectAccount( | |
}, | ||
business_profile: { | ||
mcc: "5734", | ||
name: scripter.profiles.username, | ||
support_url: "https://waspscripts.com/scripters/" + scripter.url, | ||
url: "https://waspscripts.com/scripters/" + scripter.url, | ||
support_email: "[email protected]" | ||
|
@@ -352,6 +353,37 @@ export async function finishStripeAccountSetup(baseURL: string, account: string) | |
return accountLink.url | ||
} | ||
|
||
export async function getStripeAccount(id: string) { | ||
let stripeAccount: Stripe.Response<Stripe.Account> | null = null | ||
|
||
try { | ||
stripeAccount = await stripe.accounts.retrieve(id) | ||
} catch (error) { | ||
console.error( | ||
"An error occurred when calling the Stripe API to create an account session", | ||
error | ||
) | ||
} | ||
|
||
return stripeAccount | ||
} | ||
|
||
export async function updateStripeAccount(id: string, dba: string) { | ||
let stripeAccount: Stripe.Response<Stripe.Account> | null = null | ||
|
||
try { | ||
stripeAccount = await stripe.accounts.update(id, { business_profile: { name: dba } }) | ||
} catch (error) { | ||
console.error( | ||
"An error occurred when calling the Stripe API to create an account session", | ||
error | ||
) | ||
return false | ||
} | ||
|
||
return true | ||
} | ||
|
||
export async function getStripeSession(account: string) { | ||
let accountSession: Stripe.Response<Stripe.AccountSession> | null = null | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.