fix: platform billing portal (#23975)
* fix: check if team is platform or not when sending billingPortalUrl * update team repository * fix: pass teamId explicitely for platform team * fix: coderabbit feedback * fix: merge conflicts * fix: merge conflicts * fix: make sure we pass in the correct subsciption id * fix: implement PR feedback
This commit is contained in:
1 parent
386f60ca6d
commit
f11c4dd7ec
3 files changed
+56
-12
No files matched your search
@@ -30,16 +30,18 @@ declare global {
|
||||
export default function PlatformBillingUpgrade() {
|
||||
const pathname = usePathname();
|
||||
const { t } = useLocale();
|
||||
const { isUserLoading, isUserBillingDataLoading, isPlatformUser, userBillingData, isPaidUser, userOrgId } =
|
||||
useGetUserAttributes();
|
||||
|
||||
const returnTo = pathname;
|
||||
const billingHref = `/api/integrations/stripepayment/portal?returnTo=${WEBAPP_URL}${returnTo}`;
|
||||
const teamId = `teamId=${userOrgId}`;
|
||||
const billingHref = `/api/integrations/stripepayment/portal?returnTo=${WEBAPP_URL}${returnTo}&${teamId}`;
|
||||
|
||||
const onContactSupportClick = async () => {
|
||||
if (window.Support) {
|
||||
window.Support.open();
|
||||
}
|
||||
};
|
||||
const { isUserLoading, isUserBillingDataLoading, isPlatformUser, userBillingData, isPaidUser, userOrgId } =
|
||||
useGetUserAttributes();
|
||||
|
||||
const { mutateAsync: removeTeamSubscription, isPending: isRemoveTeamSubscriptionLoading } =
|
||||
useUnsubscribeTeamToStripe({
|
||||
|
||||
Reference in new issue
Block a user