petflow / signifyd
A lightweight library for interacting with the Signifyd REST API.
Installs: 44 712
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 12
Forks: 3
Open Issues: 1
Requires
- guzzle/guzzle: 3.8.*
Requires (Dev)
- mockery/mockery: dev-master@dev
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2017-01-06 18:07:17 UTC
README
Signifyd is a third party solution for detecting fraud in e-commerce transactions, available as a RESTful API. This library is a simple wrapper for their API service, using the Guzzle http library to make requests and handle responses.
For more information about Signifyd and their API, see links below:
Installation
Download this entire repository into your local project folder, and then run the following:
curl -sS https://getcomposer.org/installer | php
php composer.phar install
composer install
Usage
Basic Case Operations
namespace Petflow\Signifyd; require './vendor/autoload.php'; $api_key = array('key' => 'your-signifyd-api-key-here'); $investigation = new Investigation($api_key); // fields match exactly to reference: https://www.signifyd.com/docs/api $data = array( 'purchase' => array(...), 'card' => array(...), ... ); // create a new case $result = $investigation->post($data); // retrieve a case $result = $investigation->get($result['case_id']); if ($result['success']) { $score = $case['response']['adjustedScore']; }
Handling Errors
$result = $investigation->post($data); if (!$result['success']) { // unsuccessful $reason = $result['reason']; } else { // successful }
FAQ
What is / where can I get a Signifyd API key?
The API key is used in Basic HTTP authentication to identify who you are to their service. They do not provide a public sandbox, however you may obtain testing keys by contacting them here: https://www.signifyd.com/get-started.