Skip to content

Commit

Permalink
Create
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakh committed Jul 11, 2024
1 parent 87ae834 commit 4e9f5a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/handson/Task04b_CHECKOUT.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public static void main(String[] args) throws IOException, ExecutionException, I
// TODO additionally: add custom line items, add shipping method
//
logger.info("Created cart/order ID: " +
customerService.getCustomerByKey("al-customer")
customerService.getCustomerByKey("la-customer")
.thenComposeAsync(cartService::createCart)

.thenComposeAsync(cartApiHttpResponse -> cartService.addProductToCartBySkusAndChannel(
cartApiHttpResponse, channel, "RWG-09", "GARM-093"
cartApiHttpResponse, channel, "RWG-09", "GARM-093", "ADPC-7"
))

.thenComposeAsync(cartApiHttpResponse -> cartService.addDiscountToCart(cartApiHttpResponse, "BOGO"))
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/handson/Task04c_CART_MERGING.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void main(String[] args) throws IOException, ExecutionException, I

// Get a customer and create a cart for this customer
//
final Cart cart = customerService.getCustomerByKey("customer-michael15")
final Cart cart = customerService.getCustomerByKey("al-customer")
.thenComposeAsync(cartService::createCart)
.toCompletableFuture().get()
.getBody();
Expand All @@ -54,8 +54,8 @@ public static void main(String[] args) throws IOException, ExecutionException, I
.post(
CustomerSigninBuilder.of()
.anonymousCartSignInMode(MERGE_WITH_EXISTING_CUSTOMER_CART) // Switch to USE_AS_NEW_ACTIVE_CUSTOMER_CART and notice the difference
.email("michael15@example.com")
.password("password")
.email("liakh.aliaksandr@gmail.com")
.password("my_password")
.anonymousCart(CartResourceIdentifierBuilder.of()
.id(anonymousCart.getId())
.build())
Expand Down

0 comments on commit 4e9f5a5

Please sign in to comment.