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: support stripe webhooks for payment statuses #2171

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

turip
Copy link
Contributor

@turip turip commented Jan 29, 2025

Overview

This patch adds support for receiving payment status updates from stripe including the void state.

The docs folder contains more details on validating and local setup.

@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch 5 times, most recently from 40afb42 to 4157137 Compare January 31, 2025 15:38
@turip turip changed the base branch from main to feature/om-1162-support-payment-states-with-sandbox-app January 31, 2025 15:38
@turip turip force-pushed the feature/om-1162-support-payment-states-with-sandbox-app branch from c9ab650 to 2957794 Compare January 31, 2025 15:41
@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch 3 times, most recently from a154459 to b5dbad3 Compare January 31, 2025 16:27
@turip turip force-pushed the feature/om-1162-support-payment-states-with-sandbox-app branch from 2957794 to 1301954 Compare January 31, 2025 16:42
@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch from b5dbad3 to 12d8d32 Compare January 31, 2025 16:42
@turip turip force-pushed the feature/om-1162-support-payment-states-with-sandbox-app branch from 1301954 to b382132 Compare February 3, 2025 09:28
@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch 2 times, most recently from 0c53713 to b177ffc Compare February 3, 2025 10:04
@turip turip force-pushed the feature/om-1162-support-payment-states-with-sandbox-app branch from e485095 to 124e212 Compare February 3, 2025 11:32
Base automatically changed from feature/om-1162-support-payment-states-with-sandbox-app to main February 3, 2025 11:53
@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch 2 times, most recently from 9d17712 to 220337d Compare February 3, 2025 15:00
This patch adds support for receiving payment status updates from stripe
including the void state.

The docs folder contains more details on validating and setup.
@turip turip force-pushed the feature/om-1114-store-payment-status-on-invoice branch from 220337d to 667b205 Compare February 3, 2025 15:24
@turip turip changed the title feat: store payment status feat: support stripe webhooks for payment statuses Feb 3, 2025
@turip turip added release-note/feature Release note: Exciting New Features area/billing labels Feb 3, 2025
@turip turip marked this pull request as ready for review February 3, 2025 15:27
@turip turip requested review from hekike and chrisgacsal February 3, 2025 15:27
return nil, err
}

if len(invoices.Items) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we return NotFound and handle it upstream? Like we do with DB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to ignore any invoices that we don't know of. E.g. if there are invoices generated on the stripe side, let's ignore them for now.

query = query.Where(billinginvoice.PaymentAppExternalIDIn(input.ExternalIDs.IDs...))
case billing.TaxExternalIDType:
query = query.Where(billinginvoice.TaxAppExternalIDIn(input.ExternalIDs.IDs...))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

error if unknown type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not needed as it's part of the validation:

if err := f.Type.Validate(); err != nil {

@@ -0,0 +1,81 @@
# Developing against a stripe test account
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome docs!

@turip turip merged commit 270df92 into main Feb 3, 2025
25 of 26 checks passed
@turip turip deleted the feature/om-1114-store-payment-status-on-invoice branch February 3, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/billing release-note/feature Release note: Exciting New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants