WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CheckoutSchema::get_checkout_response() protected WC 1.0

Get the checkout response based on the current order and any payments.

{} It's a method of the class: CheckoutSchema{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_checkout_response( $order, $payment_result );
$order(WC_Order) (required)
Order object.
$payment_result(PaymentResult)
Payment result object.
Default: null

Code of CheckoutSchema::get_checkout_response() WC 5.6.0

protected function get_checkout_response( \WC_Order $order, PaymentResult $payment_result = null ) {
	return [
		'order_id'         => $order->get_id(),
		'status'           => $order->get_status(),
		'order_key'        => $order->get_order_key(),
		'customer_note'    => $order->get_customer_note(),
		'customer_id'      => $order->get_customer_id(),
		'billing_address'  => $this->billing_address_schema->get_item_response( $order ),
		'shipping_address' => $this->shipping_address_schema->get_item_response( $order ),
		'payment_method'   => $order->get_payment_method(),
		'payment_result'   => [
			'payment_status'  => $payment_result->status,
			'payment_details' => $this->prepare_payment_details_for_response( $payment_result->payment_details ),
			'redirect_url'    => $payment_result->redirect_url,
		],
	];
}