Skip to content

Latest commit

 

History

History
executable file
·
45 lines (28 loc) · 906 Bytes

README.rdoc

File metadata and controls

executable file
·
45 lines (28 loc) · 906 Bytes

Peakium PHP API Bindings

About

This is an experimental release of converted PHP version of Peakium Ruby bindings.

Installation

1. Add peakium-php to your application's composer.json.
  {
    // ...
    "require": {
      "peakium/peakium-php": "dev-master"
    },
    // ...
  }
2. Run composer intall

Example usage

Set API key:

\Peakium::$api_key = "you_secret_api_key";

Retrieve a customer:

$customer = \Peakium\Customer::retrieve("test_customer");

Create a submission form:

$submission_form = \Peakium\SubmissionForm::build('create-subscription', $args);

Cancel a subscription:

$customer->cancel_subscription("test_subscription");

Errors

The library will throw exceptions when errors are encountered, e.g. if a resource doesn’t exist.

Requirements

  • php 5.2

  • php_curl extension

  • php_json extension