Skip to content

Commit fe8ef38

Browse files
CFR part 11 example
2 parents e6b953c + a9386f5 commit fe8ef38

30 files changed

+664
-138
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ end
6969

7070
gem 'docusign_admin', '~> 1.1.0'
7171
gem 'docusign_click', '~> 1.0.0'
72-
gem 'docusign_esign', '~> 3.17.0'
72+
gem 'docusign_esign', '~> 3.19.0'
7373
gem 'docusign_monitor', '~> 1.1.0'
7474
gem 'docusign_rooms', '~> 1.2.0.rc1'
7575
gem 'omniauth-oauth2', '~> 1.7.1'

Gemfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ GEM
108108
json (~> 2.1, >= 2.1.0)
109109
jwt (~> 2.2, >= 2.2.1)
110110
typhoeus (~> 1.0, >= 1.0.1)
111-
docusign_esign (3.17.0)
111+
docusign_esign (3.19.0)
112112
addressable (~> 2.7, >= 2.7.0)
113113
json (~> 2.1, >= 2.1.0)
114114
jwt (~> 2.2, >= 2.2.1)
@@ -131,6 +131,7 @@ GEM
131131
faraday-net_http (>= 2.0, < 3.1)
132132
ruby2_keywords (>= 0.0.4)
133133
faraday-net_http (3.0.0)
134+
ffi (1.15.5)
134135
ffi (1.15.5-x64-mingw-ucrt)
135136
globalid (1.0.0)
136137
activesupport (>= 5.0)
@@ -168,6 +169,8 @@ GEM
168169
nio4r (2.5.8)
169170
nokogiri (1.13.8-x64-mingw-ucrt)
170171
racc (~> 1.4)
172+
nokogiri (1.13.8-x86_64-darwin)
173+
racc (~> 1.4)
171174
oauth2 (2.0.9)
172175
faraday (>= 0.17.3, < 3.0)
173176
jwt (>= 1.0, < 3.0)
@@ -310,6 +313,7 @@ GEM
310313

311314
PLATFORMS
312315
x64-mingw-ucrt
316+
x86_64-darwin-21
313317

314318
DEPENDENCIES
315319
bootsnap (~> 1.7.3)
@@ -319,7 +323,7 @@ DEPENDENCIES
319323
coffee-rails (~> 5.0.0)
320324
docusign_admin (~> 1.1.0)
321325
docusign_click (~> 1.0.0)
322-
docusign_esign (~> 3.17.0)
326+
docusign_esign (~> 3.19.0)
323327
docusign_monitor (~> 1.1.0)
324328
docusign_rooms (~> 1.2.0.rc1)
325329
jbuilder (~> 2.11.5)

app/controllers/ds_common_controller.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def index
1010
end
1111

1212
def handle_redirects
13+
minimum_buffer_min = 10
1314
if Rails.configuration.quickstart
1415
@manifest = Utils::ManifestUtils.new.get_manifest(Rails.configuration.eSignManifestUrl)
1516

@@ -18,10 +19,22 @@ def handle_redirects
1819
session[:quickstarted] = true
1920
redirect_to '/auth/docusign'
2021
elsif session[:been_here].nil?
21-
redirect_to '/eg001'
22+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
23+
if enableCFR == "enabled"
24+
session[:status_cfr] = "enabled"
25+
redirect_to '/eg041'
26+
else
27+
redirect_to '/eg001'
28+
end
2229
else
2330
render_examples
2431
end
32+
elsif session[:ds_access_token].present?
33+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
34+
if enableCFR == "enabled"
35+
session[:status_cfr] = "enabled"
36+
end
37+
render_examples
2538
else
2639
render_examples
2740
end
@@ -41,7 +54,9 @@ def render_examples
4154
elsif session[:examples_API] == 'Admin'
4255
render 'admin_api/index'
4356
else
57+
@status_cfr = session[:status_cfr]
4458
session[:examples_API] = 'eSignature'
59+
render 'ds_common/index'
4560
end
4661
end
4762

app/controllers/e_sign/eg014_collect_payment_controller.rb

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,40 @@ class ESign::Eg014CollectPaymentController < EgController
55
before_action -> { @example = Utils::ManifestUtils.new.get_example(@manifest, 14) }
66

77
def create
8-
envelope_args = {
9-
signer_email: param_gsub(params['signerEmail']),
10-
signer_name: param_gsub(params['signerName']),
11-
cc_email: param_gsub(params['ccEmail']),
12-
cc_name: param_gsub(params['ccName']),
13-
gateway_account_id: Rails.application.config.gateway_account_id,
14-
gateway_name: Rails.application.config.gateway_name,
15-
gateway_display_name: Rails.application.config.gateway_display_name
16-
}
17-
args = {
18-
account_id: session['ds_account_id'],
19-
base_path: session['ds_base_path'],
20-
access_token: session['ds_access_token'],
21-
envelope_args: envelope_args
22-
}
8+
begin
9+
envelope_args = {
10+
signer_email: param_gsub(params['signerEmail']),
11+
signer_name: param_gsub(params['signerName']),
12+
cc_email: param_gsub(params['ccEmail']),
13+
cc_name: param_gsub(params['ccName']),
14+
gateway_account_id: Rails.application.config.gateway_account_id,
15+
gateway_name: Rails.application.config.gateway_name,
16+
gateway_display_name: Rails.application.config.gateway_display_name
17+
}
18+
args = {
19+
account_id: session['ds_account_id'],
20+
base_path: session['ds_base_path'],
21+
access_token: session['ds_access_token'],
22+
envelope_args: envelope_args
23+
}
2324

24-
results = ESign::Eg014CollectPaymentService.new(args).worker
25-
@title = @example['ExampleName']
26-
@message = format_string(@example['ResultsPageText'], results[:envelope_id])
27-
render 'ds_common/example_done'
28-
rescue DocuSign_eSign::ApiError => e
29-
handle_error(e)
25+
results = ESign::Eg014CollectPaymentService.new(args).worker
26+
@title = @example['ExampleName']
27+
@message = format_string(@example['ResultsPageText'], results[:envelope_id])
28+
render 'ds_common/example_done'
29+
rescue DocuSign_eSign::ApiError => e
30+
handle_error(e)
31+
end
32+
end
33+
34+
def get
35+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
36+
if enableCFR == "enabled"
37+
session[:status_cfr] = "enabled"
38+
@title = "Not CFR Part 11 compatible"
39+
@error_information = @manifest['SupportingTexts']['CFRError']
40+
render 'ds_common/error'
41+
end
42+
super
3043
end
3144
end

app/controllers/e_sign/eg020_phone_authentication_controller.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,14 @@ def create
4040
end
4141
end
4242

43-
# ***DS.snippet.0.end
43+
def get
44+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
45+
if enableCFR == "enabled"
46+
session[:status_cfr] = "enabled"
47+
@title = "Not CFR Part 11 compatible"
48+
@error_information = @manifest['SupportingTexts']['CFRError']
49+
render 'ds_common/error'
50+
end
51+
super
52+
end
4453
end

app/controllers/e_sign/eg032_pauses_signature_workflow_controller.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ def create
2525

2626
render 'e_sign/eg032_pauses_signature_workflow/return'
2727
end
28+
29+
def get
30+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
31+
if enableCFR == "enabled"
32+
session[:status_cfr] = "enabled"
33+
@title = "Not CFR Part 11 compatible"
34+
@error_information = @manifest['SupportingTexts']['CFRError']
35+
render 'ds_common/error'
36+
end
37+
super
38+
end
2839
end

app/controllers/e_sign/eg033_unpauses_signature_workflow_controller.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@ def update
1818
@envelop_id = results.to_hash[:envelopeId].to_s
1919
render 'e_sign/eg033_unpauses_signature_workflow/return'
2020
end
21+
22+
def get
23+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
24+
if enableCFR == "enabled"
25+
session[:status_cfr] = "enabled"
26+
@title = "Not CFR Part 11 compatible"
27+
@error_information = @manifest['SupportingTexts']['CFRError']
28+
render 'ds_common/error'
29+
end
30+
super
31+
end
2132
end

app/controllers/e_sign/eg034_use_conditional_recipients_controller.rb

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,48 @@ class ESign::Eg034UseConditionalRecipientsController < EgController
55
before_action -> { @example = Utils::ManifestUtils.new.get_example(@manifest, 34) }
66

77
def create
8-
signers = {
9-
signerEmail1: request['signerEmail1'],
10-
signerName1: request['signerName1'],
8+
begin
9+
signers = {
10+
signerEmail1: request['signerEmail1'],
11+
signerName1: request['signerName1'],
1112

12-
signerEmailNotChecked: request['signerEmailNotChecked'],
13-
signerNameNotChecked: request['signerNameNotChecked'],
13+
signerEmailNotChecked: request['signerEmailNotChecked'],
14+
signerNameNotChecked: request['signerNameNotChecked'],
1415

15-
signerEmailChecked: request['signerEmailChecked'],
16-
signerNameChecked: request['signerNameChecked']
17-
}
16+
signerEmailChecked: request['signerEmailChecked'],
17+
signerNameChecked: request['signerNameChecked']
18+
}
1819

19-
args = {
20-
accountId: session['ds_account_id'],
21-
basePath: session['ds_base_path'],
22-
accessToken: session['ds_access_token']
23-
}
20+
args = {
21+
accountId: session['ds_account_id'],
22+
basePath: session['ds_base_path'],
23+
accessToken: session['ds_access_token']
24+
}
2425

25-
results = ESign::Eg034UseConditionalRecipientsService.new(args, signers).worker
26-
@envelop_id = results.to_hash[:envelopeId].to_s
27-
render 'e_sign/eg034_use_conditional_recipients/return'
28-
rescue DocuSign_eSign::ApiError => e
29-
error = JSON.parse e.response_body
30-
@error_code = error['errorCode']
31-
if error['errorCode']['WORKFLOW_UPDATE_RECIPIENTROUTING_NOT_ALLOWED']
32-
@error_message = @example['CustomErrorTexts'][0]['ErrorMessage']
33-
@error_information = @example['CustomErrorTexts'][0]['ErrorMessage']
34-
else
35-
@error_message = error['message']
26+
results = ESign::Eg034UseConditionalRecipientsService.new(args, signers).worker
27+
@envelop_id = results.to_hash[:envelopeId].to_s
28+
render 'e_sign/eg034_use_conditional_recipients/return'
29+
rescue DocuSign_eSign::ApiError => e
30+
error = JSON.parse e.response_body
31+
@error_code = error['errorCode']
32+
if error['errorCode']['WORKFLOW_UPDATE_RECIPIENTROUTING_NOT_ALLOWED']
33+
@error_message = @example['CustomErrorTexts'][0]['ErrorMessage']
34+
@error_information = @example['CustomErrorTexts'][0]['ErrorMessage']
35+
else
36+
@error_message = error['message']
37+
end
38+
render 'ds_common/error'
3639
end
37-
render 'ds_common/error'
40+
end
41+
42+
def get
43+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
44+
if enableCFR == "enabled"
45+
session[:status_cfr] = "enabled"
46+
@title = "Not CFR Part 11 compatible"
47+
@error_information = @manifest['SupportingTexts']['CFRError']
48+
render 'ds_common/error'
49+
end
50+
super
3851
end
3952
end

app/controllers/e_sign/eg036_delayed_routing_controller.rb

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,39 @@ class ESign::Eg036DelayedRoutingController < EgController
55
before_action -> { @example = Utils::ManifestUtils.new.get_example(@manifest, 36) }
66

77
def create
8-
envelope_args = {
9-
signer1_email: param_gsub(params['signer1Email']),
10-
signer1_name: param_gsub(params['signer1Name']),
11-
signer2_email: param_gsub(params['signer2Email']),
12-
signer2_name: param_gsub(params['signer2Name']),
13-
delay: param_gsub(params['delay']),
14-
status: 'sent'
15-
}
16-
args = {
17-
account_id: session['ds_account_id'],
18-
base_path: session['ds_base_path'],
19-
access_token: session['ds_access_token'],
20-
envelope_args: envelope_args
21-
}
22-
results = ESign::Eg036DelayedRoutingService.new(args).worker
23-
session[:envelope_id] = results['envelope_id']
24-
@title = @example['ExampleName']
25-
@message = format_string(@example['ResultsPageText'], results['envelope_id'])
26-
render 'ds_common/example_done'
27-
rescue DocuSign_eSign::ApiError => e
28-
handle_error(e)
8+
begin
9+
envelope_args = {
10+
signer1_email: param_gsub(params['signer1Email']),
11+
signer1_name: param_gsub(params['signer1Name']),
12+
signer2_email: param_gsub(params['signer2Email']),
13+
signer2_name: param_gsub(params['signer2Name']),
14+
delay: param_gsub(params['delay']),
15+
status: 'sent'
16+
}
17+
args = {
18+
account_id: session['ds_account_id'],
19+
base_path: session['ds_base_path'],
20+
access_token: session['ds_access_token'],
21+
envelope_args: envelope_args
22+
}
23+
results = ESign::Eg036DelayedRoutingService.new(args).worker
24+
session[:envelope_id] = results['envelope_id']
25+
@title = @example['ExampleName']
26+
@message = format_string(@example['ResultsPageText'], results['envelope_id'])
27+
render 'ds_common/example_done'
28+
rescue DocuSign_eSign::ApiError => e
29+
handle_error(e)
30+
end
31+
end
32+
33+
def get
34+
enableCFR = ESign::GetDataService.new(session[:ds_access_token], session[:ds_base_path]).is_cfr(session[:ds_account_id])
35+
if enableCFR == "enabled"
36+
session[:status_cfr] = "enabled"
37+
@title = "Not CFR Part 11 compatible"
38+
@error_information = @manifest['SupportingTexts']['CFRError']
39+
render 'ds_common/error'
40+
end
41+
super
2942
end
3043
end

0 commit comments

Comments
 (0)