Skip to content

Commit af8633f

Browse files
authored
Merge branch 'master' into feature/add-linter-to-CI-CD
Signed-off-by: Anna Hileta <[email protected]>
2 parents 678e085 + a96ee57 commit af8633f

File tree

10 files changed

+57
-40
lines changed

10 files changed

+57
-40
lines changed

public/demo_documents/order_form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h4>Ordered by {signer_name}</h4>
2929
<tr>
3030
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Harmonica</td>
3131
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
32-
<span style="color:white;">/l1q/</span>
32+
<span style="color:black;">/l1q/</span>
3333
</td>
3434
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$5</td>
3535
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
@@ -39,7 +39,7 @@ <h4>Ordered by {signer_name}</h4>
3939
<tr>
4040
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Xylophone</td>
4141
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
42-
<span style="color:white;">/l2q/</span>
42+
<span style="color:black;">/l2q/</span>
4343
</td>
4444
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$150</td>
4545
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">

src/Controllers/Examples/Rooms/EG008GrantOfficeAccessToFormGroup.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ public function __construct()
2222
{
2323
parent::__construct();
2424

25-
# Step 3 Start
25+
#ds-snippet-start:Rooms8Step3
2626
$offices = GrantOfficeAccessToFormGroupService::getOffices(
2727
$this->routerService,
2828
$this->clientService,
2929
$this->args,
3030
$this::EG
3131
);
32-
# Step 3 End
32+
#ds-snippet-end:Rooms8Step3
3333

34-
# Step 4 Start
34+
#ds-snippet-start:Rooms8Step4
3535
$formGroups = GrantOfficeAccessToFormGroupService::getFormGroups(
3636
$this->routerService,
3737
$this->clientService,
3838
$this->args,
3939
$this::EG
4040
);
4141
parent::controller(null, null, null, $offices, $formGroups);
42-
# Step 4 End
42+
#ds-snippet-end:Rooms8Step4
4343
}
4444

4545
/**

src/Controllers/Examples/eSignature/EG022KbAuthentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct()
3434
*/
3535
public function createController(): void
3636
{
37-
# Step 1: Obtain your OAuth Token
37+
# Obtain your OAuth Token
3838
$this->checkDsToken();
3939

4040
$envelopeAuthentification = KbAuthenticationService::kbAuthentification(

src/Services/Examples/Admin/AuditUsersService.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,38 @@ public static function auditUsers(
2525
array $arguments,
2626
string $organizationId
2727
): array {
28-
# Step 5a start
28+
#ds-snippet-start:Admin5Step5
2929
$usersInformation = [];
3030
$userDrilldownResponse = new UsersDrilldownResponse();
31-
# Step 5a end
31+
#ds-snippet-end:Admin5Step5
3232

3333
$admin_api = $clientService->getUsersApi();
3434

3535
# Here we set the from_date to filter envelopes for the last 10 days
3636
# Use ISO 8601 date format
3737

38-
# Step 3 start
38+
#ds-snippet-start:Admin5Step3
3939
$options = new GetUsersOptions();
4040
$options->setAccountId($arguments["account_id"]);
4141
$from_date = date("c", (time() - (10 * 24 * 60 * 60)));
4242
$options->setLastModifiedSince($from_date);
4343

4444
try {
4545
$modifiedUsers = $admin_api->getUsers($organizationId, $options);
46-
# Step 3 end
46+
#ds-snippet-end:Admin5Step3
4747

48-
# Step 4 start
48+
#ds-snippet-start:Admin5Step4
4949
foreach ($modifiedUsers["users"] as $user) {
5050
$profileOptions = new GetUserProfilesOptions();
5151
$profileOptions->setEmail($user["email"]);
52-
# Step 4 end
52+
#ds-snippet-end:Admin5Step4
5353

54-
# Step 5b start
54+
#ds-snippet-start:Admin5Step5
5555
$res = $admin_api->getUserProfiles($organizationId, $profileOptions);
5656
$userDrilldownResponse->setUsers($res->getUsers());
5757
$decoded = json_decode((string)$userDrilldownResponse, true);
5858
array_push($usersInformation, $decoded["users"]);
59-
# Step 5b end
59+
#ds-snippet-end:Admin5Step5
6060
}
6161
} catch (ApiException $e) {
6262
$GLOBALS['twig']->display(

src/Services/Examples/Rooms/GrantOfficeAccessToFormGroupService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class GrantOfficeAccessToFormGroupService
1616
public static function grantOfficeAccessToFormGroup(array $args, $clientService): void
1717
{
1818
try {
19-
# Step 5 Start
19+
#ds-snippet-start:Rooms8Step5
2020
$form_api = $clientService->getFromGroupsApi();
2121
$form_api->grantOfficeAccessToFormGroup($args['form_group_id'], $args['office_id'], $args["account_id"]);
22-
# Step 5 End
22+
#ds-snippet-end:Rooms8Step5
2323
} catch (ApiException $e) {
2424
error_log($e);
2525
$clientService->showErrorTemplate($e);

src/Services/Examples/eSignature/ApplyBrandToTemplateService.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,26 @@ class ApplyBrandToTemplateService
99
{
1010
/**
1111
* Do the work of the example
12-
* 1. Create the envelope request object
13-
* 2. Send the envelope
12+
* Create the envelope request object
13+
* Send the envelope
1414
*
1515
* @param $args array
1616
* @param $clientService
1717
* @return array ['envelope_id']
1818
*/
19-
# ***DS.snippet.0.start
19+
2020
public static function applyBrandToTemplate(array $args, $clientService): array
2121
{
22-
# Step 3. Construct the request body
22+
# Construct the request body
23+
#ds-snippet-start:eSign30Step3
2324
$envelope_definition = ApplyBrandToTemplateService::makeEnvelope($args["envelope_args"]);
25+
#ds-snippet-end:eSign30Step3
2426

25-
# Step 4. Call the eSignature REST API
27+
# Call the eSignature REST API
28+
#ds-snippet-start:eSign30Step4
2629
$envelope_api = $clientService->getEnvelopeApi();
2730
$createdEnvelope = $envelope_api->createEnvelope($args['account_id'], $envelope_definition);
31+
#ds-snippet-end:eSign30Step4
2832

2933
return ['envelope_id' => $createdEnvelope->getEnvelopeId()];
3034
}
@@ -35,6 +39,7 @@ public static function applyBrandToTemplate(array $args, $clientService): array
3539
* @param $args array
3640
* @return EnvelopeDefinition -- returns an envelope definition
3741
*/
42+
#ds-snippet-start:eSign30Step3
3843
public static function makeEnvelope(array $args): EnvelopeDefinition
3944
{
4045
$signer = new TemplateRole([
@@ -55,5 +60,6 @@ public static function makeEnvelope(array $args): EnvelopeDefinition
5560
'brand_id' => $args["brand_id"], # Apply selected Brand to envelope
5661
]);
5762
}
58-
# ***DS.snippet.0.end
63+
#ds-snippet-end:eSign30Step3
64+
5965
}

src/Services/Examples/eSignature/CFREmbeddedSigningService.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ class CFREmbeddedSigningService
2727
* @param SignatureClientService $clientService
2828
* @return array ['redirect_url']
2929
*/
30-
# ***DS.snippet.0.start
3130
public static function worker(array $args, SignatureClientService $clientService, string $demoPath): array
3231
{
3332

3433

3534
// Obtain your workflowID
36-
35+
#ds-snippet-start:eSign41Step2
3736
$accounts_api = $clientService->getAccountsApi();
3837
$accounts_response = $accounts_api->getAccountIdentityVerification($_SESSION['ds_account_id']);
3938
$workflows_data = $accounts_response->getIdentityVerification();
@@ -46,11 +45,12 @@ public static function worker(array $args, SignatureClientService $clientService
4645
if (!isset($args['envelope_args']['workflow_id'])) {
4746
$clientService->showErrorTemplate(new ApiException("IDENTITY_WORKFLOW_INVALID_ID"));
4847
}
48+
#ds-snippet-end:eSign41Step2
4949

5050
# Create the envelope request object
51+
#ds-snippet-start:eSign41Step4
5152
$envelope_definition = CFREmbeddedSigningService::makeEnvelope($args['envelope_args'], $demoPath);
5253

53-
5454
$envelope_api = $clientService->getEnvelopeApi();
5555

5656
# Call Envelopes::create API method
@@ -66,19 +66,25 @@ public static function worker(array $args, SignatureClientService $clientService
6666
exit;
6767
}
6868
$envelope_id = $envelopeSummary->getEnvelopeId();
69+
#ds-snippet-end:eSign41Step4
6970

70-
# 3. Create the Recipient View request object
71+
# Create the Recipient View request object
7172
$authentication_method = 'None'; # How is this application authenticating
7273
# the signer? See the `authentication_method' definition
7374
# https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createrecipient/
75+
76+
#ds-snippet-start:eSign41Step5
7477
$recipient_view_request = $clientService->getRecipientViewRequest(
7578
$authentication_method,
7679
$args["envelope_args"]
7780
);
81+
#ds-snippet-end:eSign41Step5
7882

7983
# 4. Obtain the recipient_view_url for the embedded signing
8084
# Exceptions will be caught by the calling function
85+
#ds-snippet-start:eSign41Step6
8186
$viewUrl = $clientService->getRecipientView($args['account_id'], $envelope_id, $recipient_view_request);
87+
#ds-snippet-end:eSign41Step6
8288

8389
return ['envelope_id' => $envelope_id, 'redirect_url' => $viewUrl['url']];
8490
}
@@ -90,6 +96,7 @@ public static function worker(array $args, SignatureClientService $clientService
9096
* @param $args array
9197
* @return EnvelopeDefinition -- returns an envelope definition
9298
*/
99+
#ds-snippet-start:eSign41Step3
93100
private static function makeEnvelope(array $args, string $demoPath): EnvelopeDefinition
94101
{
95102
# document 1 (pdf) has tag /sn1/
@@ -170,5 +177,5 @@ private static function makeEnvelope(array $args, string $demoPath): EnvelopeDef
170177

171178
return $envelope_definition;
172179
}
173-
# ***DS.snippet.0.end
180+
#ds-snippet-end:eSign41Step3
174181
}

src/Services/Examples/eSignature/EnvelopeInfoService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class EnvelopeInfoService
1515
* @param $clientService
1616
* @return Envelope
1717
*/
18-
# ***DS.snippet.0.start
19-
public static function envelopeInfo(array $args, $clientService): Envelope
18+
#ds-snippet-start:eSign4Step2
19+
public static function envelopeInfo(array $args, $clientService): Envelope
2020
{
21-
# 1. call API method
21+
# Call API method
2222
# Exceptions will be caught by the calling function
2323
$envelope_api = $clientService->getEnvelopeApi();
2424
try {
@@ -30,5 +30,5 @@ public static function envelopeInfo(array $args, $clientService): Envelope
3030

3131
return $envelopeId;
3232
}
33-
# ***DS.snippet.0.end
33+
#ds-snippet-end:eSign4Step2
3434
}

src/Services/Examples/eSignature/KbAuthenticationService.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@ class KbAuthenticationService
1010
{
1111
/**
1212
* Do the work of the example
13-
* 1. Get the envelope's data
13+
* Get the envelope's data
1414
*
1515
* @param $args array
1616
* @param $clientService
1717
* @return array ['envelope_id']
1818
*/
19-
# ***DS.snippet.0.start
2019
public static function kbAuthentification(array $args, $clientService, $demoDocsPath): array
2120
{
22-
# 1. Create the envelope request object
21+
# Create the envelope request object
2322
$envelope_definition = KbAuthenticationService::makeEnvelope($args["envelope_args"], $demoDocsPath);
2423

25-
# 2. call Envelopes::create API method
24+
# Call Envelopes::create API method
2625
# Exceptions will be caught by the calling function
26+
#ds-snippet-start:eSign22Step4
2727
$envelope_api = $clientService->getEnvelopeApi();
2828
$envelopeResponse = $envelope_api->createEnvelope($args['account_id'], $envelope_definition);
2929

3030
return ['envelope_id' => $envelopeResponse->getEnvelopeId()];
31+
#ds-snippet-end:eSign22Step4
3132
}
3233

3334
/**
@@ -38,6 +39,7 @@ public static function kbAuthentification(array $args, $clientService, $demoDocs
3839
* @param $args array
3940
* @return mixed -- returns an envelope definition
4041
*/
42+
#ds-snippet-start:eSign22Step3
4143
public static function makeEnvelope(array $args, $demoDocsPath): EnvelopeDefinition
4244
{
4345
$envelopeAndSigner = RecipientAuthenticationService::constructAnEnvelope($demoDocsPath);
@@ -62,5 +64,5 @@ public static function makeEnvelope(array $args, $demoDocsPath): EnvelopeDefinit
6264

6365
return $envelope_definition;
6466
}
65-
# ***DS.snippet.0.end
67+
#ds-snippet-end:eSign22Step3
6668
}

src/Services/Examples/eSignature/PermissionDeleteService.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@ class PermissionDeleteService
1515
* @param $clientService
1616
* @return string
1717
*/
18-
# ***DS.snippet.0.start
18+
1919
public static function permissionDelete(array $args, $clientService): string
2020
{
2121
$accounts_api = $clientService->getAccountsApi();
2222

2323
try {
24-
# Step 3. call the eSignature REST API
24+
# Call the eSignature REST API
25+
#ds-snippet-start:eSign27Step3
2526
$accounts_api->deletePermissionProfile(
2627
$args['account_id'],
2728
$args['permission_args']['permission_profile_id']
2829
);
30+
#ds-snippet-end:eSign27Step3
2931
} catch (ApiException $e) {
3032
$clientService->showErrorTemplate($e);
3133
exit;
3234
}
3335

3436
return "The permission profile has been deleted!";
3537
}
36-
# ***DS.snippet.0.end
38+
3739
}

0 commit comments

Comments
 (0)