Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\PaymentGateways\Schema

AbstractPaymentGatewaySettingsSchema::get_item_schema_propertiespublicWC 1.0

Return all properties for the item schema.

Note that context determines under which context data should be visible. For example, edit would be the context used when getting records with the intent of editing them. embed context allows the data to be visible when the item is being embedded in another response.

Method of the class: AbstractPaymentGatewaySettingsSchema{}

No Hooks.

Returns

Array.

Usage

$AbstractPaymentGatewaySettingsSchema = new AbstractPaymentGatewaySettingsSchema();
$AbstractPaymentGatewaySettingsSchema->get_item_schema_properties(): array;

AbstractPaymentGatewaySettingsSchema::get_item_schema_properties() code WC 10.4.3

public function get_item_schema_properties(): array {
	return array(
		'id'                 => array(
			'description' => __( 'Payment gateway ID.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_CONTEXT,
			'readonly'    => true,
		),
		'title'              => array(
			'description' => __( 'Payment gateway title on checkout.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_CONTEXT,
		),
		'description'        => array(
			'description' => __( 'Payment gateway description on checkout.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_CONTEXT,
		),
		'order'              => array(
			'description' => __( 'Payment gateway sort order.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => self::VIEW_EDIT_CONTEXT,
			'arg_options' => array(
				'sanitize_callback' => 'absint',
			),
		),
		'enabled'            => array(
			'description' => __( 'Payment gateway enabled status.', 'woocommerce' ),
			'type'        => 'boolean',
			'context'     => self::VIEW_EDIT_CONTEXT,
		),
		'method_title'       => array(
			'description' => __( 'Payment gateway method title.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_CONTEXT,
			'readonly'    => true,
		),
		'method_description' => array(
			'description' => __( 'Payment gateway method description.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => self::VIEW_EDIT_CONTEXT,
			'readonly'    => true,
		),
		'method_supports'    => array(
			'description' => __( 'Supported features for this payment gateway.', 'woocommerce' ),
			'type'        => 'array',
			'context'     => self::VIEW_EDIT_CONTEXT,
			'readonly'    => true,
			'items'       => array(
				'type' => 'string',
			),
		),
		'values'             => array(
			'description'          => __( 'Flat key-value mapping of all setting field values.', 'woocommerce' ),
			'type'                 => 'object',
			'context'              => array( 'view', 'edit' ),
			'additionalProperties' => array(
				'description' => __( 'Setting field value.', 'woocommerce' ),
				'type'        => array( 'string', 'number', 'array', 'boolean' ),
			),
		),
		'groups'             => array(
			'description'          => __( 'Collection of setting groups.', 'woocommerce' ),
			'type'                 => 'object',
			'context'              => array( 'view', 'edit' ),
			'additionalProperties' => array(
				'type'        => 'object',
				'description' => __( 'Settings group.', 'woocommerce' ),
				'properties'  => array(
					'title'       => array(
						'description' => __( 'Group title.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => array( 'view', 'edit' ),
					),
					'description' => array(
						'description' => __( 'Group description.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => array( 'view', 'edit' ),
					),
					'order'       => array(
						'description' => __( 'Display order for the group.', 'woocommerce' ),
						'type'        => 'integer',
						'context'     => array( 'view', 'edit' ),
						'readonly'    => true,
					),
					'fields'      => array(
						'description' => __( 'Settings fields.', 'woocommerce' ),
						'type'        => 'array',
						'context'     => array( 'view', 'edit' ),
						'items'       => $this->get_field_schema(),
					),
				),
			),
		),
	);
}