Skip to content

update to version 12.0.0 #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install jq curl
- name: Set Release version env variable
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Run example
run: |
echo "running example";
Expand Down Expand Up @@ -78,7 +81,7 @@ jobs:

echo "maven install";
mvn clean install;
export CLASSPATH=.:./src/main/java:./target/lib/gson-2.8.9.jar:./target/talon-one-client-11.0.0.jar:./target/lib/okio-1.17.2.jar:./target/lib/okhttp-3.14.7.jar:./target/lib/threetenbp-1.4.3.jar:./target/lib/gson-fire-1.8.4.jar;
export CLASSPATH=.:./src/main/java:./target/lib/gson-2.8.9.jar:./target/talon-one-client-${{ env.RELEASE_VERSION }}.jar:./target/lib/okio-1.17.2.jar:./target/lib/okhttp-3.14.7.jar:./target/lib/threetenbp-1.4.3.jar:./target/lib/gson-fire-1.8.4.jar;

echo "java compile";
javac -d . Example.java;
Expand Down
28 changes: 14 additions & 14 deletions Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void main(String[] args) throws Exception {
CartItem cartItem = new CartItem();
cartItem.setName("Hawaiian Pizza");
cartItem.setSku("pizza-x");
cartItem.setQuantity(1);
cartItem.setQuantity(1L);
cartItem.setPrice(new java.math.BigDecimal("5.5"));

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

// Initiating integration request wrapping the customer session update
IntegrationRequest request = new IntegrationRequest()
.customerSession(customerSession)
// Optional parameter of requested information to be present on the response related to the customer session update
.responseContent(Arrays.asList(
IntegrationRequest.ResponseContentEnum.CUSTOMERSESSION,
IntegrationRequest.ResponseContentEnum.CUSTOMERPROFILE
));
.customerSession(customerSession)
// Optional parameter of requested information to be present on the response
// related to the customer session update
.responseContent(Arrays.asList(
IntegrationRequest.ResponseContentEnum.CUSTOMERSESSION,
IntegrationRequest.ResponseContentEnum.CUSTOMERPROFILE));

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

// 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
// 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
for (Effect eff : is.getEffects()) {
if (eff.getEffectType().equals("addLoyaltyPoints")) {
// Typecasting according to the specific effect type
AddLoyaltyPointsEffectProps props = gson.fromJson(
gson.toJson(eff.getProps()),
AddLoyaltyPointsEffectProps.class
);
gson.toJson(eff.getProps()),
AddLoyaltyPointsEffectProps.class);
// Access the specific effect's properties
System.out.println(props.getName());
System.out.println(props.getProgramId());
Expand All @@ -65,9 +66,8 @@ public static void main(String[] args) throws Exception {
if (eff.getEffectType().equals("acceptCoupon")) {
// Typecasting according to the specific effect type
AcceptCouponEffectProps props = gson.fromJson(
gson.toJson(eff.getProps()),
AcceptCouponEffectProps.class
);
gson.toJson(eff.getProps()),
AcceptCouponEffectProps.class);
// work with AcceptCouponEffectProps' properties
// ...
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>one.talon</groupId>
<artifactId>talon-one-client</artifactId>
<version>11.0.0</version>
<version>12.0.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -45,7 +45,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "one.talon:talon-one-client:11.0.0"
compile "one.talon:talon-one-client:12.0.0"
```

### Others
Expand Down
Loading
Loading