Skip to content

Commit 6c84822

Browse files
Merge pull request #2217 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents e0ba17c + 5757e73 commit 6c84822

36 files changed

Lines changed: 1942 additions & 178 deletions

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6a1eb046657923602071d7707e99ce8a004a8216
1+
2e266cdaf4a7328b80cf9bc2448dfca91811415c

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2261
1+
v2274

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,32 @@ String secondaryValue =
231231
.getAsString();
232232
```
233233

234+
> [!NOTE]
235+
> `.getRawJsonObject()` is only available on the top-level object returned by an API call. For most requests (like `.retrieve()` or `.create()`) you'll get the object itself. But for `.list()` calls, the top level object is a `List<T>`, so you can only access the raw json of an individual object by going through the list itself.
236+
>
237+
> ```java
238+
> var cards = stripeClient
239+
> .v1()
240+
> .issuing()
241+
> .cards()
242+
> .list(params);
243+
>
244+
> // doesn't work:
245+
> cards
246+
> .getData()
247+
> .get(0)
248+
> .getRawJsonObject(); // null
249+
>
250+
> // instead, go through the list:
251+
> cards
252+
> .getRawJsonObject()
253+
> .getAsJsonArray("data")
254+
> .get(0)
255+
> .getAsJsonObject()
256+
> .getAsJsonPrimitive("undocumented-val")
257+
> .getAsString(); // "some-val"
258+
> ```
259+
234260
### Writing a plugin
235261
236262
If you're writing a plugin that uses the library, we'd appreciate it if you
@@ -259,7 +285,7 @@ Stripe.enableTelemetry = false;
259285
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `25.2.0-beta.2`.
260286
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
261287

262-
To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation).
288+
To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation).
263289

264290
> **Note**
265291
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.
@@ -269,6 +295,7 @@ Some preview features require a name and version to be set in the `Stripe-Versio
269295
```java
270296
Stripe.addBetaVersion("feature_beta", "v3");
271297
```
298+
272299
### Private Preview SDKs
273300

274301
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `25.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-java?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`.

src/main/java/com/stripe/StripeClient.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,18 @@ public com.stripe.service.PaymentLinkService paymentLinks() {
750750
return new com.stripe.service.PaymentLinkService(this.getResponseGetter());
751751
}
752752

753+
/**
754+
* @deprecated StripeClient.paymentLocationCapabilities() is deprecated, use
755+
* StripeClient.v1().paymentLocationCapabilities() instead. All functionality under it has
756+
* been copied over to StripeClient.v1().paymentLocationCapabilities(). See <a
757+
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
758+
* guide</a> for more on this and tips on migrating to the new v1 namespace.
759+
*/
760+
@Deprecated
761+
public com.stripe.service.PaymentLocationCapabilityService paymentLocationCapabilities() {
762+
return new com.stripe.service.PaymentLocationCapabilityService(this.getResponseGetter());
763+
}
764+
753765
/**
754766
* @deprecated StripeClient.paymentLocations() is deprecated, use
755767
* StripeClient.v1().paymentLocations() instead. All functionality under it has been copied

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public final class EventDataClassLookup {
7272
com.stripe.model.PaymentIntentAmountDetailsLineItem.class);
7373
classLookup.put("payment_link", com.stripe.model.PaymentLink.class);
7474
classLookup.put("payment_location", com.stripe.model.PaymentLocation.class);
75+
classLookup.put(
76+
"payment_location_capability", com.stripe.model.PaymentLocationCapability.class);
7577
classLookup.put("payment_method", com.stripe.model.PaymentMethod.class);
7678
classLookup.put("payment_method_balance", com.stripe.model.PaymentMethodBalance.class);
7779
classLookup.put(

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

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -818,61 +818,10 @@ public static class RateCardRateDetails extends StripeObject {
818818
@Setter
819819
@EqualsAndHashCode(callSuper = false)
820820
public static class ProrationDetails extends StripeObject {
821-
@SerializedName("credited_items")
822-
CreditedItems creditedItems;
823-
824821
/** Discount amounts applied when the proration was created. */
825822
@SerializedName("discount_amounts")
826823
List<InvoiceItem.ProrationDetails.DiscountAmount> discountAmounts;
827824

828-
/**
829-
* For more details about CreditedItems, please refer to the <a
830-
* href="https://docs.stripe.com/api">API Reference.</a>
831-
*/
832-
@Getter
833-
@Setter
834-
@EqualsAndHashCode(callSuper = false)
835-
public static class CreditedItems extends StripeObject {
836-
/**
837-
* When {@code type} is {@code invoice_item}, the invoice item id for the debited invoice item
838-
* corresponding to this credit proration.
839-
*/
840-
@SerializedName("invoice_item")
841-
String invoiceItem;
842-
843-
@SerializedName("invoice_line_items")
844-
InvoiceLineItems invoiceLineItems;
845-
846-
/**
847-
* Whether the credit references a pending invoice item or one or more invoice line items on
848-
* an invoice.
849-
*
850-
* <p>One of {@code invoice_item}, or {@code invoice_line_items}.
851-
*/
852-
@SerializedName("type")
853-
String type;
854-
855-
/**
856-
* For more details about InvoiceLineItems, please refer to the <a
857-
* href="https://docs.stripe.com/api">API Reference.</a>
858-
*/
859-
@Getter
860-
@Setter
861-
@EqualsAndHashCode(callSuper = false)
862-
public static class InvoiceLineItems extends StripeObject {
863-
/** The invoice id for the debited line item(s). */
864-
@SerializedName("invoice")
865-
String invoice;
866-
867-
/**
868-
* IDs of the debited invoice line item(s) on the invoice that correspond to the credit
869-
* proration.
870-
*/
871-
@SerializedName("invoice_line_items")
872-
List<String> invoiceLineItems;
873-
}
874-
}
875-
876825
/**
877826
* For more details about DiscountAmount, please refer to the <a
878827
* href="https://docs.stripe.com/api">API Reference.</a>

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

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
@Setter
4949
@EqualsAndHashCode(callSuper = false)
5050
public class PaymentIntent extends ApiResource implements HasId, MetadataStore<PaymentIntent> {
51+
@SerializedName("advanced_feature_details")
52+
AdvancedFeatureDetails advancedFeatureDetails;
53+
5154
/** Details about the agent that initiated the creation of this PaymentIntent. */
5255
@SerializedName("agent_details")
5356
AgentDetails agentDetails;
@@ -56,6 +59,15 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
5659
@SerializedName("allocated_funds")
5760
AllocatedFunds allocatedFunds;
5861

62+
/**
63+
* The list of payment method types allowed for use with this payment. Stripe automatically
64+
* returns compatible payment methods from this list in the {@code payment_method_types} field of
65+
* the response, based on the other PaymentIntent parameters, such as {@code currency}, {@code
66+
* amount}, and {@code customer}.
67+
*/
68+
@SerializedName("allowed_payment_method_types")
69+
List<String> allowedPaymentMethodTypes;
70+
5971
/**
6072
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much
6173
* to charge in the <a href="https://docs.stripe.com/currencies#zero-decimal">smallest currency
@@ -1838,6 +1850,127 @@ public PaymentIntent verifyMicrodeposits(
18381850
return getResponseGetter().request(request, PaymentIntent.class);
18391851
}
18401852

1853+
/**
1854+
* For more details about AdvancedFeatureDetails, please refer to the <a
1855+
* href="https://docs.stripe.com/api">API Reference.</a>
1856+
*/
1857+
@Getter
1858+
@Setter
1859+
@EqualsAndHashCode(callSuper = false)
1860+
public static class AdvancedFeatureDetails extends StripeObject {
1861+
/** Timestamp at which the authorization will expire if not captured. */
1862+
@SerializedName("capture_before")
1863+
Long captureBefore;
1864+
1865+
@SerializedName("decremental_authorization")
1866+
DecrementalAuthorization decrementalAuthorization;
1867+
1868+
@SerializedName("incremental_authorization")
1869+
IncrementalAuthorization incrementalAuthorization;
1870+
1871+
@SerializedName("multicapture")
1872+
Multicapture multicapture;
1873+
1874+
@SerializedName("overcapture")
1875+
Overcapture overcapture;
1876+
1877+
@SerializedName("reauthorization")
1878+
Reauthorization reauthorization;
1879+
1880+
/** Timestamp at which the reauthorization window closes. */
1881+
@SerializedName("reauthorize_before")
1882+
Long reauthorizeBefore;
1883+
1884+
/**
1885+
* For more details about DecrementalAuthorization, please refer to the <a
1886+
* href="https://docs.stripe.com/api">API Reference.</a>
1887+
*/
1888+
@Getter
1889+
@Setter
1890+
@EqualsAndHashCode(callSuper = false)
1891+
public static class DecrementalAuthorization extends StripeObject {
1892+
/**
1893+
* Indicates whether the feature is supported.
1894+
*
1895+
* <p>One of {@code available}, or {@code unavailable}.
1896+
*/
1897+
@SerializedName("status")
1898+
String status;
1899+
}
1900+
1901+
/**
1902+
* For more details about IncrementalAuthorization, please refer to the <a
1903+
* href="https://docs.stripe.com/api">API Reference.</a>
1904+
*/
1905+
@Getter
1906+
@Setter
1907+
@EqualsAndHashCode(callSuper = false)
1908+
public static class IncrementalAuthorization extends StripeObject {
1909+
/**
1910+
* Indicates whether the feature is supported.
1911+
*
1912+
* <p>One of {@code available}, or {@code unavailable}.
1913+
*/
1914+
@SerializedName("status")
1915+
String status;
1916+
}
1917+
1918+
/**
1919+
* For more details about Multicapture, please refer to the <a
1920+
* href="https://docs.stripe.com/api">API Reference.</a>
1921+
*/
1922+
@Getter
1923+
@Setter
1924+
@EqualsAndHashCode(callSuper = false)
1925+
public static class Multicapture extends StripeObject {
1926+
/**
1927+
* Indicates whether the feature is supported.
1928+
*
1929+
* <p>One of {@code available}, or {@code unavailable}.
1930+
*/
1931+
@SerializedName("status")
1932+
String status;
1933+
}
1934+
1935+
/**
1936+
* For more details about Overcapture, please refer to the <a
1937+
* href="https://docs.stripe.com/api">API Reference.</a>
1938+
*/
1939+
@Getter
1940+
@Setter
1941+
@EqualsAndHashCode(callSuper = false)
1942+
public static class Overcapture extends StripeObject {
1943+
/** The maximum amount that can be captured. */
1944+
@SerializedName("maximum_amount_capturable")
1945+
Long maximumAmountCapturable;
1946+
1947+
/**
1948+
* Indicates whether overcapture is supported.
1949+
*
1950+
* <p>One of {@code available}, or {@code unavailable}.
1951+
*/
1952+
@SerializedName("status")
1953+
String status;
1954+
}
1955+
1956+
/**
1957+
* For more details about Reauthorization, please refer to the <a
1958+
* href="https://docs.stripe.com/api">API Reference.</a>
1959+
*/
1960+
@Getter
1961+
@Setter
1962+
@EqualsAndHashCode(callSuper = false)
1963+
public static class Reauthorization extends StripeObject {
1964+
/**
1965+
* Indicates whether the feature is supported.
1966+
*
1967+
* <p>One of {@code available}, or {@code unavailable}.
1968+
*/
1969+
@SerializedName("status")
1970+
String status;
1971+
}
1972+
}
1973+
18411974
/**
18421975
* For more details about AgentDetails, please refer to the <a
18431976
* href="https://docs.stripe.com/api">API Reference.</a>
@@ -8521,6 +8654,7 @@ public PaymentIntent simulateCryptoDeposit(
85218654
@Override
85228655
public void setResponseGetter(StripeResponseGetter responseGetter) {
85238656
super.setResponseGetter(responseGetter);
8657+
trySetResponseGetter(advancedFeatureDetails, responseGetter);
85248658
trySetResponseGetter(agentDetails, responseGetter);
85258659
trySetResponseGetter(allocatedFunds, responseGetter);
85268660
trySetResponseGetter(amountDetails, responseGetter);

0 commit comments

Comments
 (0)