-
Notifications
You must be signed in to change notification settings - Fork 368
/
Copy pathEarlyFraudWarning.java
166 lines (145 loc) · 5.99 KB
/
EarlyFraudWarning.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Generated by com.stripe.generator.entity.SdkBuilder
package com.stripe.model.radar;
import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.model.ExpandableField;
import com.stripe.model.HasId;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.radar.EarlyFraudWarningListParams;
import com.stripe.param.radar.EarlyFraudWarningRetrieveParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class EarlyFraudWarning extends ApiResource implements HasId {
/**
* An EFW is actionable if it has not received a dispute and has not been fully refunded. You may
* wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute
* later.
*/
@SerializedName("actionable")
Boolean actionable;
/** ID of the charge this early fraud warning is for, optionally expanded. */
@SerializedName("charge")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Charge> charge;
/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
/**
* The type of fraud labelled by the issuer. One of `card_never_received`,
* `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`,
* `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`.
*/
@SerializedName("fraud_type")
String fraudType;
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
/**
* Has the value `true` if the object exists in live mode or the value `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. */
@SerializedName("object")
String object;
/** Get id of expandable `charge` object. */
public String getCharge() {
return (this.charge != null) ? this.charge.getId() : null;
}
public void setCharge(String id) {
this.charge = ApiResource.setExpandableFieldId(id, this.charge);
}
/** Get expanded `charge`. */
public Charge getChargeObject() {
return (this.charge != null) ? this.charge.getExpanded() : null;
}
public void setChargeObject(Charge expandableObject) {
this.charge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
}
/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(Map<String, Object> params)
throws StripeException {
return list(params, (RequestOptions) null);
}
/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/early_fraud_warnings");
return requestCollection(url, params, EarlyFraudWarningCollection.class, options);
}
/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(EarlyFraudWarningListParams params)
throws StripeException {
return list(params, (RequestOptions) null);
}
/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(
EarlyFraudWarningListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/early_fraud_warnings");
return requestCollection(url, params, EarlyFraudWarningCollection.class, options);
}
/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(String earlyFraudWarning) throws StripeException {
return retrieve(earlyFraudWarning, (Map<String, Object>) null, (RequestOptions) null);
}
/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(String earlyFraudWarning, RequestOptions options)
throws StripeException {
return retrieve(earlyFraudWarning, (Map<String, Object>) null, options);
}
/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(
String earlyFraudWarning, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/radar/early_fraud_warnings/%s", ApiResource.urlEncodeId(earlyFraudWarning)));
return request(ApiResource.RequestMethod.GET, url, params, EarlyFraudWarning.class, options);
}
/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(
String earlyFraudWarning, EarlyFraudWarningRetrieveParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/radar/early_fraud_warnings/%s", ApiResource.urlEncodeId(earlyFraudWarning)));
return request(ApiResource.RequestMethod.GET, url, params, EarlyFraudWarning.class, options);
}
}