Automattic\WooCommerce\StoreApi\Schemas
ExtendSchema::register_payment_requirements()
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.
- data_callback(callable)
ExtendSchema::register_payment_requirements() 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']; }