PHP Class Dwolla\RestClient

Mostrar archivo Open project: dwolla/dwolla-php

Public Properties

Property Type Description
$client Placeholder for Guzzle REST client.
$settings Settings object.

Public Methods

Method Description
__construct ( ) Constructor. Takes no arguments.
__get ( $name ) PHP "magic" getter.
__set ( $name, $value ) PHP "magic" setter.

Protected Methods

Method Description
_console ( $data ) Echos output and logs to console (and js console to make browser debugging easier).
_delete ( string $endpoint, string[] $query, boolean $customPostfix = false, boolean $dwollaParse = true ) : string[] Wrapper around Guzzle DELETE request.
_error ( string $message ) : boolean Small error message wrapper for missing parameters, etc.
_get ( string $endpoint, string[] $query, boolean $customPostfix = false, boolean $dwollaParse = true ) : string[] Wrapper around Guzzle GET request.
_host ( ) : string Returns default host URL dependent on sandbox flag.
_logtofile ( $data ) Logs console messages to file for convenience.
_post ( string $endpoint, string $request, boolean $customPostfix = false, boolean $dwollaParse = true ) : String[] Wrapper around Guzzle POST request.
_put ( string $endpoint, string $request, boolean $customPostfix = false, boolean $dwollaParse = true ) : String[] Wrapper around Guzzle PUT request.

Private Methods

Method Description
_dwollaparse ( String[] $response ) : String[] Parses API response out of envelope and informs user of issues if they arise.

Method Details

__construct() public method

Constructor. Takes no arguments.
public __construct ( )

__get() public method

PHP "magic" getter.
public __get ( $name )
$name

__set() public method

PHP "magic" setter.
public __set ( $name, $value )
$name
$value

_console() protected method

Echos output and logs to console (and js console to make browser debugging easier).
protected _console ( $data )
$data {???} Can be anything.

_delete() protected method

Wrapper around Guzzle DELETE request.
protected _delete ( string $endpoint, string[] $query, boolean $customPostfix = false, boolean $dwollaParse = true ) : string[]
$endpoint string API endpoint string
$query string[] Array of URLEncoded query items in key-value pairs.
$customPostfix boolean Use default REST postfix?
$dwollaParse boolean Parse out of message envelope?
return string[] Response body.

_error() protected method

Small error message wrapper for missing parameters, etc.
protected _error ( string $message ) : boolean
$message string Error message.
return boolean

_get() protected method

Wrapper around Guzzle GET request.
protected _get ( string $endpoint, string[] $query, boolean $customPostfix = false, boolean $dwollaParse = true ) : string[]
$endpoint string API endpoint string
$query string[] Array of URLEncoded query items in key-value pairs.
$customPostfix boolean Use default REST postfix?
$dwollaParse boolean Parse out of message envelope?
return string[] Response body.

_host() protected method

Returns default host URL dependent on sandbox flag.
protected _host ( ) : string
return string Host

_logtofile() protected method

(Thank you, @redzarf for your contribution)
protected _logtofile ( $data )
$data {???} Can be anything.

_post() protected method

Wrapper around Guzzle POST request.
protected _post ( string $endpoint, string $request, boolean $customPostfix = false, boolean $dwollaParse = true ) : String[]
$endpoint string API endpoint string
$request string Request body. JSON encoding is optional.
$customPostfix boolean Use default REST postfix?
$dwollaParse boolean Parse out of message envelope?
return String[] Response body.

_put() protected method

Wrapper around Guzzle PUT request.
protected _put ( string $endpoint, string $request, boolean $customPostfix = false, boolean $dwollaParse = true ) : String[]
$endpoint string API endpoint string
$request string Request body. JSON encoding is optional.
$customPostfix boolean Use default REST postfix?
$dwollaParse boolean Parse out of message envelope?
return String[] Response body.

Property Details

$client public_oe static_oe property

Placeholder for Guzzle REST client.
public static $client

$settings public_oe static_oe property

Settings object.
public static $settings