ClassesBigCommerceRestCoupon Code Controller

Coupon_Code_Controller

Methods

__construct

Rest_Controller constructor.

public __construct(string $namespace_base, string $version, string $rest_base, \BigCommerce\Api\v3\Api\CheckoutApi $checkout_api, \BigCommerce\Api\v3\Api\CartApi $cart_api): mixed

Parameters:

ParameterTypeDescription
$namespace_basestring
$versionstring
$rest_basestring
$checkout_api\BigCommerce\Api\v3\Api\CheckoutApi
$cart_api\BigCommerce\Api\v3\Api\CartApi

js_config

Add data to the JS config to support cart ajax

public js_config(array $config): array

Parameters:

ParameterTypeDescription
$configarray

register_routes

public register_routes(): mixed

get_permissions_check

Checks if a given request has access to read the rendered shortcodes.

public get_permissions_check(\WP_REST_Request $request): true|\WP_Error

Parameters:

ParameterTypeDescription
$request\WP_REST_RequestFull details about the request.

Return Value:

True if the request has read access, WP_Error object otherwise.


apply_coupon_code

public apply_coupon_code(\WP_REST_Request $request): \WP_REST_Response|\WP_Error

Parameters:

ParameterTypeDescription
$request\WP_REST_RequestFull details about the request.

Return Value:

Response object on success, or WP_Error object on failure.


delete_coupon_code

public delete_coupon_code(\WP_REST_Request $request): \WP_REST_Response|\WP_Error

Parameters:

ParameterTypeDescription
$request\WP_REST_RequestFull details about the request.

Return Value:

Response object on success, or WP_Error object on failure.


Inherited methods

__construct

Rest_Controller constructor.

public __construct(string $namespace_base, string $version, string $rest_base): mixed

Parameters:

ParameterTypeDescription
$namespace_basestring
$versionstring
$rest_basestring

get_namespace

protected get_namespace(): mixed

get_base_url

public get_base_url(): mixed

parse_result

protected parse_result(mixed $response, mixed $client, mixed $rest_response = true): mixed

Parameters:

ParameterTypeDescription
$responsemixed
$clientmixed
$rest_responsemixed


Automatically generated on 2025-01-21