Automattic\WooCommerce\Internal\ReceiptRendering

ReceiptRenderingRestController::get_schema_for_get_and_post_order_receiptprivateWC 1.0

Get the schema for both the GET and the POST requests.

Method of the class: ReceiptRenderingRestController{}

No Hooks.

Returns

Array[].

Usage

// private - for code of main (parent) class only
$result = $this->get_schema_for_get_and_post_order_receipt(): array;

ReceiptRenderingRestController::get_schema_for_get_and_post_order_receipt() code WC 10.3.3

private function get_schema_for_get_and_post_order_receipt(): array {
	$schema               = $this->get_base_schema();
	$schema['properties'] = array(
		'receipt_url'     => array(
			'description' => __( 'Public url of the receipt.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'expiration_date' => array(
			'description' => __( 'Expiration date of the receipt, formatted as yyyy-mm-dd.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
	);

	return $schema;
}