Skip to content

Commit 409aa2c

Browse files
committed
fix example.java
1 parent b65bb8c commit 409aa2c

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Example.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void main(String[] args) throws Exception {
2424
CartItem cartItem = new CartItem();
2525
cartItem.setName("Hawaiian Pizza");
2626
cartItem.setSku("pizza-x");
27-
cartItem.setQuantity(1);
27+
cartItem.setQuantity(1L);
2828
cartItem.setPrice(new java.math.BigDecimal("5.5"));
2929

3030
// Creating a customer session of V2
@@ -35,12 +35,12 @@ public static void main(String[] args) throws Exception {
3535

3636
// Initiating integration request wrapping the customer session update
3737
IntegrationRequest request = new IntegrationRequest()
38-
.customerSession(customerSession)
39-
// Optional parameter of requested information to be present on the response related to the customer session update
40-
.responseContent(Arrays.asList(
41-
IntegrationRequest.ResponseContentEnum.CUSTOMERSESSION,
42-
IntegrationRequest.ResponseContentEnum.CUSTOMERPROFILE
43-
));
38+
.customerSession(customerSession)
39+
// Optional parameter of requested information to be present on the response
40+
// related to the customer session update
41+
.responseContent(Arrays.asList(
42+
IntegrationRequest.ResponseContentEnum.CUSTOMERSESSION,
43+
IntegrationRequest.ResponseContentEnum.CUSTOMERPROFILE));
4444

4545
// Flag to communicate whether the request is a "dry run"
4646
Boolean dryRun = false;
@@ -49,14 +49,15 @@ public static void main(String[] args) throws Exception {
4949
IntegrationStateV2 is = iApi.updateCustomerSessionV2("deetdoot", request, dryRun, null);
5050
System.out.println(is.toString());
5151

52-
// Parsing the returned effects list, please consult https://developers.talon.one/Integration-API/handling-effects-v2 for the full list of effects and their corresponding properties
52+
// Parsing the returned effects list, please consult
53+
// https://developers.talon.one/Integration-API/handling-effects-v2 for the full
54+
// list of effects and their corresponding properties
5355
for (Effect eff : is.getEffects()) {
5456
if (eff.getEffectType().equals("addLoyaltyPoints")) {
5557
// Typecasting according to the specific effect type
5658
AddLoyaltyPointsEffectProps props = gson.fromJson(
57-
gson.toJson(eff.getProps()),
58-
AddLoyaltyPointsEffectProps.class
59-
);
59+
gson.toJson(eff.getProps()),
60+
AddLoyaltyPointsEffectProps.class);
6061
// Access the specific effect's properties
6162
System.out.println(props.getName());
6263
System.out.println(props.getProgramId());
@@ -65,9 +66,8 @@ public static void main(String[] args) throws Exception {
6566
if (eff.getEffectType().equals("acceptCoupon")) {
6667
// Typecasting according to the specific effect type
6768
AcceptCouponEffectProps props = gson.fromJson(
68-
gson.toJson(eff.getProps()),
69-
AcceptCouponEffectProps.class
70-
);
69+
gson.toJson(eff.getProps()),
70+
AcceptCouponEffectProps.class);
7171
// work with AcceptCouponEffectProps' properties
7272
// ...
7373
}

0 commit comments

Comments
 (0)