Skip to content

feat(billing): Add payment config to charge service#229

Merged
volokluev merged 10 commits intomainfrom
volo/charge_stripe
Apr 30, 2026
Merged

feat(billing): Add payment config to charge service#229
volokluev merged 10 commits intomainfrom
volo/charge_stripe

Conversation

@volokluev
Copy link
Copy Markdown
Member

@volokluev volokluev commented Apr 29, 2026

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 PaymentConfig message to the charge service interface to support Stripe payment details when capturing charges.

The new payment_config.proto introduces:

  • StripePaymentData: Contains customer Stripe ID, default payment method ID, and payment method status
  • PaymentConfig: Uses a oneof pattern for the payment provider config, allowing future extension to other providers (PayPal, Braintree, etc.)

CaptureChargeRequest now accepts an optional payment_config field, which services can use to pass provider-specific payment information when charge_method is set to CHARGE_METHOD_STRIPE.

This design keeps the interface extensible without breaking existing callers who don't need payment provider details.

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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 30, 2026, 6:17 PM

@volokluev volokluev marked this pull request as ready for review April 29, 2026 23:24
uint64 organization_id = 4;
google.protobuf.Timestamp current_ts = 5;
optional string invoice_id = 6;
optional string invoice_guid = 7;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yes because this goes to stripe for the webhooks 👍

volokluev and others added 2 commits April 29, 2026 16:38
…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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

you're right it's redundant as of this moment. good catch

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread Cargo.lock
[[package]]
name = "sentry_protos"
version = "0.8.21"
version = "0.8.22"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 68d1416. Configure here.

@volokluev volokluev merged commit 0c1f255 into main Apr 30, 2026
12 checks passed
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