Skip to content

Commit eed6950

Browse files
committed
[dashboard] Implement Stripe portal to allow usage-based customers to manage their subscription
1 parent 41f4820 commit eed6950

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

components/dashboard/src/teams/TeamUsageBasedBilling.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ export default function TeamUsageBasedBilling() {
144144
<div className="text-xl font-semibold flex-grow text-gray-600 dark:text-gray-400">
145145
Active
146146
</div>
147-
{/* <button className="self-end secondary" disabled={true}>
147+
<button className="self-end secondary" disabled={true}>
148148
Manage →
149-
</button> */}
149+
</button>
150150
</>
151151
)}
152152
</div>
@@ -156,6 +156,13 @@ export default function TeamUsageBasedBilling() {
156156
);
157157
}
158158

159+
// (Node.js)
160+
// const session = await stripe.billingPortal.sessions.create({
161+
// customer: '{{CUSTOMER_ID}}',
162+
// return_url: 'https://example.com/account',
163+
// });
164+
// res.redirect(session.url);
165+
159166
function BillingSetupModal(props: { onClose: () => void }) {
160167
const { isDark } = useContext(ThemeContext);
161168
const [stripePromise, setStripePromise] = useState<Promise<Stripe | null> | undefined>();

0 commit comments

Comments
 (0)