diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 4540bccf09f..6cd09c6a081 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -826bf48af8bcd391512daeaf283b8486347b14c8 \ No newline at end of file +0102be2b08962b7c75658c72ec6a58a9c8abb992 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 97a2932083d..775d1bdf610 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2253 \ No newline at end of file +v2273 \ No newline at end of file diff --git a/README.md b/README.md index 6ea972c84da..15cbaf9d1b0 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,32 @@ String secondaryValue = .getAsString(); ``` +> [!NOTE] +> `.getRawJsonObject()` is only available on the top-level object returned by an API call. For most requests (like `.retrieve()` or `.create()`) you'll get the object itself. But for `.list()` calls, the top level object is a `List`, so you can only access the raw json of an individual object by going through the list itself. +> +> ```java +> var cards = stripeClient +> .v1() +> .issuing() +> .cards() +> .list(params); +> +> // doesn't work: +> cards +> .getData() +> .get(0) +> .getRawJsonObject(); // null +> +> // instead, go through the list: +> cards +> .getRawJsonObject() +> .getAsJsonArray("data") +> .get(0) +> .getAsJsonObject() +> .getAsJsonPrimitive("undocumented-val") +> .getAsString(); // "some-val" +> ``` + ### Writing a plugin If you're writing a plugin that uses the library, we'd appreciate it if you @@ -259,7 +285,7 @@ Stripe.enableTelemetry = false; Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `25.2.0-beta.2`. We would love for you to try these as we incrementally release new features and improve them based on your feedback. - To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation). +To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation). > **Note** > There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK. @@ -269,6 +295,7 @@ Some preview features require a name and version to be set in the `Stripe-Versio ```java Stripe.addBetaVersion("feature_beta", "v3"); ``` + ### Private Preview SDKs Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `25.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-java?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`. diff --git a/src/main/java/com/stripe/StripeEventNotificationHandler.java b/src/main/java/com/stripe/StripeEventNotificationHandler.java index 09e29ca4ea0..93631d30a90 100644 --- a/src/main/java/com/stripe/StripeEventNotificationHandler.java +++ b/src/main/java/com/stripe/StripeEventNotificationHandler.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe; // event-notification-class-imports: The beginning of the section generated from our OpenAPI spec diff --git a/src/main/java/com/stripe/events/UnknownEventNotification.java b/src/main/java/com/stripe/events/UnknownEventNotification.java index c70a4cca034..a91141b59fc 100644 --- a/src/main/java/com/stripe/events/UnknownEventNotification.java +++ b/src/main/java/com/stripe/events/UnknownEventNotification.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.events; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java b/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java index 195420e022d..6a0288f4098 100644 --- a/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java +++ b/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.examples; import com.stripe.StripeClient; diff --git a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java index 728b786d83f..82829cb1901 100644 --- a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java +++ b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.examples; import com.stripe.StripeClient; diff --git a/src/main/java/com/stripe/model/v2/core/EventNotification.java b/src/main/java/com/stripe/model/v2/core/EventNotification.java index 374abbb60f8..a56742d3a4a 100644 --- a/src/main/java/com/stripe/model/v2/core/EventNotification.java +++ b/src/main/java/com/stripe/model/v2/core/EventNotification.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.model.v2.core; import com.google.gson.JsonObject; diff --git a/src/main/java/com/stripe/service/V2Services.java b/src/main/java/com/stripe/service/V2Services.java index b69848f3579..8dd57ea4b9b 100644 --- a/src/main/java/com/stripe/service/V2Services.java +++ b/src/main/java/com/stripe/service/V2Services.java @@ -21,8 +21,8 @@ public com.stripe.service.v2.CoreService core() { return new com.stripe.service.v2.CoreService(this.getResponseGetter()); } - public com.stripe.service.v2.DatumService data() { - return new com.stripe.service.v2.DatumService(this.getResponseGetter()); + public com.stripe.service.v2.DataService data() { + return new com.stripe.service.v2.DataService(this.getResponseGetter()); } public com.stripe.service.v2.ExtendService extend() { diff --git a/src/main/java/com/stripe/service/v2/DatumService.java b/src/main/java/com/stripe/service/v2/DataService.java similarity index 75% rename from src/main/java/com/stripe/service/v2/DatumService.java rename to src/main/java/com/stripe/service/v2/DataService.java index a8199e24c3b..21a4841920f 100644 --- a/src/main/java/com/stripe/service/v2/DatumService.java +++ b/src/main/java/com/stripe/service/v2/DataService.java @@ -4,8 +4,8 @@ import com.stripe.net.ApiService; import com.stripe.net.StripeResponseGetter; -public final class DatumService extends ApiService { - public DatumService(StripeResponseGetter responseGetter) { +public final class DataService extends ApiService { + public DataService(StripeResponseGetter responseGetter) { super(responseGetter); } diff --git a/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java b/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java index eaa77ac4bd2..31c567d6468 100644 --- a/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java +++ b/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe; import static org.junit.jupiter.api.Assertions.assertEquals;