WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

ExtendRestApi::get_payment_requirements() public WC 1.0

Returns the additional payment requirements.

{} It's a method of the class: ExtendRestApi{}

No Hooks.

Return

Array. Returns a list of payment requirements.

Usage

$ExtendRestApi = new ExtendRestApi();
$ExtendRestApi->get_payment_requirements( $initial_requirements );
$initial_requirements(array)
list of requirements that should be added to the collected requirements.
Default: [ foo ]

Code of ExtendRestApi::get_payment_requirements() WC 5.7.0

public function get_payment_requirements( array $initial_requirements = [ 'products' ] ) {
	$requirements = $initial_requirements;
	if ( empty( $this->payment_requirements ) ) {
		return $initial_requirements;
	}

	foreach ( $this->payment_requirements as $callback ) {
		$data = [];

		try {
			$data = $callback();

			if ( ! is_array( $data ) ) {
				throw new Exception( '$data_callback must return an array.' );
			}
		} catch ( Throwable $e ) {
			$this->throw_exception( $e );
			continue;
		}
		$requirements = array_merge( $requirements, $data );
	}

	return array_unique( $requirements );
}