You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ If you are not using Gradle or Maven, you will need to manually install the foll
55
55
- We recommend using the same version of Gson if possible to guarantee compatibility, but you should be able to use any stable version of Gson that is 2.10.1 or newer
56
56
57
57
To use these JARs:
58
+
58
59
1. Download the JARs from the links provided above
59
60
2. Add the JARs to your project's classpath
60
61
@@ -241,6 +242,32 @@ String secondaryValue =
241
242
.getAsString();
242
243
```
243
244
245
+
> [!NOTE]
246
+
> `.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<T>`, so you can only access the raw json of an individual object by going through the list itself.
247
+
>
248
+
> ```java
249
+
>var cards = stripeClient
250
+
> .v1()
251
+
> .issuing()
252
+
> .cards()
253
+
> .list(params);
254
+
>
255
+
>// doesn't work:
256
+
> cards
257
+
> .getData()
258
+
> .get(0)
259
+
> .getRawJsonObject(); // null
260
+
>
261
+
>// instead, go through the list:
262
+
> cards
263
+
> .getRawJsonObject()
264
+
> .getAsJsonArray("data")
265
+
> .get(0)
266
+
> .getAsJsonObject()
267
+
> .getAsJsonPrimitive("undocumented-val")
268
+
> .getAsString(); // "some-val"
269
+
> ```
270
+
244
271
### Writing a plugin
245
272
246
273
If you're writing a plugin that uses the library, we'd appreciate it if you
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`.
270
297
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
271
298
272
-
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).
299
+
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).
273
300
274
301
> **Note**
275
302
> 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.
@@ -279,6 +306,7 @@ Some preview features require a name and version to be set in the `Stripe-Versio
279
306
```java
280
307
Stripe.addBetaVersion("feature_beta", "v3");
281
308
```
309
+
282
310
### Private Preview SDKs
283
311
284
312
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`.
0 commit comments