Skip to content

Commit 2de83fa

Browse files
committed
fix intellij link in readme, add in ph# form field
1 parent 35f6f27 commit 2de83fa

6 files changed

Lines changed: 24 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ $ java -Dspring.profiles.active=dev -jar code-examples-java-1.0-SNAPSHOT.war
164164

165165
### IntelliJ Ultimate installation
166166

167-
See the [IntelliJ Ultimate instructions](https://github.com/docusign/eg-03-java-auth-code-grant/blob/master/docs/Readme_IntelliJ_Ultimate.md).
167+
See the [IntelliJ Ultimate instructions](https://github.com/docusign/code-examples-java/blob/master/docs/Readme_IntelliJ_Ultimate.md).
168168

169169
## Configure the example
170170

171171
Configure the example via the properties file:
172-
`eg-03-java-auth-code-grant/src/main/resources/application-dev.properties`.
172+
`code-examples-java/src/main/resources/application-dev.properties`.
173173

174174
Add the client id, secret, signer name and email to the file.
175175
Also add the URL that the application will use (the **DS_APP_URL** setting).
@@ -184,7 +184,7 @@ To use the payments example, create a
184184
test payments gateway for your developer sandbox account.
185185

186186
See the
187-
[PAYMENTS_INSTALLATION.md](https://github.com/docusign/eg-03-java-auth-code-grant/blob/master/PAYMENTS_INSTALLATION.md)
187+
[PAYMENTS_INSTALLATION.md](https://github.com/docusign/code-examples-java/blob/master/PAYMENTS_INSTALLATION.md)
188188
file for instructions.
189189

190190
Then add the payment gateway account id to the **application.properties** file.

‎src/main/java/com/docusign/controller/examples/EG020ControllerSmsAuthentication.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
@Controller
3232
@RequestMapping("/eg020")
3333
public class EG020ControllerSmsAuthentication extends AbstractController {
34-
35-
private static final List<String> RECIPIENT_PHONE_NUMBERS = List.of("415-555-1212", "415-555-3434");
34+
// For List.of you could even do groups of numbers such as List.of("415-555-1212", "415-555-3434");
3635
private static final String DOCUMENT_FILE_NAME = "World_Wide_Corp_lorem.pdf";
3736
private static final String DOCUMENT_NAME = "Lorem";
3837

@@ -57,7 +56,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
5756
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
5857

5958
// Step 3: Construct your envelope JSON body
60-
EnvelopeDefinition envelope = createEnvelope(args.getSignerName(), args.getSignerEmail());
59+
EnvelopeDefinition envelope = createEnvelope(args.getSignerName(), args.getSignerEmail(), args.getPhoneNumber());
6160

6261
// Step 4: Call the eSignature REST API
6362
EnvelopeSummary results = envelopesApi.createEnvelope(accountId, envelope);
@@ -72,7 +71,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
7271
return DONE_EXAMPLE_PAGE;
7372
}
7473

75-
private static EnvelopeDefinition createEnvelope(String signerName, String signerEmail) throws IOException {
74+
private static EnvelopeDefinition createEnvelope(String signerName, String signerEmail, String phoneNumber) throws IOException {
7675
Document doc = EnvelopeHelpers.createDocumentFromFile(DOCUMENT_FILE_NAME, DOCUMENT_NAME, "1");
7776

7877
SignHere signHere = new SignHere();
@@ -85,7 +84,7 @@ private static EnvelopeDefinition createEnvelope(String signerName, String signe
8584
// A 1- to 8-digit integer or 32-character GUID to match recipient IDs on your own systems.
8685
// This value is referenced in the Tabs element below to assign tabs on a per-recipient basis.
8786
signHere.setRecipientId("1");
88-
87+
List<String> RECIPIENT_PHONE_NUMBERS = List.of(phoneNumber);
8988
RecipientSMSAuthentication smsAuth = new RecipientSMSAuthentication();
9089
smsAuth.setSenderProvidedNumbers(RECIPIENT_PHONE_NUMBERS);
9190

‎src/main/java/com/docusign/controller/examples/EG021ControllerPhoneAuthentication.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
@RequestMapping("/eg021")
3232
public class EG021ControllerPhoneAuthentication extends AbstractController {
3333

34-
private static final List<String> RECIPIENT_PHONE_NUMBERS = List.of("415-555-1212", "415-555-3434");
3534
private static final String DOCUMENT_FILE_NAME = "World_Wide_Corp_lorem.pdf";
3635
private static final String DOCUMENT_NAME = "Lorem";
3736

@@ -54,7 +53,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
5453
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
5554

5655
// Step 2: Construct your envelope JSON body
57-
EnvelopeDefinition envelope = createEnvelope(args.getSignerName(), args.getSignerEmail());
56+
EnvelopeDefinition envelope = createEnvelope(args.getSignerName(), args.getSignerEmail(), args.getPhoneNumber());
5857

5958
// Step 3: Call the eSignature REST API
6059
EnvelopeSummary results = envelopesApi.createEnvelope(session.getAccountId(), envelope);
@@ -69,7 +68,7 @@ protected Object doWork(WorkArguments args, ModelMap model,
6968
return DONE_EXAMPLE_PAGE;
7069
}
7170

72-
private static EnvelopeDefinition createEnvelope(String signerName, String signerEmail) throws IOException {
71+
private static EnvelopeDefinition createEnvelope(String signerName, String signerEmail, String phoneNumber) throws IOException {
7372
Document doc = EnvelopeHelpers.createDocumentFromFile(DOCUMENT_FILE_NAME, DOCUMENT_NAME, "1");
7473

7574
SignHere signHere = new SignHere();
@@ -82,7 +81,7 @@ private static EnvelopeDefinition createEnvelope(String signerName, String signe
8281
// A 1- to 8-digit integer or 32-character GUID to match recipient IDs on your own systems.
8382
// This value is referenced in the Tabs element below to assign tabs on a per-recipient basis.
8483
signHere.setRecipientId("1");
85-
84+
List<String> RECIPIENT_PHONE_NUMBERS = List.of(phoneNumber);
8685
RecipientPhoneAuthentication phoneAuth = new RecipientPhoneAuthentication();
8786
phoneAuth.setRecipMayProvideNumber("true");
8887
phoneAuth.setSenderProvidedNumbers(RECIPIENT_PHONE_NUMBERS);

‎src/main/java/com/docusign/controller/examples/WorkArguments.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ public class WorkArguments {
3535
private String profileId;
3636
private String groupId;
3737
private String permissionProfileName;
38+
private String phoneNumber;
3839
}

‎src/main/webapp/WEB-INF/templates/views/pages/examples/eg020.jsp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818

1919
<form class="eg" action="" method="post" data-busy="form">
20+
<div class="form-group">
21+
<label for="phoneNumber">Signer SMS Phone Number</label>
22+
<input type="text" class="form-control" id="phoneNumber" placeholder="415-555-1212" name="phoneNumber"
23+
value="" required>
24+
</div>
2025
<div class="form-group">
2126
<label for="signerEmail">Signer Email</label>
2227
<input type="email" class="form-control" id="signerEmail" name="signerEmail"
@@ -29,6 +34,7 @@
2934
<input type="text" class="form-control" id="signerName" placeholder="Pat Johnson" name="signerName"
3035
value="${locals.dsConfig.signerName}" required>
3136
</div>
37+
3238
<input type="hidden" name="_csrf" value="${csrfToken}">
3339
<button type="submit" class="btn btn-docu">Submit</button>
3440
</form>

‎src/main/webapp/WEB-INF/templates/views/pages/examples/eg021.jsp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717

1818

1919
<form class="eg" action="" method="post" data-busy="form">
20+
21+
<div class="form-group">
22+
<label for="phoneNumber">Signer Phone Number</label>
23+
<input type="text" class="form-control" id="phoneNumber" placeholder="415-555-1212" name="phoneNumber"
24+
value="" required>
25+
</div>
26+
2027
<div class="form-group">
2128
<label for="signerEmail">Signer Email</label>
2229
<input type="email" class="form-control" id="signerEmail" name="signerEmail"

0 commit comments

Comments
 (0)