Automattic\WooCommerce\StoreApi\Schemas

ExtendSchema::register_payment_requirements()publicWC 1.0

Registers and validates payment requirements callbacks.

Method of the class: ExtendSchema{}

No Hooks.

Return

null. Nothing (null).

Usage

$ExtendSchema = new ExtendSchema();
$ExtendSchema->register_payment_requirements( $args );
$args(array) (required)

Array of registration data.

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

ExtendSchema::register_payment_requirements() code WC 9.4.2

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'];
}