@@ -93,7 +93,7 @@ public class StripeExample {
93
93
.build();
94
94
95
95
try {
96
- Customer customer = client. customers(). create(params);
96
+ Customer customer = client. v1() . customers(). create(params);
97
97
System . out. println(customer);
98
98
} catch (StripeException e) {
99
99
e. printStackTrace();
@@ -112,7 +112,7 @@ Once the legacy pattern is deprecated, new API endpoints will only be accessible
112
112
113
113
### Per-request Configuration
114
114
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
116
116
used if you want to set an [ idempotency key] [ idempotency-keys ] , if you are
117
117
using [ Stripe Connect] [ connect-auth ] , or if you want to pass the secret API
118
118
key on each method.
@@ -124,9 +124,9 @@ RequestOptions requestOptions = RequestOptions.builder()
124
124
.setStripeAccount(" acct_..." )
125
125
.build();
126
126
127
- client. customers(). list(requestOptions);
127
+ client. v1() . customers(). list(requestOptions);
128
128
129
- client. customers(). retrieve(" cus_123456789" , requestOptions);
129
+ client. v1() . customers(). retrieve(" cus_123456789" , requestOptions);
130
130
```
131
131
132
132
### Configuring automatic retries
@@ -147,7 +147,7 @@ Or on a finer grain level using `RequestOptions`:
147
147
RequestOptions options = RequestOptions . builder()
148
148
.setMaxNetworkRetries(2 )
149
149
.build();
150
- client. customers(). create(params, options);
150
+ client. v1() . customers(). create(params, options);
151
151
```
152
152
153
153
[ Idempotency keys] [ idempotency-keys ] are added to requests to guarantee that
@@ -171,7 +171,7 @@ RequestOptions options = RequestOptions.builder()
171
171
.setConnectTimeout(30 * 1000 ) // in milliseconds
172
172
.setReadTimeout(80 * 1000 )
173
173
.build();
174
- client. customers(). create(params, options);
174
+ client. v1() . customers(). create(params, options);
175
175
```
176
176
177
177
Please take care to set conservative read timeouts. Some API requests can take
@@ -207,15 +207,15 @@ CustomerCreateParams params =
207
207
.putExtraParam(" secret_parameter[secondary]" , " secondary value" )
208
208
.build();
209
209
210
- client. customers(). create(params);
210
+ client. v1() . customers(). create(params);
211
211
```
212
212
213
213
#### Properties
214
214
215
215
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:
216
216
217
217
``` java
218
- final Customer customer = client. customers(). retrieve(" cus_1234" );
218
+ final Customer customer = client. v1() . customers(). retrieve(" cus_1234" );
219
219
Boolean featureEnabled =
220
220
customer. getRawJsonObject()
221
221
.getAsJsonPrimitive(" secret_feature_enabled" )
0 commit comments