Automattic\WooCommerce\StoreApi\Routes\V1
Checkout::build_draft_route_response
Build a checkout response for a session with no order in flight.
Method of the class: Checkout{}
No Hooks.
Returns
\WP_REST_Response.
Usage
// private - for code of main (parent) class only $result = $this->build_draft_route_response( $request );
- $request(WP_REST_Request) (required)
- Request object.
Checkout::build_draft_route_response() Checkout::build draft route response code WC 11.0.0
private function build_draft_route_response( \WP_REST_Request $request ) {
/**
* Narrow the parent-declared schema property to the checkout subclass for phpstan.
*
* @var \Automattic\WooCommerce\StoreApi\Schemas\V1\CheckoutSchema $schema
*/
$schema = $this->schema;
return new \WP_REST_Response(
$schema->get_draft_response(
$this->cart_controller->get_cart_instance(),
wc()->customer
)
);
}