Skip to content

feat(checkout): CHECKOUT-10150 add billing form in payment step#3140

Merged
richapatel1510 merged 8 commits into
masterfrom
CHECKOUT-10150
Jul 14, 2026
Merged

feat(checkout): CHECKOUT-10150 add billing form in payment step#3140
richapatel1510 merged 8 commits into
masterfrom
CHECKOUT-10150

Conversation

@richapatel1510

@richapatel1510 richapatel1510 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What/Why?

  • Add billing address form in payment step below the payment method list.
  • Submit the edited billling address when Place Order button is clicked.

Rollout/Rollback

Revert this PR.

Testing

  • CI checks
  • Manual testing

Experiment OFF
Screenshot 2026-07-06 at 2 39 27 pm

Experiment ON
Screenshot 2026-07-06 at 2 36 18 pm

Screen.Recording.2026-07-09.at.3.48.59.pm.mov

Note

Medium Risk
Changes order placement and billing persistence on the payment step for themeV2; incorrect gating could block orders or submit with stale billing, though behavior is scoped to themeV2 and covered by new integration tests.

Overview
For checkoutV2 / themeV2, billing moves into the payment step: PaymentBillingBlock and PaymentBillingForm replace the placeholder, reusing billing UI patterns (address book, Amazon Pay static address, order comments) without a separate Continue action.

Place Order now validates and persists billing first via ensureBillingAddressSaved on PaymentContext; invalid or unsaved billing blocks submitOrder. The submit button is disabled while billing countries load or billing/checkout updates are in flight.

Shared billingFormConfig centralizes initial values and validation (including Amazon Pay) for both the standalone billing step and the embedded form.

Reviewed by Cursor Bugbot for commit 7fc573d. Bugbot is set up for automated code reviews on this repo. Configure here.

@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/billing/BillingForm.tsx Outdated
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/payment/Payment.tsx Outdated
Comment thread packages/core/src/app/payment/billingForm/PaymentBillingBlock.tsx
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b8fb01e. Configure here.

onUnhandledError(error: Error): void;
}

const getFieldsWithExtraFields = (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will move all these commonalities to a new hook called useBilling in the next PR.

@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/payment/billingForm/PaymentBillingBlock.tsx
Comment thread packages/core/src/app/payment/billingForm/PaymentBillingForm.tsx Outdated
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/payment/billingForm/PaymentBillingForm.tsx Outdated
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/payment/billingForm/PaymentBillingBlock.tsx Outdated
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

Comment thread packages/core/src/app/payment/Payment.tsx Outdated
Comment thread packages/core/src/app/payment/billingForm/PaymentBillingForm.tsx
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 529fb36. Configure here.

@richapatel1510
richapatel1510 marked this pull request as ready for review July 9, 2026 05:51
@richapatel1510
richapatel1510 requested a review from a team as a code owner July 9, 2026 05:51
Comment thread packages/core/src/app/payment/Payment.tsx Outdated
Comment thread packages/core/src/app/payment/billingForm/PaymentBillingForm.tsx Outdated
Comment on lines +203 to +208
{themeV2 && (
<PaymentBillingBlock
methodId={selectedMethod?.id}
onUnhandledError={onUnhandledError ?? noop}
/>
)}

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.

Just to confirm my understanding on the overall process:

  • Add a new billing form as a block inside the payment form.
    • Handle the billing form saving process there.
  • Hide the existing billing step when applicable.

Did I miss anything?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For this PR, we are not hiding the existing billing step yet. This PR just adds the billing form below the list of payment methods and place order button will validate and save the billing address first and then submit order.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When enhanced UI is enabled*

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.

Sounds good.

Yeah, I forgot to mention it was about the whole project's roadmap.

@richapatel1510

Copy link
Copy Markdown
Contributor Author

Converting this to draft since this will need to change once we merge #3146

@richapatel1510
richapatel1510 marked this pull request as draft July 10, 2026 05:28
@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e665afe. Configure here.

@richapatel1510

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2f14789. Configure here.

@richapatel1510
richapatel1510 marked this pull request as ready for review July 13, 2026 08:18
@richapatel1510
richapatel1510 requested a review from bc-peng July 13, 2026 08:18
Comment on lines +10 to +15
// Lets the themeV2 payment billing form register a callback the payment submit
// awaits, so the order can't finalize against a stale billing address. Pass
// null to unregister. Optional: only the themeV2 billing form uses it.
registerEnsureBillingAddressSaved?(
ensureBillingAddressSaved: EnsureBillingAddressSaved | null,
): void;

@bc-peng bc-peng Jul 14, 2026

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.

If possible, can we avoid using register concept here?
We used register concept to handle one-to-many relationships, here it appears to be an on/off hook.

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.

The rest of the PR looks good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 👍 . Done 7fc573d

animesh1987
animesh1987 previously approved these changes Jul 14, 2026
@richapatel1510
richapatel1510 merged commit 7677dba into master Jul 14, 2026
17 checks passed
@richapatel1510
richapatel1510 deleted the CHECKOUT-10150 branch July 14, 2026 06:28
@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Staging US
success 20260714064317 by Launchbay

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse results

🖥️ Desktop:

Category Score
🟢 Performance 97
🟢 Accessibility 90
🟠 Best practices 78

📱 Mobile:

Category Score
🟠 Performance 79
🟢 Accessibility 90
🟠 Best practices 78

@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Integration US
success 20260714064317 by Richa Patel

@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Production US
success 20260714064317 by Launchbay

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.

4 participants