Skip to content

Commit a51ee2e

Browse files
authored
Merge pull request #918 from stripe/remi/codegen-4ec3068
Multiple API changes
2 parents 50310bf + a0b7db1 commit a51ee2e

17 files changed

+254
-119
lines changed

src/main/java/com/stripe/model/Charge.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ public static class Outcome extends StripeObject {
925925
/**
926926
* Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and
927927
* `invalid`. See [understanding declines](https://stripe.com/docs/declines) and [Radar
928-
* reviews](radar/review) for details.
928+
* reviews](https://stripe.com/docs/radar/reviews) for details.
929929
*/
930930
@SerializedName("type")
931931
String type;

src/main/java/com/stripe/model/PaymentIntent.java

+5-21
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
7474
String cancellationReason;
7575

7676
/**
77-
* One of `automatic` (default) or `manual`.
77+
* Controls when the funds will be captured from the customer's account.
7878
*
79-
* <p>When the capture method is `automatic`, Stripe automatically captures funds when the
80-
* customer authorizes the payment.
81-
*
82-
* <p>Change `capture_method` to manual if you wish to use [separate authorization and
83-
* capture](https://stripe.com/docs/payments/capture-later) for payment methods that support this.
79+
* <p>One of `automatic`, or `manual`.
8480
*/
8581
@SerializedName("capture_method")
8682
String captureMethod;
@@ -103,18 +99,6 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
10399
@SerializedName("client_secret")
104100
String clientSecret;
105101

106-
/**
107-
* One of `automatic` (default) or `manual`.
108-
*
109-
* <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
110-
* publishable key. After `next_action`s are handled, no additional confirmation is required to
111-
* complete the payment.
112-
*
113-
* <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
114-
* key. The PaymentIntent returns to the `requires_confirmation` state after handling
115-
* `next_action`s, and requires your server to initiate each payment attempt with an explicit
116-
* confirmation.
117-
*/
118102
@SerializedName("confirmation_method")
119103
String confirmationMethod;
120104

@@ -235,9 +219,7 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
235219
* [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the
236220
* transaction completes.
237221
*
238-
* <p>Use `on_session` if you intend to only reuse the payment method when your customer is
239-
* present in your checkout flow. Use `off_session` if your customer may or may not be in your
240-
* checkout flow. For more, learn to [save card details after a
222+
* <p>For more, learn to [save card details after a
241223
* payment](https://stripe.com/docs/payments/save-after-payment).
242224
*
243225
* <p>Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with
@@ -247,6 +229,8 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
247229
* collect [off-session
248230
* payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards)
249231
* for this customer.
232+
*
233+
* <p>One of `off_session`, or `on_session`.
250234
*/
251235
@SerializedName("setup_future_usage")
252236
String setupFutureUsage;

src/main/java/com/stripe/model/checkout/Session.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public class Session extends ApiResource implements HasId {
8585
* The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's
8686
* locale is used.
8787
*
88-
* <p>One of `auto`, `da`, `de`, `en`, `es`, `fi`, `fr`, `it`, `ja`, `nb`, `nl`, `pl`, `pt`, `sv`,
89-
* or `zh`.
88+
* <p>One of `auto`, `da`, `de`, `en`, `es`, `fi`, `fr`, `it`, `ja`, `ms`, `nb`, `nl`, `pl`, `pt`,
89+
* `sv`, or `zh`.
9090
*/
9191
@SerializedName("locale")
9292
String locale;
@@ -125,7 +125,6 @@ public class Session extends ApiResource implements HasId {
125125
* Describes the type of transaction being performed by Checkout in order to customize relevant
126126
* text on the page, such as the submit button. `submit_type` can only be specified on Checkout
127127
* Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode.
128-
* Supported values are `auto`, `book`, `donate`, or `pay`.
129128
*
130129
* <p>One of `auto`, `book`, `donate`, or `pay`.
131130
*/

src/main/java/com/stripe/model/issuing/Authorization.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,14 @@ public static class ViolatedAuthorizationControl extends StripeObject {
470470
@EqualsAndHashCode(callSuper = false)
471471
public static class VerificationData extends StripeObject {
472472
/**
473-
* Wether the cardholder provided an address first line and if it matched the cardholder’s
473+
* Whether the cardholder provided an address first line and if it matched the cardholder’s
474474
* `billing.address.line1`. One of `match`, `mismatch`, or `not_provided`.
475475
*/
476476
@SerializedName("address_line1_check")
477477
String addressLine1Check;
478478

479479
/**
480-
* Wether the cardholder provided a zip (or postal code) and if it matched the cardholder’s
480+
* Whether the cardholder provided a zip (or postal code) and if it matched the cardholder’s
481481
* `billing.address.postal_code`. One of `match`, `mismatch`, or `not_provided`.
482482
*/
483483
@SerializedName("address_zip_check")
@@ -488,7 +488,7 @@ public static class VerificationData extends StripeObject {
488488
String authentication;
489489

490490
/**
491-
* Wether the cardholder provided a CVC and if it matched Stripe’s record. One of `match`,
491+
* Whether the cardholder provided a CVC and if it matched Stripe’s record. One of `match`,
492492
* `mismatch`, or `not_provided`.
493493
*/
494494
@SerializedName("cvc_check")

src/main/java/com/stripe/model/issuing/Card.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ public static class Shipping extends StripeObject {
408408
@SerializedName("address")
409409
Address address;
410410

411-
/** The delivery service that shipped a card. One of `fedex` or `usps`. */
411+
/**
412+
* The delivery company that shipped a card.
413+
*
414+
* <p>One of `fedex`, or `usps`.
415+
*/
412416
@SerializedName("carrier")
413417
String carrier;
414418

src/main/java/com/stripe/model/issuing/Cardholder.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
@Setter
2626
@EqualsAndHashCode(callSuper = false)
2727
public class Cardholder extends ApiResource implements HasId, MetadataStore<Cardholder> {
28+
/**
29+
* Spending rules that give you some control over how this cardholder's cards can be used. Refer
30+
* to our [authorizations](https://stripe.com/docs/issuing/authorizations) documentation for more
31+
* details.
32+
*/
2833
@SerializedName("authorization_controls")
2934
AuthorizationControls authorizationControls;
3035

@@ -256,15 +261,15 @@ public static class AuthorizationControls extends StripeObject {
256261
/**
257262
* Array of strings containing
258263
* [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category)
259-
* of authorizations permitted on this card.
264+
* of authorizations permitted on this cardholder's cards.
260265
*/
261266
@SerializedName("allowed_categories")
262267
List<String> allowedCategories;
263268

264269
/**
265270
* Array of strings containing
266271
* [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category)
267-
* of authorizations to always decline on this card.
272+
* of authorizations to always decline on this cardholder's cards.
268273
*/
269274
@SerializedName("blocked_categories")
270275
List<String> blockedCategories;

src/main/java/com/stripe/model/issuing/Transaction.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ public class Transaction extends ApiResource
111111
String object;
112112

113113
/**
114-
* One of `capture`, `refund`, `cash_withdrawal`, `refund_reversal`, `dispute`, or `dispute_loss`.
114+
* The nature of the transaction.
115+
*
116+
* <p>One of `capture`, `cash_withdrawal`, `dispute`, `dispute_loss`, `refund`, or
117+
* `refund_reversal`.
115118
*/
116119
@SerializedName("type")
117120
String type;

src/main/java/com/stripe/model/terminal/Location.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.Address;
77
import com.stripe.model.HasId;
8+
import com.stripe.model.MetadataStore;
89
import com.stripe.net.ApiResource;
910
import com.stripe.net.RequestOptions;
1011
import com.stripe.param.terminal.LocationCreateParams;
@@ -20,7 +21,7 @@
2021
@Getter
2122
@Setter
2223
@EqualsAndHashCode(callSuper = false)
23-
public class Location extends ApiResource implements HasId {
24+
public class Location extends ApiResource implements HasId, MetadataStore<Location> {
2425
@SerializedName("address")
2526
Address address;
2627

@@ -37,6 +38,21 @@ public class Location extends ApiResource implements HasId {
3738
@SerializedName("id")
3839
String id;
3940

41+
/**
42+
* Has the value `true` if the object exists in live mode or the value `false` if the object
43+
* exists in test mode.
44+
*/
45+
@SerializedName("livemode")
46+
Boolean livemode;
47+
48+
/**
49+
* Set of key-value pairs that you can attach to an object. This can be useful for storing
50+
* additional information about the object in a structured format.
51+
*/
52+
@Getter(onMethod_ = {@Override})
53+
@SerializedName("metadata")
54+
Map<String, String> metadata;
55+
4056
/**
4157
* String representing the object's type. Objects of the same type share the same value.
4258
*
@@ -108,6 +124,7 @@ public static Location create(LocationCreateParams params, RequestOptions option
108124
* Updates a <code>Location</code> object by setting the values of the parameters passed. Any
109125
* parameters not provided will be left unchanged.
110126
*/
127+
@Override
111128
public Location update(Map<String, Object> params) throws StripeException {
112129
return update(params, (RequestOptions) null);
113130
}
@@ -116,6 +133,7 @@ public Location update(Map<String, Object> params) throws StripeException {
116133
* Updates a <code>Location</code> object by setting the values of the parameters passed. Any
117134
* parameters not provided will be left unchanged.
118135
*/
136+
@Override
119137
public Location update(Map<String, Object> params, RequestOptions options)
120138
throws StripeException {
121139
String url =

src/main/java/com/stripe/model/terminal/Reader.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.stripe.Stripe;
55
import com.stripe.exception.StripeException;
66
import com.stripe.model.HasId;
7+
import com.stripe.model.MetadataStore;
78
import com.stripe.net.ApiResource;
89
import com.stripe.net.RequestOptions;
910
import com.stripe.param.terminal.ReaderCreateParams;
@@ -19,7 +20,7 @@
1920
@Getter
2021
@Setter
2122
@EqualsAndHashCode(callSuper = false)
22-
public class Reader extends ApiResource implements HasId {
23+
public class Reader extends ApiResource implements HasId, MetadataStore<Reader> {
2324
/** Always true for a deleted object. */
2425
@SerializedName("deleted")
2526
Boolean deleted;
@@ -45,10 +46,25 @@ public class Reader extends ApiResource implements HasId {
4546
@SerializedName("label")
4647
String label;
4748

49+
/**
50+
* Has the value `true` if the object exists in live mode or the value `false` if the object
51+
* exists in test mode.
52+
*/
53+
@SerializedName("livemode")
54+
Boolean livemode;
55+
4856
/** The location identifier of the reader. */
4957
@SerializedName("location")
5058
String location;
5159

60+
/**
61+
* Set of key-value pairs that you can attach to an object. This can be useful for storing
62+
* additional information about the object in a structured format.
63+
*/
64+
@Getter(onMethod_ = {@Override})
65+
@SerializedName("metadata")
66+
Map<String, String> metadata;
67+
5268
/**
5369
* String representing the object's type. Objects of the same type share the same value.
5470
*
@@ -69,6 +85,7 @@ public class Reader extends ApiResource implements HasId {
6985
* Updates a <code>Reader</code> object by setting the values of the parameters passed. Any
7086
* parameters not provided will be left unchanged.
7187
*/
88+
@Override
7289
public Reader update(Map<String, Object> params) throws StripeException {
7390
return update(params, (RequestOptions) null);
7491
}
@@ -77,6 +94,7 @@ public Reader update(Map<String, Object> params) throws StripeException {
7794
* Updates a <code>Reader</code> object by setting the values of the parameters passed. Any
7895
* parameters not provided will be left unchanged.
7996
*/
97+
@Override
8098
public Reader update(Map<String, Object> params, RequestOptions options) throws StripeException {
8199
String url =
82100
String.format(

src/main/java/com/stripe/param/PaymentIntentCreateParams.java

+4-49
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,7 @@ public class PaymentIntentCreateParams extends ApiRequestParams {
3030
@SerializedName("application_fee_amount")
3131
Long applicationFeeAmount;
3232

33-
/**
34-
* One of `automatic` (default) or `manual`.
35-
*
36-
* <p>When the capture method is `automatic`, Stripe automatically captures funds when the
37-
* customer authorizes the payment.
38-
*
39-
* <p>Change `capture_method` to manual if you wish to use [separate authorization and
40-
* capture](https://stripe.com/docs/payments/capture-later) for payment methods that support this.
41-
*/
33+
/** Controls when the funds will be captured from the customer's account. */
4234
@SerializedName("capture_method")
4335
CaptureMethod captureMethod;
4436

@@ -51,18 +43,6 @@ public class PaymentIntentCreateParams extends ApiRequestParams {
5143
@SerializedName("confirm")
5244
Boolean confirm;
5345

54-
/**
55-
* One of `automatic` (default) or `manual`.
56-
*
57-
* <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
58-
* publishable key. After `next_action`s are handled, no additional confirmation is required to
59-
* complete the payment.
60-
*
61-
* <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
62-
* key. The PaymentIntent returns to the `requires_confirmation` state after handling
63-
* `next_action`s, and requires your server to initiate each payment attempt with an explicit
64-
* confirmation.
65-
*/
6646
@SerializedName("confirmation_method")
6747
ConfirmationMethod confirmationMethod;
6848

@@ -201,9 +181,7 @@ public class PaymentIntentCreateParams extends ApiRequestParams {
201181
* [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the
202182
* transaction completes.
203183
*
204-
* <p>Use `on_session` if you intend to only reuse the payment method when your customer is
205-
* present in your checkout flow. Use `off_session` if your customer may or may not be in your
206-
* checkout flow. For more, learn to [save card details after a
184+
* <p>For more, learn to [save card details after a
207185
* payment](https://stripe.com/docs/payments/save-after-payment).
208186
*
209187
* <p>Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with
@@ -454,16 +432,7 @@ public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
454432
return this;
455433
}
456434

457-
/**
458-
* One of `automatic` (default) or `manual`.
459-
*
460-
* <p>When the capture method is `automatic`, Stripe automatically captures funds when the
461-
* customer authorizes the payment.
462-
*
463-
* <p>Change `capture_method` to manual if you wish to use [separate authorization and
464-
* capture](https://stripe.com/docs/payments/capture-later) for payment methods that support
465-
* this.
466-
*/
435+
/** Controls when the funds will be captured from the customer's account. */
467436
public Builder setCaptureMethod(CaptureMethod captureMethod) {
468437
this.captureMethod = captureMethod;
469438
return this;
@@ -480,18 +449,6 @@ public Builder setConfirm(Boolean confirm) {
480449
return this;
481450
}
482451

483-
/**
484-
* One of `automatic` (default) or `manual`.
485-
*
486-
* <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
487-
* publishable key. After `next_action`s are handled, no additional confirmation is required to
488-
* complete the payment.
489-
*
490-
* <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
491-
* key. The PaymentIntent returns to the `requires_confirmation` state after handling
492-
* `next_action`s, and requires your server to initiate each payment attempt with an explicit
493-
* confirmation.
494-
*/
495452
public Builder setConfirmationMethod(ConfirmationMethod confirmationMethod) {
496453
this.confirmationMethod = confirmationMethod;
497454
return this;
@@ -746,9 +703,7 @@ public Builder setSavePaymentMethod(Boolean savePaymentMethod) {
746703
* [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the
747704
* transaction completes.
748705
*
749-
* <p>Use `on_session` if you intend to only reuse the payment method when your customer is
750-
* present in your checkout flow. Use `off_session` if your customer may or may not be in your
751-
* checkout flow. For more, learn to [save card details after a
706+
* <p>For more, learn to [save card details after a
752707
* payment](https://stripe.com/docs/payments/save-after-payment).
753708
*
754709
* <p>Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with

0 commit comments

Comments
 (0)