Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
paigesrossi committed Jul 27, 2023
2 parents e1a6b5a + 749f373 commit dbd9f82
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Services/Examples/eSignature/PhoneAuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class PhoneAuthenticationService
* @param $clientService
* @return array ['envelope_id']
*/
# ***DS.snippet.0.start
public static function phone_authentication(array $args, $demoDocsPath, $clientService, string $fixingInstructions): array
{
# Create the envelope request object
Expand All @@ -33,10 +32,10 @@ public static function phone_authentication(array $args, $demoDocsPath, $clientS

# call Envelopes::create API method
# Exceptions will be caught by the calling function
# Step 5 start
#ds-snippet-start:eSign20Step5
$envelope_api = $clientService->getEnvelopeApi();
$envelopeResponse = $envelope_api->createEnvelope($args['account_id'], $envelope_definition);
# Step 5 end
#ds-snippet-end:eSign20Step5

return ['envelope_id' => $envelopeResponse->getEnvelopeId()];
}
Expand All @@ -53,7 +52,7 @@ public static function make_envelope(array $args, $clientService, $demoDocsPath,
{

# Retrieve the workflow ID
# Step 3 start
#ds-snippet-start:eSign20Step3
$accounts_api = $clientService->getAccountsApi();
$accounts_response = $accounts_api->getAccountIdentityVerification($_SESSION['ds_account_id']);
$workflows_data = $accounts_response->getIdentityVerification();
Expand All @@ -62,12 +61,12 @@ public static function make_envelope(array $args, $clientService, $demoDocsPath,
if ($workflow['default_name'] == 'Phone Authentication')
$workflow_id = $workflow['workflow_id'];
}
# step 3 end
#ds-snippet-end:eSign20Step3
if ($workflow_id == '')
throw new ApiException($fixingInstructions);

$envelopeAndSigner = RecipientAuthenticationService::constructAnEnvelope($demoDocsPath);
# step 4 start
#ds-snippet-start:eSign20Step4
$envelope_definition = $envelopeAndSigner['envelopeDefinition'];
$signer1Tabs = $envelopeAndSigner['signerTabs'];

Expand Down Expand Up @@ -100,9 +99,8 @@ public static function make_envelope(array $args, $clientService, $demoDocsPath,
$recipients->setSigners(array($signer1));

$envelope_definition->setRecipients($recipients);
# Step 4 end
#ds-snippet-end:eSign20Step4

return $envelope_definition;
}
# ***DS.snippet.0.end
}

0 comments on commit dbd9f82

Please sign in to comment.