Automattic\WooCommerce\StoreApi\Routes\V1
Checkout::get_args
Get method arguments for this REST route.
Method of the class: Checkout{}
No Hooks.
Returns
array. An array of endpoints.
Usage
$Checkout = new Checkout(); $Checkout->get_args();
Checkout::get_args() Checkout::get args code WC 11.1.2
public function get_args() {
return [
[
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'context' => $this->get_context_param( [ 'default' => 'view' ] ),
],
],
[
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => array_merge(
[
'payment_data' => [
'description' => __( 'Data to pass through to the payment method when processing payment.', 'woocommerce' ),
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'key' => [
'type' => 'string',
],
'value' => [
'type' => [ 'string', 'boolean' ],
],
],
],
],
'customer_password' => [
'description' => __( 'Customer password for new accounts, if applicable.', 'woocommerce' ),
'type' => 'string',
],
'expected_total' => [
'description' => __( 'The order total the shopper confirmed on the client, as a string in the smallest unit of the store currency (e.g. cents), matching the cart `totals.total_price` format. When provided, the order is rejected if the total calculated on the server no longer matches it, protecting the shopper from being charged an unexpected amount.', 'woocommerce' ),
'type' => 'string',
// Digits only. The value is compared as an integer, so decimals or stray characters would silently weaken the check.
'pattern' => '^[0-9]+$',
'validate_callback' => 'rest_validate_request_arg',
],
],
$this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE )
),
],
[
'methods' => \WP_REST_Server::EDITABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => array_merge(
[
'additional_fields' => [
'description' => __( 'Additional fields related to the order.', 'woocommerce' ),
'type' => 'object',
],
'payment_method' => [
'description' => __( 'Selected payment method for the order.', 'woocommerce' ),
'type' => 'string',
],
'order_notes' => [
'description' => __( 'Order notes.', 'woocommerce' ),
'type' => 'string',
],
],
$this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::EDITABLE )
),
],
'schema' => [ $this->schema, 'get_public_item_schema' ],
'allow_batch' => [ 'v1' => true ],
];
}