Skip to content

Commit 3aeffe0

Browse files
committed
readme and docs
1 parent 2f6e8ce commit 3aeffe0

File tree

4 files changed

+172
-0
lines changed

4 files changed

+172
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2018 DocuSign, Inc. (https://www.docusign.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PAYMENTS_INSTALLATION.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Configuring a DocuSign payments gateway
2+
3+
DocuSign offers built-in connections to multiple payment
4+
gateways. The payments example uses a demo account via the Stripe
5+
gateway service.
6+
7+
## Creating the payments gateway account
8+
9+
1. Login to demo.docusign.net and go to the Admin Tool.
10+
1. On the Integrations / Payments screen, click Stripe.
11+
1. For development, you can skip the Stripe account application
12+
by using the `Skip this account form` link:
13+
14+
![Skipping the Stripe account form](docs/stripe_skip_account_form_link.png)
15+
1. Next, the Admin Tool will show that an enabled Stripe
16+
payment gateway account has been associated with your
17+
DocuSign demo sandbox account.
18+
1. Configure the example launcher with the gateway account id shown in the Admin tool.
19+
20+
## Additional documentation
21+
See the
22+
[Managing Payment Gateways](https://support.docusign.com/en/guides/managing-payment-gateways)
23+
documentation.
24+

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# C#: Authorization Code Grant Examples
2+
3+
### Github repo: eg-03-csharp-auth-code-grant-core
4+
## Introduction
5+
This repo is a C# .NET Core MVC application that demonstrates:
6+
7+
* Authentication with DocuSign via the
8+
[Authorization Code Grant flow](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant).
9+
When the token expires, the user is asked to re-authenticate.
10+
The **refresh token** is not used in this example.
11+
1. **Embedded Signing Ceremony.**
12+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg001EmbeddedSigningController.cs)
13+
This example sends an envelope, and then uses an embedded signing ceremony for the first signer.
14+
With embedded signing, the DocuSign signing ceremony is initiated from your website.
15+
1. **Send an envelope with a remote (email) signer and cc recipient.**
16+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg002SigningViaEmailController.cs)
17+
The envelope includes a pdf, Word, and HTML document.
18+
Anchor text ([AutoPlace](https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience)) is used to position the signing fields in the documents.
19+
1. **List envelopes in the user's account.**
20+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg003ListEnvelopesController.cs)
21+
The envelopes' current status is included.
22+
1. **Get an envelope's basic information.**
23+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/eg004EnvelopeInfoController.cs)
24+
The example lists the basic information about an envelope, including its overall status.
25+
1. **List an envelope's recipients**
26+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg005EnvelopeRecipientsController.cs)
27+
Includes current recipient status.
28+
1. **List an envelope's documents.**
29+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg006EnvelopeDocsController.cs)
30+
1. **Download an envelope's documents.**
31+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg007EnvelopeGetDocController.cs)
32+
The example can download individual
33+
documents, the documents concatenated together, or a zip file of the documents.
34+
1. **Programmatically create a template.**
35+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg008CreateTemplateController.cs)
36+
1. **Send an envelope using a template.**
37+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg009UseTemplateController.cs)
38+
1. **Send an envelope and upload its documents with multpart binary transfer.**
39+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg010SendBinaryDocsController.cs)
40+
Binary transfer is 33% more efficient than using Base64 encoding.
41+
1. **Embedded sending.**
42+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg011EmbeddedSendingController.cs)
43+
Embeds the DocuSign web tool (NDSE) in your web app to finalize or update
44+
the envelope and documents before they are sent.
45+
1. **Embedded DocuSign web tool (NDSE).**
46+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg012EmbeddedConsoleController.cs)
47+
1. **Embedded Signing Ceremony from a template with an added document.**
48+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg013AddDocToTemplateController.cs)
49+
This example sends an envelope based on a template.
50+
In addition to the template's document(s), the example adds an
51+
additional document to the envelope by using the
52+
[Composite Templates](https://developers.docusign.com/esign-rest-api/guides/features/templates#composite-templates)
53+
feature.
54+
1. **Payments example: an order form, with online payment by credit card.**
55+
[Source.](https://github.com/docusign/eg-03-csharp-auth-code-grant-core/blob/master/eg-03-csharp-auth-code-grant-core/Controllers/Eg014CollectPaymentController.cs)
56+
57+
## Installation
58+
59+
### Prerequisites
60+
1. A DocuSign Developer Sandbox account (email and password) on [demo.docusign.net](https://demo.docusign.net).
61+
Create a [free account](https://go.docusign.com/o/sandbox/).
62+
1. A DocuSign Integration Key (a client ID) that is configured to use the
63+
OAuth Authorization Code flow.
64+
You will need the **Integration Key** itself, and its **secret**.
65+
66+
If you use this example on your own workstation,
67+
the Integration key must include a **Redirect URI** of `http://localhost:8080/ds/callback`
68+
69+
If you will not be running the example on your own workstation,
70+
use the appropriate DNS name and port instead of `localhost`
71+
72+
1. C# .NET Core version 2.1 or later.
73+
1. A name and email for a signer, and a name and email for a cc recipient.
74+
75+
### Installation steps
76+
* Download or clone this repository.
77+
* The repository includes a Visual Studio 2017 solution file and
78+
NuGet package references in the project file.
79+
* Configure the project by editing the existing project file
80+
`appsettings.json`
81+
82+
See the Configuration section, below, for more information.
83+
84+
### Configuration
85+
**appsettings.json** is the configuration file.
86+
87+
Replace the {CLIENT_ID}, {CLIENT_SECRET}, {USER_EMAIL}, and {USER_FULLNAME}
88+
text with your values. Do not leave the braces { } in the configuration file.
89+
90+
The Client_id (Integration Key) and its secret are private. Please do not
91+
store the appsettings file in your code repository after you have added
92+
the private information to it.
93+
94+
To update to production, change all of the authorization service
95+
**https://account-d.docusign.com** addresses to **https://account.docusign.com**
96+
97+
#### Payments code example
98+
To use the payments example, create a
99+
test payments gateway for your developer sandbox account.
100+
101+
See the
102+
[PAYMENTS_INSTALLATION.md](https://github.com/docusign/eg-03-python-auth-code-grant/blob/master/PAYMENTS_INSTALLATION.md)
103+
file for instructions.
104+
105+
Then add the payment gateway account id to the **appsettings.json** file.
106+
107+
### Running the example
108+
Build and then start the solution.
109+
110+
Your default browser will be opened to https://localhost:8080 and you will
111+
see the application's home page.
112+
113+
## Using the examples with other authentication flows
114+
115+
The examples in this repository can also be used with either the
116+
Implicit Grant or JWT OAuth flows.
117+
See the [Authentication guide](https://developers.docusign.com/esign-rest-api/guides/authentication)
118+
for information on choosing the right authentication flow for your application.
119+
120+
## License and additional information
121+
122+
### License
123+
This repository uses the MIT License. See the LICENSE file for more information.
124+
125+
### Pull Requests
126+
Pull requests are welcomed. Pull requests will only be considered if their content
127+
uses the MIT License.
33.7 KB
Loading

0 commit comments

Comments
 (0)