-
Notifications
You must be signed in to change notification settings - Fork 394
chore(clerk-js,backend): Replace /commerce
endpoints with /billing
endpoints
#6854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@clerk/clerk-js': patch | ||
'@clerk/backend': patch | ||
--- | ||
|
||
Replace `/commerce` endpoints with `/billing` endpoints. |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,7 @@ import type { | |||||||||||||||||
import { unixEpochToDate } from '@/utils/date'; | ||||||||||||||||||
|
||||||||||||||||||
import { billingMoneyAmountFromJSON } from '../../utils'; | ||||||||||||||||||
import { Billing } from '../modules/billing/namespace'; | ||||||||||||||||||
import { BaseResource, BillingPlan, DeletedObject } from './internal'; | ||||||||||||||||||
|
||||||||||||||||||
export class BillingSubscription extends BaseResource implements BillingSubscriptionResource { | ||||||||||||||||||
|
@@ -110,9 +111,7 @@ export class BillingSubscriptionItem extends BaseResource implements BillingSubs | |||||||||||||||||
const { orgId } = params; | ||||||||||||||||||
const json = ( | ||||||||||||||||||
await BaseResource._fetch({ | ||||||||||||||||||
path: orgId | ||||||||||||||||||
? `/organizations/${orgId}/commerce/subscription_items/${this.id}` | ||||||||||||||||||
: `/me/commerce/subscription_items/${this.id}`, | ||||||||||||||||||
path: Billing.path(`/subscription_items/${this.id}`, { orgId }), | ||||||||||||||||||
method: 'DELETE', | ||||||||||||||||||
}) | ||||||||||||||||||
Comment on lines
+114
to
116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore organization billing routes before merging Line 114: static path(subPath: string, param?: { orgId?: string }): string {
const { orgId } = param || {};
- let prefix = '';
- if (orgId) {
- prefix = `/organizations/${orgId}`;
- }
- prefix = '/me';
+ const prefix = orgId ? `/organizations/${orgId}` : '/me';
return `${prefix}${Billing.#pathRoot}${subPath}`;
} 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
)?.response as unknown as DeletedObjectJSON; | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 Looks like this is calling an authenticated endpoint
/me/billing/plans
but the actual path is just/billing/plans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed since I merged main into this branch. take a look here https://clerk-js-sandbox-gqfa0nbi0.clerkstage.dev/pricing-table