Skip to content

Commit 6449279

Browse files
Merge pull request #1473 from stripe/richardm-next-major
API Version 2022-11-09
2 parents 0cdfc2f + c9e235b commit 6449279

File tree

5 files changed

+40
-147
lines changed

5 files changed

+40
-147
lines changed

src/main/java/com/stripe/ApiVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
package com.stripe;
33

44
final class ApiVersion {
5-
public static final String CURRENT = "2022-08-01";
5+
public static final String CURRENT = "2022-11-09";
66
}

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
113113
@SerializedName("capture_method")
114114
String captureMethod;
115115

116-
/** Charges that were created by this PaymentIntent, if any. */
117-
@SerializedName("charges")
118-
ChargeCollection charges;
119-
120116
/**
121117
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable
122118
* key.
@@ -183,6 +179,12 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
183179
@SerializedName("last_payment_error")
184180
StripeError lastPaymentError;
185181

182+
/** The latest charge created by this payment intent. */
183+
@SerializedName("latest_charge")
184+
@Getter(lombok.AccessLevel.NONE)
185+
@Setter(lombok.AccessLevel.NONE)
186+
ExpandableField<Charge> latestCharge;
187+
186188
/**
187189
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
188190
* object exists in test mode.
@@ -383,6 +385,24 @@ public void setInvoiceObject(Invoice expandableObject) {
383385
this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
384386
}
385387

388+
/** Get ID of expandable {@code latestCharge} object. */
389+
public String getLatestCharge() {
390+
return (this.latestCharge != null) ? this.latestCharge.getId() : null;
391+
}
392+
393+
public void setLatestCharge(String id) {
394+
this.latestCharge = ApiResource.setExpandableFieldId(id, this.latestCharge);
395+
}
396+
397+
/** Get expanded {@code latestCharge}. */
398+
public Charge getLatestChargeObject() {
399+
return (this.latestCharge != null) ? this.latestCharge.getExpanded() : null;
400+
}
401+
402+
public void setLatestChargeObject(Charge expandableObject) {
403+
this.latestCharge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
404+
}
405+
386406
/** Get ID of expandable {@code onBehalfOf} object. */
387407
public String getOnBehalfOf() {
388408
return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,19 @@ public static class RequestHistory extends StripeObject {
692692
* <p>One of {@code account_disabled}, {@code card_active}, {@code card_inactive}, {@code
693693
* cardholder_inactive}, {@code cardholder_verification_required}, {@code insufficient_funds},
694694
* {@code not_allowed}, {@code spending_controls}, {@code suspected_fraud}, {@code
695-
* verification_failed}, {@code webhook_approved}, {@code webhook_declined}, or {@code
696-
* webhook_timeout}.
695+
* verification_failed}, {@code webhook_approved}, {@code webhook_declined}, {@code
696+
* webhook_error}, or {@code webhook_timeout}.
697697
*/
698698
@SerializedName("reason")
699699
String reason;
700700

701+
/**
702+
* If approve/decline decision is directly responsed to the webhook with json payload and if the
703+
* response is invalid (e.g., parsing errors), we surface the detailed message via this field.
704+
*/
705+
@SerializedName("reason_message")
706+
String reasonMessage;
707+
701708
@Getter
702709
@Setter
703710
@EqualsAndHashCode(callSuper = false)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam {
565565
VERSION_2020_08_27("2020-08-27"),
566566

567567
@SerializedName("2022-08-01")
568-
VERSION_2022_08_01("2022-08-01");
568+
VERSION_2022_08_01("2022-08-01"),
569+
570+
@SerializedName("2022-11-09")
571+
VERSION_2022_11_09("2022-11-09");
569572

570573
@Getter(onMethod_ = {@Override})
571574
private final String value;

src/main/java/com/stripe/param/checkout/SessionCreateParams.java

Lines changed: 2 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,26 +1552,6 @@ public static class LineItem {
15521552
@SerializedName("adjustable_quantity")
15531553
AdjustableQuantity adjustableQuantity;
15541554

1555-
/**
1556-
* [Deprecated] The amount to be collected per unit of the line item. If specified, must also
1557-
* pass {@code currency} and {@code name}.
1558-
*/
1559-
@SerializedName("amount")
1560-
Long amount;
1561-
1562-
/**
1563-
* [Deprecated] Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
1564-
* currency code</a>, in lowercase. Must be a <a
1565-
* href="https://stripe.com/docs/currencies">supported currency</a>. Required if {@code amount}
1566-
* is passed.
1567-
*/
1568-
@SerializedName("currency")
1569-
String currency;
1570-
1571-
/** [Deprecated] The description for the line item, to be displayed on the Checkout page. */
1572-
@SerializedName("description")
1573-
String description;
1574-
15751555
/**
15761556
* The <a href="https://stripe.com/docs/api/tax_rates">tax rates</a> that will be applied to
15771557
* this line item depending on the customer's billing/shipping address. We currently support the
@@ -1589,21 +1569,6 @@ public static class LineItem {
15891569
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
15901570
Map<String, Object> extraParams;
15911571

1592-
/**
1593-
* [Deprecated] A list of image URLs representing this line item. Each image can be up to 5 MB
1594-
* in size. If passing {@code price} or {@code price_data}, specify images on the associated
1595-
* product instead.
1596-
*/
1597-
@SerializedName("images")
1598-
List<String> images;
1599-
1600-
/**
1601-
* [Deprecated] The name for the item to be displayed on the Checkout page. Required if {@code
1602-
* amount} is passed.
1603-
*/
1604-
@SerializedName("name")
1605-
String name;
1606-
16071572
/**
16081573
* The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> or <a
16091574
* href="https://stripe.com/docs/api/plans">Plan</a> object. One of {@code price} or {@code
@@ -1635,25 +1600,15 @@ public static class LineItem {
16351600

16361601
private LineItem(
16371602
AdjustableQuantity adjustableQuantity,
1638-
Long amount,
1639-
String currency,
1640-
String description,
16411603
List<String> dynamicTaxRates,
16421604
Map<String, Object> extraParams,
1643-
List<String> images,
1644-
String name,
16451605
String price,
16461606
PriceData priceData,
16471607
Long quantity,
16481608
List<String> taxRates) {
16491609
this.adjustableQuantity = adjustableQuantity;
1650-
this.amount = amount;
1651-
this.currency = currency;
1652-
this.description = description;
16531610
this.dynamicTaxRates = dynamicTaxRates;
16541611
this.extraParams = extraParams;
1655-
this.images = images;
1656-
this.name = name;
16571612
this.price = price;
16581613
this.priceData = priceData;
16591614
this.quantity = quantity;
@@ -1667,20 +1622,10 @@ public static Builder builder() {
16671622
public static class Builder {
16681623
private AdjustableQuantity adjustableQuantity;
16691624

1670-
private Long amount;
1671-
1672-
private String currency;
1673-
1674-
private String description;
1675-
16761625
private List<String> dynamicTaxRates;
16771626

16781627
private Map<String, Object> extraParams;
16791628

1680-
private List<String> images;
1681-
1682-
private String name;
1683-
16841629
private String price;
16851630

16861631
private PriceData priceData;
@@ -1693,13 +1638,8 @@ public static class Builder {
16931638
public SessionCreateParams.LineItem build() {
16941639
return new SessionCreateParams.LineItem(
16951640
this.adjustableQuantity,
1696-
this.amount,
1697-
this.currency,
1698-
this.description,
16991641
this.dynamicTaxRates,
17001642
this.extraParams,
1701-
this.images,
1702-
this.name,
17031643
this.price,
17041644
this.priceData,
17051645
this.quantity,
@@ -1716,32 +1656,6 @@ public Builder setAdjustableQuantity(
17161656
return this;
17171657
}
17181658

1719-
/**
1720-
* [Deprecated] The amount to be collected per unit of the line item. If specified, must also
1721-
* pass {@code currency} and {@code name}.
1722-
*/
1723-
public Builder setAmount(Long amount) {
1724-
this.amount = amount;
1725-
return this;
1726-
}
1727-
1728-
/**
1729-
* [Deprecated] Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
1730-
* currency code</a>, in lowercase. Must be a <a
1731-
* href="https://stripe.com/docs/currencies">supported currency</a>. Required if {@code
1732-
* amount} is passed.
1733-
*/
1734-
public Builder setCurrency(String currency) {
1735-
this.currency = currency;
1736-
return this;
1737-
}
1738-
1739-
/** [Deprecated] The description for the line item, to be displayed on the Checkout page. */
1740-
public Builder setDescription(String description) {
1741-
this.description = description;
1742-
return this;
1743-
}
1744-
17451659
/**
17461660
* Add an element to `dynamicTaxRates` list. A list is initialized for the first `add/addAll`
17471661
* call, and subsequent calls adds additional elements to the original list. See {@link
@@ -1794,41 +1708,6 @@ public Builder putAllExtraParam(Map<String, Object> map) {
17941708
return this;
17951709
}
17961710

1797-
/**
1798-
* Add an element to `images` list. A list is initialized for the first `add/addAll` call, and
1799-
* subsequent calls adds additional elements to the original list. See {@link
1800-
* SessionCreateParams.LineItem#images} for the field documentation.
1801-
*/
1802-
public Builder addImage(String element) {
1803-
if (this.images == null) {
1804-
this.images = new ArrayList<>();
1805-
}
1806-
this.images.add(element);
1807-
return this;
1808-
}
1809-
1810-
/**
1811-
* Add all elements to `images` list. A list is initialized for the first `add/addAll` call,
1812-
* and subsequent calls adds additional elements to the original list. See {@link
1813-
* SessionCreateParams.LineItem#images} for the field documentation.
1814-
*/
1815-
public Builder addAllImage(List<String> elements) {
1816-
if (this.images == null) {
1817-
this.images = new ArrayList<>();
1818-
}
1819-
this.images.addAll(elements);
1820-
return this;
1821-
}
1822-
1823-
/**
1824-
* [Deprecated] The name for the item to be displayed on the Checkout page. Required if {@code
1825-
* amount} is passed.
1826-
*/
1827-
public Builder setName(String name) {
1828-
this.name = name;
1829-
return this;
1830-
}
1831-
18321711
/**
18331712
* The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> or <a
18341713
* href="https://stripe.com/docs/api/plans">Plan</a> object. One of {@code price} or {@code
@@ -6902,17 +6781,9 @@ public static class Paynow {
69026781
@SerializedName("setup_future_usage")
69036782
SetupFutureUsage setupFutureUsage;
69046783

6905-
/** Confirm that the payer has accepted the P24 terms and conditions. */
6906-
@SerializedName("tos_shown_and_accepted")
6907-
Boolean tosShownAndAccepted;
6908-
6909-
private Paynow(
6910-
Map<String, Object> extraParams,
6911-
SetupFutureUsage setupFutureUsage,
6912-
Boolean tosShownAndAccepted) {
6784+
private Paynow(Map<String, Object> extraParams, SetupFutureUsage setupFutureUsage) {
69136785
this.extraParams = extraParams;
69146786
this.setupFutureUsage = setupFutureUsage;
6915-
this.tosShownAndAccepted = tosShownAndAccepted;
69166787
}
69176788

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

69256796
private SetupFutureUsage setupFutureUsage;
69266797

6927-
private Boolean tosShownAndAccepted;
6928-
69296798
/** Finalize and obtain parameter instance from this builder. */
69306799
public SessionCreateParams.PaymentMethodOptions.Paynow build() {
69316800
return new SessionCreateParams.PaymentMethodOptions.Paynow(
6932-
this.extraParams, this.setupFutureUsage, this.tosShownAndAccepted);
6801+
this.extraParams, this.setupFutureUsage);
69336802
}
69346803

69356804
/**
@@ -6981,12 +6850,6 @@ public Builder setSetupFutureUsage(
69816850
this.setupFutureUsage = setupFutureUsage;
69826851
return this;
69836852
}
6984-
6985-
/** Confirm that the payer has accepted the P24 terms and conditions. */
6986-
public Builder setTosShownAndAccepted(Boolean tosShownAndAccepted) {
6987-
this.tosShownAndAccepted = tosShownAndAccepted;
6988-
return this;
6989-
}
69906853
}
69916854

69926855
public enum SetupFutureUsage implements ApiRequestParams.EnumParam {

0 commit comments

Comments
 (0)