Skip to content

API Updates #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2021
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
26 changes: 26 additions & 0 deletions src/main/java/com/stripe/model/radar/EarlyFraudWarning.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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> paymentIntent;

/** Get ID of expandable {@code charge} object. */
public String getCharge() {
return (this.charge != null) ? this.charge.getId() : null;
Expand All @@ -84,6 +91,25 @@ public void setChargeObject(Charge expandableObject) {
this.charge = new ExpandableField<Charge>(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<PaymentIntent>(expandableObject.getId(), expandableObject);
}

/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(Map<String, Object> params)
throws StripeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,12 +66,14 @@ private EarlyFraudWarningListParams(
List<String> expand,
Map<String, Object> 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;
}

Expand All @@ -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. */
Expand All @@ -93,6 +104,7 @@ public EarlyFraudWarningListParams build() {
this.expand,
this.extraParams,
this.limit,
this.paymentIntent,
this.startingAfter);
}

Expand Down Expand Up @@ -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
Expand Down