Skip to content

Capture billing address details in checkout intents and checkout session flow - #235

Draft
gshivajibiradar with Copilot wants to merge 6 commits into
mainfrom
copilot/capture-billing-address-details
Draft

Capture billing address details in checkout intents and checkout session flow#235
gshivajibiradar with Copilot wants to merge 6 commits into
mainfrom
copilot/capture-billing-address-details

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This updates the self-service billing flow to capture billing address details during checkout instead of relying solely on Stripe-side retrieval after purchase. Billing address data is now persisted on CheckoutIntent, validated at the API boundary, and exposed through the existing checkout/admin surfaces.

  • Checkout intent schema

    • Added persisted billing address fields to CheckoutIntent:
      • billing_address_country
      • billing_address_line_1
      • billing_address_line_2
      • billing_address_city
      • billing_address_state
      • billing_address_postal_code
    • Added the corresponding migration with nullable defaults so existing rows remain valid.
    • Updated model PII annotations to reflect stored location data.
  • API contract

    • Extended checkout-intent and create-checkout-session serializers to accept and return billing address fields.
    • Added cross-field validation so billing address submission is all-or-nothing for required fields, while still allowing line_2 to remain optional.
    • Passed billing address values through CheckoutIntent.create_intent(...) so both direct intent creation and checkout-session creation persist the same shape.
  • Stripe checkout behavior

    • Updated Stripe checkout session creation to require billing address collection and allow Stripe to write back customer address/name updates.
    • This keeps the hosted checkout flow aligned with the new persisted billing-address model.
  • Admin and BFF exposure

    • Exposed billing address fields in the CheckoutIntent admin detail view.
    • Added billing address fields to the checkout BFF serializer so downstream consumers can read the stored values from checkout-intent payloads.
  • Coverage

    • Added focused tests for:
      • model persistence/update behavior
      • serializer/API validation
      • checkout-intent create/update flows
      • migration defaults for existing rows
      • admin field visibility
      • Stripe checkout session configuration

Example shape now accepted by checkout creation endpoints:

{
  "enterprise_slug": "acme",
  "enterprise_name": "Acme Corp",
  "quantity": 25,
  "billing_address_country": "US",
  "billing_address_line_1": "123 Main St",
  "billing_address_line_2": "Suite 400",
  "billing_address_city": "Boston",
  "billing_address_state": "MA",
  "billing_address_postal_code": "02110"
}

Copilot AI changed the title [WIP] Add support for capturing billing address details Capture billing address details in checkout intents and checkout session flow Jul 13, 2026
Copilot AI requested a review from gshivajibiradar July 13, 2026 15:00
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