Skip to content

Commit

Permalink
Merge pull request #1842 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 Aug 1, 2024
2 parents 1b5754a + ea397f2 commit 8fafa95
Show file tree
Hide file tree
Showing 32 changed files with 3,697 additions and 441 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 26.6.0 - 2024-08-01
* [#1841](https://github.com/stripe/stripe-java/pull/1841) Update generated code
* Add support for new resources `Billing.AlertTriggered` and `Billing.Alert`
* ⚠️ Remove support for `authorization_code` on `Charge.payment_method_details.card`. This was accidentally released last week.
* Add support for new value `billing.alert.triggered` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 26.6.0-beta.1 - 2024-07-25
* [#1834](https://github.com/stripe/stripe-java/pull/1834) Update generated code for beta
⚠️ `InvoicePayment.charge` and `InvoicePayment.paymentIntent` were removed in favor of `InvoicePayment.Payment`, which encapsulates both. The `Charge` and `PaymentIntent` fields are now found at `InvoicePayment.Payment.Charge` `InvoicePaymentPayment.paymentIntent`
Expand All @@ -10,7 +16,7 @@
* Add support for `capital` on `Account.settings`, `AccountCreateParams.settings`, and `AccountUpdateParams.settings`
* Add support for `async_workflows` on `PaymentIntentCaptureParams`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams`, `PaymentIntentDecrementAuthorizationParams`, `PaymentIntentIncrementAuthorizationParams`, `PaymentIntentUpdateParams`, and `PaymentIntent`
* Add support for `payto` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration`
* Add support for `display_name` on `Treasury.FinancialAccount`, `treasury.FinancialAccountCreateParams`, and `treasury.FinancialAccountUpdateParams`
* Add support for `display_name` on `Treasury.FinancialAccount`, `treasury.FinancialAccountCreateParams`, and `treasury.FinancialAccountUpdateParams`

## 26.5.1 - 2024-07-25
* [#1840](https://github.com/stripe/stripe-java/pull/1840) 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 @@
v1157
v1169
4 changes: 0 additions & 4 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1574,10 +1574,6 @@ public static class Card extends StripeObject {
@SerializedName("amount_authorized")
Long amountAuthorized;

/** Authorization code on the charge. */
@SerializedName("authorization_code")
String authorizationCode;

/**
* Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au},
* {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}.
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/stripe/model/Dispute.java
Original file line number Diff line number Diff line change
Expand Up @@ -1009,16 +1009,6 @@ public static class EnhancedEligibility extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class VisaCompellingEvidence3 extends StripeObject {
/**
* Rejection reason for evidence submitted as Visa Compelling Evidence 3.0 to Visa and
* rejected by Visa.
*
* <p>One of {@code fraudulent_prior_transaction}, {@code other}, or {@code
* visa_internal_error}.
*/
@SerializedName("partner_rejected_details")
String partnerRejectedDetails;

/**
* List of actions required to qualify dispute for Visa Compelling Evidence 3.0 evidence
* submission.
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/stripe/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public class Event extends ApiResource implements HasId {
* {@code customer.subscription.created}, {@code customer.subscription.custom_event}, {@code
* customer.subscription.deleted}, {@code customer.subscription.paused}, {@code
* customer.subscription.pending_update_applied}, {@code
* customer.subscription.pending_update_expired}, {@code customer.subscription.resumed}, {@code
* customer.subscription.pending_update_expired}, {@code
* customer.subscription.price_migration_failed}, {@code customer.subscription.resumed}, {@code
* customer.subscription.trial_will_end}, {@code customer.subscription.updated}, {@code
* customer.tax_id.created}, {@code customer.tax_id.deleted}, {@code customer.tax_id.updated},
* {@code customer.updated}, {@code customer_cash_balance_transaction.created}, {@code
Expand Down Expand Up @@ -201,9 +202,9 @@ public class Event extends ApiResource implements HasId {
* source.transaction.updated}, {@code subscription_schedule.aborted}, {@code
* subscription_schedule.canceled}, {@code subscription_schedule.completed}, {@code
* subscription_schedule.created}, {@code subscription_schedule.expiring}, {@code
* subscription_schedule.released}, {@code subscription_schedule.updated}, {@code
* tax.form.updated}, {@code tax.settings.updated}, {@code tax_rate.created}, {@code
* tax_rate.updated}, {@code terminal.reader.action_failed}, {@code
* subscription_schedule.price_migration_failed}, {@code subscription_schedule.released}, {@code
* subscription_schedule.updated}, {@code tax.form.updated}, {@code tax.settings.updated}, {@code
* tax_rate.created}, {@code tax_rate.updated}, {@code terminal.reader.action_failed}, {@code
* terminal.reader.action_succeeded}, {@code terminal.reader.action_updated}, {@code
* test_helpers.test_clock.advancing}, {@code test_helpers.test_clock.created}, {@code
* test_helpers.test_clock.deleted}, {@code test_helpers.test_clock.internal_failure}, {@code
Expand Down
151 changes: 151 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.InvoiceAddLinesParams;
import com.stripe.param.InvoiceAttachPaymentIntentParams;
import com.stripe.param.InvoiceAttachPaymentParams;
import com.stripe.param.InvoiceCreateParams;
import com.stripe.param.InvoiceCreatePreviewParams;
import com.stripe.param.InvoiceFinalizeInvoiceParams;
Expand Down Expand Up @@ -1026,6 +1027,156 @@ public Invoice addLines(InvoiceAddLinesParams params, RequestOptions options)
return getResponseGetter().request(request, Invoice.class);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment() throws StripeException {
return attachPayment((Map<String, Object>) null, (RequestOptions) null);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment(RequestOptions options) throws StripeException {
return attachPayment((Map<String, Object>) null, options);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment(Map<String, Object> params) throws StripeException {
return attachPayment(params, (RequestOptions) null);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/invoices/%s/attach_payment", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, Invoice.class);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment(InvoiceAttachPaymentParams params) throws StripeException {
return attachPayment(params, (RequestOptions) null);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
* {@code payments}.
*
* <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
* {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
* {@code paid} if necessary.
*
* <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
* payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
* fully paid, the invoice’s status becomes {@code paid}.
*
* <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
* to the invoice immediately.
*
* <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
* payment</a> to learn more.
*/
public Invoice attachPayment(InvoiceAttachPaymentParams params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/invoices/%s/attach_payment", ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, Invoice.class);
}

/**
* Attaches a PaymentIntent to the invoice, adding it to the list of {@code payments}. When the
* PaymentIntent’s status changes to {@code succeeded}, the payment is credited to the invoice,
Expand Down
Loading

0 comments on commit 8fafa95

Please sign in to comment.