Skip to content

Commit 36f965c

Browse files
authored
@W-13547150 - Do Not Proceed to Checkout Review with Invalid Billing Address (#1632)
* Fix checkout flow - Don't proceed in checkout flow with invalid billing address * Update CHANGELOG.md * Fix lint --------- Signed-off-by: Ben Chypak <bchypak@mobify.com>
1 parent 4c6c2dd commit 36f965c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
### Bug Fixes
4646

47+
- Fix checkout allowing you to proceed to review with invalid billing address [#1632](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1632)
4748
- Fix password change functionality [#1634](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1634)
4849
- Remove internal linter rule that is missing in generated projects [#1554](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1554)
4950
- Fix bug where you can add duplicates of the same item to the wishlist. Also fixes bug where skeleton appears when removing last item from the wishlist. [#1560](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1560)

packages/template-retail-react-app/app/pages/checkout/partials/payment.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ const Payment = () => {
131131
if (!appliedPayment) {
132132
await onPaymentSubmit(paymentFormValues)
133133
}
134-
await onBillingSubmit()
135-
goToNextStep()
134+
135+
// If successful `onBillingSubmit` returns the updated basket. If the form was invalid on
136+
// submit, `undefined` is returned.
137+
const updatedBasket = await onBillingSubmit()
138+
139+
if (updatedBasket) {
140+
goToNextStep()
141+
}
136142
})
137143

138144
return (

0 commit comments

Comments
 (0)