Skip to content

Commit

Permalink
Merge pull request #314 from giselles-ai/fix/payment-page-back-naviga…
Browse files Browse the repository at this point in the history
…tion

fix: Update cancel URL in Stripe Checkout
  • Loading branch information
gentamura authored Jan 17, 2025
2 parents 36eb4cb + faac51a commit 9dac293
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Giselle app
NEXT_PUBLIC_SERVICE_SITE_URL="https://example.com/"

# for signed cookie
COOKIE_SECRET=

Expand Down
4 changes: 1 addition & 3 deletions services/teams/actions/create-team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ async function prepareProTeamCreation(supabaseUser: User, teamName: string) {

async function createCheckout(userDbId: number, teamName: string) {
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL;
const serviceSiteUrl = process.env.NEXT_PUBLIC_SERVICE_SITE_URL;
invariant(siteUrl, "NEXT_PUBLIC_SITE_URL is not set");
invariant(serviceSiteUrl, "NEXT_PUBLIC_SERVICE_SITE_URL is not set");

const successUrl = `${siteUrl}/subscriptions/success`;
const cancelUrl = `${serviceSiteUrl}/pricing`;
const cancelUrl = `${siteUrl}/settings/team`;

const subscriptionMetadata: Record<string, string> = {
[DRAFT_TEAM_USER_DB_ID_METADATA_KEY]: userDbId.toString(),
Expand Down
4 changes: 1 addition & 3 deletions services/teams/actions/upgrade-team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { createCheckoutSession } from "./create-checkout-session";

export async function upgradeTeam(team: CurrentTeam) {
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL;
const serviceSiteUrl = process.env.NEXT_PUBLIC_SERVICE_SITE_URL;
invariant(siteUrl, "NEXT_PUBLIC_SITE_URL is not set");
invariant(serviceSiteUrl, "NEXT_PUBLIC_SERVICE_SITE_URL is not set");

const successUrl = `${siteUrl}/settings/team`;
const cancelUrl = `${serviceSiteUrl}/pricing`;
const cancelUrl = successUrl;

const subscriptionMetadata: Record<string, string> = {
[UPGRADING_TEAM_DB_ID_KEY]: team.dbId.toString(),
Expand Down

0 comments on commit 9dac293

Please sign in to comment.