Skip to content
  •  
  •  
  •  
364 changes: 354 additions & 10 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "com.chargebee"
version = "4.0.0-beta.2"
version = "4.0.0"
description = "Next-gen Java client library for ChargeBee API"

// Project metadata
Expand Down
Binary file removed dist/chargebee-java-4.0.0-beta.2-javadoc.jar
Binary file not shown.
Binary file removed dist/chargebee-java-4.0.0-beta.2-sources.jar
Binary file not shown.
Binary file removed dist/chargebee-java-4.0.0-beta.2.jar
Binary file not shown.
Binary file added dist/chargebee-java-4.0.0-javadoc.jar
Binary file not shown.
Binary file added dist/chargebee-java-4.0.0-sources.jar
Binary file not shown.
Binary file added dist/chargebee-java-4.0.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The v4 SDK provides a modern, immutable client with enhanced type safety and imp
<dependency>
<groupId>com.chargebee</groupId>
<artifactId>chargebee-java</artifactId>
<version>4.0.0-beta.1</version>
<version>4.0.0</version>
</dependency>
```

Expand Down
25 changes: 15 additions & 10 deletions src/main/java/com/chargebee/v4/client/ChargebeeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import com.chargebee.v4.client.request.RequestContext;
import com.chargebee.v4.client.request.RequestInterceptor;
import com.chargebee.v4.client.request.RequestWrap;
import com.chargebee.v4.exceptions.ChargebeeException;
import com.chargebee.v4.exceptions.ConfigurationException;
import com.chargebee.v4.exceptions.NetworkException;
import com.chargebee.v4.exceptions.TimeoutException;
import com.chargebee.v4.exceptions.TransportException;
import com.chargebee.v4.internal.RetryConfig;
import com.chargebee.v4.transport.*;
import com.chargebee.v4.transport.Transport;
Expand Down Expand Up @@ -105,9 +110,9 @@ public String getBaseUrl() {
* @param path the API path (e.g., "/customers")
* @param queryParams optional query parameters
* @return the HTTP response
* @throws Exception for network, timeout, configuration failures, or interceptor errors
* @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
public Response get(String path, Map<String, List<String>> queryParams) throws Exception {
public Response get(String path, Map<String, List<String>> queryParams) throws ChargebeeException {
Map<String, Object> objectParams = new HashMap<>(queryParams);
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, objectParams);
Request.Builder builder = Request.builder()
Expand All @@ -126,9 +131,9 @@ public Response get(String path, Map<String, List<String>> queryParams) throws E
*
* @param path the API path (e.g., "/customers")
* @return the HTTP response
* @throws Exception for network, timeout, configuration failures, or interceptor errors
* @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
public Response get(String path) throws Exception {
public Response get(String path) throws ChargebeeException {
return get(path, Collections.emptyMap());
}

Expand Down Expand Up @@ -169,9 +174,9 @@ public CompletableFuture<Response> getAsync(String path) {
* @param path the API path (e.g., "/customers")
* @param formData the form data to send
* @return the HTTP response
* @throws Exception for network, timeout, configuration failures, or interceptor errors
* @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
public Response post(String path, Map<String, Object> formData) throws Exception {
public Response post(String path, Map<String, Object> formData) throws ChargebeeException {
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, null);
Request.Builder builder = Request.builder()
.method("POST")
Expand All @@ -191,9 +196,9 @@ public Response post(String path, Map<String, Object> formData) throws Exception
* @param path the API path (e.g., "/customers")
* @param jsonData the JSON data to send
* @return the HTTP response
* @throws Exception for network, timeout, configuration failures, or interceptor errors
* @throws ChargebeeException for network, timeout, configuration failures, or interceptor errors
*/
public Response postJson(String path, String jsonData) throws Exception {
public Response postJson(String path, String jsonData) throws ChargebeeException {
String fullUrl = UrlBuilder.buildUrl(getBaseUrl(), path, null);
Request.Builder builder = Request.builder()
.method("POST")
Expand Down Expand Up @@ -252,7 +257,7 @@ public CompletableFuture<Response> postJsonAsync(String path, String jsonData) {
/**
* Execute a request with optional interceptor.
*/
public Response executeWithInterceptor(Request request) throws Exception {
public Response executeWithInterceptor(Request request) throws ChargebeeException {
if (requestInterceptor != null) {
RequestWrap requestWrap = new RequestWrap(this, request);
return requestInterceptor.handleRequest(requestWrap);
Expand All @@ -276,7 +281,7 @@ public CompletableFuture<Response> executeWithInterceptorAsync(Request request)
/**
* Send a request with retry logic based on the configured RetryConfig.
*/
public Response sendWithRetry(Request request) throws TransportException {
public Response sendWithRetry(Request request) {
Request enrichedRequest = addDefaultHeaders(request);

Integer overrideRetries = enrichedRequest.getMaxNetworkRetriesOverride();
Expand Down
Loading