Trustev 1.1.2

dotnet add package Trustev --version 1.1.2
NuGet\Install-Package Trustev -Version 1.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trustev" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Trustev --version 1.1.2
#r "nuget: Trustev, 1.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Trustev as a Cake Addin
#addin nuget:?package=Trustev&version=1.1.2

// Install Trustev as a Cake Tool
#tool nuget:?package=Trustev&version=1.1.2

alt text

#Trustev .NET Library

##Requirements

  • .NET version 4.0 and later

##Installation ####NuGet

  • Simply install via the Nuget Package Manager or install via the Package Manager Console with the following 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.

##Integration Tests Included are async and sync tests to test the integration of the .NET Library against the Trustev API - This will show examples of how to use the various endpoints of the Trustev API. Simply include your Test API Keys in the app.config files of either the Tests folder (Async) or TestsNet40 folder (sync).

Usage

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 in a couple of simple steps.

Simple Trustev Integration

This is simple version of the Trustev Integration and involves 4 simple steps:


// 1. Set-Up the Trustev API Client with your user credentials, and include your location details 
// - i.e. US (Enums.BaseUrl.US) or EU (Enums.BaseUrl.EU)
ApiClient.SetUp(userName, password, secret, baseURL);


// 2. Create your case.
// You will need two bits of information for this step
// 		SessionId : This is the SessionId that you have recieved from the Trustev JavaScript 
//					and transferred 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);

// Now add any further information you have. The more you give us, the more accurate 
// our decisions.
kase.Customer = new Customer()
{
	FirstName = "John",
    LastName = "Doe",
}


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


// 4. You can now get your Decision from Trustev base on the case you have given us!
Decision decision = ApiClient.GetDecision(returnCase.Id);


// Now it is up to you what you do with our decision

Optional Integration Steps

As mentioned earlier, we also provide 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

// 1. Set-Up the Trustev API Client with your user credentials, and include your location details 
// - i.e. US (Enums.BaseUrl.US) or EU (Enums.BaseUrl.EU)
ApiClient.SetUp(userName, password, secret, baseURL);


// 2. Create your case.
// You will need two bits of information for this step
// 		SessionId : This is the SessionId that you have received from the trustev JavaScript 
//					and transferred 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 let's create the customer.
Customer customer = new Customer()
{
	FirstName = "John",
    LastName = "Doe",
}

//    Now we can go ahead and add 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 on this case, including
//    the new customer you have added
Decision decision = ApiClient.GetDecision(returnCase.Id);


// Now it's up to you what you do with our decision

Example : Updating a Transaction

// 1. Set-Up the Trustev API Client with your user credentials, and include your location details
// - i.e. US (Enums.BaseUrl.US) or EU (Enums.BaseUrl.EU)
ApiClient.SetUp(userName, password, secret, baseURL);


// 2. Create your case.
// You will need two bits of information for this step
// 		SessionId : This is the SessionId that you have recieved from the Trustev JavaScript 
//					and transferred 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 add the Transaction to the Case we added earlier.
Transaction returnTransaction = ApiClient.UpdateTransaction(returnCase.Id, transaction);


// 5. You can now continue as normal and get the Decision on 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.

Multiple Site Credentials Trustev Integration - Valid as of version update 1.1.1

This is simple version of the Trustev Integration and involves 4 simple steps:


// 1. Set-Up the Trustev API Client with your user credentials, and include your location details 
// - i.e. US (Enums.BaseUrl.US) or EU (Enums.BaseUrl.EU)
ApiClient.SetUp(userName, password, secret, baseURL);


// 2. Create your case.
// You will need two bits of information for this step
//		userName : This is optional - The user name, needed to support multiple credentials,
//      if only one set of credentials is used this parameter is not needed
//
// 		SessionId : This is the SessionId that you have received from the Trustev JavaScript 
//					and transferred 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);

Case kase = new Case(sessionId, caseNumber, userName);

// Now add any further information you have. The more you give us, the more accurate 
// our decisions.
kase.Customer = new Customer()
{
	FirstName = "John",
    LastName = "Doe",
}


// 3. Post this Case to the Trustev API

Case returnCase = ApiClient.PostCase(kase);

//	userName is Optional: The user name, needed to support multiple credentials, 
//  if only one set of credentials is used this parameter is not needed

Case returnCase = ApiClient.PostCase(kase, userName);


// 4. You can now get your Decision from Trustev base on the case you have given us!

Decision decision = ApiClient.GetDecision(returnCase.Id);

//	userName is Optional: The user name, needed to support multiple credentials,
//  if only one set of credentials is used this parameter is not needed

Decision decision = ApiClient.GetDecision(returnCase.Id, userName);


// Now it is up to you what you do with our decision

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 2,726 6/12/2020
1.1.2-Preview 844 6/11/2020
1.1.1 1,213 10/9/2019
1.1.1-alpha 1,041 8/1/2019
1.1.0-alpha 974 8/1/2019
1.0.33 1,371 7/23/2019
1.0.32 1,084 7/23/2019
1.0.31 1,064 7/23/2019
1.0.30 3,128 5/17/2019
1.0.29 1,199 4/4/2019
1.0.28 1,244 12/18/2018
1.0.28-Preview 1,167 9/26/2018
1.0.28-beta 1,138 9/26/2018
1.0.27 1,538 8/16/2018
1.0.26-beta 1,231 8/9/2018
1.0.25-beta 1,193 7/26/2018
1.0.24 3,875 5/30/2018
1.0.23-beta 1,358 5/11/2018
1.0.22-beta 1,275 5/11/2018
1.0.21-beta 1,227 5/11/2018
1.0.20-beta 1,346 5/9/2018
1.0.19 2,047 3/30/2018
1.0.18 1,615 3/30/2018
1.0.17 1,525 3/29/2018
1.0.16 1,554 10/25/2017
1.0.15 1,368 10/20/2017
1.0.14 1,537 10/26/2016
1.0.13 1,393 10/21/2016
1.0.12 1,475 10/21/2016
1.0.11 1,546 6/1/2016
1.0.10 1,591 3/10/2016
1.0.8 7,629 10/23/2015
1.0.7 1,682 9/28/2015
1.0.6 1,506 9/24/2015
1.0.5 1,648 9/15/2015
1.0.3 1,654 7/27/2015
1.0.2 1,588 7/7/2015
1.0.1 1,560 7/2/2015
1.0.0 3,480 7/2/2015

Added Id-Vision Unified Platform Version.