Skip to content

Commit

Permalink
Updating the readme and adding Nuget Folder
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonsweetnam committed Jul 3, 2015
1 parent 43c7a1e commit 6601bd2
Show file tree
Hide file tree
Showing 11 changed files with 276 additions and 24 deletions.
112 changes: 106 additions & 6 deletions README.md
@@ -1,24 +1,29 @@
![alt text](https://app.trustev.com/assets/img/apple-icon-144.png)


#Trustev .NET Libary
- If you are not familiar with Trustev, start with our [Developer Portal](http://www.trustev.com/developers).
- Check out our [API Documentation](http://www.trustev.com/developers#apioverview).
- If you would like to get some test keys to begin integrating please contact integrationteam@trustev.com
- If you would like to get some test keys to begin integrating please contact integrate@trustev.com

##Requirements
- .NET version 4.0 and later

##Installation
####NuGet
- TODO : Detail how to install the NuGet package here
- Simply install via the Nuget Package manager or install via the Package Manager Console with the command

PM> Install-Package Trustev

####Others
- You could also download our solution, build it and simply include the .dll files as you need them.
- Our library can also be used as an example to inspire your own integration to the Trustev Platform.

## Usage
The stripe API has been designed to allow users complete control over what information they are sending us while still ensuring that integration can be done a couple of simple steps
The Trustev API has been designed to allow users complete control over what information they are sending to us while still ensuring that integration can be done a couple of simple steps

#### Simple Trustev Integration
This is simple version of the trustev integration. and involes 3 simple steps
### Simple Trustev Integration
This is simple version of the trustev integration and involes 4 simple steps
```c#

// 1. Set-Up the Trustev Api Client with your user credentials
Expand All @@ -34,7 +39,7 @@ ApiClient.SetUp(userName, password, secret);
Case kase = new Case(sessionId, caseNumber);

// Now add any further information you have. The more you give us, the more accurate
// our decisions
// our decisions.
kase.Customer = new Customer()
{
FirstName = "John",
Expand All @@ -51,5 +56,100 @@ Decision decision = ApiClient.GetDecision(returnCase.Id);


// Now its up to you what you do with our decision
As

```

#### Optional Integration Steps
As mentioned earlier, we also provided detailed Api endpoints for updating specific parts of your Case. These steps can be used where use cases require. See below for some examples.

##### Example : Adding a Customer

```c#

// 1. Set-Up the Trustev Api Client with your user credentials
ApiClient.SetUp(userName, password, secret);


// 2. Create your case.
// You will need two bits of information for this setp
// SessionId : This is the SessionId that you have recieved from the trustev JavaScript
// and transfered server-side
// CaseNumber : This is a number that you use to uniquely identify this case. It must
// be unique.
Case kase = new Case(sessionId, caseNumber);

// 3. Post this Case to the Trustev Api
Case returnCase = ApiClient.PostCase(kase);


// 4. You may now want to add a Customer to Case you have already added.
// First lets create the customer.
Customer customer = new Customer()
{
FirstName = "John",
LastName = "Doe",
}

// Now we can go ahead and at the customer to the case we added earlier.
Customer returnCustomer = ApiClient.PostCustomer(returnCase.Id, customer);


// 5. You can now continue as normal and get the Decision this case including
// the new customer you have added
Decision decision = ApiClient.GetDecision(returnCase.Id);


// Now its up to you what you do with our decision
```

##### Example : Updating a Transaction

```c#

// 1. Set-Up the Trustev Api Client with your user credentials
ApiClient.SetUp(userName, password, secret);


// 2. Create your case.
// You will need two bits of information for this setp
// SessionId : This is the SessionId that you have recieved from the trustev JavaScript
// and transfered server-side
// CaseNumber : This is a number that you use to uniquely identify this case. It must
// be unique.
Case kase = new Case(sessionId, caseNumber);
kase.Transaction = new Transaction()
{
Currency = "USD",
TotalTransactionValue = 10
};

// 3. Post this Case to the Trustev Api
Case returnCase = ApiClient.PostCase(kase);


// 4. Now, say the value of this transaction changes,
// We provide the functionality to update the transaction you have already added
// Just rebuild the transaction again with the new information
Transaction transaction = new Transaction()
{
Currency = "USD",
TotalTransactionValue = 2000
};

// Now we can go ahead and at the customer to the case we added earlier.
Transaction returnTransaction = ApiClient.UpdateTransaction(returnCase.Id, transaction);


// 5. You can now continue as normal and get the Decision this case including
// the updated transaction you have added
Decision decision = ApiClient.GetDecision(returnCase.Id);


// Now its up to you what you do with our decision
```

We provide similar functions i.e. Post, Update and Get for every Sub Entity of the Case Object.
For more examples of these, check out the unit tests.
101 changes: 101 additions & 0 deletions Settings.StyleCop
@@ -0,0 +1,101 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<IntegerProperty Name="MaxViolationCount">5000</IntegerProperty>
<CollectionProperty Name="RecognizedWords">
<Value>api</Value>
<Value>Api</Value>
<Value>integrationteam</Value>
<Value>js</Value>
<Value>trustev</Value>
<Value>Trustev</Value>
<Value>Utc</Value>
</CollectionProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveCopyrightText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingDirectivesMustBeOrderedAlphabeticallyByNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>
10 changes: 5 additions & 5 deletions Trustev.Domain/Properties/AssemblyInfo.cs
Expand Up @@ -6,12 +6,12 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Trustev.Domain")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("Trustev Api Domain Entities")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Trustev")]
[assembly: AssemblyProduct("Trustev.Domain")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyTrademark("Trustev Ltd")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
Binary file added Trustev.Nuget/NuGet.exe
Binary file not shown.
29 changes: 29 additions & 0 deletions Trustev.Nuget/Package.nuspec
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Trustev</id>
<version>1.0.1</version>
<title>Trustev Api Client</title>
<authors>Trustev</authors>
<owners>Trustev</owners>
<licenseUrl>http://www.trustev.com/terms</licenseUrl>
<projectUrl>https://github.com/Trustev/netclientapi</projectUrl>
<iconUrl>https://app.trustev.com/assets/img/apple-icon-144.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is the Trustev Client which provides a set of classes and methods which can be used to integration to the Trustev Platform.</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2015</copyright>
<language>en-IE</language>
<tags>Trustev trustev api client</tags>
<dependencies>
<dependency id="Newtonsoft.Json" version="7.0.1" />
</dependencies>
</metadata>
<files>
<file src="..\Trustev.Domain\bin\Debug-Net40\Trustev.Domain.dll" target="lib\net40\Trustev.Domain.dll" />
<file src="..\Trustev.Web\bin\Debug-Net40\Trustev.Web.dll" target="lib\net40\Trustev.Web.dll" />
<file src="..\Trustev.Domain\bin\Debug\Trustev.Domain.dll" target="lib\net45\Trustev.Domain.dll" />
<file src="..\Trustev.Web\bin\Debug-Net40\Trustev.Web.dll" target="lib\net45\Trustev.Web.dll" />
<file src="..\Trustev.WebAsync\bin\Debug\Trustev.WebAsync.dll" target="lib\net45\Trustev.WebAsync.dll" />
</files>
</package>
Binary file added Trustev.Nuget/Trustev.1.0.1.nupkg
Binary file not shown.
2 changes: 1 addition & 1 deletion Trustev.Web/ApiClient.cs
Expand Up @@ -15,7 +15,7 @@
namespace Trustev.Web
{
/// <summary>
/// The ApiClient Class is used to store you trustev credentials
/// The ApiClient has all the methods required to communicate with the Trustev Platform.
/// </summary>
public static class ApiClient
{
Expand Down
12 changes: 6 additions & 6 deletions Trustev.Web/Properties/AssemblyInfo.cs
Expand Up @@ -5,13 +5,13 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Trustev.Web")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("Trustev.ApiClient")]
[assembly: AssemblyDescription("Trustev Web Client for Synchronous communication to the Trustev Platform")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Trustev")]
[assembly: AssemblyProduct("Trustev.Web")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyTrademark("Trustev Ltd")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
22 changes: 22 additions & 0 deletions Trustev.Web/Trustev.Web.nuspec
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>Trustev</id>
<version>1.0.0.1</version>
<title>Trustev Api Client</title>
<authors>Trustev</authors>
<owners>Trustev</owners>
<licenseUrl>http://www.trustev.com/terms</licenseUrl>
<projectUrl>https://github.com/Trustev/netclientapi</projectUrl>
<iconUrl>https://app.trustev.com/assets/img/apple-icon-144.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is the Trustev Client which provides a set of classes and methods which can be used to integration to the Trustev Platform.</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags>Trustev trustev api client</tags>
</metadata>
<files>
<file src="bin\Debug\Trustev.Domain.dll" target="" />
<file src="bin\Debug\Trustev.Web.dll" target="" />
</files>
</package>
2 changes: 1 addition & 1 deletion Trustev.WebAsync/ApiClient.cs
Expand Up @@ -15,7 +15,7 @@
namespace Trustev.WebAsync
{
/// <summary>
/// The ApiClient Class is used to store you trustev credentials
/// The ApiClient has all the methods required to communicate with the Trustev Platform
/// </summary>
public static class ApiClient
{
Expand Down
10 changes: 5 additions & 5 deletions Trustev.WebAsync/Properties/AssemblyInfo.cs
Expand Up @@ -6,12 +6,12 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Trustev.WebAsync")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("Trustev Web Client for Async communication to the Trustev Platform")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Trustev")]
[assembly: AssemblyProduct("Trustev.WebAsync")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyTrademark("Trustev Ltd")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]

0 comments on commit 6601bd2

Please sign in to comment.