Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ipp-v3-java-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.intuit.quickbooks-online</groupId>
<artifactId>ipp-v3-java-devkit-pom</artifactId>
<version>6.6.1</version>
<version>6.6.2</version>
</parent>

<artifactId>ipp-v3-java-data</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*******************************************************************************
* Copyright (c) 2025 Intuit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package com.intuit.ipp.data;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/**
* New CloudEvents-based webhook event item.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class WebhooksCloudEvents {

@JsonProperty("specversion")
private String specVersion;

@JsonProperty("id")
private String id;

@JsonProperty("source")
private String source;

@JsonProperty("type")
private String type;

@JsonProperty("datacontenttype")
private String dataContentType;

@JsonProperty("time")
private String time;

@JsonProperty("intuitentityid")
private String intuitEntityId;

@JsonProperty("intuitaccountid")
private String intuitAccountId;

@JsonProperty("data")
private Map<String, Object> data;

public String getSpecVersion() {
return specVersion;
}

public void setSpecVersion(String specVersion) {
this.specVersion = specVersion;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getSource() {
return source;
}

public void setSource(String source) {
this.source = source;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getDataContentType() {
return dataContentType;
}

public void setDataContentType(String dataContentType) {
this.dataContentType = dataContentType;
}

public String getTime() {
return time;
}

public void setTime(String time) {
this.time = time;
}

public String getIntuitEntityId() {
return intuitEntityId;
}

public void setIntuitEntityId(String intuitEntityId) {
this.intuitEntityId = intuitEntityId;
}

public String getIntuitAccountId() {
return intuitAccountId;
}

public void setIntuitAccountId(String intuitAccountId) {
this.intuitAccountId = intuitAccountId;
}

public Map<String, Object> getData() {
return data;
}

public void setData(Map<String, Object> data) {
this.data = data;
}
}
6 changes: 3 additions & 3 deletions ipp-v3-java-devkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ipp-v3-java-devkit-pom</artifactId>
<groupId>com.intuit.quickbooks-online</groupId>
<version>6.6.1</version>
<version>6.6.2</version>
</parent>
<artifactId>ipp-v3-java-devkit</artifactId>
<packaging>jar</packaging>
Expand All @@ -20,8 +20,8 @@
<dependency>
<groupId>com.intuit.quickbooks-online</groupId>
<artifactId>ipp-v3-java-data</artifactId>
<version>6.6.1</version>
<exclusions>
<version>6.6.2</version>
<exclusions>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

import jakarta.xml.bind.DatatypeConverter;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.intuit.ipp.data.WebhooksCloudEvents;
import com.intuit.ipp.util.StringUtils;

import com.intuit.ipp.data.WebhooksEvent;
Expand Down Expand Up @@ -88,6 +92,31 @@ public WebhooksEvent getWebhooksEvent(String payload) {
}

}

/**
* Deserialize new CloudEvents-based webhook payloads which are arrays of events
* PR parity: method name uses getWebhooksCloudEvents (typo preserved)
* @param payload JSON array payload
* @return list of WebhooksCloudEvents or null if payload empty/invalid
*/
public List<WebhooksCloudEvents> getWebhooksCloudEvents(String payload) {
if (!StringUtils.hasText(payload)) {
return null;
}
try {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(payload, new TypeReference<List<WebhooksCloudEvents>>() {});
} catch (JsonParseException e) {
LOG.error("Error while parsing new webhooks payload", e);
return null;
} catch (JsonMappingException e) {
LOG.error("Error while mapping new webhooks payload", e);
return null;
} catch (IOException e) {
LOG.error("IO exception while parsing new webhooks payload", e);
return null;
}
}

/**
* Verifier key to validate webhooks payload
Expand All @@ -98,4 +127,4 @@ private String getVerifierKey() {
}


}
}
2 changes: 1 addition & 1 deletion ipp-v3-java-devkit/src/main/resources/ippdevkit.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Devkit Version
# This version has to be updated according to the pom version
version = 6.6.1
version = 6.6.2

# This is to have the request source to be sent to IDS request header
request.source = V3JavaSDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*******************************************************************************/
package com.intuit.ipp.services;

import com.intuit.ipp.data.WebhooksCloudEvents;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -56,6 +57,15 @@ public void testGetWebhooksEvent() throws FMSException {
Assert.assertNotNull(webhooksEvent);
Assert.assertEquals(webhooksEvent.getEventNotifications().size(), 1);
}


}
@Test
public void testGetWebhooksCloudEvents() throws FMSException {
String newPayload = "[{\"specversion\":\"1.0\",\"id\":\"d1a3aedd-9670-41bf-a4f9-c148a1cc4e03\",\"source\":\"intuit.dsnBgbseACLLRZNxo2dfc4evmEJdxde58xeeYcZliOU=\",\"type\":\"qbo.class.created.v1\",\"time\":\"2025-10-07T19:59:07.034359333Z\",\"intuitentityid\":\"1234\",\"intuitaccountid\":\"310687\"}]";
java.util.List<WebhooksCloudEvents> events = webhooksService.getWebhooksCloudEvents(newPayload);
Assert.assertNotNull(events);
Assert.assertEquals(events.size(), 1);
Assert.assertEquals(events.get(0).getSpecVersion(), "1.0");
Assert.assertEquals(events.get(0).getId(), "d1a3aedd-9670-41bf-a4f9-c148a1cc4e03");
}

}
2 changes: 1 addition & 1 deletion ipp-v3-java-devkit/src/test/resources/ippdevkit.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### IPP Dev Kit helper properties

## Devkit version
version = 6.6.1
version = 6.6.2

# This is to have the request source to be sent to IDS request header
request.source = V3JavaSDK
Expand Down
2 changes: 1 addition & 1 deletion oauth2-platform-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>ipp-v3-java-devkit-pom</artifactId>
<groupId>com.intuit.quickbooks-online</groupId>
<version>6.6.1</version>
<version>6.6.2</version>
</parent>
<artifactId>oauth2-platform-api</artifactId>
<name>Quickbooks API Helper for OAuth2</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ EMAIL=email
INTUIT_NAME=intuit_name

#Version
version = 6.6.1
version = 6.6.2

#MIGRATION SERVICE URL
OAUTH_MIGRATION_URL_PRODUCTION=https://developer.api.intuit.com/v2/oauth2/tokens/migrate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ EMAIL=email
INTUIT_NAME=intuit_name

#Version
version = 6.6.1
version = 6.6.2

#MIGRATION SERVICE URL
OAUTH_MIGRATION_URL_PRODUCTION=https://developer.api.intuit.com/v2/oauth2/tokens/migrate
Expand Down
2 changes: 1 addition & 1 deletion payments-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>ipp-v3-java-devkit-pom</artifactId>
<groupId>com.intuit.quickbooks-online</groupId>
<version>6.6.1</version>
<version>6.6.2</version>
</parent>
<artifactId>payments-api</artifactId>
<name>Payments API SDK</name>
Expand Down
2 changes: 1 addition & 1 deletion payments-api/src/main/resources/payment.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PAYMENTS_BASE_URL_PRODUCTION=https://api.intuit.com/quickbooks/v4/payments/
PAYMENTS_BASE_URL_SANDBOX=https://sandbox.api.intuit.com/quickbooks/v4/payments/

#Version
version = 6.6.1
version = 6.6.2

#TLS Version
TLS_VERSION=TLSv1.2
2 changes: 1 addition & 1 deletion payments-api/src/test/resources/payment.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PAYMENTS_BASE_URL_PRODUCTION=https://api.intuit.com/quickbooks/v4/payments/
PAYMENTS_BASE_URL_SANDBOX=https://sandbox.api.intuit.com/quickbooks/v4/payments/

#Version
version = 6.6.1
version = 6.6.2

#TLS Version
TLS_VERSION=TLSv1.2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.intuit.quickbooks-online</groupId>
<artifactId>ipp-v3-java-devkit-pom</artifactId>
<version>6.6.1</version>
<version>6.6.2</version>
<packaging>pom</packaging>
<name>IPP V3 Java DevKit</name>
<url>https://github.com/intuit/QuickBooks-V3-Java-SDK</url>
Expand Down