Download the PHP package compayer/compayer-lib-php without Composer
On this page you can find all versions of the php package compayer/compayer-lib-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download compayer/compayer-lib-php
More information about compayer/compayer-lib-php
Files in compayer/compayer-lib-php
Package compayer-lib-php
Short Description Library for push stat message to Compayer from php-based projects
License proprietary
Homepage https://compayer.com
Informations about the package compayer-lib-php
Compayer PHP SDK
Compayer is a stat data preprocessor and web analytics service that tracks customer events in payment forms for financial and marketing reports.
Compayer PHP SDK library is designed to push stat messages to the Compayer analytics from the php-based projects.
Features
- Creates and sends the Events of start, success, failure or refund payments to the Compare analytics.
- Helps to convert a response message from payment systems Yandex.Money, Xsolla and PaySuper to the Event message.
Table of Contents
- Requirements
- Getting Started
- Installation
- Usage
Requirements
- PHP >= 5.5
- Required PHP extensions: json
Getting Started
Register your account in Compayer analytics to get:
- CLIENT ID (the unique identifier for your client)
- SECRET KEY (the secret API key for your client)
Installation
We recommend installing Compayer PHP SDK using Composer.
After installing, you need to require the Composer's autoloader:
Usage
To use analytics you need to send 2 events:
- The Event
start
when a user initiates a payment. Thestart
event is optional, but we strongly recommend using it to track the entire payment chain. - One of the Events
success
,fail
orrefund
after the payment system responds about the result of the operation.
The Event tries automatically determine the user IP address and address of the payment initiation page based on the data from the server request. If the user’s request is not available to the script, you can set the payment initiation page or user IP address by yourself (this is necessary for the geolocation filters to work correctly).
To send an Event start
, use the following example:
After a payment system has received a response about a payment result (success
, failure
or refund
), you need to send an Event with the data that you received after the payment.
You can form the response event as described in the Event start
. If you received a transaction ID at the start step, set it to link the entire payment chain.
For success
, failure
or refund
events a payment system response is required in its original form.
The response should be written as a string with the key "response" in the property extra
.
For example, if the answer received in the JSON format then use the construct: setPaymentSystemResponse(json_encode($jsonPaymentSystemResponse))
.
License
The project is available as open source under the terms of the MIT License.
All versions of compayer-lib-php with dependencies
ext-json Version *
guzzlehttp/guzzle Version ~6.5
ramsey/uuid Version 3.9.2