Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
### v3.37.0 ( 2025-09-23)
* * *

### New Resources:
* PersonalizedOffer has been added.
* OfferFulfillment has been added.
* OfferEvent has been added.
* OmnichannelSubscriptionItemOffer has been added.

### New Attributes:
* business_entity_id has been added to Customer#Balance.
* processor_advice_code has been added to GatewayErrorDetail.
* processor_advice_code has been added to Transaction#GatewayErrorDetail.
* omnichannel_subscription_item_offers has been added to OmnichannelSubscriptionItem.
* linked_omnichannel_subscriptions has been added to OmnichannelTransaction.
* linked_omnichannel_one_time_orders has been added to OmnichannelTransaction.
* contract_term has been added to Ramp.
* charge_once has been added to Ramp#ItemsToAdd.
* charge_on_option has been added to Ramp#ItemsToAdd.
* charge_on_event has been added to Ramp#ItemsToAdd.
* charge_once has been added to Ramp#ItemsToUpdate.
* charge_on_option has been added to Ramp#ItemsToUpdate.
* charge_on_event has been added to Ramp#ItemsToUpdate.
* error_file_path has been added to UsageFile.
* error_file_url has been added to UsageFile.

### New Endpoint:
* move has been added to OmnichannelSubscription.

### New Parameters:
* offline_payment_method has been added to Estimate#CreateSubItemEstimateRequest.
* offline_payment_method has been added to Estimate#CreateSubItemForCustomerEstimateRequest.
* offline_payment_method has been added to HostedPage#CheckoutNewForItemsRequest.
* offline_payment_method has been added to Quote#SubscriptionCreateSubItemsForCustomerQuoteRequest.
* offline_payment_method has been added to Quote#SubscriptionEditCreateSubCustomerQuoteForItemsRequest.
* contract_term has been added to Ramp#CreateForSubscriptionRequest.
* items_to_add has been added to Ramp#CreateForSubscriptionRequest.
* items_to_update has been added to Ramp#CreateForSubscriptionRequest.
* contract_term has been added to Ramp#UpdateRequest.
* items_to_add has been added to Ramp#UpdateRequest.
* items_to_update has been added to Ramp#UpdateRequest.

### New Enums:
* DUNNING_UPDATED has been added EventType.
* OMNICHANNEL_SUBSCRIPTION_MOVED_IN has been added to EventType.


### Bug Fixes:
* currency list action has been marked as ListRequest.
* index has been removed from CreditNote#ShippingAddress.
* index has been removed from Invoice#ShippingAddress
* index has been removed from Order#ShippingAddress.
* index has been removed from Quote#ShippingAddress.
* index has been removed from SubscriptionEstimate#ShippingAddress.
* index has been removed from Subscription#ShippingAddress.

### v3.36.1 (2025-09-16)
* * *

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.chargebee</groupId>
<artifactId>chargebee-java</artifactId>
<version>3.36.1</version>
<version>3.37.0</version>


<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chargebee/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Environment {

public static final String API_VERSION = "v2";

public static final String LIBRARY_VERSION = "3.36.1";
public static final String LIBRARY_VERSION = "3.37.0";

private final String apiBaseUrl;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/chargebee/internal/HttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@ private static Resp sendRequest(HttpURLConnection conn) throws IOException {
int httpRespCode = conn.getResponseCode();
final String UBB_BATCH_INGESTION_INVALID_REQUEST = "ubb_batch_ingestion_invalid_request";
Map<String, List<String>> responseHeaders = conn.getHeaderFields();
if (httpRespCode == HttpURLConnection.HTTP_NO_CONTENT) {
throw new RuntimeException("Got http_no_content response");
}
boolean error = httpRespCode < 200 || httpRespCode > 299;
String content = getContentAsString(conn, error);
JSONObject jsonResp = getContentAsJSON(content);
JSONObject jsonResp = getContentAsJSON(content, httpRespCode);
if (error) {
try {
jsonResp.getString("api_error_code");
Expand Down Expand Up @@ -297,8 +294,11 @@ private static String getAuthValue(Environment config) {
.replaceAll("\r?", "").replaceAll("\n?", "");
}

private static JSONObject getContentAsJSON(String content) throws IOException {
private static JSONObject getContentAsJSON(String content, int httpRespCode) throws IOException {
try {
if(httpRespCode == 204) {
return null;
}
return new JSONObject(content);
} catch (JSONException exp) {
if (content.contains("503")){
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/chargebee/internal/ResultBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,22 @@ public UsageFile usageFile() {
return (UsageFile)get("usage_file");
}

public PersonalizedOffer personalizedOffer() {
return (PersonalizedOffer)get("personalized_offer");
}

public Brand brand() {
return (Brand)get("brand");
}

public OfferFulfillment offerFulfillment() {
return (OfferFulfillment)get("offer_fulfillment");
}

public OfferEvent offerEvent() {
return (OfferEvent)get("offer_event");
}

public WebhookEndpoint webhookEndpoint() {
return (WebhookEndpoint)get("webhook_endpoint");
}
Expand Down Expand Up @@ -408,6 +420,10 @@ public List<InAppSubscription> inAppSubscriptions() {
return (List<InAppSubscription>) getList("in_app_subscriptions", "in_app_subscription");
}

public List<PersonalizedOffer> personalizedOffers() {
return (List<PersonalizedOffer>) getList("personalized_offers", "personalized_offer");
}


private List<? extends Resource> getList(String pluralName, String singularName) {
JSONArray listModels = jsonObj.optJSONArray(pluralName);
Expand Down Expand Up @@ -446,6 +462,9 @@ public JSONObject jsonObj(){
@Override
public String toString() {
try {
if(jsonObj == null){
return null;
}
return jsonObj.toString(2);
} catch (JSONException ex) {
throw new RuntimeException(ex);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chargebee/models/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public UpdateCardForCustomerRequest customerVatNumber(String customerVatNumber)
params.addOpt("customer[vat_number]", customerVatNumber);
return this;
}

@Override
public Params params() {
return params;
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/com/chargebee/models/CreditNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,6 @@ public ValidationStatus validationStatus() {
return optEnum("validation_status", ValidationStatus.class);
}

public Integer index() {
return reqInteger("index");
}

}

public static class BillingAddress extends Resource<BillingAddress> {
Expand Down Expand Up @@ -1198,32 +1194,32 @@ public RecordRefundRequest transactionId(String transactionId) {
params.addOpt("transaction[id]", transactionId);
return this;
}

public RecordRefundRequest transactionAmount(Long transactionAmount) {
params.addOpt("transaction[amount]", transactionAmount);
return this;
}

public RecordRefundRequest transactionPaymentMethod(com.chargebee.models.enums.PaymentMethod transactionPaymentMethod) {
params.add("transaction[payment_method]", transactionPaymentMethod);
return this;
}

public RecordRefundRequest transactionReferenceNumber(String transactionReferenceNumber) {
params.addOpt("transaction[reference_number]", transactionReferenceNumber);
return this;
}

public RecordRefundRequest transactionCustomPaymentMethodId(String transactionCustomPaymentMethodId) {
params.addOpt("transaction[custom_payment_method_id]", transactionCustomPaymentMethodId);
return this;
}

public RecordRefundRequest transactionDate(Timestamp transactionDate) {
params.add("transaction[date]", transactionDate);
return this;
}

@Override
public Params params() {
return params;
Expand Down Expand Up @@ -1390,7 +1386,7 @@ public RemoveTaxWithheldRefundRequest taxWithheldId(String taxWithheldId) {
params.add("tax_withheld[id]", taxWithheldId);
return this;
}

@Override
public Params params() {
return params;
Expand Down
Loading