PHP Class WC_Auth

Datei anzeigen Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__construct ( ) Setup class.
add_endpoint ( ) Add auth endpoint.
add_query_vars ( array $vars ) : string[] Add query vars.
handle_auth_requests ( ) Handle auth requests.

Protected Methods

Method Description
auth_endpoint ( string $route ) Auth endpoint.
build_url ( array $data, string $endpoint ) : string Build auth urls.
create_keys ( string $app_name, string $app_user_id, string $scope ) : array Create keys.
get_formatted_url ( string $url ) : array Decode and format a URL.
get_i18n_scope ( string $scope ) : string Get scope name.
get_permissions_in_scope ( string $scope ) : array Return a list of permissions a scope allows.
make_validation ( ) Make validation.
post_consumer_data ( array $consumer_data, string $url ) : boolean Post consumer data.

Private Methods

Method Description
maybe_delete_key ( array $key ) Maybe delete key.

Method Details

__construct() public method

Setup class.
Since: 2.4.0
public __construct ( )

add_endpoint() public static method

Add auth endpoint.
Since: 2.4.0
public static add_endpoint ( )

add_query_vars() public method

Add query vars.
Since: 2.4.0
public add_query_vars ( array $vars ) : string[]
$vars array
return string[]

auth_endpoint() protected method

Auth endpoint.
Since: 2.4.0
protected auth_endpoint ( string $route )
$route string

build_url() protected method

Build auth urls.
Since: 2.4.0
protected build_url ( array $data, string $endpoint ) : string
$data array
$endpoint string
return string

create_keys() protected method

Create keys.
Since: 2.4.0
protected create_keys ( string $app_name, string $app_user_id, string $scope ) : array
$app_name string
$app_user_id string
$scope string
return array

get_formatted_url() protected method

Decode and format a URL.
protected get_formatted_url ( string $url ) : array
$url string
return array

get_i18n_scope() protected method

Get scope name.
Since: 2.4.0
protected get_i18n_scope ( string $scope ) : string
$scope string
return string

get_permissions_in_scope() protected method

Return a list of permissions a scope allows.
Since: 2.4.0
protected get_permissions_in_scope ( string $scope ) : array
$scope string
return array

handle_auth_requests() public method

Handle auth requests.
Since: 2.4.0

make_validation() protected method

Make validation.
Since: 2.4.0
protected make_validation ( )

post_consumer_data() protected method

Post consumer data.
Since: 2.4.0
protected post_consumer_data ( array $consumer_data, string $url ) : boolean
$consumer_data array
$url string
return boolean