2017 © Pedro Peláez
 

library recurly_client

Recurly REST API services.

image

droath/recurly_client

Recurly REST API services.

  • Friday, April 3, 2015
  • by droath
  • Repository
  • 0 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Recurly Client

Build Status, (*1)

The Recurly Client library allows you to simply interact with the exposed RESTful API Services provided by Recurly.com., (*2)

We're using the PHP Guzzle library to construct the HTTP requests for the available Recurly web services. This will give us the opportunity to leverage Guzzle and its pluggable HTTP adapters. Hopefully it will make for a more feature rich experience when handling the Recurly web services., (*3)

Requirements

The PHP library depends on PHP 5.4 or higher., (*4)

NOTE: Currently we don't support PHP:hhvm, due to HHVM not fully supporting the SimpleXMLIterator class., (*5)

Installation

Composer

If you're using Composer, you can simply add a dependency droath/recurly_client to your project's composer.json file. Here's a snippet of the composer.json., (*6)

{
    "require": {
        "droath/recurly_client": "*"
    }
}

Usage

Configuration

Set the Recurly API key and subdomain, which are defined within your Recurly Account., (*7)

<?php

$config = new \RecurlyClient\Config(
    'abcdef01234567890abcdef01234567890',
    'your-subdomain'
);
$client = new \RecurlyClient\Client($config);

Service Manager

Request types

Display the available request types for a particular Recurly service., (*8)

<?php
...

$service = new \RecurlyClient\Service\Account();
$manager = new \RecurlyClient\ServiceManager($client, $service);

$request_types = $manager->getRequestTypes();

print $request_types;

Invoke

Display the Recurly response object based on the invoked request type action., (*9)

<?php
...

$service = new \RecurlyClient\Service\Account();
$manager = new \RecurlyClient\ServiceManager($client, $service);

try {
    $response = $manager->invoke('list')->execute();
} catch (Exception $e) {
    // Handle errors here
}

print $response;

Response

Extract

Simply extract the data that was retrieved from the Recurly web service. The data can be extracted from the response in the following formats: Array, JSON, or XML., (*10)

<?php
...

try {
    $response = $manager->invoke('list')->execute();
} catch (Exception $e) {
    // Handle errors here
}

// Available formats are: array, json, xml.
$data = $response->getData()->extract('array');

The Versions

03/04 2015

dev-master

9999999-dev

Recurly REST API services.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Travis Tomka

api payment recurly