Track payment method
This commit is contained in:
@@ -98,6 +98,7 @@ export type Tenant = {
|
||||
nwc_is_set: boolean
|
||||
created_at: number
|
||||
stripe_customer_id: string
|
||||
stripe_payment_method_id: string | null
|
||||
nwc_error: string | null
|
||||
stripe_error: string | null
|
||||
churned_at: number | null
|
||||
|
||||
@@ -135,7 +135,7 @@ export const reactivateRelayById = (id: string) => reactivateRelay(id)
|
||||
|
||||
export async function tenantNeedsPaymentSetup(): Promise<boolean> {
|
||||
const tenant = await getTenant(account()!.pubkey)
|
||||
return !tenant.nwc_is_set
|
||||
return !tenant.nwc_is_set && !tenant.stripe_payment_method_id
|
||||
}
|
||||
|
||||
export async function getLatestOpenInvoice(): Promise<Invoice | null> {
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function RelayDetail() {
|
||||
if (!isPaidRelay()) return false
|
||||
const t = tenant()
|
||||
if (!t) return false
|
||||
return !t.nwc_is_set
|
||||
return !t.nwc_is_set && !t.stripe_payment_method_id
|
||||
})
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user