Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stripe): Handle missing payment #2825

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

vincent-pochet
Copy link
Collaborator

Context

Some PaymentProviders::Stripe::HandleEventJob with 'payment_intent.payment_failed' or 'payment_intent.succeeded' event type are failing with BaseService::NotFoundFailure - stripe_payment_not_found.

The webhook contains metadata of lago's invoices but the related Payment cannot be found in the database. It is probably because the job creating the stripe payment was killed allong with the worker running it under heavy load.

Description

This PR changes the logic to re-create the Payment record when missing using the data from the webhook object. It will allow to update the invoice.payment_status accordingly

@vincent-pochet vincent-pochet force-pushed the fix-missing-payments branch 3 times, most recently from f7f6101 to 68875ac Compare November 15, 2024 13:01
Copy link
Contributor

@nudded nudded left a comment

Choose a reason for hiding this comment

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

nice!

@vincent-pochet vincent-pochet merged commit 67ae334 into main Nov 18, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the fix-missing-payments branch November 18, 2024 16:33
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