Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7f436e73385732b1c5502f408a6fe37f7b6b0612
368be7755d15d02a1038325c7d159703b01662b0
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2128
v2129
12 changes: 12 additions & 0 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,18 @@ public com.stripe.service.PrivacyService privacy() {
return new com.stripe.service.PrivacyService(this.getResponseGetter());
}

/**
* @deprecated StripeClient.productCatalog() is deprecated, use StripeClient.v1().productCatalog()
* instead. All functionality under it has been copied over to
* StripeClient.v1().productCatalog(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ProductCatalogService productCatalog() {
return new com.stripe.service.ProductCatalogService(this.getResponseGetter());
}

/**
* @deprecated StripeClient.products() is deprecated, use StripeClient.v1().products() instead.
* All functionality under it has been copied over to StripeClient.v1().products(). See <a
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ public final class EventDataClassLookup {
"privacy.redaction_job_validation_error",
com.stripe.model.privacy.RedactionJobValidationError.class);

classLookup.put(
"product_catalog.trial_offer", com.stripe.model.productcatalog.TrialOffer.class);

classLookup.put("radar.account_evaluation", com.stripe.model.radar.AccountEvaluation.class);
classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class);
classLookup.put("radar.value_list", com.stripe.model.radar.ValueList.class);
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("payment_method_types")
List<String> paymentMethodTypes;

/**
* When you enable this parameter, this PaymentIntent will route your payment to processors that
* you configure in the dashboard.
*/
@SerializedName("payments_orchestration")
PaymentsOrchestration paymentsOrchestration;

@SerializedName("presentment_details")
PresentmentDetails presentmentDetails;

Expand Down Expand Up @@ -6342,6 +6349,19 @@ public static class Zip extends StripeObject {
}
}

/**
* For more details about PaymentsOrchestration, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentsOrchestration extends StripeObject {
/** Whether this feature is enabled. */
@SerializedName("enabled")
Boolean enabled;
}

/**
* For more details about PresentmentDetails, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
Expand Down Expand Up @@ -6477,6 +6497,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(paymentMethod, responseGetter);
trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
trySetResponseGetter(paymentMethodOptions, responseGetter);
trySetResponseGetter(paymentsOrchestration, responseGetter);
trySetResponseGetter(presentmentDetails, responseGetter);
trySetResponseGetter(processing, responseGetter);
trySetResponseGetter(review, responseGetter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,6 @@ public static class LineItemDetail extends StripeObject {
@SerializedName("amount_subtotal")
Long amountSubtotal;

/** The total after discounts but before taxes are applied. */
@SerializedName("amount_subtotal_after_discount")
Long amountSubtotalAfterDiscount;

/** The total after discounts and taxes. */
@SerializedName("amount_total")
Long amountTotal;

/** The description of the line item. */
@SerializedName("description")
String description;
Expand Down Expand Up @@ -571,14 +563,6 @@ public static class LineItemDetail extends StripeObject {
/** The per-unit amount of the item before any discounts or taxes are applied. */
@SerializedName("unit_amount")
Long unitAmount;

/** The per-unit amount of the item after discounts but before taxes are applied. */
@SerializedName("unit_amount_after_discount")
Long unitAmountAfterDiscount;

/** The per-unit discount amount. If no discount were applied, defaults to 0. */
@SerializedName("unit_discount")
Long unitDiscount;
}

/**
Expand Down Expand Up @@ -718,17 +702,23 @@ public static class SellerDetails extends StripeObject {}
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TotalDetails extends StripeObject {
/** The amount discount of the total details. */
@SerializedName("amount_discount")
Long amountDiscount;
/**
* The amount of order-level discounts applied to the cart. The total discount amount for this
* session can be computed by summing the cart discount and the item discounts.
*/
@SerializedName("amount_cart_discount")
Long amountCartDiscount;

/** The amount fulfillment of the total details. */
@SerializedName("amount_fulfillment")
Long amountFulfillment;

/** Total of all items after discounts but before taxes are applied. */
@SerializedName("amount_subtotal_after_discount")
Long amountSubtotalAfterDiscount;
/**
* The amount of item-level discounts applied to the cart. The total discount amount for this
* session can be computed by summing the cart discount and the item discounts.
*/
@SerializedName("amount_items_discount")
Long amountItemsDiscount;

/** The amount tax of the total details. */
@SerializedName("amount_tax")
Expand Down
187 changes: 187 additions & 0 deletions src/main/java/com/stripe/model/productcatalog/TrialOffer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// File generated from our OpenAPI spec
package com.stripe.model.productcatalog;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.ExpandableField;
import com.stripe.model.HasId;
import com.stripe.model.Price;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.productcatalog.TrialOfferCreateParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* Resource for the TrialOffer API, used to describe a subscription item's trial period settings.
* Renders a TrialOffer object that describes the price, duration, end_behavior of a trial offer.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class TrialOffer extends ApiResource implements HasId {
@SerializedName("duration")
Duration duration;

@SerializedName("end_behavior")
EndBehavior endBehavior;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;

/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code product_catalog.trial_offer}.
*/
@SerializedName("object")
String object;

/** The price during the trial offer. */
@SerializedName("price")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Price> price;

/** Get ID of expandable {@code price} object. */
public String getPrice() {
return (this.price != null) ? this.price.getId() : null;
}

public void setPrice(String id) {
this.price = ApiResource.setExpandableFieldId(id, this.price);
}

/** Get expanded {@code price}. */
public Price getPriceObject() {
return (this.price != null) ? this.price.getExpanded() : null;
}

public void setPriceObject(Price expandableObject) {
this.price = new ExpandableField<Price>(expandableObject.getId(), expandableObject);
}

/** Creates a trial offer. */
public static TrialOffer create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}

/** Creates a trial offer. */
public static TrialOffer create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/product_catalog/trial_offers";
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
return getGlobalResponseGetter().request(request, TrialOffer.class);
}

/** Creates a trial offer. */
public static TrialOffer create(TrialOfferCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}

/** Creates a trial offer. */
public static TrialOffer create(TrialOfferCreateParams params, RequestOptions options)
throws StripeException {
String path = "/v1/product_catalog/trial_offers";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options);
return getGlobalResponseGetter().request(request, TrialOffer.class);
}

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

/**
* The type of trial offer duration.
*
* <p>One of {@code relative}, or {@code timestamp}.
*/
@SerializedName("type")
String type;

/**
* For more details about Relative, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Relative extends StripeObject {
/** The number of iterations of the price's interval for this trial offer. */
@SerializedName("iterations")
Long iterations;
}
}

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

/**
* The type of behavior when the trial offer ends.
*
* <p>Equal to {@code transition}.
*/
@SerializedName("type")
String type;

/**
* For more details about Transition, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Transition extends StripeObject {
/** The new price to use at the end of the trial offer period. */
@SerializedName("price")
String price;
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(duration, responseGetter);
trySetResponseGetter(endBehavior, responseGetter);
trySetResponseGetter(price, responseGetter);
}
}
Loading
Loading