Skip to content

Commit bd67ca0

Browse files
Add step comments for document visibility and IPS
2 parents 490ffc9 + 4e5a1ba commit bd67ca0

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

app/services/e_sign/eg039_signing_in_person_service.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,26 @@ def worker
1717
host_name = args[:host_name]
1818
signer_name = args[:signer_name]
1919

20-
# Step 1. Create the envelope definition
2120
envelope = make_envelope(pdf_filename, host_email, host_name, signer_name)
2221

23-
# Step 2. Call DocuSign to create the envelope
22+
# Step 3 start
2423
envelope_api = create_envelope_api(args)
2524

2625
results = envelope_api.create_envelope args[:account_id], envelope
26+
# Step 3 end
27+
2728
envelope_id = results.envelope_id
2829

29-
# Step 3. Create the recipient view for the embedded signing
30+
31+
# Step 5 start
3032
view_request = make_recipient_view_request(ds_return_url, ds_ping_url, host_email, host_name
3133
)
3234

3335
# Call the CreateRecipientView API
3436
results = envelope_api.create_recipient_view args[:account_id], envelope_id, view_request
37+
# Step 5 end
3538

36-
# Step 4. Redirect the user to the embedded signing
39+
# Redirect the user to the embedded signing
3740
# Don't use an iframe!
3841
# State can be stored/recovered using the framework's session or a
3942
# query parameter on the returnUrl (see the makeRecipientViewRequest method)
@@ -43,6 +46,7 @@ def worker
4346

4447
private
4548

49+
# Step 4 start
4650
def make_recipient_view_request(ds_return_url, ds_ping_url, host_email, host_name)
4751
view_request = DocuSign_eSign::RecipientViewRequest.new
4852
# Set the URL where you want the recipient to go once they are done signing
@@ -74,7 +78,9 @@ def make_recipient_view_request(ds_return_url, ds_ping_url, host_email, host_nam
7478

7579
view_request
7680
end
81+
# Step 4 end
7782

83+
# Step 2 start
7884
def make_envelope(pdf_filename, host_email, host_name, signer_name)
7985
envelope_definition = DocuSign_eSign::EnvelopeDefinition.new
8086
envelope_definition.email_subject = 'Please sign this document sent from Ruby SDK'
@@ -118,5 +124,5 @@ def make_envelope(pdf_filename, host_email, host_name, signer_name)
118124
envelope_definition.status = 'sent'
119125
envelope_definition
120126
end
121-
# ***DS.snippet.0.end
127+
# Step 2 end
122128
end

app/services/e_sign/eg040_set_document_visibility_service.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ def initialize(args)
99
end
1010

1111
def worker
12-
# 1. Create the envelope request object
12+
# Step 3-1 start
1313
envelope_definition = make_envelope args[:envelope_args]
14-
# 2. Call Envelopes::create API method
14+
# Step 3-1 end
15+
1516
# Exceptions will be caught by the calling function
17+
# Step 4 start
1618
envelope_api = create_envelope_api(args)
1719

1820
results = envelope_api.create_envelope args[:account_id], envelope_definition
1921
envelope_id = results.envelope_id
22+
# Step 4 end
23+
2024
{ 'envelope_id' => envelope_id }
2125
end
2226

2327
private
2428

29+
# Step 3-2 start
2530
def make_envelope(envelope_args)
2631
# document 1 (HTML) has tag **signature_1**
2732
# document 2 (DOCX) has tag /sn1/
@@ -141,6 +146,7 @@ def make_envelope(envelope_args)
141146
envelope_definition.status = envelope_args[:status]
142147
envelope_definition
143148
end
149+
# Step 3-2 end
144150

145151
def create_document1(args)
146152
"

0 commit comments

Comments
 (0)