PHPackages                             gregoriopellegrino/php-cantook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gregoriopellegrino/php-cantook

ActiveLibrary

gregoriopellegrino/php-cantook
==============================

A PHP wrapper for Cantook (and Edigita) API for ebook sales

1151PHP

Since Oct 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/gregoriopellegrino/php-cantook)[ Packagist](https://packagist.org/packages/gregoriopellegrino/php-cantook)[ RSS](/packages/gregoriopellegrino-php-cantook/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-cantook
===========

[](#php-cantook)

A PHP wrapper for Cantook (and Edigita) API for ebook sales. API specifications:

Installing
----------

[](#installing)

You can install through Composer. Simply add "gregoriopellegrino/php-cantook" in your composer.json file like below.

```
{
    "require": {
                "gregoriopellegrino/php-cantook": "dev-master"
    }
}
```

Usage
-----

[](#usage)

You can find some code in the file test/test.php.

### Simulate a sale

[](#simulate-a-sale)

```
$platform = new Platform("https://edigita.cantook.net", "username", "password", 310, "ita");
$publication = new Publication("9788874028047", "epub", 2.99, "none", "EUR");
$response = $platform->callService("simulation", $publication);
```

### Sale

[](#sale)

```
$platform = new Platform("https://edigita.cantook.net", "username", "password", 310, "ita");
$publication = new Publication("9788874028047", "epub", 2.99, "none", "EUR");
$transaction = new Transaction("123456", "123456", "Gregorio Pellegrino");
$transaction->sale_state = "test";
$response = $platform->callService("sale", $publication, $transaction);
```

### Download

[](#download)

```
$platform = new Platform("https://edigita.cantook.net", "username", "password", 310, "ita");
$publication = new Publication("9788874028047", "epub", 2.99, "none", "EUR");
$transaction = new Transaction("123456", "123456", "Gregorio Pellegrino");
$transaction->sale_state = "test";
$response = $platform->callService("download", $publication, $transaction);
```

### Response structure

[](#response-structure)

```
array(3) {
  ["url"]=> "https://edigita.cantook.net/api/organisations/..." // the requested url
  ["code"]=> 200												// the response code
  ["response"]=> "success"										// the response message
}

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f652f92c0b3c01bd1eb12453bca498015caaf561959f1d68d8d43c3cadf46923?d=identicon)[gregoriopellegrino](/maintainers/gregoriopellegrino)

---

Top Contributors

[![gregoriopellegrino](https://avatars.githubusercontent.com/u/5065125?v=4)](https://github.com/gregoriopellegrino "gregoriopellegrino (12 commits)")

### Embed Badge

![Health badge](/badges/gregoriopellegrino-php-cantook/health.svg)

```
[![Health](https://phpackages.com/badges/gregoriopellegrino-php-cantook/health.svg)](https://phpackages.com/packages/gregoriopellegrino-php-cantook)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
