Skip to content

Commit

Permalink
stripe: fix metadata guard. also a mistaken return url
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Jan 18, 2025
1 parent 3d22d60 commit a23d7ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/packages/server/purchases/stripe/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export async function getAccountIdFromStripeCustomerId(
return rows[0]?.account_id;
}

// [ ] TODO!?
// could this be done better?
export async function defaultReturnUrl() {
const return_url = url();
const return_url = await url();
return return_url;
}

Expand All @@ -142,10 +142,11 @@ export function assertValidUserMetadata(metadata) {
metadata?.account_id != null ||
metadata?.confirm != null ||
metadata?.processed != null ||
metadata?.recorded != null ||
metadata?.total_excluding_tax_usd != null
) {
throw Error(
"metadata must not include 'purpose', 'account_id', 'confirm', 'total_excluding_tax_usd' or 'processed' as a key",
"metadata must not include 'purpose', 'account_id', 'confirm', 'total_excluding_tax_usd', 'recorded', or 'processed' as a key",
);
}
}
Expand Down

0 comments on commit a23d7ec

Please sign in to comment.