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

API Version 2022-11-09 #1473

Merged
merged 1 commit into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/ApiVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package com.stripe;

final class ApiVersion {
public static final String CURRENT = "2022-08-01";
public static final String CURRENT = "2022-11-09";
}
28 changes: 24 additions & 4 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("capture_method")
String captureMethod;

/** Charges that were created by this PaymentIntent, if any. */
@SerializedName("charges")
ChargeCollection charges;

/**
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable
* key.
Expand Down Expand Up @@ -183,6 +179,12 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("last_payment_error")
StripeError lastPaymentError;

/** The latest charge created by this payment intent. */
@SerializedName("latest_charge")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Charge> latestCharge;

/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
Expand Down Expand Up @@ -383,6 +385,24 @@ public void setInvoiceObject(Invoice expandableObject) {
this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code latestCharge} object. */
public String getLatestCharge() {
return (this.latestCharge != null) ? this.latestCharge.getId() : null;
}

public void setLatestCharge(String id) {
this.latestCharge = ApiResource.setExpandableFieldId(id, this.latestCharge);
}

/** Get expanded {@code latestCharge}. */
public Charge getLatestChargeObject() {
return (this.latestCharge != null) ? this.latestCharge.getExpanded() : null;
}

public void setLatestChargeObject(Charge expandableObject) {
this.latestCharge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code onBehalfOf} object. */
public String getOnBehalfOf() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/com/stripe/model/issuing/Authorization.java
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,19 @@ public static class RequestHistory extends StripeObject {
* <p>One of {@code account_disabled}, {@code card_active}, {@code card_inactive}, {@code
* cardholder_inactive}, {@code cardholder_verification_required}, {@code insufficient_funds},
* {@code not_allowed}, {@code spending_controls}, {@code suspected_fraud}, {@code
* verification_failed}, {@code webhook_approved}, {@code webhook_declined}, or {@code
* webhook_timeout}.
* verification_failed}, {@code webhook_approved}, {@code webhook_declined}, {@code
* webhook_error}, or {@code webhook_timeout}.
*/
@SerializedName("reason")
String reason;

/**
* If approve/decline decision is directly responsed to the webhook with json payload and if the
* response is invalid (e.g., parsing errors), we surface the detailed message via this field.
*/
@SerializedName("reason_message")
String reasonMessage;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam {
VERSION_2020_08_27("2020-08-27"),

@SerializedName("2022-08-01")
VERSION_2022_08_01("2022-08-01");
VERSION_2022_08_01("2022-08-01"),

@SerializedName("2022-11-09")
VERSION_2022_11_09("2022-11-09");

@Getter(onMethod_ = {@Override})
private final String value;
Expand Down
141 changes: 2 additions & 139 deletions src/main/java/com/stripe/param/checkout/SessionCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -1552,26 +1552,6 @@ public static class LineItem {
@SerializedName("adjustable_quantity")
AdjustableQuantity adjustableQuantity;

/**
* [Deprecated] The amount to be collected per unit of the line item. If specified, must also
* pass {@code currency} and {@code name}.
*/
@SerializedName("amount")
Long amount;

/**
* [Deprecated] Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
* currency code</a>, in lowercase. Must be a <a
* href="https://stripe.com/docs/currencies">supported currency</a>. Required if {@code amount}
* is passed.
*/
@SerializedName("currency")
String currency;

/** [Deprecated] The description for the line item, to be displayed on the Checkout page. */
@SerializedName("description")
String description;

/**
* The <a href="https://stripe.com/docs/api/tax_rates">tax rates</a> that will be applied to
* this line item depending on the customer's billing/shipping address. We currently support the
Expand All @@ -1589,21 +1569,6 @@ public static class LineItem {
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

/**
* [Deprecated] A list of image URLs representing this line item. Each image can be up to 5 MB
* in size. If passing {@code price} or {@code price_data}, specify images on the associated
* product instead.
*/
@SerializedName("images")
List<String> images;

/**
* [Deprecated] The name for the item to be displayed on the Checkout page. Required if {@code
* amount} is passed.
*/
@SerializedName("name")
String name;

/**
* The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> or <a
* href="https://stripe.com/docs/api/plans">Plan</a> object. One of {@code price} or {@code
Expand Down Expand Up @@ -1635,25 +1600,15 @@ public static class LineItem {

private LineItem(
AdjustableQuantity adjustableQuantity,
Long amount,
String currency,
String description,
List<String> dynamicTaxRates,
Map<String, Object> extraParams,
List<String> images,
String name,
String price,
PriceData priceData,
Long quantity,
List<String> taxRates) {
this.adjustableQuantity = adjustableQuantity;
this.amount = amount;
this.currency = currency;
this.description = description;
this.dynamicTaxRates = dynamicTaxRates;
this.extraParams = extraParams;
this.images = images;
this.name = name;
this.price = price;
this.priceData = priceData;
this.quantity = quantity;
Expand All @@ -1667,20 +1622,10 @@ public static Builder builder() {
public static class Builder {
private AdjustableQuantity adjustableQuantity;

private Long amount;

private String currency;

private String description;

private List<String> dynamicTaxRates;

private Map<String, Object> extraParams;

private List<String> images;

private String name;

private String price;

private PriceData priceData;
Expand All @@ -1693,13 +1638,8 @@ public static class Builder {
public SessionCreateParams.LineItem build() {
return new SessionCreateParams.LineItem(
this.adjustableQuantity,
this.amount,
this.currency,
this.description,
this.dynamicTaxRates,
this.extraParams,
this.images,
this.name,
this.price,
this.priceData,
this.quantity,
Expand All @@ -1716,32 +1656,6 @@ public Builder setAdjustableQuantity(
return this;
}

/**
* [Deprecated] The amount to be collected per unit of the line item. If specified, must also
* pass {@code currency} and {@code name}.
*/
public Builder setAmount(Long amount) {
this.amount = amount;
return this;
}

/**
* [Deprecated] Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
* currency code</a>, in lowercase. Must be a <a
* href="https://stripe.com/docs/currencies">supported currency</a>. Required if {@code
* amount} is passed.
*/
public Builder setCurrency(String currency) {
this.currency = currency;
return this;
}

/** [Deprecated] The description for the line item, to be displayed on the Checkout page. */
public Builder setDescription(String description) {
this.description = description;
return this;
}

/**
* Add an element to `dynamicTaxRates` list. A list is initialized for the first `add/addAll`
* call, and subsequent calls adds additional elements to the original list. See {@link
Expand Down Expand Up @@ -1794,41 +1708,6 @@ public Builder putAllExtraParam(Map<String, Object> map) {
return this;
}

/**
* Add an element to `images` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#images} for the field documentation.
*/
public Builder addImage(String element) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.add(element);
return this;
}

/**
* Add all elements to `images` list. A list is initialized for the first `add/addAll` call,
* and subsequent calls adds additional elements to the original list. See {@link
* SessionCreateParams.LineItem#images} for the field documentation.
*/
public Builder addAllImage(List<String> elements) {
if (this.images == null) {
this.images = new ArrayList<>();
}
this.images.addAll(elements);
return this;
}

/**
* [Deprecated] The name for the item to be displayed on the Checkout page. Required if {@code
* amount} is passed.
*/
public Builder setName(String name) {
this.name = name;
return this;
}

/**
* The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> or <a
* href="https://stripe.com/docs/api/plans">Plan</a> object. One of {@code price} or {@code
Expand Down Expand Up @@ -6902,17 +6781,9 @@ public static class Paynow {
@SerializedName("setup_future_usage")
SetupFutureUsage setupFutureUsage;

/** Confirm that the payer has accepted the P24 terms and conditions. */
@SerializedName("tos_shown_and_accepted")
Boolean tosShownAndAccepted;

private Paynow(
Map<String, Object> extraParams,
SetupFutureUsage setupFutureUsage,
Boolean tosShownAndAccepted) {
private Paynow(Map<String, Object> extraParams, SetupFutureUsage setupFutureUsage) {
this.extraParams = extraParams;
this.setupFutureUsage = setupFutureUsage;
this.tosShownAndAccepted = tosShownAndAccepted;
}

public static Builder builder() {
Expand All @@ -6924,12 +6795,10 @@ public static class Builder {

private SetupFutureUsage setupFutureUsage;

private Boolean tosShownAndAccepted;

/** Finalize and obtain parameter instance from this builder. */
public SessionCreateParams.PaymentMethodOptions.Paynow build() {
return new SessionCreateParams.PaymentMethodOptions.Paynow(
this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted);
this.extraParams, this.setupFutureUsage);
}

/**
Expand Down Expand Up @@ -6981,12 +6850,6 @@ public Builder setSetupFutureUsage(
this.setupFutureUsage = setupFutureUsage;
return this;
}

/** Confirm that the payer has accepted the P24 terms and conditions. */
public Builder setTosShownAndAccepted(Boolean tosShownAndAccepted) {
this.tosShownAndAccepted = tosShownAndAccepted;
return this;
}
}

public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
Expand Down