ClassesBigCommerceApiAPI Scopes Validator

Api_Scopes_Validator

Validates the API scopes for several resources, ensuring that the correct permissions are in place during the onboarding process. This includes validating scopes for customers, orders, and payment methods.

Constants

ConstantVisibilityTypeValue
CUSTOMERS_RESOURCEpublicstring’/customers’
MARKETING_RESOURCEpublicstring’/gift_certificates’
ORDERS_RESOURCEpublicstring’/orders’
PAYMENT_METHODS_RESOURCEpublicstring’/payments/methods’

Methods

validate

Validates scopes for several API items to ensure that the necessary permissions are in place during the onboarding process.

public validate(): bool

This method checks the scopes for customers, orders, and payment methods and throws an exception if any of them are invalid.

Return Value:

Returns true if all scopes are valid.

Throws:

If any of the scopes are invalid.


Inherited methods

__construct

Constructor

public __construct(\BigCommerce\Api\Base_Client $apiClient): mixed

Initializes the API client instance to be used in making requests.

Parameters:

ParameterTypeDescription
$apiClient\BigCommerce\Api\Base_ClientThe API client to use.

__call

Magic method to call methods on the client class.

public __call(string $method, array $args): mixed

Dynamically calls methods on the client class if available. Throws an exception if the method does not exist.

Parameters:

ParameterTypeDescription
$methodstringThe method name to call.
$argsarrayThe arguments to pass to the method.

Return Value:

The result of the method call.

Throws:

If the method is not found.


get_store_hash

Retrieve the store hash from the API client configuration.

protected get_store_hash(): string

Extracts the store hash from the API client’s configuration using the host URL.

Return Value:

The store hash.



Automatically generated on 2025-01-21