2017 © Pedro Peláez
 

library php-cantook

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

image

gregoriopellegrino/php-cantook

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

  • Wednesday, October 7, 2015
  • by gregoriopellegrino
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

php-cantook

A PHP wrapper for Cantook (and Edigita) API for ebook sales. API specifications: http://help.cantook.net/support/solutions/articles/4000034849-the-web-services#2, (*1)

Installing

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

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

Usage

You can find some code in the file test/test.php., (*3)

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

$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

$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

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

The Versions

07/10 2015

dev-master

9999999-dev

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

  Sources   Download

MIT License

The Requires

 

by Gregorio Pellegrino