feat: view invoices from stripe portal
This commit is contained in:
parent
7725c1ce71
commit
631db83595
|
|
@ -506,7 +506,7 @@ export const MainBillingComponent: FC<{
|
||||||
<PurchaseCrypto />
|
<PurchaseCrypto />
|
||||||
{!!subscription?.id && (
|
{!!subscription?.id && (
|
||||||
<div className="flex justify-center mt-[20px] gap-[10px]">
|
<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 && (
|
{isGeneral && !subscription?.cancelAt && (
|
||||||
<Button
|
<Button
|
||||||
className="bg-red-500"
|
className="bg-red-500"
|
||||||
|
|
|
||||||
|
|
@ -348,15 +348,7 @@ export class StripeService {
|
||||||
async createBillingPortalLink(customer: string) {
|
async createBillingPortalLink(customer: string) {
|
||||||
return stripe.billingPortal.sessions.create({
|
return stripe.billingPortal.sessions.create({
|
||||||
customer,
|
customer,
|
||||||
flow_data: {
|
return_url: process.env['FRONTEND_URL'] + '/billing',
|
||||||
after_completion: {
|
|
||||||
type: 'redirect',
|
|
||||||
redirect: {
|
|
||||||
return_url: process.env['FRONTEND_URL'] + '/billing',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
type: 'payment_method_update',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue