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 for beta #1947

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d5ef112
Updated upload artifact ci action (#1941)
prathmesh-stripe Jan 25, 2025
73961c6
Update generated code (#1936)
stripe-openapi[bot] Jan 27, 2025
dfafa65
Bump version to 28.3.0
helenye-stripe Jan 27, 2025
7c99196
Ensure `getRawJsonObject` returns data for constructed webhooks (#1946)
xavdid-stripe Feb 5, 2025
5ff5113
Bump version to 28.3.1
xavdid-stripe Feb 7, 2025
67ec448
add codeowners file (#1948)
xavdid-stripe Feb 13, 2025
032d672
Update generated code (#1943)
stripe-openapi[bot] Feb 24, 2025
1cf6c5b
Bump version to 28.4.0
prathmesh-stripe Feb 24, 2025
9ae1c08
Fix publish-docs token permissions (#1951)
jar-stripe Mar 4, 2025
1444581
Add @EqualsAndHashCode annotations
mbroshi-stripe Mar 11, 2025
e9c1325
Revert "Add @EqualsAndHashCode annotations"
mbroshi-stripe Mar 11, 2025
6b047be
Add @EqualsAndHashCode annotations (#1955)
mbroshi-stripe Mar 17, 2025
76da3a4
Merge upstream and update generated code for v1572
stripe-openapi[bot] Mar 19, 2025
3f18261
Update generated code for v1573
stripe-openapi[bot] Mar 19, 2025
6cfde23
Update generated code for v1574
stripe-openapi[bot] Mar 19, 2025
e96e0d6
Support for StripeAccount in StripeClient, and StripeContext on V1 (#…
ramya-stripe Mar 19, 2025
660a3ae
Merge upstream and update generated code for v1583
stripe-openapi[bot] Mar 19, 2025
af9e059
Update generated code for v1585
stripe-openapi[bot] Mar 19, 2025
33f8728
Update generated code for v1586
stripe-openapi[bot] Mar 20, 2025
77e856c
Update generated code for v1587
stripe-openapi[bot] Mar 20, 2025
a873234
Update generated code for v1588
stripe-openapi[bot] Mar 20, 2025
312fe5c
Update generated code for v1590
stripe-openapi[bot] Mar 20, 2025
07f94d8
Update generated code for v1591
stripe-openapi[bot] Mar 20, 2025
2ac7619
Update generated code for v1593
stripe-openapi[bot] Mar 20, 2025
aceee40
Update generated code for v1594
stripe-openapi[bot] Mar 20, 2025
71cf700
Update generated code for v1595
stripe-openapi[bot] Mar 20, 2025
039ce60
Update generated code for v1597
stripe-openapi[bot] Mar 20, 2025
61ec1b9
Update generated code for v1598
stripe-openapi[bot] Mar 20, 2025
96c8934
Update generated code for v1599
stripe-openapi[bot] Mar 20, 2025
8cd0d60
Update generated code for v1601
stripe-openapi[bot] Mar 20, 2025
7367653
Update generated code for v1602
stripe-openapi[bot] Mar 20, 2025
b6273ac
Update generated code for v1604
stripe-openapi[bot] Mar 21, 2025
5a19e3b
Update generated code for v1605
stripe-openapi[bot] Mar 21, 2025
c9d0e37
Update generated code for v1606
stripe-openapi[bot] Mar 21, 2025
115dad4
Update generated code for v1607
stripe-openapi[bot] Mar 21, 2025
59beb90
Update generated code for v1608
stripe-openapi[bot] Mar 21, 2025
db74f48
Update generated code for v1609
stripe-openapi[bot] Mar 21, 2025
903c752
Update generated code for v1610
stripe-openapi[bot] Mar 21, 2025
4ebe999
Update generated code for v1611
stripe-openapi[bot] Mar 21, 2025
e818f9c
Update generated code for v1612
stripe-openapi[bot] Mar 21, 2025
77dda35
Update generated code for v1613
stripe-openapi[bot] Mar 24, 2025
df3663b
Update generated code for v1615
stripe-openapi[bot] Mar 24, 2025
4bbffce
Add generated v2 test support (#1953)
helenye-stripe Mar 25, 2025
49d3e37
Merge upstream and update generated code for v1618
stripe-openapi[bot] Mar 25, 2025
fcdbb7b
Update generated code for v1620
stripe-openapi[bot] Mar 25, 2025
5700c53
Update generated code for v1621
stripe-openapi[bot] Mar 25, 2025
9db0ffe
Update generated code for v1622
stripe-openapi[bot] Mar 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# All files should be reviewed by a member of the SDKs team
* @stripe/api-library-reviewers
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ jobs:
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: "ubuntu-24.04"
permissions:
contents: write
steps:
- uses: actions/checkout@master
- name: Setup Java
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* [#1956](https://github.com/stripe/stripe-java/pull/1956) Beta SDK updates between Open API versions 1473 and 1505

* Add support for `succeed_input_collection` and `timeout_input_collection` test helper methods on resource `Terminal.Reader`
* Add support for `target_date` on `Order.payment.settings.payment_method_options.acss_debit`, `Order.payment.settings.payment_method_options.sepa_debit`, `OrderCreateParams.payment.settings.payment_method_options.acss_debit`, `OrderCreateParams.payment.settings.payment_method_options.sepa_debit`, `OrderUpdateParams.payment.settings.payment_method_options.acss_debit`, and `OrderUpdateParams.payment.settings.payment_method_options.sepa_debit`
* Add support for `target_date` on `Order.payment.settings.payment_method_options.acss_debit`, `Order.payment.settings.payment_method_options.sepa_debit`, `OrderCreateParams.payment.settings.payment_method_options.acss_debit`, `OrderCreateParams.payment.settings.payment_method_options.sepa_debit`, `OrderUpdateParams.payment.settings.payment_method_options.acss_debit`, and `OrderUpdateParams.payment.settings.payment_method_options.sepa_debit`

## 28.4.0 - 2025-02-24
* [#1943](https://github.com/stripe/stripe-java/pull/1943) Update generated code
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1505
v1622
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 = "2025-02-24.acacia";
public static final String CURRENT = "2025-03-31.basil";
}
34 changes: 25 additions & 9 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ static class ClientStripeResponseGetterOptions extends StripeResponseGetterOptio
@Getter(onMethod_ = {@Override})
private final String meterEventsBase;

@Getter(onMethod_ = {@Override})
private final String stripeAccount;

@Getter(onMethod_ = {@Override})
private final String stripeContext;

Expand All @@ -473,6 +476,7 @@ static class ClientStripeResponseGetterOptions extends StripeResponseGetterOptio
String filesBase,
String connectBase,
String meterEventsBase,
String stripeAccount,
String stripeContext) {
this.authenticator = authenticator;
this.clientId = clientId;
Expand All @@ -485,6 +489,7 @@ static class ClientStripeResponseGetterOptions extends StripeResponseGetterOptio
this.filesBase = filesBase;
this.connectBase = connectBase;
this.meterEventsBase = meterEventsBase;
this.stripeAccount = stripeAccount;
this.stripeContext = stripeContext;
}
}
Expand All @@ -509,6 +514,7 @@ public static final class StripeClientBuilder {
private String filesBase = Stripe.UPLOAD_API_BASE;
private String connectBase = Stripe.CONNECT_API_BASE;
private String meterEventsBase = Stripe.METER_EVENTS_API_BASE;
private String stripeAccount;
private String stripeContext;

/**
Expand Down Expand Up @@ -695,6 +701,15 @@ public String getMeterEventsBase() {
return this.meterEventsBase;
}

public StripeClientBuilder setStripeAccount(String account) {
this.stripeAccount = account;
return this;
}

public String getStripeAccount() {
return this.stripeAccount;
}

public StripeClientBuilder setStripeContext(String context) {
this.stripeContext = context;
return this;
Expand All @@ -717,15 +732,16 @@ StripeResponseGetterOptions buildOptions() {
return new ClientStripeResponseGetterOptions(
this.authenticator,
this.clientId,
connectTimeout,
readTimeout,
maxNetworkRetries,
connectionProxy,
proxyCredential,
apiBase,
filesBase,
connectBase,
meterEventsBase,
this.connectTimeout,
this.readTimeout,
this.maxNetworkRetries,
this.connectionProxy,
this.proxyCredential,
this.apiBase,
this.filesBase,
this.connectBase,
this.meterEventsBase,
this.stripeAccount,
this.stripeContext);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/** Returned when the bank account cannot be added due to previous suspicious activity. */
public final class BlockedByStripeException extends ApiException {
private static final long serialVersionUID = 2L;

private BlockedByStripeException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static BlockedByStripeException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
BlockedByStripeException.BlockedByStripeError error =
(BlockedByStripeException.BlockedByStripeError)
StripeObject.deserializeStripeObject(
body, BlockedByStripeException.BlockedByStripeError.class, responseGetter);
BlockedByStripeException exception =
new BlockedByStripeException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class BlockedByStripeError extends StripeError {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/**
* Returned when the PayoutMethodBankAccount object is controlled by the Stripe Dashboard, and
* cannot be archived.
*/
public final class ControlledByDashboardException extends ApiException {
private static final long serialVersionUID = 2L;

private ControlledByDashboardException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static ControlledByDashboardException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
ControlledByDashboardException.ControlledByDashboardError error =
(ControlledByDashboardException.ControlledByDashboardError)
StripeObject.deserializeStripeObject(
body,
ControlledByDashboardException.ControlledByDashboardError.class,
responseGetter);
ControlledByDashboardException exception =
new ControlledByDashboardException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class ControlledByDashboardError extends StripeError {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;
import lombok.Getter;

/**
* Returned in cases where the bank account provided is not valid (wrong format of account number or
* a routing number that does not correspond to a banking institution).
*/
public final class InvalidPaymentMethodException extends ApiException {
private static final long serialVersionUID = 2L;
@Getter String invalidParam;

private InvalidPaymentMethodException(
String message,
String requestId,
String code,
Integer statusCode,
Throwable e,
String invalidParam) {
super(message, requestId, code, statusCode, e);
this.invalidParam = invalidParam;
}

static InvalidPaymentMethodException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
InvalidPaymentMethodException.InvalidPaymentMethodError error =
(InvalidPaymentMethodException.InvalidPaymentMethodError)
StripeObject.deserializeStripeObject(
body,
InvalidPaymentMethodException.InvalidPaymentMethodError.class,
responseGetter);
InvalidPaymentMethodException exception =
new InvalidPaymentMethodException(
error.getMessage(),
requestId,
error.getCode(),
statusCode,
null,
error.getInvalidParam());
exception.setStripeError(error);
return exception;
}

public static class InvalidPaymentMethodError extends StripeError {
@Getter
@SerializedName("invalid_param")
String invalidParam;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/** Returned in cases where the ID provided doesn't correspond to a valid payout method. */
public final class InvalidPayoutMethodException extends ApiException {
private static final long serialVersionUID = 2L;

private InvalidPayoutMethodException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static InvalidPayoutMethodException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
InvalidPayoutMethodException.InvalidPayoutMethodError error =
(InvalidPayoutMethodException.InvalidPayoutMethodError)
StripeObject.deserializeStripeObject(
body, InvalidPayoutMethodException.InvalidPayoutMethodError.class, responseGetter);
InvalidPayoutMethodException exception =
new InvalidPayoutMethodException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class InvalidPayoutMethodError extends StripeError {}
}
38 changes: 38 additions & 0 deletions src/main/java/com/stripe/exception/QuotaExceededException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// File generated from our OpenAPI spec
package com.stripe.exception;

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.model.StripeObject;
import com.stripe.net.StripeResponseGetter;

/**
* Returned when the number of country bank accounts has exceeded the limit in a given workspace.
* PayoutMethodBankAccount objects may be archived with the /archive API, at which point they will
* not count against the limit. If you are not passing a V2 Account ID in the Stripe-Context header
* you may receive this error since you are creating all your bank account objects in your own
* workspace.
*/
public final class QuotaExceededException extends ApiException {
private static final long serialVersionUID = 2L;

private QuotaExceededException(
String message, String requestId, String code, Integer statusCode, Throwable e) {
super(message, requestId, code, statusCode, e);
}

static QuotaExceededException parse(
JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) {
QuotaExceededException.QuotaExceededError error =
(QuotaExceededException.QuotaExceededError)
StripeObject.deserializeStripeObject(
body, QuotaExceededException.QuotaExceededError.class, responseGetter);
QuotaExceededException exception =
new QuotaExceededException(
error.getMessage(), requestId, error.getCode(), statusCode, null);
exception.setStripeError(error);
return exception;
}

public static class QuotaExceededError extends StripeError {}
}
15 changes: 15 additions & 0 deletions src/main/java/com/stripe/exception/StripeException.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ public static StripeException parseV2Exception(
case "temporary_session_expired":
return com.stripe.exception.TemporarySessionExpiredException.parse(
body, statusCode, requestId, responseGetter);
case "blocked_by_stripe":
return com.stripe.exception.BlockedByStripeException.parse(
body, statusCode, requestId, responseGetter);
case "invalid_payout_method":
return com.stripe.exception.InvalidPayoutMethodException.parse(
body, statusCode, requestId, responseGetter);
case "quota_exceeded":
return com.stripe.exception.QuotaExceededException.parse(
body, statusCode, requestId, responseGetter);
case "controlled_by_dashboard":
return com.stripe.exception.ControlledByDashboardException.parse(
body, statusCode, requestId, responseGetter);
case "invalid_payment_method":
return com.stripe.exception.InvalidPaymentMethodException.parse(
body, statusCode, requestId, responseGetter);
// The end of the section generated from our OpenAPI spec
}
return null;
Expand Down
Loading
Loading