ClassesBigCommerceCartCheckout

Checkout

Handles requests during checkout from the Buy Now button for products.

  • Full name: \BigCommerce\Cart\Checkout

Constants

ConstantVisibilityTypeValue
ACTIONpublicstring’checkout’

Methods

__construct

Constructor.

public __construct(\BigCommerce\Api_Factory $api_factory): mixed

Parameters:

ParameterTypeDescription
$api_factory\BigCommerce\Api_FactoryFactory for creating API clients.

handle_request

Handle the request for redirecting to checkout.

public handle_request(string $cart_id, \BigCommerce\Api\v3\Api\CartApi $cart_api): void

This method processes a checkout request based on the provided cart ID and redirects the user to the appropriate checkout page or URL. If the cart ID is missing or an error occurs, an error is displayed to the user.

Parameters:

ParameterTypeDescription
$cart_idstringThe ID of the cart to check out.
$cart_api\BigCommerce\Api\v3\Api\CartApiThe BigCommerce Cart API client.


Automatically generated on 2025-01-21