diff --git a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java index 291149da42d..25b065670d6 100644 --- a/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java +++ b/src/main/java/com/stripe/model/radar/EarlyFraudWarning.java @@ -7,6 +7,7 @@ import com.stripe.model.Charge; import com.stripe.model.ExpandableField; import com.stripe.model.HasId; +import com.stripe.model.PaymentIntent; import com.stripe.net.ApiResource; import com.stripe.net.RequestOptions; import com.stripe.param.radar.EarlyFraudWarningListParams; @@ -66,6 +67,12 @@ public class EarlyFraudWarning extends ApiResource implements HasId { @SerializedName("object") String object; + /** ID of the Payment Intent this early fraud warning is for, optionally expanded. */ + @SerializedName("payment_intent") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentIntent; + /** Get ID of expandable {@code charge} object. */ public String getCharge() { return (this.charge != null) ? this.charge.getId() : null; @@ -84,6 +91,25 @@ public void setChargeObject(Charge expandableObject) { this.charge = new ExpandableField(expandableObject.getId(), expandableObject); } + /** Get ID of expandable {@code paymentIntent} object. */ + public String getPaymentIntent() { + return (this.paymentIntent != null) ? this.paymentIntent.getId() : null; + } + + public void setPaymentIntent(String id) { + this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent); + } + + /** Get expanded {@code paymentIntent}. */ + public PaymentIntent getPaymentIntentObject() { + return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null; + } + + public void setPaymentIntentObject(PaymentIntent expandableObject) { + this.paymentIntent = + new ExpandableField(expandableObject.getId(), expandableObject); + } + /** Returns a list of early fraud warnings. */ public static EarlyFraudWarningCollection list(Map params) throws StripeException { diff --git a/src/main/java/com/stripe/param/radar/EarlyFraudWarningListParams.java b/src/main/java/com/stripe/param/radar/EarlyFraudWarningListParams.java index 7b1874b8a36..3c91a4a77e0 100644 --- a/src/main/java/com/stripe/param/radar/EarlyFraudWarningListParams.java +++ b/src/main/java/com/stripe/param/radar/EarlyFraudWarningListParams.java @@ -44,6 +44,13 @@ public class EarlyFraudWarningListParams extends ApiRequestParams { @SerializedName("limit") Long limit; + /** + * Only return early fraud warnings for charges that were created by the PaymentIntent specified + * by this PaymentIntent ID. + */ + @SerializedName("payment_intent") + String paymentIntent; + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place * in the list. For instance, if you make a list request and receive 100 objects, ending with @@ -59,12 +66,14 @@ private EarlyFraudWarningListParams( List expand, Map extraParams, Long limit, + String paymentIntent, String startingAfter) { this.charge = charge; this.endingBefore = endingBefore; this.expand = expand; this.extraParams = extraParams; this.limit = limit; + this.paymentIntent = paymentIntent; this.startingAfter = startingAfter; } @@ -83,6 +92,8 @@ public static class Builder { private Long limit; + private String paymentIntent; + private String startingAfter; /** Finalize and obtain parameter instance from this builder. */ @@ -93,6 +104,7 @@ public EarlyFraudWarningListParams build() { this.expand, this.extraParams, this.limit, + this.paymentIntent, this.startingAfter); } @@ -174,6 +186,15 @@ public Builder setLimit(Long limit) { return this; } + /** + * Only return early fraud warnings for charges that were created by the PaymentIntent specified + * by this PaymentIntent ID. + */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + /** * A cursor for use in pagination. {@code starting_after} is an object ID that defines your * place in the list. For instance, if you make a list request and receive 100 objects, ending