Skip to content

Commit edcce27

Browse files
committed
fix: allow inputting promo codes in org subscription (so we can test w/o charging ourselves)
1 parent 8a25ae7 commit edcce27

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

codebuff.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"name": "typecheck-web",
42-
"command": "bun run typecheck",
42+
"command": "bun run typecheck-only",
4343
"cwd": "web",
4444
"filePattern": "web/**/*.ts"
4545
},

web/src/app/api/orgs/[orgId]/billing/setup/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ export async function GET(req: NextRequest, { params }: RouteParams) {
6969
stripeServer.paymentMethods.list({
7070
customer: organization.stripe_customer_id,
7171
type: 'link',
72-
})
72+
}),
7373
])
74-
isSetup = cardPaymentMethods.data.length > 0 || linkPaymentMethods.data.length > 0
74+
isSetup =
75+
cardPaymentMethods.data.length > 0 ||
76+
linkPaymentMethods.data.length > 0
7577
} catch (error) {
7678
logger.warn(
7779
{ orgId, error },
@@ -183,6 +185,7 @@ export async function POST(req: NextRequest, { params }: RouteParams) {
183185
quantity: 1,
184186
},
185187
],
188+
allow_promotion_codes: true,
186189
success_url: `${env.NEXT_PUBLIC_APP_URL}/orgs/${organization.slug}/billing/purchase?subscription_success=true`,
187190
cancel_url: `${env.NEXT_PUBLIC_APP_URL}/orgs/${organization.slug}?subscription_canceled=true`,
188191
metadata: {

0 commit comments

Comments
 (0)