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): ensure payment method is up to date #379

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

vincent-pochet
Copy link
Collaborator

@vincent-pochet vincent-pochet commented Aug 11, 2022

Context

Stripe integration is missing the payment method cleanup webhook and does not checks for the validity of the registered payment method

Description

If a payment method is removed from a customer on stripe dashboard, or via an API call, Lago application does not know about it and will try to use it for future payment.

This PR includes two fixes:

  • handle payment_method.detached Stripe webhook to cleanup PaymentProviderCustomers::StripeCustomer payment_method_id field when a payment method is removed on Stripe side
  • Check if a registered payment method still exists before processing a payment

How Has This Been Tested?

A Complete QA will be performed both locally and on a staging branch

@vincent-pochet vincent-pochet added Invoice Related to Invoices 🐞 Bug Something isn't working labels Aug 11, 2022
@vincent-pochet vincent-pochet self-assigned this Aug 11, 2022
@vincent-pochet vincent-pochet changed the title Fix/stripe payment method fix(stripe): ensure payment method is up to date Aug 11, 2022
@vincent-pochet vincent-pochet merged commit 84499bf into main Aug 11, 2022
@vincent-pochet vincent-pochet deleted the fix/stripe-payment-method branch August 11, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working Invoice Related to Invoices
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants