feat: view invoices from stripe portal

This commit is contained in:
Nevo David 2025-04-14 10:33:43 +07:00
parent 7725c1ce71
commit 631db83595
2 changed files with 2 additions and 10 deletions

View File

@ -506,7 +506,7 @@ export const MainBillingComponent: FC<{
<PurchaseCrypto />
{!!subscription?.id && (
<div className="flex justify-center mt-[20px] gap-[10px]">
<Button onClick={updatePayment}>Update Payment Method</Button>
<Button onClick={updatePayment}>Update Payment Method / Invoices History</Button>
{isGeneral && !subscription?.cancelAt && (
<Button
className="bg-red-500"

View File

@ -348,15 +348,7 @@ export class StripeService {
async createBillingPortalLink(customer: string) {
return stripe.billingPortal.sessions.create({
customer,
flow_data: {
after_completion: {
type: 'redirect',
redirect: {
return_url: process.env['FRONTEND_URL'] + '/billing',
},
},
type: 'payment_method_update',
},
return_url: process.env['FRONTEND_URL'] + '/billing',
});
}