Skip to content

Conversation

rsbh
Copy link
Member

@rsbh rsbh commented May 27, 2025

This PR will add a check for the address in the checkout.
If the customer already has the pin code and country as per minimum address required for stripe, then it will not auto-update the customer's billing address from the checkout flow.

@rsbh rsbh requested review from rohilsurana and Copilot May 27, 2025 07:38
Copy link

vercel bot commented May 27, 2025

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 27, 2025 10:50am

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a check in the checkout flow to skip billing address collection when the customer already has a postal code and country, per Stripe’s minimum requirements.

  • Introduce HasMinimumRequiredAddress on Address and Customer
  • Add unit tests for these new methods
  • Update Service.Create to set CustomerUpdate.Address based on the existing address

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
billing/customer/customer.go Added methods to check for minimum required address
billing/customer/customer_test.go Added tests for HasMinimumRequiredAddress on Address and Customer
billing/checkout/service.go Conditionally set billing address collection param in checkout session
Comments suppressed due to low confidence (1)

billing/checkout/service.go:225

  • Consider adding unit tests for Service.Create to verify that addressCollectionParam correctly switches to "never" when billingCustomer.HasMinimumRequiredAddress() is true, and defaults to auto otherwise.
// Determine address collection setting based on whether customer already has minimum required address

@coveralls
Copy link

coveralls commented May 27, 2025

Pull Request Test Coverage Report for Build 15273293571

Details

  • 6 of 12 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 33.348%

Changes Missing Coverage Covered Lines Changed/Added Lines %
billing/checkout/service.go 0 6 0.0%
Totals Coverage Status
Change from base Build 15206650041: 0.009%
Covered Lines: 9871
Relevant Lines: 29600

💛 - Coveralls

@rsbh rsbh merged commit 48b1c73 into main May 28, 2025
7 checks passed
@rsbh rsbh deleted the feat_checkout_address_check branch May 28, 2025 05:42
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.

3 participants