@@ -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
122128end
0 commit comments