Skip to content

Commit

Permalink
Merge pull request #1914 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] authored Oct 29, 2024
2 parents 347f1fa + b194361 commit b7ec2c3
Show file tree
Hide file tree
Showing 61 changed files with 7,789 additions and 495 deletions.
44 changes: 43 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 28.0.0 - 2024-10-29
* [#1896](https://github.com/stripe/stripe-java/pull/1896) This release changes the pinned API version to `2024-10-28.acacia`.
* Add support for new resource `V2.EventDestinations`
* Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations`
* Add support for `submit_card` test helper method on resource `Issuing.Card`
* Add support for `groups` on `AccountCreateParams`, `AccountUpdateParams`, and `Account`
* Add support for `alma_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, and `samsung_pay_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `disable_stripe_user_authentication` on `AccountSession.components.account_management.features`, `AccountSession.components.account_onboarding.features`, `AccountSession.components.balances.features`, `AccountSession.components.notification_banner.features`, `AccountSession.components.payouts.features`, `AccountSessionCreateParams.components.account_management.features`, `AccountSessionCreateParams.components.account_onboarding.features`, `AccountSessionCreateParams.components.balances.features`, `AccountSessionCreateParams.components.notification_banner.features`, and `AccountSessionCreateParams.components.payouts.features`
* Add support for `schedule_at_period_end` on `BillingPortal.Configuration.features.subscription_update`, `billingportal.ConfigurationCreateParams.features.subscription_update`, and `billingportal.ConfigurationUpdateParams.features.subscription_update`
* Change `billingportal.ConfigurationCreateParams.business_profile` to be optional
* Add support for `alma` on `Charge.payment_method_details`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `Refund.destination_details`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for `kakao_pay` and `kr_card` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `Mandate.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentUpdateParams.payment_method_data`, and `checkout.SessionCreateParams.payment_method_options`
* Add support for `naver_pay` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentUpdateParams.payment_method_data`, and `checkout.SessionCreateParams.payment_method_options`
* Add support for `payco` and `samsung_pay` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentUpdateParams.payment_method_data`, and `checkout.SessionCreateParams.payment_method_options`
* Add support for new values `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, `PaymentMethodListParams.type`, and `checkout.SessionCreateParams.payment_method_types[]`
* Add support for new values `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on enums `ConfirmationTokenCreateParams.payment_method_data.type`, `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new value `auto` on enum `CustomerUpdateParams.tax.validate_location`
* Add support for new values `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, and `uz_vat` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceCreatePreviewParams.customer_details.tax_ids[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `TaxIdCreateParams.type`, and `tax.CalculationCreateParams.customer_details.tax_ids[].type`
* Add support for `enhanced_evidence` on `Dispute.evidence` and `DisputeUpdateParams.evidence`
* Add support for `enhanced_eligibility_types` on `Dispute`
* Add support for `enhanced_eligibility` on `Dispute.evidence_details`
* Add support for `metadata` on `Forwarding.Request` and `forwarding.RequestCreateParams`
* Add support for `automatically_finalizes_at` on `InvoiceCreateParams` and `InvoiceUpdateParams`
* Add support for new values `jp_credit_transfer`, `kakao_pay`, `kr_card`, `naver_pay`, and `payco` 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[]`
* Add support for new value `retail_delivery_fee` on enums `InvoiceAddLinesParams.lines[].tax_amounts[].tax_rate_data.tax_type`, `InvoiceUpdateLinesParams.lines[].tax_amounts[].tax_rate_data.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type`
* Add support for new value `alma` on enums `PaymentLinkCreateParams.payment_method_types[]` and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for `amazon_pay` on `PaymentMethodDomain`
* Add support for `flat_amount` and `rate_type` on `Tax.Calculation.tax_breakdown[].tax_rate_details` and `TaxRate`
* Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, and `uz` on `Tax.Registration.country_options` and `tax.RegistrationCreateParams.country_options`
* Add support for new value `state_retail_delivery_fee` on enum `tax.RegistrationCreateParams.country_options.us.type`
* Add support for `pln` on `Terminal.Configuration.tipping`, `terminal.ConfigurationCreateParams.tipping`, and `terminal.ConfigurationUpdateParams.tipping`
* Add support for new values `issuing_transaction.purchase_details_receipt_updated` and `refund.failed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* Add support for new value `2024-10-28.acacia` on enum `WebhookEndpointCreateParams.api_version`

## 27.2.0-beta.3 - 2024-10-18
* [#1897](https://github.com/stripe/stripe-java/pull/1897) Update generated code for beta
* Add support for `alma_payments`, `gopay_payments`, `kakao_pay_payments`, `kr_card_payments`, `naver_pay_payments`, `payco_payments`, `qris_payments`, `samsung_pay_payments`, `shopeepay_payments`, `treasury_evolve`, `treasury_fifth_third`, and `treasury_goldman_sachs` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
Expand Down Expand Up @@ -49,9 +83,17 @@
* Remove support for `from_schedule` on `Quote.subscription_data`
* Add support for `allow_redisplay` on `terminal.ReaderCollectPaymentMethodParams.collect_config`

## 27.1.2 - 2024-10-29
* [#1912](https://github.com/stripe/stripe-java/pull/1912) add `tolerance` argument to `parseThinEvent`
- The default `tolerance` value is still what most users will want, but this fixes an oversight where it wasn't possible to set `tolerance` at all when parsing thin events
* [#1911](https://github.com/stripe/stripe-java/pull/1911) Fixes bug [#1899](https://github.com/stripe/stripe-java/issues/1899)
- Fixes the bug introduced in v27 where StripeException#getUserMessage on v1 API errors would return null instead of the error message.
* [#1906](https://github.com/stripe/stripe-java/pull/1906) Update webhook API version validation
- Update webhook event processing to accept events from any API version within the supported major release

## 27.1.1 - 2024-10-18
* [#1901](https://github.com/stripe/stripe-java/pull/1901) update object tags for meter-related classes

- fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
* [#1898](https://github.com/stripe/stripe-java/pull/1898) Clean up examples
* [#1894](https://github.com/stripe/stripe-java/pull/1894) Fixed example for raw request in readme file
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1314
v1319
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 = "2024-09-30.acacia";
public static final String CURRENT = "2024-10-28.acacia";
}
20 changes: 19 additions & 1 deletion src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,25 @@ protected StripeResponseGetter getResponseGetter() {
*/
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret)
throws SignatureVerificationException {
Signature.verifyHeader(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
return parseThinEvent(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
}

/**
* Returns an StripeEvent instance using the provided JSON payload. Throws a JsonSyntaxException
* if the payload is not valid JSON, and a SignatureVerificationException if the signature
* verification fails for any reason.
*
* @param payload the payload sent by Stripe.
* @param sigHeader the contents of the signature header sent by Stripe.
* @param secret secret used to generate the signature.
* @param tolerance number of seconds that the event's timestamp can differ from the system time.
* Passing `0` will disable the time check entirely and is **strongly discouraged**.
* @return the StripeEvent instance
* @throws SignatureVerificationException if the verification fails.
*/
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret, long tolerance)
throws SignatureVerificationException {
Signature.verifyHeader(payload, sigHeader, secret, tolerance);

return ApiResource.GSON.fromJson(payload, ThinEvent.class);
}
Expand Down
20 changes: 18 additions & 2 deletions src/main/java/com/stripe/exception/StripeException.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.gson.JsonObject;
import com.stripe.model.StripeError;
import com.stripe.net.ApiMode;
import com.stripe.net.StripeResponseGetter;
import lombok.Getter;

Expand All @@ -14,10 +15,19 @@ public abstract class StripeException extends Exception {
// implement Serializable
transient StripeError stripeError;

// This field and its getter are used internally and may change in a non-major version
// of the SDK
ApiMode stripeErrorApiMode;

public void setStripeError(StripeError err) {
stripeError = err;
stripeErrorApiMode = ApiMode.V1;
}

public void setStripeV2Error(StripeError err) {
stripeError = err;
stripeErrorApiMode = ApiMode.V2;
}
/**
* Returns the error code of the response that triggered this exception. For {@link ApiException}
* the error code will be equal to {@link StripeError#getCode()}.
Expand Down Expand Up @@ -68,7 +78,8 @@ public String getMessage() {
if (requestId != null) {
additionalInfo += "; request-id: " + requestId;
}
if (this.getUserMessage() != null) {
// a separate user message is only available on v2 errors
if (stripeErrorApiMode == ApiMode.V2 && this.getUserMessage() != null) {
additionalInfo += "; user-message: " + this.getUserMessage();
}
return super.getMessage() + additionalInfo;
Expand All @@ -81,7 +92,12 @@ public String getMessage() {
*/
public String getUserMessage() {
if (this.getStripeError() != null) {
return this.getStripeError().getUserMessage();
switch (stripeErrorApiMode) {
case V1:
return this.getStripeError().getMessage();
case V2:
return this.getStripeError().getUserMessage();
}
}
return null;
}
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,23 @@ public static class Capabilities extends StripeObject {
@SerializedName("grabpay_payments")
String grabpayPayments;

/**
* The status of the Indonesia Bank Transfer payments capability of the account, or whether the
* account can directly process Indonesia Bank Transfer charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("id_bank_transfer_payments")
String idBankTransferPayments;

/**
* The status of Bank BCA onboarding of the account.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("id_bank_transfer_payments_bca")
String idBankTransferPaymentsBca;

/**
* The status of the iDEAL payments capability of the account, or whether the account can
* directly process iDEAL charges.
Expand Down Expand Up @@ -2312,6 +2329,9 @@ public static class Settings extends StripeObject {
@SerializedName("bacs_debit_payments")
BacsDebitPayments bacsDebitPayments;

@SerializedName("bank_bca_onboarding")
BankBcaOnboarding bankBcaOnboarding;

@SerializedName("branding")
Branding branding;

Expand Down Expand Up @@ -2373,6 +2393,23 @@ public static class BacsDebitPayments extends StripeObject {
String serviceUserNumber;
}

/**
* For more details about BankBcaOnboarding, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class BankBcaOnboarding extends StripeObject {
/** Bank BCA business account holder name. */
@SerializedName("account_holder_name")
String accountHolderName;

/** Bank BCA business account number. */
@SerializedName("business_account_number")
String businessAccountNumber;
}

/**
* For more details about Branding, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,9 @@ public static class PaymentMethodDetails extends StripeObject {
@SerializedName("grabpay")
Grabpay grabpay;

@SerializedName("id_bank_transfer")
IdBankTransfer idBankTransfer;

@SerializedName("ideal")
Ideal ideal;

Expand Down Expand Up @@ -2647,6 +2650,42 @@ public static class Grabpay extends StripeObject {
String transactionId;
}

/**
* For more details about IdBankTransfer, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class IdBankTransfer extends StripeObject {
/** Account number of the bank account to transfer funds to. */
@SerializedName("account_number")
String accountNumber;

/**
* Bank where the account is located.
*
* <p>One of {@code bca}, {@code bni}, {@code bri}, {@code cimb}, or {@code permata}.
*/
@SerializedName("bank")
String bank;

/** Local bank code of the bank. */
@SerializedName("bank_code")
String bankCode;

/** Name of the bank associated with the bank account. */
@SerializedName("bank_name")
String bankName;

/**
* Merchant name and billing details name, for the customer to check for the correct merchant
* when performing the bank transfer.
*/
@SerializedName("display_name")
String displayName;
}

/**
* For more details about Ideal, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
Expand Down
38 changes: 31 additions & 7 deletions src/main/java/com/stripe/model/ConfirmationToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ public static class PaymentMethodPreview extends StripeObject {
@SerializedName("grabpay")
Grabpay grabpay;

@SerializedName("id_bank_transfer")
IdBankTransfer idBankTransfer;

@SerializedName("ideal")
Ideal ideal;

Expand Down Expand Up @@ -400,13 +403,13 @@ public static class PaymentMethodPreview extends StripeObject {
* {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code
* bancontact}, {@code blik}, {@code boleto}, {@code card}, {@code card_present}, {@code
* cashapp}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code giropay}, {@code gopay},
* {@code grabpay}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna},
* {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code
* multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code payco}, {@code paynow},
* {@code paypal}, {@code payto}, {@code pix}, {@code promptpay}, {@code qris}, {@code
* rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code sepa_debit}, {@code shopeepay},
* {@code sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or
* {@code zip}.
* {@code grabpay}, {@code id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code
* kakao_pay}, {@code klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way},
* {@code mobilepay}, {@code multibanco}, {@code naver_pay}, {@code oxxo}, {@code p24}, {@code
* payco}, {@code paynow}, {@code paypal}, {@code payto}, {@code pix}, {@code promptpay}, {@code
* qris}, {@code rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code sepa_debit}, {@code
* shopeepay}, {@code sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code
* wechat_pay}, or {@code zip}.
*/
@SerializedName("type")
String type;
Expand Down Expand Up @@ -1560,6 +1563,27 @@ public static class Gopay extends StripeObject {}
@EqualsAndHashCode(callSuper = false)
public static class Grabpay extends StripeObject {}

/**
* For more details about IdBankTransfer, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class IdBankTransfer extends StripeObject {
@SerializedName("bank")
String bank;

@SerializedName("bank_code")
String bankCode;

@SerializedName("bank_name")
String bankName;

@SerializedName("display_name")
String displayName;
}

/**
* For more details about Ideal, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
Expand Down
Loading

0 comments on commit b7ec2c3

Please sign in to comment.