WooCommerce Code Reference

WC_Auth
in package

Auth class.

Table of Contents

VERSION  = 1
Version.
__construct()  : mixed
Setup class.
add_endpoint()  : mixed
Add auth endpoint.
add_query_vars()  : string[]
Add query vars.
handle_auth_requests()  : mixed
Handle auth requests.
auth_endpoint()  : mixed
Auth endpoint.
build_url()  : string
Build auth urls.
create_keys()  : array
Create keys.
get_formatted_url()  : string
Decode and format a URL.
get_i18n_scope()  : string
Get scope name.
get_permissions_in_scope()  : array
Return a list of permissions a scope allows.
make_validation()  : mixed
Make validation.
post_consumer_data()  : bool
Post consumer data.
maybe_delete_key()  : mixed
Maybe delete key.

Constants

Methods

add_endpoint()

Add auth endpoint.

public static add_endpoint() : mixed
Tags
since
2.4.0
Return values
mixed

add_query_vars()

Add query vars.

public add_query_vars(array $vars) : string[]
Parameters
$vars : array

Query variables.

Tags
since
2.4.0
Return values
string[]

handle_auth_requests()

Handle auth requests.

public handle_auth_requests() : mixed
Tags
since
2.4.0
throws
Exception

When auth_endpoint validation fails.

Return values
mixed

auth_endpoint()

Auth endpoint.

protected auth_endpoint(string $route) : mixed
Parameters
$route : string

Route.

Tags
since
2.4.0
throws
Exception

When validation fails.

Return values
mixed

build_url()

Build auth urls.

protected build_url(array $data, string $endpoint) : string
Parameters
$data : array

Data to build URL.

$endpoint : string

Endpoint.

Tags
since
2.4.0
Return values
string

create_keys()

Create keys.

protected create_keys(string $app_name, string $app_user_id, string $scope) : array
Parameters
$app_name : string

App name.

$app_user_id : string

User ID.

$scope : string

Scope.

Tags
since
2.4.0
Return values
array

get_formatted_url()

Decode and format a URL.

protected get_formatted_url(string $url) : string
Parameters
$url : string

URL.

Return values
string

get_i18n_scope()

Get scope name.

protected get_i18n_scope(string $scope) : string
Parameters
$scope : string

Permission scope.

Tags
since
2.4.0
Return values
string

get_permissions_in_scope()

Return a list of permissions a scope allows.

protected get_permissions_in_scope(string $scope) : array
Parameters
$scope : string

Permission scope.

Tags
since
2.4.0
Return values
array

make_validation()

Make validation.

protected make_validation() : mixed
Tags
since
2.4.0
throws
Exception

When validate fails.

Return values
mixed

post_consumer_data()

Post consumer data.

protected post_consumer_data(array $consumer_data, string $url) : bool
Parameters
$consumer_data : array

Consumer data.

$url : string

URL.

Tags
since
2.4.0
throws
Exception

When validation fails.

Return values
bool

maybe_delete_key()

Maybe delete key.

private maybe_delete_key(array $key) : mixed
Parameters
$key : array

Key.

Tags
since
2.4.0
Return values
mixed