Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #417 from beabee-communityrm/fix/missing-invoice-u…
Browse files Browse the repository at this point in the history
…pdates

fix: payment status updates being missed
  • Loading branch information
wpf500 authored May 9, 2024
2 parents f343666 + 3928d7e commit e232503
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/webhooks/handlers/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@ async function getContributionFromInvoice(
async function findOrCreatePayment(
invoice: Stripe.Invoice
): Promise<Payment | undefined> {
const contribution = await getContributionFromInvoice(invoice);
if (!contribution) {
return;
}

const payment = await getRepository(Payment).findOneBy({ id: invoice.id });
if (payment) {
return payment;
}

const contribution = await getContributionFromInvoice(invoice);
if (!contribution) {
return;
}

const newPayment = new Payment();
newPayment.id = invoice.id;

Expand Down

0 comments on commit e232503

Please sign in to comment.