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
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,6 +231,32 @@ String secondaryValue =
231
231
.getAsString();
232
232
```
233
233
234
+
> [!NOTE]
235
+
> `.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.
236
+
>
237
+
> ```java
238
+
>var cards = stripeClient
239
+
> .v1()
240
+
> .issuing()
241
+
> .cards()
242
+
> .list(params);
243
+
>
244
+
>// doesn't work:
245
+
> cards
246
+
> .getData()
247
+
> .get(0)
248
+
> .getRawJsonObject(); // null
249
+
>
250
+
>// instead, go through the list:
251
+
> cards
252
+
> .getRawJsonObject()
253
+
> .getAsJsonArray("data")
254
+
> .get(0)
255
+
> .getAsJsonObject()
256
+
> .getAsJsonPrimitive("undocumented-val")
257
+
> .getAsString(); // "some-val"
258
+
> ```
259
+
234
260
### Writing a plugin
235
261
236
262
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`.
260
286
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
261
287
262
-
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).
288
+
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).
263
289
264
290
> **Note**
265
291
> 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
269
295
```java
270
296
Stripe.addBetaVersion("feature_beta", "v3");
271
297
```
298
+
272
299
### Private Preview SDKs
273
300
274
301
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