acme-shop/checkout-service
Lightrun Interactive Demo
Step 1 of 9

Block checkout for undeliverable addresses #4281

Openmaya-chen wants to merge 1 commit into main from feature/strict-address-validation
MC
Maya Chenopened this pull request just now

Improve checkout reliability by preventing users from placing orders with addresses marked as not deliverable by the address validation provider.

@@ -12,4 +12,8 @@ public Address validateAndNormalize(Address address) {
1 AddressValidationResult result = addressClient.validate(address);
2- return result.normalizedAddress();
3+
4+ if (!result.isDeliverable()) {
5+ throw new InvalidShippingAddressException("Address is not deliverable");
6+ }
7+
8+ return result.normalizedAddress();
All checks have passed
ci / unit-tests38s
ci / integration-tests2m 14s
lint / eslint12s
security / codeql1m 03s
Choose review flow
Compare the same PR through two different processes.
Tip: continue with “Without Lightrun” first to see the contrast.