[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/wepay/ -> wepay.php (summary)

(no description)

File Size: 291 lines (10 kb)
Included or required: 4 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 classes

WePay:: (10 methods):
  getAllScopes()
  getAuthorizationUri()
  getDomain()
  getToken()
  useProduction()
  useStaging()
  __construct()
  __destruct()
  make_request()
  request()

WePayException:: (1 method):
  __construct()

WePayRequestException:: (0 methods):

WePayPermissionException:: (0 methods):

WePayServerException:: (0 methods):


Class: WePay  - X-Ref

getAllScopes()   X-Ref
Pass WePay::getAllScopes() into getAuthorizationUri if your application desires full access


getAuthorizationUri(array $scope, $redirect_uri, array $options = array()   X-Ref
Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls

param: array  $scope             List of scope fields for which your application wants access
param: string $redirect_uri      Where user goes after logging in at WePay (domain must match application settings)
param: array  $options optional  user_name,user_email which will be pre-filled on login form, state to be returned in querystring of redirect_uri
return: string URI to which you must redirect your user to grant access to your application

getDomain()   X-Ref
No description

getToken($code, $redirect_uri)   X-Ref
Exchange a temporary access code for a (semi-)permanent access token

param: string $code          'code' field from query string passed to your redirect_uri page
param: string $redirect_uri  Where user went after logging in at WePay (must match value from getAuthorizationUri)
return: StdClass|false

useProduction($client_id, $client_secret)   X-Ref
Configure SDK to run against WePay's production servers

param: string $client_id      Your application's client id
param: string $client_secret  Your application's client secret
return: void

useStaging($client_id, $client_secret)   X-Ref
Configure SDK to run against WePay's staging servers

param: string $client_id      Your application's client id
param: string $client_secret  Your application's client secret
return: void

__construct($token)   X-Ref
Create a new API session

param: string $token - access_token returned from WePay::getToken

__destruct()   X-Ref
Clean up cURL handle


make_request($endpoint, $values, $headers = array()   X-Ref
create the cURL request and execute it


request($endpoint, array $values = array()   X-Ref
Make API calls against authenticated user

param: string $endpoint - API call to make (ex. 'user', 'account/find')
param: array  $values   - Associative array of values to send in API call
return: StdClass

Class: WePayException  - X-Ref

Different problems will have different exception types so you can
catch and handle them differently.

WePayServerException indicates some sort of 500-level error code and
was unavoidable from your perspective. You may need to re-run the
call, or check whether it was received (use a "find" call with your
reference_id and make a decision based on the response)

WePayRequestException indicates a development error - invalid endpoint,
erroneous parameter, etc.

WePayPermissionException indicates your authorization token has expired,
was revoked, or is lacking in scope for the call you made
__construct($description = '', $http_code = FALSE, $response = FALSE, $code = 0, $previous = NULL)   X-Ref
No description

Class: WePayRequestException  - X-Ref

Class: WePayPermissionException  - X-Ref

Class: WePayServerException  - X-Ref



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1