Download the PHP package siftscience/sift-php without Composer
On this page you can find all versions of the php package siftscience/sift-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download siftscience/sift-php
More information about siftscience/sift-php
Files in siftscience/sift-php
Package sift-php
Short Description Sift Science PHP library
License MIT
Homepage https://github.com/SiftScience/sift-php
Informations about the package sift-php
Sift Bindings
Installation
With Composer
-
Add siftscience/sift-php as a composer dependency
- Now
SiftClient
will be autoloaded into your project.
Manually
-
Download the latest release.
-
Extract into a folder in your project root named "sift-php".
- Include
SiftClient
in your project like this:
Usage
Track an event
To learn more about the Events API visit our developer docs.
Optional Params
return_score
::true
or:false
return_action
::true
or:false
return_workflow_status
::true
or:false
return_route_info
::true
or:false
force_workflow_run
::true
or:false
include_score_percentiles
::true
or:false
warnings
::true
or:false
abuse_types
:["payment_abuse", "content_abuse", "content_abuse", "account_abuse", "legacy", "account_takeover"]
Here's an example that sends a $transaction
event to Sift.
Label a user as good/bad
Unlabel a user
Get a user's score
Get the status of a workflow run
Get the latest decisions for a user
Get the latest decisions for an order
Get the latest decisions for a session
List of configured Decisions
Optional Params
entity_type
:user
ororder
orsession
abuse_types
:["payment_abuse", "content_abuse", "content_abuse", "account_abuse", "legacy", "account_takeover"]
Apply decision to a user
Apply decision to an order
Apply decision to a session
Creates a new webhook with a specified URL.
Retrieves a webhook when given an ID.
List All Webhooks
Update a Webhook
Deletes a webhook when given an ID.
Contributing
Run the tests from the project root with PHPUnit like this:
Updating Packagist
-
Update
composer.json
to reflect the new version, as well as any new requirements then merge changes into master. - Create a new release with the version number and use it as the description. Packagist will automatically deploy a new package via the configured webhook.
HTTP connection pooling
You can substantially improve the performance of SiftClient
by using HTTP connection pooling.
Because standard PHP/fastcgi deployments don't have a mechanism for persisting connections between
requests, the easiest way to pool connections is by routing requests through a proxy like Apache httpd or nginx.
For Debian-based distributions, the certificate file is /etc/ssl/certs/ca-certificates.crt
Then, instantiate SiftClient
to route requests through the proxy:
Integration testing app
For testing the app with real calls it is possible to run the integration testing app, it makes calls to almost all our public endpoints to make sure the library integrates well. At the moment, the app is run on every merge to master
How to run it locally
- Add env variable
ACCOUNT_ID
with the valid account id - Add env variable
API_KEY
with the valid Api Key associated from the account - Run the following under the project root folder
License
MIT
All versions of sift-php with dependencies
ext-json Version *