Download the PHP package konduto/sdk without Composer

On this page you can find all versions of the php package konduto/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

Intro

Welcome! This document will explain how to integrate with Konduto's anti-fraud service so you can begin to spot fraud on your e-commerce website.

This document covers Konduto PHP SDK integration library that facilitates the integration with the Orders API in your PHP application. For more information about the service, other APIs and other integration details check out Konduto documentation.

Minimum requirements

Installation with Composer

For older versions of this library check the releases section. We strongly recommend using the latest version possible.

Getting started

When a customer makes a purchase on your e-commerce you should input the order information into Konduto's Orders API so it can be analyzed for fraud risk. The analysis happens in real-time and will return you a recommendation of what to do next and a score, a numeric confidence level about that order's risk.

While most of the parameters are optional we recommend you send most you can, because every data point matters for the analysis. The billing address and credit card information are specially important, though we understand there are cases where you don't have that information.

Import Namespaces

Import the following Namespaces:

Konduto provides methods for using Konduto services, such as sending an order for analysis (POST), querying (GET) or updating an existent order (PUT):

Set your API key

Before using Konduto methods you need first to set your Konduto API key using the setApiKey() method. Check the official Konduto docs for how to obtain your API key:

Send an order for analysis

Sending an order for analysis is as easy as calling the analyze method from Konduto core class for an Order object, as the snippet below shows. Use $order->getRecommendention() to see the recommendation for this order and $order->getScore() to know the score representing the order's risk that Konduto calculated for it.

Every call performed with Konduto can throw an exception in case something goes wrong. Check the exception's message to see what went wrong. An example of what can go wrong is that a mandatory field wasn't provided, or a field was provided in the wrong format. Example:

Building an Order

You can create an Order object (or any other model from Konduto SDK) in two ways: by providing an associative array with the allowed fields to the model's constructor or using the methods such as setters and getters.

Check the official Konduto documentation for reference to all fields accepted in the Konduto Orders API. Some fields are mandatory, like the order id and total amount, but most are optional.

You can provide order informatino using an associative array, like this:

Or using the methods provided by each model, like this:

You can check all the possible models in src/Models/ folder.

Using dates and DateTime

This library automatically converts dates to the required API format. If it is convenient for you, you can directly provide a DateTime object to the fields that require dates.

Updating order status

After you decide what to do with the order you asked for analysis (e.g. approve, decline, fraud, cancel, not authorized) it is very important that you inform Konduto service about it. So the machine learning algorithm can learn better about your orders and improve itself. For this, you have to use the Konduto::updateOrderStatus() method.

Parameter Description
orderId (required) The id for the order
status (required) String of one of the possible order status, check the available status.
comments (required) Reason or comments about the status update.

Querying orders

Reference Tables

Please click here for the Currency and Category reference tables.

Support

Feel free to contact our support team if you have any questions or suggestions!

Contributing

Found a bug or missing feature? This is an open-source project, so a Pull Request will be more than welcome. Just make sure following the guidelines:

Testing

This project uses PHPUnit as its testing framework. Before running any test, make sure you install it. To install all project's dependencies using Composer run a composer install first:

There are two types of test:

You can run the unit tests with the command:

Before running the integration tests you will need to provide a working sandbox API key as an environment variable KONDUTO_SANDBOX_API_KEY. If you don't do this all integration tests will fail.

Now you can run the integration tests:


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package konduto/sdk contains the following files

Loading the files please wait ....