Skip to content

Commit 3fe78b4

Browse files
Codegen for openapi v162 (stripe#1387)
1 parent 5d15904 commit 3fe78b4

11 files changed

+230
-110
lines changed

OPENAPI_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v161
1+
v162

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
public class CashBalance extends ApiResource {
2121
/**
2222
* A hash of all cash balances available to this customer. You cannot delete a customer with any
23-
* cash balances, even if the balance is 0.
23+
* cash balances, even if the balance is 0. Amounts are represented in the <a
24+
* href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
2425
*/
2526
@SerializedName("available")
2627
Map<String, Long> available;
@@ -118,12 +119,12 @@ public CashBalance retrieve(
118119
ApiResource.RequestMethod.GET, url, params, CashBalance.class, options);
119120
}
120121

121-
/** Updates a customer’s cash balance. */
122+
/** Changes the settings on a customer’s cash balance. */
122123
public CashBalance update(Map<String, Object> params) throws StripeException {
123124
return update(params, (RequestOptions) null);
124125
}
125126

126-
/** Updates a customer’s cash balance. */
127+
/** Changes the settings on a customer’s cash balance. */
127128
public CashBalance update(Map<String, Object> params, RequestOptions options)
128129
throws StripeException {
129130
String url =
@@ -136,12 +137,12 @@ public CashBalance update(Map<String, Object> params, RequestOptions options)
136137
ApiResource.RequestMethod.POST, url, params, CashBalance.class, options);
137138
}
138139

139-
/** Updates a customer’s cash balance. */
140+
/** Changes the settings on a customer’s cash balance. */
140141
public CashBalance update(CashBalanceUpdateParams params) throws StripeException {
141142
return update(params, (RequestOptions) null);
142143
}
143144

144-
/** Updates a customer’s cash balance. */
145+
/** Changes the settings on a customer’s cash balance. */
145146
public CashBalance update(CashBalanceUpdateParams params, RequestOptions options)
146147
throws StripeException {
147148
String url =

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

+10-12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class CashBalanceUpdateParams extends ApiRequestParams {
2424
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
2525
Map<String, Object> extraParams;
2626

27+
/** A hash of settings for this cash balance. */
2728
@SerializedName("settings")
2829
Settings settings;
2930

@@ -102,6 +103,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
102103
return this;
103104
}
104105

106+
/** A hash of settings for this cash balance. */
105107
public Builder setSettings(Settings settings) {
106108
this.settings = settings;
107109
return this;
@@ -120,12 +122,10 @@ public static class Settings {
120122
Map<String, Object> extraParams;
121123

122124
/**
123-
* Method for using the customer balance to pay outstanding {@code customer_balance}
124-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be used
125-
* to pay any outstanding PaymentIntent. If set to {@code manual}, only customer balance funds
126-
* from bank transfers with a reference code matching {@code
127-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
128-
* automatically be used to pay the corresponding outstanding PaymentIntent.
125+
* Controls how funds transferred by the customer are applied to payment intents and invoices.
126+
* Valid options are {@code automatic} or {@code manual}. For more information about these
127+
* reconciliation modes, see <a
128+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
129129
*/
130130
@SerializedName("reconciliation_mode")
131131
ReconciliationMode reconciliationMode;
@@ -176,12 +176,10 @@ public Builder putAllExtraParam(Map<String, Object> map) {
176176
}
177177

178178
/**
179-
* Method for using the customer balance to pay outstanding {@code customer_balance}
180-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be used
181-
* to pay any outstanding PaymentIntent. If set to {@code manual}, only customer balance funds
182-
* from bank transfers with a reference code matching {@code
183-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
184-
* automatically be used to pay the corresponding outstanding PaymentIntent.
179+
* Controls how funds transferred by the customer are applied to payment intents and invoices.
180+
* Valid options are {@code automatic} or {@code manual}. For more information about these
181+
* reconciliation modes, see <a
182+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
185183
*/
186184
public Builder setReconciliationMode(ReconciliationMode reconciliationMode) {
187185
this.reconciliationMode = reconciliationMode;

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

+8-12
Original file line numberDiff line numberDiff line change
@@ -792,12 +792,10 @@ public static class Settings {
792792
Map<String, Object> extraParams;
793793

794794
/**
795-
* Method for using the customer balance to pay outstanding {@code customer_balance}
796-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be used
797-
* to pay any outstanding PaymentIntent. If set to {@code manual}, only customer balance funds
798-
* from bank transfers with a reference code matching {@code
799-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
800-
* automatically be used to pay the corresponding outstanding PaymentIntent.
795+
* Controls how funds transferred by the customer are applied to payment intents and invoices.
796+
* Valid options are {@code automatic} or {@code manual}. For more information about these
797+
* reconciliation modes, see <a
798+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
801799
*/
802800
@SerializedName("reconciliation_mode")
803801
ReconciliationMode reconciliationMode;
@@ -850,12 +848,10 @@ public Builder putAllExtraParam(Map<String, Object> map) {
850848
}
851849

852850
/**
853-
* Method for using the customer balance to pay outstanding {@code customer_balance}
854-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be
855-
* used to pay any outstanding PaymentIntent. If set to {@code manual}, only customer
856-
* balance funds from bank transfers with a reference code matching {@code
857-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
858-
* automatically be used to pay the corresponding outstanding PaymentIntent.
851+
* Controls how funds transferred by the customer are applied to payment intents and
852+
* invoices. Valid options are {@code automatic} or {@code manual}. For more information
853+
* about these reconciliation modes, see <a
854+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
859855
*/
860856
public Builder setReconciliationMode(ReconciliationMode reconciliationMode) {
861857
this.reconciliationMode = reconciliationMode;

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

+8-12
Original file line numberDiff line numberDiff line change
@@ -919,12 +919,10 @@ public static class Settings {
919919
Map<String, Object> extraParams;
920920

921921
/**
922-
* Method for using the customer balance to pay outstanding {@code customer_balance}
923-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be used
924-
* to pay any outstanding PaymentIntent. If set to {@code manual}, only customer balance funds
925-
* from bank transfers with a reference code matching {@code
926-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
927-
* automatically be used to pay the corresponding outstanding PaymentIntent.
922+
* Controls how funds transferred by the customer are applied to payment intents and invoices.
923+
* Valid options are {@code automatic} or {@code manual}. For more information about these
924+
* reconciliation modes, see <a
925+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
928926
*/
929927
@SerializedName("reconciliation_mode")
930928
ReconciliationMode reconciliationMode;
@@ -977,12 +975,10 @@ public Builder putAllExtraParam(Map<String, Object> map) {
977975
}
978976

979977
/**
980-
* Method for using the customer balance to pay outstanding {@code customer_balance}
981-
* PaymentIntents. If set to {@code automatic}, all available funds will automatically be
982-
* used to pay any outstanding PaymentIntent. If set to {@code manual}, only customer
983-
* balance funds from bank transfers with a reference code matching {@code
984-
* payment_intent.next_action.display_bank_transfer_intructions.reference_code} will
985-
* automatically be used to pay the corresponding outstanding PaymentIntent.
978+
* Controls how funds transferred by the customer are applied to payment intents and
979+
* invoices. Valid options are {@code automatic} or {@code manual}. For more information
980+
* about these reconciliation modes, see <a
981+
* href="https://stripe.com/docs/payments/customer-balance/reconciliation">Reconciliation</a>.
986982
*/
987983
public Builder setReconciliationMode(ReconciliationMode reconciliationMode) {
988984
this.reconciliationMode = reconciliationMode;

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ public class PaymentLinkCreateParams extends ApiRequestParams {
132132

133133
/**
134134
* Describes the type of transaction being performed in order to customize relevant text on the
135-
* page, such as the submit button.
135+
* page, such as the submit button. Changing this value will also affect the hostname in the <a
136+
* href="https://stripe.com/docs/api/payment_links/payment_links/object#url">url</a> property
137+
* (example: {@code donate.stripe.com}).
136138
*/
137139
@SerializedName("submit_type")
138140
SubmitType submitType;
@@ -529,7 +531,9 @@ public Builder addAllShippingOption(List<ShippingOption> elements) {
529531

530532
/**
531533
* Describes the type of transaction being performed in order to customize relevant text on the
532-
* page, such as the submit button.
534+
* page, such as the submit button. Changing this value will also affect the hostname in the <a
535+
* href="https://stripe.com/docs/api/payment_links/payment_links/object#url">url</a> property
536+
* (example: {@code donate.stripe.com}).
533537
*/
534538
public Builder setSubmitType(SubmitType submitType) {
535539
this.submitType = submitType;

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

+68
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@
1212

1313
@Getter
1414
public class RefundCreateParams extends ApiRequestParams {
15+
/** A positive integer representing how much to refund. */
1516
@SerializedName("amount")
1617
Long amount;
1718

1819
@SerializedName("charge")
1920
String charge;
2021

22+
/**
23+
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
24+
* in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
25+
*/
26+
@SerializedName("currency")
27+
String currency;
28+
29+
/** Customer whose customer balance to refund from. */
30+
@SerializedName("customer")
31+
String customer;
32+
2133
/** Specifies which fields in the response should be expanded. */
2234
@SerializedName("expand")
2335
List<String> expand;
@@ -31,6 +43,7 @@ public class RefundCreateParams extends ApiRequestParams {
3143
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
3244
Map<String, Object> extraParams;
3345

46+
/** Address to send refund email, use customer email if not specified. */
3447
@SerializedName("instructions_email")
3548
String instructionsEmail;
3649

@@ -43,6 +56,10 @@ public class RefundCreateParams extends ApiRequestParams {
4356
@SerializedName("metadata")
4457
Object metadata;
4558

59+
/** Origin of the refund. */
60+
@SerializedName("origin")
61+
Origin origin;
62+
4663
@SerializedName("payment_intent")
4764
String paymentIntent;
4865

@@ -58,20 +75,26 @@ public class RefundCreateParams extends ApiRequestParams {
5875
private RefundCreateParams(
5976
Long amount,
6077
String charge,
78+
String currency,
79+
String customer,
6180
List<String> expand,
6281
Map<String, Object> extraParams,
6382
String instructionsEmail,
6483
Object metadata,
84+
Origin origin,
6585
String paymentIntent,
6686
Reason reason,
6787
Boolean refundApplicationFee,
6888
Boolean reverseTransfer) {
6989
this.amount = amount;
7090
this.charge = charge;
91+
this.currency = currency;
92+
this.customer = customer;
7193
this.expand = expand;
7294
this.extraParams = extraParams;
7395
this.instructionsEmail = instructionsEmail;
7496
this.metadata = metadata;
97+
this.origin = origin;
7598
this.paymentIntent = paymentIntent;
7699
this.reason = reason;
77100
this.refundApplicationFee = refundApplicationFee;
@@ -87,6 +110,10 @@ public static class Builder {
87110

88111
private String charge;
89112

113+
private String currency;
114+
115+
private String customer;
116+
90117
private List<String> expand;
91118

92119
private Map<String, Object> extraParams;
@@ -95,6 +122,8 @@ public static class Builder {
95122

96123
private Object metadata;
97124

125+
private Origin origin;
126+
98127
private String paymentIntent;
99128

100129
private Reason reason;
@@ -108,16 +137,20 @@ public RefundCreateParams build() {
108137
return new RefundCreateParams(
109138
this.amount,
110139
this.charge,
140+
this.currency,
141+
this.customer,
111142
this.expand,
112143
this.extraParams,
113144
this.instructionsEmail,
114145
this.metadata,
146+
this.origin,
115147
this.paymentIntent,
116148
this.reason,
117149
this.refundApplicationFee,
118150
this.reverseTransfer);
119151
}
120152

153+
/** A positive integer representing how much to refund. */
121154
public Builder setAmount(Long amount) {
122155
this.amount = amount;
123156
return this;
@@ -128,6 +161,22 @@ public Builder setCharge(String charge) {
128161
return this;
129162
}
130163

164+
/**
165+
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
166+
* code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
167+
* currency</a>.
168+
*/
169+
public Builder setCurrency(String currency) {
170+
this.currency = currency;
171+
return this;
172+
}
173+
174+
/** Customer whose customer balance to refund from. */
175+
public Builder setCustomer(String customer) {
176+
this.customer = customer;
177+
return this;
178+
}
179+
131180
/**
132181
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
133182
* subsequent calls adds additional elements to the original list. See {@link
@@ -180,6 +229,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
180229
return this;
181230
}
182231

232+
/** Address to send refund email, use customer email if not specified. */
183233
public Builder setInstructionsEmail(String instructionsEmail) {
184234
this.instructionsEmail = instructionsEmail;
185235
return this;
@@ -235,6 +285,12 @@ public Builder setMetadata(Map<String, String> metadata) {
235285
return this;
236286
}
237287

288+
/** Origin of the refund. */
289+
public Builder setOrigin(Origin origin) {
290+
this.origin = origin;
291+
return this;
292+
}
293+
238294
public Builder setPaymentIntent(String paymentIntent) {
239295
this.paymentIntent = paymentIntent;
240296
return this;
@@ -256,6 +312,18 @@ public Builder setReverseTransfer(Boolean reverseTransfer) {
256312
}
257313
}
258314

315+
public enum Origin implements ApiRequestParams.EnumParam {
316+
@SerializedName("customer_balance")
317+
CUSTOMER_BALANCE("customer_balance");
318+
319+
@Getter(onMethod_ = {@Override})
320+
private final String value;
321+
322+
Origin(String value) {
323+
this.value = value;
324+
}
325+
}
326+
259327
public enum Reason implements ApiRequestParams.EnumParam {
260328
@SerializedName("duplicate")
261329
DUPLICATE("duplicate"),

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

+16
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,22 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam {
750750
@SerializedName("file.created")
751751
FILE__CREATED("file.created"),
752752

753+
@SerializedName("financial_connections.account.created")
754+
FINANCIAL_CONNECTIONS__ACCOUNT__CREATED("financial_connections.account.created"),
755+
756+
@SerializedName("financial_connections.account.deactivated")
757+
FINANCIAL_CONNECTIONS__ACCOUNT__DEACTIVATED("financial_connections.account.deactivated"),
758+
759+
@SerializedName("financial_connections.account.disconnected")
760+
FINANCIAL_CONNECTIONS__ACCOUNT__DISCONNECTED("financial_connections.account.disconnected"),
761+
762+
@SerializedName("financial_connections.account.reactivated")
763+
FINANCIAL_CONNECTIONS__ACCOUNT__REACTIVATED("financial_connections.account.reactivated"),
764+
765+
@SerializedName("financial_connections.account.refreshed_balance")
766+
FINANCIAL_CONNECTIONS__ACCOUNT__REFRESHED_BALANCE(
767+
"financial_connections.account.refreshed_balance"),
768+
753769
@SerializedName("identity.verification_session.canceled")
754770
IDENTITY__VERIFICATION_SESSION__CANCELED("identity.verification_session.canceled"),
755771

0 commit comments

Comments
 (0)