docs: fix wrong cancelUrl and returnUrl descriptions (#3647)

* docs: fix wrong cancelUrl and returnUrl descriptions

* chore: changeset

* chore: update changeset

---------

Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
This commit is contained in:
Andrew Patton
2025-08-01 09:43:48 -07:00
committed by GitHub
parent e5f3f31311
commit 91cae8aa1e
3 changed files with 12 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"@better-auth/stripe": patch
---
chore: fix wrong cancelUrl and returnUrl descriptions

View File

@@ -234,10 +234,11 @@ type upgradeSubscription = {
*/
successUrl: string
/**
* Callback URL to redirect back after successful subscription.
* If set, checkout shows a back button and customers will be directed here if they cancel payment.
*/
cancelUrl: string
* Return URL to redirect back after successful subscription.
/**
* URL to take customers to when they click on the billing portals link to return to your website.
*/
returnUrl?: string
/**
@@ -345,7 +346,7 @@ type cancelSubscription = {
*/
subscriptionId?: string = 'sub_123'
/**
* Return URL to redirect back after successful subscription.
* URL to take customers to when they click on the billing portals link to return to your website.
*/
returnUrl: string = '/account'
}

View File

@@ -198,7 +198,7 @@ export const stripe = <O extends StripeOptions>(options: O) => {
.string()
.meta({
description:
'Callback URL to redirect back after successful subscription. Eg: "https://example.com/success"',
'If set, checkout shows a back button and customers will be directed here if they cancel payment. Eg: "https://example.com/pricing"',
})
.default("/"),
/**
@@ -208,7 +208,7 @@ export const stripe = <O extends StripeOptions>(options: O) => {
.string()
.meta({
description:
'Return URL to redirect back after successful subscription. Eg: "https://example.com/success"',
'URL to take customers to when they click on the billing portals link to return to your website. Eg: "https://example.com/dashboard"',
})
.optional(),
/**
@@ -625,7 +625,7 @@ export const stripe = <O extends StripeOptions>(options: O) => {
.optional(),
returnUrl: z.string().meta({
description:
"Return URL to redirect back after successful subscription. Eg: 'https://example.com/success'",
'URL to take customers to when they click on the billing portals link to return to your website. Eg: "https://example.com/dashboard"',
}),
}),
use: [