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
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-27.basil
2025-09-30.clover
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f4b80890ea17e89a543a77a389f29ca9be6fe615
768c16b55352ce5cc78d27c0bbd7448263942018
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class StripeExample {
.build();

try {
Customer customer = client.customers().create(params);
Customer customer = client.v1().customers().create(params);
System.out.println(customer);
} catch (StripeException e) {
e.printStackTrace();
Expand All @@ -102,7 +102,7 @@ Once the legacy pattern is deprecated, new API endpoints will only be accessible

### Per-request Configuration

All of the request methods accept an optional `RequestOptions` object. This is
All the request methods accept an optional `RequestOptions` object. This is
used if you want to set an [idempotency key][idempotency-keys], if you are
using [Stripe Connect][connect-auth], or if you want to pass the secret API
key on each method.
Expand All @@ -114,9 +114,9 @@ RequestOptions requestOptions = RequestOptions.builder()
.setStripeAccount("acct_...")
.build();

client.customers().list(requestOptions);
client.v1().customers().list(requestOptions);

client.customers().retrieve("cus_123456789", requestOptions);
client.v1().customers().retrieve("cus_123456789", requestOptions);
```

### Configuring automatic retries
Expand All @@ -137,7 +137,7 @@ Or on a finer grain level using `RequestOptions`:
RequestOptions options = RequestOptions.builder()
.setMaxNetworkRetries(2)
.build();
client.customers().create(params, options);
client.v1().customers().create(params, options);
```

[Idempotency keys][idempotency-keys] are added to requests to guarantee that
Expand All @@ -161,7 +161,7 @@ RequestOptions options = RequestOptions.builder()
.setConnectTimeout(30 * 1000) // in milliseconds
.setReadTimeout(80 * 1000)
.build();
client.customers().create(params, options);
client.v1().customers().create(params, options);
```

Please take care to set conservative read timeouts. Some API requests can take
Expand Down Expand Up @@ -197,15 +197,15 @@ CustomerCreateParams params =
.putExtraParam("secret_parameter[secondary]", "secondary value")
.build();

client.customers().create(params);
client.v1().customers().create(params);
```

#### Properties

To retrieve undocumented properties from Stripe using Java you can use an option in the library to return the raw JSON object and return the property as a native type. An example of this is shown below:

```java
final Customer customer = client.customers().retrieve("cus_1234");
final Customer customer = client.v1().customers().retrieve("cus_1234");
Boolean featureEnabled =
customer.getRawJsonObject()
.getAsJsonPrimitive("secret_feature_enabled")
Expand Down
765 changes: 432 additions & 333 deletions src/main/java/com/stripe/StripeClient.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static final class EventData {
public static final class Reason {
/** The total error count within this window. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** The error details. */
@SerializedName("error_types")
List<V1BillingMeterErrorReportTriggeredEvent.EventData.Reason.ErrorType> errorTypes;
Expand All @@ -53,7 +53,7 @@ public static final class ErrorType {
String code;
/** The number of errors of this type. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** A list of sample errors of this type. */
@SerializedName("sample_errors")
List<V1BillingMeterErrorReportTriggeredEvent.EventData.Reason.ErrorType.SampleError>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static final class EventData {
public static final class Reason {
/** The total error count within this window. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** The error details. */
@SerializedName("error_types")
List<V1BillingMeterNoMeterFoundEvent.EventData.Reason.ErrorType> errorTypes;
Expand All @@ -51,7 +51,7 @@ public static final class ErrorType {
String code;
/** The number of errors of this type. */
@SerializedName("error_count")
Integer errorCount;
Long errorCount;
/** A list of sample errors of this type. */
@SerializedName("sample_errors")
List<V1BillingMeterNoMeterFoundEvent.EventData.Reason.ErrorType.SampleError> sampleErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,10 @@
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.billing.Cadence;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class V2BillingCadenceBilledEvent extends Event {
/** Data for the v2.billing.cadence.billed event. */
@SerializedName("data")
V2BillingCadenceBilledEvent.EventData data;

@Getter
@Setter
public static final class EventData {
/** The IDs of the invoices that were generated by the tick for this Cadence. */
@SerializedName("invoices")
List<String> invoices;
}

@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.reporting.ReportRun;
import com.stripe.model.v2.billing.Cadence;
import lombok.Getter;

@Getter
public final class V2ReportingReportRunFailedEvent extends Event {
public final class V2BillingCadenceErroredEvent extends Event {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public ReportRun fetchRelatedObject() throws StripeException {
return (ReportRun) super.fetchRelatedObject(this.relatedObject);
public Cadence fetchRelatedObject() throws StripeException {
return (Cadence) super.fetchRelatedObject(this.relatedObject);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.core.Person;
import com.stripe.model.v2.core.AccountPerson;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -28,7 +28,7 @@ public static final class EventData {
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Person fetchRelatedObject() throws StripeException {
return (Person) super.fetchRelatedObject(this.relatedObject);
public AccountPerson fetchRelatedObject() throws StripeException {
return (AccountPerson) super.fetchRelatedObject(this.relatedObject);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.core.Person;
import com.stripe.model.v2.core.AccountPerson;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -28,7 +28,7 @@ public static final class EventData {
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Person fetchRelatedObject() throws StripeException {
return (Person) super.fetchRelatedObject(this.relatedObject);
public AccountPerson fetchRelatedObject() throws StripeException {
return (AccountPerson) super.fetchRelatedObject(this.relatedObject);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.core.Person;
import com.stripe.model.v2.core.AccountPerson;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -28,7 +28,7 @@ public static final class EventData {
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Person fetchRelatedObject() throws StripeException {
return (Person) super.fetchRelatedObject(this.relatedObject);
public AccountPerson fetchRelatedObject() throws StripeException {
return (AccountPerson) super.fetchRelatedObject(this.relatedObject);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static final class Impact {
String httpStatus;
/** The number of impacted requests. */
@SerializedName("impacted_requests")
Integer impactedRequests;
Long impactedRequests;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static final class Impact {
String httpStatus;
/** The number of impacted requests. */
@SerializedName("impacted_requests")
Integer impactedRequests;
Long impactedRequests;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static final class Impact {
String httpStatus;
/** The number of impacted requests. */
@SerializedName("impacted_requests")
Integer impactedRequests;
Long impactedRequests;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static final class Impact {
String httpStatus;
/** The number of impacted requests. */
@SerializedName("impacted_requests")
Integer impactedRequests;
Long impactedRequests;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.google.gson.annotations.SerializedName;
import com.stripe.model.v2.Event;
import java.math.BigDecimal;
import java.time.Instant;
import java.util.List;
import lombok.Getter;
Expand Down Expand Up @@ -43,7 +44,7 @@ public static final class Impact {
String chargeType;
/** The current authorization rate percentage. */
@SerializedName("current_percentage")
String currentPercentage;
BigDecimal currentPercentage;
/** Dimensions that describe what subset of payments are impacted. */
@SerializedName("dimensions")
List<V2CoreHealthAuthorizationRateDropFiringEvent.EventData.Impact.Dimension> dimensions;
Expand All @@ -65,7 +66,7 @@ public static final class Impact {
String paymentMethodType;
/** The previous authorization rate percentage. */
@SerializedName("previous_percentage")
String previousPercentage;
BigDecimal previousPercentage;

public static final class Dimension {
/** The issuer dimension. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.google.gson.annotations.SerializedName;
import com.stripe.model.v2.Event;
import java.math.BigDecimal;
import java.time.Instant;
import java.util.List;
import lombok.Getter;
Expand Down Expand Up @@ -46,7 +47,7 @@ public static final class Impact {
String chargeType;
/** The current authorization rate percentage. */
@SerializedName("current_percentage")
String currentPercentage;
BigDecimal currentPercentage;
/** Dimensions that describe what subset of payments are impacted. */
@SerializedName("dimensions")
List<V2CoreHealthAuthorizationRateDropResolvedEvent.EventData.Impact.Dimension> dimensions;
Expand All @@ -68,7 +69,7 @@ public static final class Impact {
String paymentMethodType;
/** The previous authorization rate percentage. */
@SerializedName("previous_percentage")
String previousPercentage;
BigDecimal previousPercentage;

public static final class Dimension {
/** The issuer dimension. */
Expand Down
Loading
Loading