1+ package com .braintreegateway ;
2+
3+ import java .util .HashMap ;
4+ import java .util .Map ;
5+
6+ /**
7+ * Provides a fluent interface to build requests for creating Bank Account Instant Verification JWTs.
8+ */
9+ public class BankAccountInstantVerificationJwtRequest extends Request {
10+ private String businessName ;
11+ private String returnUrl ;
12+ private String cancelUrl ;
13+
14+ /**
15+ * Sets the officially registered business name for the merchant.
16+ *
17+ * @param businessName the business name
18+ * @return the BankAccountInstantVerificationJwtRequest
19+ */
20+ public BankAccountInstantVerificationJwtRequest businessName (String businessName ) {
21+ this .businessName = businessName ;
22+ return this ;
23+ }
24+
25+ /**
26+ * Sets the URL to redirect the consumer after successful account selection.
27+ *
28+ * @param returnUrl the return URL
29+ * @return the BankAccountInstantVerificationJwtRequest
30+ */
31+ public BankAccountInstantVerificationJwtRequest returnUrl (String returnUrl ) {
32+ this .returnUrl = returnUrl ;
33+ return this ;
34+ }
35+
36+ /**
37+ * Sets the URL to redirect the consumer upon cancellation of the Open Banking flow.
38+ *
39+ * @param cancelUrl the cancel URL
40+ * @return the BankAccountInstantVerificationJwtRequest
41+ */
42+ public BankAccountInstantVerificationJwtRequest cancelUrl (String cancelUrl ) {
43+ this .cancelUrl = cancelUrl ;
44+ return this ;
45+ }
46+
47+
48+ public String getBusinessName () {
49+ return businessName ;
50+ }
51+
52+ public String getReturnUrl () {
53+ return returnUrl ;
54+ }
55+
56+ public String getCancelUrl () {
57+ return cancelUrl ;
58+ }
59+
60+
61+ @ Override
62+ public Map <String , Object > toGraphQLVariables () {
63+ Map <String , Object > variables = new HashMap <>();
64+ Map <String , Object > input = new HashMap <>();
65+
66+ if (businessName != null ) {
67+ input .put ("businessName" , businessName );
68+ }
69+ if (returnUrl != null ) {
70+ input .put ("returnUrl" , returnUrl );
71+ }
72+ if (cancelUrl != null ) {
73+ input .put ("cancelUrl" , cancelUrl );
74+ }
75+
76+ variables .put ("input" , input );
77+ return variables ;
78+ }
79+ }
0 commit comments