Skip to content

Commit ee20ac7

Browse files
Updated stripeclient snippets in Readme.md (#2014)
1 parent d177cbc commit ee20ac7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class StripeExample {
9393
.build();
9494

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

113113
### Per-request Configuration
114114

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

127-
client.customers().list(requestOptions);
127+
client.v1().customers().list(requestOptions);
128128

129-
client.customers().retrieve("cus_123456789", requestOptions);
129+
client.v1().customers().retrieve("cus_123456789", requestOptions);
130130
```
131131

132132
### Configuring automatic retries
@@ -147,7 +147,7 @@ Or on a finer grain level using `RequestOptions`:
147147
RequestOptions options = RequestOptions.builder()
148148
.setMaxNetworkRetries(2)
149149
.build();
150-
client.customers().create(params, options);
150+
client.v1().customers().create(params, options);
151151
```
152152

153153
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
@@ -171,7 +171,7 @@ RequestOptions options = RequestOptions.builder()
171171
.setConnectTimeout(30 * 1000) // in milliseconds
172172
.setReadTimeout(80 * 1000)
173173
.build();
174-
client.customers().create(params, options);
174+
client.v1().customers().create(params, options);
175175
```
176176

177177
Please take care to set conservative read timeouts. Some API requests can take
@@ -207,15 +207,15 @@ CustomerCreateParams params =
207207
.putExtraParam("secret_parameter[secondary]", "secondary value")
208208
.build();
209209

210-
client.customers().create(params);
210+
client.v1().customers().create(params);
211211
```
212212

213213
#### Properties
214214

215215
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:
216216

217217
```java
218-
final Customer customer = client.customers().retrieve("cus_1234");
218+
final Customer customer = client.v1().customers().retrieve("cus_1234");
219219
Boolean featureEnabled =
220220
customer.getRawJsonObject()
221221
.getAsJsonPrimitive("secret_feature_enabled")

0 commit comments

Comments
 (0)