Skip to content

Commit 99f7bd7

Browse files
Update generated code (#1683)
* Update generated code for v657 * Update generated code for v658 * Update generated code for v659 * Update generated code for v660 * Update generated code for v661 * Update generated code for v662 * Update generated code for v666 * Update generated code for v667 * Handle InvoiceLineItem update case in test (#1684) --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <[email protected]>
1 parent b7b3f8d commit 99f7bd7

17 files changed

+2605
-26
lines changed

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v655
1+
v667

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,11 +1802,23 @@ public static class Settings extends StripeObject {
18021802
@EqualsAndHashCode(callSuper = false)
18031803
public static class BacsDebitPayments extends StripeObject {
18041804
/**
1805-
* The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct
1806-
* Debit, this will appear on the mandate, and as the statement descriptor.
1805+
* The Bacs Direct Debit display name for this account. For payments made with Bacs Direct
1806+
* Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps
1807+
* display it as the name of the business. To use custom branding, set the Bacs Direct Debit
1808+
* Display Name during or right after creation. Custom branding incurs an additional monthly
1809+
* fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't
1810+
* set the display name before requesting Bacs capability, it's automatically set as
1811+
* &quot;Stripe&quot; and the account is onboarded to Stripe branding, which is free.
18071812
*/
18081813
@SerializedName("display_name")
18091814
String displayName;
1815+
1816+
/**
1817+
* The Bacs Direct Debit Service user number for this account. For payments made with Bacs
1818+
* Direct Debit, this number is a unique identifier of the account with our banking partners.
1819+
*/
1820+
@SerializedName("service_user_number")
1821+
String serviceUserNumber;
18101822
}
18111823

18121824
@Getter

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,13 @@ public static class Card extends StripeObject {
15781578
@SerializedName("brand")
15791579
String brand;
15801580

1581+
/**
1582+
* When using manual capture, a future timestamp at which the charge will be automatically
1583+
* refunded if uncaptured.
1584+
*/
1585+
@SerializedName("capture_before")
1586+
Long captureBefore;
1587+
15811588
/** Check results by Card networks on Card address and CVC at time of payment. */
15821589
@SerializedName("checks")
15831590
Checks checks;

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

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
package com.stripe.model;
33

44
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.net.ApiMode;
7+
import com.stripe.net.ApiRequestParams;
58
import com.stripe.net.ApiResource;
9+
import com.stripe.net.BaseAddress;
10+
import com.stripe.net.RequestOptions;
11+
import com.stripe.net.StripeResponseGetter;
12+
import com.stripe.param.InvoiceLineItemUpdateParams;
613
import java.math.BigDecimal;
714
import java.util.List;
815
import java.util.Map;
@@ -14,7 +21,7 @@
1421
@Getter
1522
@Setter
1623
@EqualsAndHashCode(callSuper = false)
17-
public class InvoiceLineItem extends StripeObject implements HasId {
24+
public class InvoiceLineItem extends ApiResource implements HasId {
1825
/** The amount, in cents (or local equivalent). */
1926
@SerializedName("amount")
2027
Long amount;
@@ -249,6 +256,79 @@ public void setDiscountObjects(List<Discount> objs) {
249256
: null;
250257
}
251258

259+
/**
260+
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
261+
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
262+
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
263+
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
264+
* possible before the invoice is finalized.
265+
*/
266+
public InvoiceLineItem update(String invoice, Map<String, Object> params) throws StripeException {
267+
return update(invoice, params, (RequestOptions) null);
268+
}
269+
270+
/**
271+
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
272+
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
273+
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
274+
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
275+
* possible before the invoice is finalized.
276+
*/
277+
public InvoiceLineItem update(String invoice, Map<String, Object> params, RequestOptions options)
278+
throws StripeException {
279+
String path =
280+
String.format(
281+
"/v1/invoices/%s/lines/%s",
282+
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
283+
return getResponseGetter()
284+
.request(
285+
BaseAddress.API,
286+
ApiResource.RequestMethod.POST,
287+
path,
288+
params,
289+
InvoiceLineItem.class,
290+
options,
291+
ApiMode.V1);
292+
}
293+
294+
/**
295+
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
296+
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
297+
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
298+
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
299+
* possible before the invoice is finalized.
300+
*/
301+
public InvoiceLineItem update(String invoice, InvoiceLineItemUpdateParams params)
302+
throws StripeException {
303+
return update(invoice, params, (RequestOptions) null);
304+
}
305+
306+
/**
307+
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
308+
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
309+
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
310+
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
311+
* possible before the invoice is finalized.
312+
*/
313+
public InvoiceLineItem update(
314+
String invoice, InvoiceLineItemUpdateParams params, RequestOptions options)
315+
throws StripeException {
316+
String path =
317+
String.format(
318+
"/v1/invoices/%s/lines/%s",
319+
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
320+
ApiResource.checkNullTypedParams(path, params);
321+
return getResponseGetter()
322+
.request(
323+
BaseAddress.API,
324+
ApiResource.RequestMethod.POST,
325+
path,
326+
ApiRequestParams.paramsToMap(params),
327+
InvoiceLineItem.class,
328+
options,
329+
ApiMode.V1);
330+
}
331+
252332
@Getter
253333
@Setter
254334
@EqualsAndHashCode(callSuper = false)
@@ -376,4 +456,16 @@ public void setTaxRateObject(TaxRate expandableObject) {
376456
this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
377457
}
378458
}
459+
460+
@Override
461+
public void setResponseGetter(StripeResponseGetter responseGetter) {
462+
super.setResponseGetter(responseGetter);
463+
trySetResponseGetter(invoiceItem, responseGetter);
464+
trySetResponseGetter(period, responseGetter);
465+
trySetResponseGetter(plan, responseGetter);
466+
trySetResponseGetter(price, responseGetter);
467+
trySetResponseGetter(prorationDetails, responseGetter);
468+
trySetResponseGetter(subscription, responseGetter);
469+
trySetResponseGetter(subscriptionItem, responseGetter);
470+
}
379471
}

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,18 @@ public static Price create(PriceCreateParams params, RequestOptions options)
254254
ApiMode.V1);
255255
}
256256

257-
/** Returns a list of your prices. */
257+
/**
258+
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
259+
* false.
260+
*/
258261
public static PriceCollection list(Map<String, Object> params) throws StripeException {
259262
return list(params, (RequestOptions) null);
260263
}
261264

262-
/** Returns a list of your prices. */
265+
/**
266+
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
267+
* false.
268+
*/
263269
public static PriceCollection list(Map<String, Object> params, RequestOptions options)
264270
throws StripeException {
265271
String path = "/v1/prices";
@@ -274,12 +280,18 @@ public static PriceCollection list(Map<String, Object> params, RequestOptions op
274280
ApiMode.V1);
275281
}
276282

277-
/** Returns a list of your prices. */
283+
/**
284+
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
285+
* false.
286+
*/
278287
public static PriceCollection list(PriceListParams params) throws StripeException {
279288
return list(params, (RequestOptions) null);
280289
}
281290

282-
/** Returns a list of your prices. */
291+
/**
292+
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
293+
* false.
294+
*/
283295
public static PriceCollection list(PriceListParams params, RequestOptions options)
284296
throws StripeException {
285297
String path = "/v1/prices";

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,7 @@ public class Topup extends ApiResource implements MetadataStore<Topup>, BalanceT
105105
@SerializedName("object")
106106
String object;
107107

108-
/**
109-
* For most Stripe users, the source of every top-up is a bank account. This hash is then the <a
110-
* href="https://stripe.com/docs/api#source_object">source object</a> describing that bank
111-
* account.
112-
*/
108+
/** The source field is deprecated. It might not always be present in the API response. */
113109
@SerializedName("source")
114110
Source source;
115111

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,9 @@ public static class PaymentMethodOptions extends StripeObject {
13301330
@SerializedName("paynow")
13311331
Paynow paynow;
13321332

1333+
@SerializedName("paypal")
1334+
Paypal paypal;
1335+
13331336
@SerializedName("pix")
13341337
Pix pix;
13351338

@@ -2065,6 +2068,51 @@ public static class Paynow extends StripeObject {
20652068
String setupFutureUsage;
20662069
}
20672070

2071+
@Getter
2072+
@Setter
2073+
@EqualsAndHashCode(callSuper = false)
2074+
public static class Paypal extends StripeObject {
2075+
/**
2076+
* Controls when the funds will be captured from the customer's account.
2077+
*
2078+
* <p>Equal to {@code manual}.
2079+
*/
2080+
@SerializedName("capture_method")
2081+
String captureMethod;
2082+
2083+
/** Preferred locale of the PayPal checkout page that the customer is redirected to. */
2084+
@SerializedName("preferred_locale")
2085+
String preferredLocale;
2086+
2087+
/**
2088+
* A reference of the PayPal transaction visible to customer which is mapped to PayPal's
2089+
* invoice ID. This must be a globally unique ID if you have configured in your PayPal
2090+
* settings to block multiple payments per invoice ID.
2091+
*/
2092+
@SerializedName("reference")
2093+
String reference;
2094+
2095+
/**
2096+
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
2097+
*
2098+
* <p>Providing this parameter will <a
2099+
* href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2100+
* to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2101+
* required actions from the user are complete. If no Customer was provided, the payment
2102+
* method can still be <a
2103+
* href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2104+
* the transaction completes.
2105+
*
2106+
* <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2107+
* dynamically optimize your payment flow and comply with regional legislation and network
2108+
* rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2109+
*
2110+
* <p>One of {@code none}, or {@code off_session}.
2111+
*/
2112+
@SerializedName("setup_future_usage")
2113+
String setupFutureUsage;
2114+
}
2115+
20682116
@Getter
20692117
@Setter
20702118
@EqualsAndHashCode(callSuper = false)

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public class Transaction extends ApiResource
135135
@SerializedName("metadata")
136136
Map<String, String> metadata;
137137

138+
/** Details about the transaction, such as processing dates, set by the card network. */
139+
@SerializedName("network_data")
140+
NetworkData networkData;
141+
138142
/**
139143
* String representing the object's type. Objects of the same type share the same value.
140144
*
@@ -509,6 +513,19 @@ public static class MerchantData extends StripeObject {
509513
String url;
510514
}
511515

516+
@Getter
517+
@Setter
518+
@EqualsAndHashCode(callSuper = false)
519+
public static class NetworkData extends StripeObject {
520+
/**
521+
* The date the transaction was processed by the card network. This can be different from the
522+
* date the seller recorded the transaction depending on when the acquirer submits the
523+
* transaction to the network.
524+
*/
525+
@SerializedName("processing_date")
526+
String processingDate;
527+
}
528+
512529
@Getter
513530
@Setter
514531
@EqualsAndHashCode(callSuper = false)
@@ -840,6 +857,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
840857
trySetResponseGetter(cardholder, responseGetter);
841858
trySetResponseGetter(dispute, responseGetter);
842859
trySetResponseGetter(merchantData, responseGetter);
860+
trySetResponseGetter(networkData, responseGetter);
843861
trySetResponseGetter(purchaseDetails, responseGetter);
844862
trySetResponseGetter(token, responseGetter);
845863
trySetResponseGetter(treasury, responseGetter);

0 commit comments

Comments
 (0)