-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStrongCustomerAuthentication.java
222 lines (179 loc) · 6.22 KB
/
StrongCustomerAuthentication.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
package io.paymenthighway.model.request.sca;
import com.fasterxml.jackson.annotation.JsonProperty;
public class StrongCustomerAuthentication {
@JsonProperty(value = "return_urls")
private Urls returnUrls;
@JsonProperty(value = "customer_details")
private CustomerDetails customerDetails;
@JsonProperty(value = "customer_account")
private CustomerAccount customerAccount;
@JsonProperty(value = "purchase")
private Purchase purchase;
@JsonProperty(value = "billing_address")
private Address billingAddress;
@JsonProperty(value = "shipping_address")
private Address shippingAddress;
@JsonProperty(value = "customer_authentication_info")
private CustomerAuthenticationInfo customerAuthenticationInfo;
@JsonProperty(value = "desired_challenge_window_size")
private DesiredChallengeWindowSize desiredChallengeWindowSize;
@JsonProperty(value = "exit_iframe_on_result")
private Boolean exitIframeOnResult;
@JsonProperty(value = "exit_iframe_on_three_d_secure")
private Boolean exitIframeOnThreeDSecure;
private StrongCustomerAuthentication(Builder builder) {
returnUrls = builder.returnUrls;
customerDetails = builder.customerDetails;
customerAccount = builder.customerAccount;
purchase = builder.purchase;
billingAddress = builder.billingAddress;
shippingAddress = builder.shippingAddress;
customerAuthenticationInfo = builder.customerAuthenticationInfo;
desiredChallengeWindowSize = builder.desiredChallengeWindowSize;
exitIframeOnResult = builder.exitIframeOnResult;
exitIframeOnThreeDSecure = builder.exitIframeOnThreeDSecure;
}
public Urls getReturnUrls() {
return returnUrls;
}
public CustomerDetails getCustomerDetails() {
return customerDetails;
}
public CustomerAccount getCustomerAccount() {
return customerAccount;
}
public Purchase getPurchase() {
return purchase;
}
public Address getBillingAddress() {
return billingAddress;
}
public Address getShippingAddress() {
return shippingAddress;
}
public CustomerAuthenticationInfo getCustomerAuthenticationInfo() {
return customerAuthenticationInfo;
}
public DesiredChallengeWindowSize getDesiredChallengeWindowSize() {
return desiredChallengeWindowSize;
}
public Boolean getExitIframeOnResult() {
return exitIframeOnResult;
}
public Boolean getExitIframeOnThreeDSecure() {
return exitIframeOnThreeDSecure;
}
/**
* @param returnUrls The URLs where to redirect the user and send the webhook requests to, after the
* Strong Customer Authentication is performed via the 3DS url response in case of a soft decline.
* @return Builder
*/
public static Builder Builder(Urls returnUrls) {
return new Builder(returnUrls);
}
public static final class Builder {
private Urls returnUrls;
private CustomerDetails customerDetails;
private CustomerAccount customerAccount;
private Purchase purchase;
private Address billingAddress;
private Address shippingAddress;
private CustomerAuthenticationInfo customerAuthenticationInfo;
private DesiredChallengeWindowSize desiredChallengeWindowSize;
private Boolean exitIframeOnResult;
private Boolean exitIframeOnThreeDSecure;
public Builder(Urls returnUrls) {
this.returnUrls = returnUrls;
}
public Builder setCustomerDetails(CustomerDetails customerDetails) {
this.customerDetails = customerDetails;
return this;
}
public Builder setCustomerAccount(CustomerAccount customerAccount) {
this.customerAccount = customerAccount;
return this;
}
public Builder setPurchase(Purchase purchase) {
this.purchase = purchase;
return this;
}
public Builder setBillingAddress(Address billingAddress) {
this.billingAddress = billingAddress;
return this;
}
public Builder setShippingAddress(Address shippingAddress) {
this.shippingAddress = shippingAddress;
return this;
}
public Builder setCustomerAuthenticationInfo(CustomerAuthenticationInfo customerAuthenticationInfo) {
this.customerAuthenticationInfo = customerAuthenticationInfo;
return this;
}
/**
* Dimensions of the challenge window that has been displayed to the Cardholder.
* The ACS shall reply with content that is formatted to appropriately render in this window to provide the best possible user experience.
* @param desiredChallengeWindowSize Desired challenge window size for 3DS 2.x.
* @return Builder
*/
public Builder setDesiredChallengeWindowSize(DesiredChallengeWindowSize desiredChallengeWindowSize) {
this.desiredChallengeWindowSize = desiredChallengeWindowSize;
return this;
}
/**
* @param exitIframeOnResult Exit form iframe when redirecting user back to success, failure or cancel URLs.
* @return Builder
*/
public Builder setExitIframeOnResult(Boolean exitIframeOnResult) {
this.exitIframeOnResult = exitIframeOnResult;
return this;
}
/**
* @param exitIframeOnThreeDSecure Exit from iframe when redirecting the user to 3DS.
* @return Builder
*/
public Builder setExitIframeOnThreeDSecure(Boolean exitIframeOnThreeDSecure) {
this.exitIframeOnThreeDSecure = exitIframeOnThreeDSecure;
return this;
}
public StrongCustomerAuthentication build() {
return new StrongCustomerAuthentication(this);
}
}
/**
* Desired challenge window size for 3DS 2.x.
* Dimensions of the challenge window that has been displayed to the Cardholder.
* The ACS shall reply with content that is formatted to appropriately render in this window to provide the best possible user experience.
* {@link #Window250x400}
* {@link #Window390x400}
* {@link #Window500x600}
* {@link #Window600x400}
* {@link #FullScreen}
*/
public enum DesiredChallengeWindowSize {
/**
* 01 = 250 x 400
*/
@JsonProperty("01")
Window250x400,
/**
* 02 = 390 x 400
*/
@JsonProperty("02")
Window390x400,
/**
* 03 = 500 x 600
*/
@JsonProperty("03")
Window500x600,
/**
* 04 = 600 x 400
*/
@JsonProperty("04")
Window600x400,
/**
* 05 = Full screen
*/
@JsonProperty("05")
FullScreen
}
}