2017 © Pedro Peláez
 

library sift-partner-php

Sift Science Partnership API PHP library

image

siftscience/sift-partner-php

Sift Science Partnership API PHP library

  • Friday, July 1, 2016
  • by siftscience
  • Repository
  • 93 Watchers
  • 0 Stars
  • 295 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

Sift Science PHP Bindings

Installation

With Composer

  1. Add siftscience/sift-partner-php as a dependency in composer.json., (*1)

    "require": {
        ...
        "siftscience/sift-partner-php" : "1.*"
        ...
    }
    
  2. Run composer update., (*2)

  3. Now SiftClient will be autoloaded into your project., (*3)

    require 'vendor/autoload.php';
    
    $partner_client = new SiftClient('my_api_key', 'my_partner_id');
    

Manually

  1. Download the latest release.
  2. Extract into a folder in your project root named "sift-partner-php".
  3. Include SiftClient in your project like this:, (*4)

    require 'sift-partner-php/lib/Services_JSON-1.0.3/JSON.php';
    require 'sift-partner-php/lib/SiftRequest.php';
    require 'sift-partner-php/lib/SiftResponse.php';
    require 'sift-partner-php/lib/SiftClient.php';
    
    $partner_client = new SiftClient('my_api_key', 'my_partner_id');
    

Usage

Create a new account

Here's an example that creates a new merchant account., (*5)

// Note: this will only work once, afterwards you will receive an 
// error as the merchant account with these details has already been created
$partner_client = new SiftClient('my_api_key', 'my_partner_id');
$response = $partner_client->new_account(
  "merchantsite.com", // the url for the merchant's site
  "shopowner@merchantsite.com", // an email belonging to the merchant
  "johndoe@merchantsite.com", // an email used to log in to Sift
  "s0m3l0ngp455w0rd" // password associated with that log in
);

$response->isOk();

Get a list of accounts created by you

$partner_client = new SiftClient('my_api_key', 'my_partner_id');
$response = $partner_client->getAccounts();

$response->isOk();

Configure the http notification endpoint and threshold for all of your merchants.

// Note: The %s must appear exactly once in your notification url.
$partner_client = new SiftClient('my_api_key', 'my_partner_id');
$response = $partner_client->updateNotificationConfig('http://your.url.endpoint/someting?id=%s', 0.60);  //This sets the threshold to a 60 (0.60*100)

Contributing

Run the tests from the project root with PHPUnit like this:, (*6)

phpunit --bootstrap vendor/autoload.php test/SiftClientTest

License

MIT, (*7)

The Versions

01/07 2016

dev-master

9999999-dev https://github.com/SiftScience/sift-partner-php

Sift Science Partnership API PHP library

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Yoav Schatzberg

php fraud sift science sift sift science partnership api

01/07 2016

0.0.3

0.0.3.0 https://github.com/SiftScience/sift-partner-php

Sift Science Partnership API PHP library

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Yoav Schatzberg

php fraud sift science sift sift science partnership api

24/11 2014

0.0.2

0.0.2.0 https://github.com/SiftScience/sift-partner-php

Sift Science Partnership API PHP library

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Yoav Schatzberg

php fraud sift science sift sift science partnerhsip api