PHPackages                             trustev/phpclientapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. trustev/phpclientapi

ActiveLibrary[API Development](/categories/api)

trustev/phpclientapi
====================

PHP Wrapper for the Trustev API

v0.3(9y ago)011.6k4PHPPHP &gt;=5.3.0

Since Sep 14Pushed 4y ago8 watchersCompare

[ Source](https://github.com/Trustev/phpclientapi)[ Packagist](https://packagist.org/packages/trustev/phpclientapi)[ Docs](https://github.com/Trustev/phpclientapi)[ RSS](/packages/trustev-phpclientapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

⛔ \[DEPRECATED\]

This library is deprecated and you should use the web API.

[![alt text](https://camo.githubusercontent.com/7bbfa52fcb1cfa4a62925eeaf13f092eabb255c472bebe73997cd14db88d4812/68747470733a2f2f6170702e747275737465762e636f6d2f6173736574732f696d672f6170706c652d69636f6e2d3134342e706e67)](https://camo.githubusercontent.com/7bbfa52fcb1cfa4a62925eeaf13f092eabb255c472bebe73997cd14db88d4812/68747470733a2f2f6170702e747275737465762e636f6d2f6173736574732f696d672f6170706c652d69636f6e2d3134342e706e67)

\#Trustev PHP 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 API Keys to begin Integrating, please contact our Integration Tema:

\##Requirements

- PHP 5.3+

\##Installation ####Composer You can install this via [Composer](http://getcomposer.org/). Add this to your `composer.json`:

```
{
"require" : {
	"trustev/phpclientapi" : "dev-master"
	}
}
```

Then install via:

```
composer install
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading):

```
require_once('vendor/autoload.php');
```

\####Download and Unpackage

- Simply download and untar using curl with the command

    ```
      	$> curl -L https://github.com/Trustev/phpclientapi/tarball/latest | tar zx

    ```
- Or using wget with the command

    ```
      	$> wget --no-check-certificate https://github.com/Trustev/phpclientapi/tarball/latest -O - | tar xz

    ```

Usage
-----

[](#usage)

The Trustev API has been designed to allow users complete control over what information they are sending to us, while still ensuring that the Trustev Integration can be done in a couple of simple steps.

### Simple Trustev Integration

[](#simple-trustev-integration)

This is a simple version of the Trustev Integration and it involves 4 simple steps.

```
// 1. Set-Up the Trustev Api Client with your user credentials
// If none is specified it defaults to the constants in Settings.php (have a look if you are unsure)
ApiClient::SetUp($userName, $password, $secret, $baseUrl);

// 2. Create your case and POST this Case to the Trustev API.
// You will need two bits of information for this step
// 		SessionId : This is the SessionId that you have received from the Trustev JavaScript (Trustev.js)
//					and transferred server-side.
// 		CaseNumber : This is a number that you use to uniquely identify this Case - we recommend using your internal Order Number for the Case Number.
					It must be unique per Case request.
$kase = new CaseBase(array(
							'SessionId' => $SessionId,
                             'CaseNumber' => $caseNumber
                             ));

// Now add any further information you have. The more you give us, the more accurate
// our Decisions.
$kase->Customer = new Customer(array(
                                        'FirstName' => "John",
                                        'LastName' => "Doe"
                                    ));

// Post this Case to the Trustev Api
$caseReturn = ApiClient::PostCase($kase);

// 3. You can now get your Decision from Trustev based on the Case you have given us
$decision = ApiClient::GetDecision($caseReturn->Id);

// 4. Now it's up to you what to do with our Decision, and then updating the Case Status with what the order outcome was.
$status = new Status(array(
							'Status' => 0,
							'Comment' => "Order Completed Successfully"
						));
$statusReturn = ApiClient::PostCaseStatus($caseReturn->Id, $status);
```

#### Optional Integration Steps

[](#optional-integration-steps)

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

[](#example--adding-a-customer)

```
// 1. Set-Up the Trustev Api Client with your user credentials
// If none is specified it defaults to the constants in Settings.php (have a look if you are unsure)
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 (Trustev.js)
//					and transferred server-side.
// 		CaseNumber : This is a number that you use to uniquely identify this Case - we recommend using your internal Order Number for the Case Number.
					It must be unique per Case request.
$kase = new CaseBase(array(
							'SessionId' => $SessionId,
                             'CaseNumber' => $caseNumber
                             ));

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

// 4. You may now want to add a Customer to the Case you have already added.
//    First let's create the customer.
$customer = new Customer(array(
                                        'FirstName' => "John",
                                        'LastName' => "Doe"
                                    ));

//    Now we can go ahead and add the Customer to the Case we added earlier.
$returnCustomer = ApiClient::PostCustomer($returnCase->Id, $customer);

// 5. You can now continue as normal and get the Decision of this Case including
//    the new Customer you have added
$decision = ApiClient::GetDecision($returnCase->Id);

// 6. Now it's up to you what to do with our Decision, and then updating the Case Status with what the order outcome was.
$status = new Status(array(
							'Status' => 0,
							'Comment' => "Order Completed Successfully"
						));
$statusReturn = ApiClient::PostCaseStatus($caseReturn->Id, $status);
```

##### Example : Updating a Transaction

[](#example--updating-a-transaction)

```
// 1. Set-Up the Trustev Api Client with your user credentials
// If none is specified it defaults to the constants in Settings.php (have a look if you are unsure)
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 (Trustev.js)
//					and transferred server-side.
// 		CaseNumber : This is a number that you use to uniquely identify this Case - we recommend using your internal Order Number for the Case Number.
					It must be unique per Case request.
$kase = new CaseBase(array(
							'SessionId' => $SessionId,
                             'CaseNumber' => $caseNumber
                             ));

$kase->Transaction = new TransactionBase(array(
							'Currency' => "USD",
                             'TotalTransactionValue' => 10
                             ));

// 3. Post this Case to the Trustev Api
$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 = new TransactionBase(array(
							'Currency' => "USD",
                             'TotalTransactionValue' => 2000
                             ));

//    Now we can go ahead and add the Transaction to the Case we created earlier.
$returnTransaction = ApiClient::UpdateTransaction($returnCase->Id, $transaction);

// 5. You can now continue as normal and get the Decision of this Case including
//    the updated Transaction you have added.
$decision = ApiClient::GetDecision($returnCase->Id);

// Now it's up to you what to do with our Decision, and then updating the Case Status with what the order outcome was.
$status = new Status(array(
							'Status' => 0,
							'Comment' => "Order Completed Successfully"
						));
$statusReturn = ApiClient::PostCaseStatus($caseReturn->Id, $status);
```

We provide similar functions i.e. Post (POST), Update (PUT) and Get (GET) for every Sub Entity of the Case Object.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~207 days

Total

3

Last Release

3483d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4920290094ed0c6a73723c02f587456984855e4fa5428ff0bda9cfdc8959a20b?d=identicon)[yvonne2me](/maintainers/yvonne2me)

---

Top Contributors

[![yvonne2me](https://avatars.githubusercontent.com/u/13201277?v=4)](https://github.com/yvonne2me "yvonne2me (20 commits)")[![otherview](https://avatars.githubusercontent.com/u/4471462?v=4)](https://github.com/otherview "otherview (9 commits)")[![Asherlock](https://avatars.githubusercontent.com/u/15909275?v=4)](https://github.com/Asherlock "Asherlock (1 commits)")[![mockpit](https://avatars.githubusercontent.com/u/11564916?v=4)](https://github.com/mockpit "mockpit (1 commits)")

---

Tags

trustev

### Embed Badge

![Health badge](/badges/trustev-phpclientapi/health.svg)

```
[![Health](https://phpackages.com/badges/trustev-phpclientapi/health.svg)](https://phpackages.com/packages/trustev-phpclientapi)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
