feat(billing): Add payment config to charge service#229
Conversation
Add PaymentConfig message with Stripe payment data to the charge service interface. The PaymentConfig uses a oneof pattern to support multiple payment providers in the future. New payment_config.proto includes: - StripePaymentData: customer ID, payment method, and payment status - PaymentConfig: oneof wrapper for extensibility CaptureChargeRequest now accepts optional payment_config for provider-specific payment details. Also includes buf format fixes for indentation across billing protos. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
| uint64 organization_id = 4; | ||
| google.protobuf.Timestamp current_ts = 5; | ||
| optional string invoice_id = 6; | ||
| optional string invoice_guid = 7; |
There was a problem hiding this comment.
Ah yes because this goes to stripe for the webhooks 👍
…endpoint - Move StripePaymentData and PaymentConfig from charge service to common/v1 - Update charge service to import from common - Add get_stripe_payment_data endpoint to billing_details service - Both services now share the same payment configuration types Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| message StripePaymentData { | ||
| optional string customer_stripe_id = 1; | ||
| optional string default_payment_method_id = 2; | ||
| bool has_payment_method = 3; |
There was a problem hiding this comment.
What's the difference between has_payment_method and default_payment_method_id being non-null? Can you ever had default_payment_method_id = None and has_payment_method = True?
There was a problem hiding this comment.
you're right it's redundant as of this moment. good catch
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 68d1416. Configure here.
| [[package]] | ||
| name = "sentry_protos" | ||
| version = "0.8.21" | ||
| version = "0.8.22" |
There was a problem hiding this comment.
Cargo.lock version mismatches Cargo.toml and VERSION
Medium Severity
The Cargo.lock bumps sentry_protos to 0.8.22, but rust/Cargo.toml and the VERSION file both remain at 0.8.21. Since Cargo.lock derives the workspace member version from Cargo.toml, this mismatch means the lockfile is inconsistent and will be overwritten back to 0.8.21 on the next cargo build. The project's scripts/bump-version.sh confirms VERSION and Cargo.toml are the sources of truth.
Reviewed by Cursor Bugbot for commit 68d1416. Configure here.


Human comments
First pass of implementing charging, I realized that the invoicer needs to pass stripe details to the charge service as well as the invoice guid. This is to avoid having to call the contract service from the charge service.
AI comments
Add
PaymentConfigmessage to the charge service interface to support Stripe payment details when capturing charges.The new
payment_config.protointroduces:StripePaymentData: Contains customer Stripe ID, default payment method ID, and payment method statusPaymentConfig: Uses a oneof pattern for the payment provider config, allowing future extension to other providers (PayPal, Braintree, etc.)CaptureChargeRequestnow accepts an optionalpayment_configfield, which services can use to pass provider-specific payment information whencharge_methodis set toCHARGE_METHOD_STRIPE.This design keeps the interface extensible without breaking existing callers who don't need payment provider details.