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

feat: handle stripe invoice.payment_failed events #2663

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pavelbrm
Copy link
Contributor

@pavelbrm pavelbrm commented Oct 7, 2024

Summary

This PR adds support for invoice.payment_failed events from Stripe, and adds processing for such events. When an event is received, for the corresponding order, if found, the counter for failed payment attempts is incremented. This information will be used in other backend services to make decisions when dealing with orders that have non-zero number of failed payment attempts. When a successful payment is recorded, or the order is cancelled, the counter is reset to zero.

This new functionality is necessary for handling cases when a user enters the past due state in Stripe (because of failed payments), and then the user is able to resubscribe in the Account website again, which is undesired.

Type of Change

  • Product feature
  • Bug fix
  • Performance improvement
  • Refactor
  • Other

Tested Environments

  • Development
  • Staging
  • Production

Before Requesting Review

  • Does your code build cleanly without any errors or warnings?
  • Have you used auto closing keywords?
  • Have you added tests for new functionality?
  • Have validated query efficiency for new database queries?
  • Have documented new functionality in README or in comments?
  • Have you squashed all intermediate commits?
  • Is there a clear title that explains what the PR does?
  • Have you used intuitive function, variable and other naming?
  • Have you requested security and/or privacy review if needed
  • Have you performed a self review of this PR?

Manual Test Plan

@pavelbrm pavelbrm self-assigned this Oct 7, 2024
@pavelbrm pavelbrm changed the title feat: parse invoice.payment_failed event feat: handle invoice.payment_failed events Oct 9, 2024
@pavelbrm pavelbrm changed the title feat: handle invoice.payment_failed events feat: handle stripe invoice.payment_failed events Oct 9, 2024
@pavelbrm pavelbrm requested a review from clD11 October 9, 2024 11:11
@pavelbrm pavelbrm marked this pull request as ready for review October 9, 2024 11:15
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.

1 participant