Skip to content

Commit

Permalink
Merge pull request #1714 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] committed Jan 12, 2024
2 parents d1d323a + 61fbad1 commit 56166ca
Show file tree
Hide file tree
Showing 120 changed files with 4,924 additions and 4,028 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ jobs:
- name: Run JAPI Compliance Checker
run: |
cd ../japi-compliance-checker
pushd ../japi-compliance-checker
perl japi-compliance-checker.pl -old old.jar -new new.jar --lib=stripe-java || echo "failed" > compliance_failure
cd ../stripe-java
popd
mv ../japi-compliance-checker/compat_reports/stripe-java/*/compat_report.html report.html
- name: Upload report as artifact
Expand All @@ -218,6 +218,6 @@ jobs:
- name: Fail if compatibility problems exist
run: |
if [ -f "../japi-compliance-checker/compliance_failure" ]; then
echo "There were compatibility problems. See the generated report at https://github.com/stripe/stripe-java/actions/runs/${{ github.run_id }}?check_suite_focus=true#artifacts"
echo "There were compatibility problems. See the generated report at https://github.com/stripe/${{ github.repository }}/actions/runs/${{ github.run_id }}?check_suite_focus=true#artifacts"
exit 1
fi
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Changelog

## 24.11.0 - 2024-01-12
* [#1715](https://github.com/stripe/stripe-java/pull/1715) Update generated code
* Add support for new resource `CustomerSession`
* Add support for `create` method on resource `CustomerSession`
* Remove support for `expand` on `BankAccountDeleteParams` and `CardDeleteParams`
* Add support for `account_type`, `default_for_currency`, and `documents` on `BankAccountUpdateParams` and `CardUpdateParams`
* Remove support for `owner` on `BankAccountUpdateParams` and `CardUpdateParams`
* Change type of `BankAccountUpdateParams.account_holder_type` and `CardUpdateParams.account_holder_type` from `enum('company'|'individual')` to `emptyStringable(enum('company'|'individual'))`
* Add support for new values `eps` and `p24` on enums `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Remove support for value `obligation` from enum `reporting.ReportRunCreateParams.parameters.reporting_category`
* Add support for `billing_cycle_anchor_config` on `SubscriptionCreateParams` and `Subscription`
* [#1702](https://github.com/stripe/stripe-java/pull/1702) Change StripeResponseGetter to take a single APIRequest object
* [#1716](https://github.com/stripe/stripe-java/pull/1716) Add missing method overloads

## 24.11.0-beta.1 - 2024-01-04
* [#1713](https://github.com/stripe/stripe-java/pull/1713) Update generated code for beta
* Updated stable APIs to the latest version


## 24.10.0 - 2024-01-04
* [#1712](https://github.com/stripe/stripe-java/pull/1712) Update generated code
* Add support for `retrieve` method on resource `Tax.Registration`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v742
v756
36 changes: 18 additions & 18 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -524,29 +524,29 @@ public Account reject(AccountRejectParams params, RequestOptions options) throws
}

/** Retrieves the details of an account. */
public static Account retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
public static Account retrieve(String account) throws StripeException {
return retrieve(account, (Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves the details of an account. */
public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
public static Account retrieve(String account, RequestOptions options) throws StripeException {
return retrieve(account, (Map<String, Object>) null, options);
}

/** Retrieves the details of an account. */
public static Account retrieve(Map<String, Object> params, RequestOptions options)
public static Account retrieve(String account, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}

/** Retrieves the details of an account. */
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
public static Account retrieve(
String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
Expand All @@ -560,29 +560,29 @@ public static Account retrieve(AccountRetrieveParams params, RequestOptions opti
}

/** Retrieves the details of an account. */
public static Account retrieve(String account) throws StripeException {
return retrieve(account, (Map<String, Object>) null, (RequestOptions) null);
public static Account retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves the details of an account. */
public static Account retrieve(String account, RequestOptions options) throws StripeException {
return retrieve(account, (Map<String, Object>) null, options);
public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
}

/** Retrieves the details of an account. */
public static Account retrieve(String account, Map<String, Object> params, RequestOptions options)
public static Account retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
String path = "/v1/account";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}

/** Retrieves the details of an account. */
public static Account retrieve(
String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/com/stripe/model/BalanceTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ public class BalanceTransaction extends ApiResource implements HasId {
* charge}, {@code climate_order_purchase}, {@code climate_order_refund}, {@code
* connect_collection_transfer}, {@code contribution}, {@code issuing_authorization_hold}, {@code
* issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code obligation_payout}, {@code obligation_payout_failure},
* {@code payment}, {@code payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* obligation_outbound}, {@code obligation_reversal_inbound}, {@code payment}, {@code
* payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code
* payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code
* refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code
Expand All @@ -143,15 +142,15 @@ public class BalanceTransaction extends ApiResource implements HasId {
* charge}, {@code climate_order_purchase}, {@code climate_order_refund}, {@code
* connect_collection_transfer}, {@code contribution}, {@code issuing_authorization_hold}, {@code
* issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_payout}, {@code
* obligation_payout_failure}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code payment}, {@code payment_failure_refund}, {@code
* payment_network_reserve_hold}, {@code payment_network_reserve_release}, {@code payment_refund},
* {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel},
* {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction},
* {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code
* topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code
* transfer_failure}, or {@code transfer_refund}.
* obligation_outbound}, {@code obligation_reversal_inbound}, {@code payment}, {@code
* payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code
* payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code
* refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code
* stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal},
* {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, {@code transfer_refund},
* {@code obligation_inbound}, {@code obligation_payout}, {@code obligation_payout_failure}, or
* {@code obligation_reversal_outbound}.
*/
@SerializedName("type")
String type;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/stripe/model/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,17 @@ public static Customer retrieve(
return getGlobalResponseGetter().request(request, Customer.class);
}

/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(String paymentMethod) throws StripeException {
return retrievePaymentMethod(paymentMethod, (Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(String paymentMethod, Map<String, Object> params)
throws StripeException {
return retrievePaymentMethod(paymentMethod, params, (RequestOptions) null);
}

/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(
String paymentMethod, Map<String, Object> params, RequestOptions options)
Expand All @@ -617,6 +628,12 @@ public PaymentMethod retrievePaymentMethod(
return getResponseGetter().request(request, PaymentMethod.class);
}

/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(
String paymentMethod, CustomerRetrievePaymentMethodParams params) throws StripeException {
return retrievePaymentMethod(paymentMethod, params, (RequestOptions) null);
}

/** Retrieves a PaymentMethod object for a given Customer. */
public PaymentMethod retrievePaymentMethod(
String paymentMethod, CustomerRetrievePaymentMethodParams params, RequestOptions options)
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/stripe/model/CustomerSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ public static CustomerSession create(CustomerSessionCreateParams params, Request
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Components extends StripeObject {
/** This hash contains whether the buy button is enabled. */
@SerializedName("buy_button")
BuyButton buyButton;

/** This hash contains whether the payment element is enabled and the features it supports. */
@SerializedName("payment_element")
PaymentElement paymentElement;
Expand All @@ -147,6 +151,16 @@ public static class Components extends StripeObject {
@SerializedName("pricing_table")
PricingTable pricingTable;

/** This hash contains whether the buy button is enabled. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class BuyButton extends StripeObject {
/** Whether the buy button is enabled. */
@SerializedName("enabled")
Boolean enabled;
}

/** This hash contains whether the payment element is enabled and the features it supports. */
@Getter
@Setter
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/ExternalAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import java.util.Map;

public interface ExternalAccount extends StripeObjectInterface, HasId {
ExternalAccount update(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount update(Map<String, Object> params) throws StripeException;

ExternalAccount delete(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount delete() throws StripeException;

ExternalAccount delete(RequestOptions options) throws StripeException;

ExternalAccount delete(Map<String, Object> params) throws StripeException;

ExternalAccount update(Map<String, Object> params, RequestOptions options) throws StripeException;

ExternalAccount update(Map<String, Object> params) throws StripeException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,28 @@ public String getId() {
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount update(Map<String, Object> params, RequestOptions options)
public ExternalAccount delete(Map<String, Object> params, RequestOptions options)
throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
+ "does not implement method: update. "
+ "does not implement method: delete. "
+ "Please contact support@stripe.com for assistance.",
this.id, this.object));
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount update(Map<String, Object> params) throws StripeException {
public ExternalAccount delete() throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
+ "does not implement method: update. "
+ "does not implement method: delete. "
+ "Please contact support@stripe.com for assistance.",
this.id, this.object));
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount delete(Map<String, Object> params, RequestOptions options)
throws StripeException {
public ExternalAccount delete(RequestOptions options) throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
Expand All @@ -115,7 +114,7 @@ public ExternalAccount delete(Map<String, Object> params, RequestOptions options
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount delete() throws StripeException {
public ExternalAccount delete(Map<String, Object> params) throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
Expand All @@ -125,21 +124,22 @@ public ExternalAccount delete() throws StripeException {
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount delete(RequestOptions options) throws StripeException {
public ExternalAccount update(Map<String, Object> params, RequestOptions options)
throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
+ "does not implement method: delete. "
+ "does not implement method: update. "
+ "Please contact support@stripe.com for assistance.",
this.id, this.object));
}
/** Unsupported operation for unknown subtype. */
@Override
public ExternalAccount delete(Map<String, Object> params) throws StripeException {
public ExternalAccount update(Map<String, Object> params) throws StripeException {
throw new UnsupportedOperationException(
String.format(
"Unknown subtype of ExternalAccount with id: %s, object: %s, "
+ "does not implement method: delete. "
+ "does not implement method: update. "
+ "Please contact support@stripe.com for assistance.",
this.id, this.object));
}
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/stripe/model/LoginLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,41 @@ public class LoginLink extends ApiResource {
@SerializedName("url")
String url;

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
* <p><strong>You may only create login links for <a
* href="https://stripe.com/docs/connect/express-accounts">Express accounts</a> connected to your
* platform</strong>.
*/
public static LoginLink createOnAccount(String account) throws StripeException {
return createOnAccount(account, (Map<String, Object>) null, (RequestOptions) null);
}

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
* <p><strong>You may only create login links for <a
* href="https://stripe.com/docs/connect/express-accounts">Express accounts</a> connected to your
* platform</strong>.
*/
public static LoginLink createOnAccount(String account, RequestOptions options)
throws StripeException {
return createOnAccount(account, (Map<String, Object>) null, options);
}

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
* <p><strong>You may only create login links for <a
* href="https://stripe.com/docs/connect/express-accounts">Express accounts</a> connected to your
* platform</strong>.
*/
public static LoginLink createOnAccount(String account, Map<String, Object> params)
throws StripeException {
return createOnAccount(account, params, (RequestOptions) null);
}

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
Expand All @@ -54,6 +89,18 @@ public static LoginLink createOnAccount(
return getGlobalResponseGetter().request(request, LoginLink.class);
}

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
* <p><strong>You may only create login links for <a
* href="https://stripe.com/docs/connect/express-accounts">Express accounts</a> connected to your
* platform</strong>.
*/
public static LoginLink createOnAccount(String account, LoginLinkCreateOnAccountParams params)
throws StripeException {
return createOnAccount(account, params, (RequestOptions) null);
}

/**
* Creates a single-use login link for an Express account to access their Stripe dashboard.
*
Expand Down

0 comments on commit 56166ca

Please sign in to comment.