2017 © Pedro Peláez
 

library octobat-php

Octobat PHP Library

image

0ctobat/octobat-php

Octobat PHP Library

  • Wednesday, May 2, 2018
  • by Octobat
  • Repository
  • 3 Watchers
  • 1 Stars
  • 255 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 723 % Grown

The README.md

Octobat PHP bindings

You can sign up for an Octobat account at https://www.octobat.com., (*1)

Requirements

PHP 5.4.0 and later., (*2)

Composer

You can install the bindings via Composer. Run the following command:, (*3)

composer require 0ctobat/octobat-php

To use the bindings, use Composer's autoload:, (*4)

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file., (*5)

require_once('/path/to/octobat-php/init.php');

Dependencies

The bindings require the following extensions in order to work properly:, (*6)

  • curl, although you can use your own non-cURL client if you prefer
  • json
  • mbstring (Multibyte String)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available., (*7)

Getting Started

Simple usage looks like:, (*8)

\Octobat\Octobat::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$customer = \Octobat\Customer::create(['email' => "john.doe@gmail.com", 'name' => 'John Doe', 'billing_address_country' => 'FR']);
echo $customer;

Documentation

Please see http://v2apidoc.octobat.com/ for up-to-date documentation., (*9)

Configuring a Logger

The library does minimal logging, but it can be configured with a [PSR-3 compatible logger][psr3] so that messages end up there instead of error_log:, (*10)

\Octobat\Octobat::setLogger($logger);

Per-request Configuration

For apps that need to use multiple keys during the lifetime of a process, it's also possible to set a per-request key and/or account:, (*11)

\Octobat\Customer::all([], [
    'api_key' => 'oc_test_skey...'
]);

\Octobat\Customer::retrieve("oc_cu_xxxxxxxx", [
    'api_key' => 'oc_test_skey...'
]);

The Versions

02/05 2018

2.0.0

2.0.0.0 https://www.octobat.com/

Octobat PHP Library

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api octobat

02/05 2018

dev-master

9999999-dev https://www.octobat.com/

Octobat PHP Library

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api octobat