Download the PHP package bayonet/bayonet-php without Composer
On this page you can find all versions of the php package bayonet/bayonet-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bayonet/bayonet-php
More information about bayonet/bayonet-php
Files in bayonet/bayonet-php
Package bayonet-php
Short Description Bayonet PHP library
License MIT
Homepage https://bayonet.io
Informations about the package bayonet-php
Bayonet
Bayonet enables companies to feed and consult a global database about online consumers’ reputation, based on historic payments. Start making smarter business decisions today.
Introduction
Bayonet’s API is organized around REST and exposes endpoints for HTTP requests. It is designed to have predictable, resource-oriented URLs and uses standard HTTP response codes to indicate the outcome of operations. Request and response payloads are formatted as JSON.
About the service
Bayonet provides an Ecosystem of Trust and Protection where companies can collaborate with each other to combat online fraud together. We provide a secure platform to share and consult data to understand when a consumer is related to fraudulent activity or has a fraud-free record. Different technologies that run algorithms to link parameters seen in different transactions, fed by companies connected to the ecosystem are employed in order to build consumer profiles. By consulting Bayonet’s API, a response with data provided by companies themselves is available in real-time for your risk assesment process to analyze it and take better decisions.
Bayonet's API details
The examples shown in this README are only for demonstration of the functionality of this SDK. For the detailed integration flow, and when to send which API call, please refer to the Bayonet API documentation.
Getting started
Requirements
To use this SDK, please make sure:
- You have PHP 5.4 or superior installed on your system.
- You have an API KEY (sandbox and/or live) provided by Bayonet's team.
Composer
-
Add dependency 'bayonet-php' in your composer.json file
Run composer to get the dependencies
- Load the dependencies using Composer autoload
Manual Installation
-
If you do not use Composer, download the latest release. Extract into your project root into a folder named
bayonet-php
. Use theinit.php
file to load the Bayonet dependencies -
BayonetClient uses Guzzle as dependency. Make sure you download and include Guzzle into your project as well
If you use Composer, the above dependency will be handled automatically. If you choose manual installation, you will need to make sure the dependency is available.
Usage
Once you have Bayonet's SDK configured, you can call the APIs with the following syntax. Follow the guidelines specific to the product you are integrating:
-
Ecommerce
- Lending
Ecommerce
-
Initialize the Ecommerce client
You can use environment vars to load the api key too
-
Consult API
-
Update Transaction API
- Feedback-historical API
Lending
-
Initialize the Lending client
You can use environment vars to load the api key too
-
Report Transaction (Request for loan received)
-
Report Transaction (Request for loan received) + Consult
This lets you report a transaction (solicitud) and consult Bayonet at the same time. The only difference from the above method (Report Transaction) is that this method will also return a consult response
-
Consult (consult the persona present in the transaction)
-
Feedback (send feedback regarding a transaction - raise alert or block the user)
- Feedback historical (for reporting historical transactions that were not sent to Bayonet)
Device Fingerprint
-
Initialize the Device Fingerprint client
You can use environment vars to load the api key too
- Get-fingerprint-data API You can use this endpoint to get detailed information about a fingerprint generated by the Bayonet fingerprinting JS installed on your front-end
Success and error handling
Bayonet's SDK supports callbacks for success and error handling
For a full list of error codes and their messages, please refer to the Bayonet API documentation.
Testing
You can run the test suite with the following command: