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: accept stripe webhooks events to sync state faster #622

Merged
merged 2 commits into from
May 19, 2024

Conversation

kushsharma
Copy link
Member

@kushsharma kushsharma commented May 16, 2024

  • A new RPC BillingWebhookCallback(/v1beta1/billing/webhooks/callback/{provider}) allows accepting stripe webhook events being sent to frontier
  • This reduces the delay between the state sync between stripe and frontier for customer changes, checkout success, etc.
  • Stripe endpoint secret needs to be set in frontier config under billing.stripe_webhook_secrets. It accepts an array of keys and all keys will be tried to validate the event. If the validation fails, event will be discarded.
  • feat(frontier): accept stripe billing webhook proton#358

- this reduces delay of syncing states between frontier and the
billing provider

Signed-off-by: Kush Sharma <thekushsharma@gmail.com>
Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2024 1:48pm

@kushsharma kushsharma marked this pull request as ready for review May 16, 2024 17:22
@coveralls
Copy link

coveralls commented May 16, 2024

Pull Request Test Coverage Report for Build 9148133038

Details

  • 1 of 570 (0.18%) changed or added relevant lines in 18 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 9.379%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/event/listener.go 0 1 0.0%
internal/api/v1beta1/v1beta1.go 0 1 0.0%
cmd/serve.go 0 3 0.0%
internal/store/postgres/billing_customer_repository.go 0 5 0.0%
pkg/server/interceptors/enrich.go 0 5 0.0%
billing/customer/customer.go 0 7 0.0%
internal/store/postgres/billing_checkout_repository.go 0 8 0.0%
billing/customer/service.go 0 12 0.0%
billing/checkout/service.go 0 13 0.0%
internal/api/v1beta1/billing_webhook.go 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
proto/v1beta1/frontier_grpc.pb.go 1 0.0%
proto/v1beta1/frontier.pb.gw.go 2 0.0%
Totals Coverage Status
Change from base Build 9108032192: -0.04%
Covered Lines: 9560
Relevant Lines: 101934

💛 - Coveralls

- A new RPC BillingWebhookCallback(/v1beta1/billing/webhooks/callback/{provider})
allows accepting stripe webhook events being sent to frontier
- This reduces the delay between the state sync between stripe
and frontier for customer changes, checkout success, etc.
- Stripe endpoint secret needs to be set in frontier config
under `billing.stripe_webhook_secrets`. It accepts an array
of keys and all keys will be tried to validate the event. If
the validation fails, event will be discarded.

Signed-off-by: Kush Sharma <thekushsharma@gmail.com>
@kushsharma kushsharma merged commit 8452cf0 into main May 19, 2024
7 checks passed
@kushsharma kushsharma deleted the stripe-webhooks branch May 19, 2024 13:52
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