Automattic\WooCommerce\StoreApi\Schemas

ExtendSchema::register_payment_requirements()publicWC 1.0

Registers and validates payment requirements callbacks.

{} Это метод класса: ExtendSchema{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$ExtendSchema = new ExtendSchema();
$ExtendSchema->register_payment_requirements( $args );
$args(массив) (обязательный)

Array of registration data.

  • data_callback(callable)
    Required. Callback executed to add payment requirements data.

Код ExtendSchema::register_payment_requirements() WC 6.8.0

public function register_payment_requirements( $args ) {
	if ( empty( $args['data_callback'] ) || ! is_callable( $args['data_callback'] ) ) {
		$this->throw_exception( '$data_callback must be a callable function.' );
	}
	$this->payment_requirements[] = $args['data_callback'];
}