Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1683

Merged
merged 9 commits into from
Nov 16, 2023
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v655
v667
16 changes: 14 additions & 2 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1802,11 +1802,23 @@ public static class Settings extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class BacsDebitPayments extends StripeObject {
/**
* The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct
* Debit, this will appear on the mandate, and as the statement descriptor.
* The Bacs Direct Debit display name for this account. For payments made with Bacs Direct
* Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps
* display it as the name of the business. To use custom branding, set the Bacs Direct Debit
* Display Name during or right after creation. Custom branding incurs an additional monthly
* fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't
* set the display name before requesting Bacs capability, it's automatically set as
* "Stripe" and the account is onboarded to Stripe branding, which is free.
*/
@SerializedName("display_name")
String displayName;

/**
* The Bacs Direct Debit Service user number for this account. For payments made with Bacs
* Direct Debit, this number is a unique identifier of the account with our banking partners.
*/
@SerializedName("service_user_number")
String serviceUserNumber;
}

@Getter
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,13 @@ public static class Card extends StripeObject {
@SerializedName("brand")
String brand;

/**
* When using manual capture, a future timestamp at which the charge will be automatically
* refunded if uncaptured.
*/
@SerializedName("capture_before")
Long captureBefore;

/** Check results by Card networks on Card address and CVC at time of payment. */
@SerializedName("checks")
Checks checks;
Expand Down
94 changes: 93 additions & 1 deletion src/main/java/com/stripe/model/InvoiceLineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiMode;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.InvoiceLineItemUpdateParams;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
Expand All @@ -14,7 +21,7 @@
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class InvoiceLineItem extends StripeObject implements HasId {
public class InvoiceLineItem extends ApiResource implements HasId {
/** The amount, in cents (or local equivalent). */
@SerializedName("amount")
Long amount;
Expand Down Expand Up @@ -249,6 +256,79 @@ public void setDiscountObjects(List<Discount> objs) {
: null;
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, Map<String, Object> params) throws StripeException {
return update(invoice, params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
return getResponseGetter()
.request(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
params,
InvoiceLineItem.class,
options,
ApiMode.V1);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(String invoice, InvoiceLineItemUpdateParams params)
throws StripeException {
return update(invoice, params, (RequestOptions) null);
}

/**
* Updates an invoice’s line item. Some fields, such as {@code tax_amounts}, only live on the
* invoice line item, so they can only be updated through this endpoint. Other fields, such as
* {@code amount}, live on both the invoice item and the invoice line item, so updates on this
* endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only
* possible before the invoice is finalized.
*/
public InvoiceLineItem update(
String invoice, InvoiceLineItemUpdateParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/invoices/%s/lines/%s",
ApiResource.urlEncodeId(invoice), ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
return getResponseGetter()
.request(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
InvoiceLineItem.class,
options,
ApiMode.V1);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -376,4 +456,16 @@ public void setTaxRateObject(TaxRate expandableObject) {
this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(invoiceItem, responseGetter);
trySetResponseGetter(period, responseGetter);
trySetResponseGetter(plan, responseGetter);
trySetResponseGetter(price, responseGetter);
trySetResponseGetter(prorationDetails, responseGetter);
trySetResponseGetter(subscription, responseGetter);
trySetResponseGetter(subscriptionItem, responseGetter);
}
}
20 changes: 16 additions & 4 deletions src/main/java/com/stripe/model/Price.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,18 @@ public static Price create(PriceCreateParams params, RequestOptions options)
ApiMode.V1);
}

/** Returns a list of your prices. */
/**
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
* false.
*/
public static PriceCollection list(Map<String, Object> params) throws StripeException {
return list(params, (RequestOptions) null);
}

/** Returns a list of your prices. */
/**
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
* false.
*/
public static PriceCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/prices";
Expand All @@ -274,12 +280,18 @@ public static PriceCollection list(Map<String, Object> params, RequestOptions op
ApiMode.V1);
}

/** Returns a list of your prices. */
/**
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
* false.
*/
public static PriceCollection list(PriceListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}

/** Returns a list of your prices. */
/**
* Returns a list of your active prices. For the list of inactive prices, set {@code active} to
* false.
*/
public static PriceCollection list(PriceListParams params, RequestOptions options)
throws StripeException {
String path = "/v1/prices";
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/stripe/model/Topup.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ public class Topup extends ApiResource implements MetadataStore<Topup>, BalanceT
@SerializedName("object")
String object;

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

Expand Down
48 changes: 48 additions & 0 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,9 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("paypal")
Paypal paypal;

@SerializedName("pix")
Pix pix;

Expand Down Expand Up @@ -2065,6 +2068,51 @@ public static class Paynow extends StripeObject {
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Paypal extends StripeObject {
/**
* Controls when the funds will be captured from the customer's account.
*
* <p>Equal to {@code manual}.
*/
@SerializedName("capture_method")
String captureMethod;

/** Preferred locale of the PayPal checkout page that the customer is redirected to. */
@SerializedName("preferred_locale")
String preferredLocale;

/**
* A reference of the PayPal transaction visible to customer which is mapped to PayPal's
* invoice ID. This must be a globally unique ID if you have configured in your PayPal
* settings to block multiple payments per invoice ID.
*/
@SerializedName("reference")
String reference;

/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* <p>Providing this parameter will <a
* href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
* to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
* required actions from the user are complete. If no Customer was provided, the payment
* method can still be <a
* href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
* the transaction completes.
*
* <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
* dynamically optimize your payment flow and comply with regional legislation and network
* rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
*
* <p>One of {@code none}, or {@code off_session}.
*/
@SerializedName("setup_future_usage")
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/stripe/model/issuing/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public class Transaction extends ApiResource
@SerializedName("metadata")
Map<String, String> metadata;

/** Details about the transaction, such as processing dates, set by the card network. */
@SerializedName("network_data")
NetworkData networkData;

/**
* String representing the object's type. Objects of the same type share the same value.
*
Expand Down Expand Up @@ -509,6 +513,19 @@ public static class MerchantData extends StripeObject {
String url;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class NetworkData extends StripeObject {
/**
* The date the transaction was processed by the card network. This can be different from the
* date the seller recorded the transaction depending on when the acquirer submits the
* transaction to the network.
*/
@SerializedName("processing_date")
String processingDate;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -840,6 +857,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(cardholder, responseGetter);
trySetResponseGetter(dispute, responseGetter);
trySetResponseGetter(merchantData, responseGetter);
trySetResponseGetter(networkData, responseGetter);
trySetResponseGetter(purchaseDetails, responseGetter);
trySetResponseGetter(token, responseGetter);
trySetResponseGetter(treasury, responseGetter);
Expand Down
Loading
Loading