Download the PHP package / without Composer

On this page you can find all versions of the php package /. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
/
Rate from 1 - 5
Rated 5.00 based on 2 reviews

Informations about the package

Recurly

This repository houses the official php client for Recurly's V3 API.

Note: If you were looking for the V2 client, see the v2 branch.

Documentation for the HTTP API and example code can be found on our Developer Portal.

Getting Started

Reference documentation can be found on Github Pages.

Installing

This package is published on Packagist under the name recurly/recurly-client and can be added as a dependency to your project's composer.json file. We recommend using Composer to install and maintain this dependency.

Note: We try to follow semantic versioning and will only apply breaking changes to major versions.

Creating a Client

Client instances provide one place where every operation on the Recurly API can be found (rather than having them spread out amongst classes). A new client can be initialized with its constructor. It only requires an API key which can be obtained on the API Credentials Page.

To access Recurly API in Europe, you will need to specify the EU Region in the options.

Logging

The client constructor optionally accepts a logger provided by the programmer. The logger you pass should implement the PSR-3 Logger Interface. By default, the client creates an instance of the \Recurly\Logger which is a basic implementation that prints log messages to php://stdout with the \Psr\Log\LogLevel::WARNING level.

SECURITY WARNING: The log level should never be set to DEBUG in production. This could potentially result in sensitive data in your logging system.

Operations

The \Recurly\Client contains every operation you can perform on the site as a list of methods. Each method is documented explaining the types and descriptions for each input and return type. For example, to use the get_plan endpoint, call the Client#getPlan() method:

Pagination

Pagination is accomplished using the \Recurly\Pager object. A pager is created by the list* operations of the client. The Pager implements PHP's Iterator interface, so it can be used in a foreach loop.

Note Calling list* methods do not call the API right away. They return immediately with the Pager. The API is not called until you iterate over the pager or request items from it.

Sorting and Filtering

When calling the list* methods and constructing Pagers, you can pass in optional query parameters to help you sort or filter the resulting resources in the list. The query params are documented on the method and can be found in the docs under the Query Parameters section of any pageable endpoint.

Example filtering an sorting accounts:

Counting Resources

The Pager class implements a getCount() method which allows you to count the resources the pager would return if iterated. It does so by calling the endpoint with HEAD and parsing and returning the Recurly-Total-Records header. This method respects any filtering parameters you apply to the pager, but the sorting parameters will have no effect.

Efficiently Fetch the First or Last Resource

The Pager class implements a getFirst() method which allows you to fetch just the first or last resource from the server. On top of being a convenient abstraction, this is implemented efficiently by only asking the server for the 1 resource you want.

If you want to fetch the last account in this scenario, invert the order from desc to asc:

A Note on Headers

In accordance with section 4.2 of RFC 2616, HTTP header fields are case-insensitive.

Creating Resources

For creating or updating resources, pass a plain associative array to one of the create* or update* methods:

Error Handling

HTTP Metadata

Sometimes you might want to get some additional information about the underlying HTTP request and response. Instead of returning this information directly and forcing the programmer to unwrap it, we inject this metadata into the top level resource that was returned. You can access the response by calling getResponse() on any Resource.

Warning: Do not log or render whole requests or responses as they may contain PII or sensitive data.

Information about the request is also included in the \Recurly\Response class and can be accessed using the getRequest() method on the Response.

This also works on Empty resources (for when there is no return body):


All versions of with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package / contains the following files

Loading the files please wait ....