Recurly v3 API

ClientError extends RecurlyError

Table of Contents

$_api_error  : mixed
__construct()  : mixed
Constructor
fromResponse()  : RecurlyError
Class method to build a \Recurly\RecurlyError from a Recurly response.
getApiError()  : ErrorMayHaveTransaction
Getter for the Recurly API Error
encodeApiKey()  : string
Base64 encodes the API key
errorFromStatus()  : string
Returns an error type for a given $status_code or an empty string.
getUserAgent()  : string
Generates User-Agent for API requests
titleize()  : string
Capitalizes all the words in the $input.
_defaultErrorType()  : string
Inspects the $response's HTTP status code and determines the default error type to be used if a more suitable class is not found.

Properties

Methods

encodeApiKey()

Base64 encodes the API key

protected static encodeApiKey(string $key) : string
Parameters
$key : string

The API key to encode

Return values
string

base64 encoded API key

errorFromStatus()

Returns an error type for a given $status_code or an empty string.

protected static errorFromStatus(int $status_code) : string
Parameters
$status_code : int

A HTTP status code

Return values
string

A key that can be used to determine an error class

getUserAgent()

Generates User-Agent for API requests

protected static getUserAgent() : string
Return values
string

Recurly client User-Agent string

titleize()

Capitalizes all the words in the $input.

protected static titleize(string $input[, string $prefix = '' ]) : string
Parameters
$input : string

The string to titleize

$prefix : string = ''

(optional) Prefix to add to the beginning of the titleized string. The prefix will not be titleized.

Return values
string

The titleized $input wtih the prepended $prefix

_defaultErrorType()

Inspects the $response's HTTP status code and determines the default error type to be used if a more suitable class is not found.

private static _defaultErrorType(Response $response) : string
Parameters
$response : Response

The \Recurly\Response object

Return values
string

Default error class name

Search results