UseSubscriptionResult
UseSubscriptionResult =
object
Defined in: src/react/useSubscription.ts:41
Properties
cancelSubscription()
cancelSubscription: () =>
Promise<HandlersCancelSubscriptionResponse|null>
Defined in: src/react/useSubscription.ts:77
Cancel the subscription at the end of the current period
Returns
Promise<HandlersCancelSubscriptionResponse | null>
The cancellation response or null on error
createCheckoutSession()
createCheckoutSession: (
options?:object) =>Promise<string|null>
Defined in: src/react/useSubscription.ts:62
Create a Stripe checkout session for a subscription plan
Parameters
| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Promise<string | null>
The checkout URL or null on error
error
error:
Error|null
Defined in: src/react/useSubscription.ts:53
Error from the last operation
isLoading
isLoading:
boolean
Defined in: src/react/useSubscription.ts:49
Whether any operation is in progress
openCustomerPortal()
openCustomerPortal: (
options?:object) =>Promise<string|null>
Defined in: src/react/useSubscription.ts:72
Open the Stripe customer portal for managing billing
Parameters
| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Promise<string | null>
The portal URL or null on error
refetch()
refetch: () =>
Promise<void>
Defined in: src/react/useSubscription.ts:57
Refetch the subscription status
Returns
Promise<void>
renewSubscription()
renewSubscription: () =>
Promise<HandlersRenewSubscriptionResponse|null>
Defined in: src/react/useSubscription.ts:82
Reactivate a cancelled subscription
Returns
Promise<HandlersRenewSubscriptionResponse | null>
The renewal response or null on error
status
status:
HandlersSubscriptionStatusResponse|null
Defined in: src/react/useSubscription.ts:45
Current subscription status