Skip to content

Commit

Permalink
ignore deleted payment intents when checking for student pay
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Jan 18, 2025
1 parent 17b8213 commit ed33d8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/packages/server/purchases/student-pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ export async function studentPayAssertNotPaying({ project_id }) {
if (payment_intent_id) {
const stripe = await getConn();
const intent = await stripe.paymentIntents.retrieve(payment_intent_id);
if (intent.status != "canceled" && intent.status != "succeeded") {
if (
intent.status != "canceled" &&
intent.status != "succeeded" &&
intent.metadata["deleted"] != "true"
) {
throw Error(
`There is an outstanding payment for this course right now (payment intent id ${payment_intent_id}). [Pay that invoice or cancel it](${await url("settings/payments")}).`,
);
Expand Down

0 comments on commit ed33d8e

Please sign in to comment.