Skip to content

Conversation

@StaberindeZA
Copy link
Contributor

@StaberindeZA StaberindeZA commented Oct 24, 2025

Because

  • The payments-api service needs to be able to processes Stripe webhooks

This pull request

  • Adds Controller, StripeWebhookService and related modules to payments-api

Issue that this pull request solves

Closes: #PAY-3292

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

@StaberindeZA StaberindeZA force-pushed the pay-3292-api-stripe-webhooks branch 2 times, most recently from 20843e2 to ff811a5 Compare October 27, 2025 17:17
@StaberindeZA StaberindeZA marked this pull request as ready for review October 27, 2025 17:18
@StaberindeZA StaberindeZA requested a review from a team as a code owner October 27, 2025 17:18
Because:

- The payments-api service needs to be able to processes Stripe webhooks

This commit:

- Adds Controller, StripeWebhookService and related modules to payments-api

Closes #PAY-3292
@StaberindeZA StaberindeZA force-pushed the pay-3292-api-stripe-webhooks branch from ff811a5 to 601db2f Compare October 27, 2025 18:06
Comment on lines +32 to +42
const eventAlreadyProcessed = await this.stripeEventManager.isProcessed(
webhookEventResponse.event.id
);

if (eventAlreadyProcessed) {
return {};
}

await this.dispatchEventToHandler(webhookEventResponse);

await this.stripeEventManager.markAsProcessed(webhookEventResponse.event);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[non-blocking] Looks like this allows two requests filed in parallel and does not de-dupe. Not the biggest deal, but I think this would need to be solved with two fields lastAttemptedAt: date and processed: true|false on the webhook event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants