Tribe__Tickets__Commerce__PayPal__Main::is_active()

Whether PayPal tickets will be available as a provider or not.

This will take into account the enable/disable option and the configuration status of the current payment handler (IPN or PDT).


Return

(bool)


Top ↑

Source

File: src/Tribe/Commerce/PayPal/Main.php

	public function is_active() {
		/**
		 * Filters the check for the active status of the PayPal tickets module.
		 *
		 * Returning a non `null` value in this filter will override the default checks.
		 *
		 * @since 4.7
		 *
		 * @param bool                                   $is_active
		 * @param Tribe__Tickets__Commerce__PayPal__Main $this
		 */
		$is_active = apply_filters( 'tribe_tickets_commerce_paypal_is_active', null, $this );

		if ( null !== $is_active ) {
			return (bool) $is_active;
		}

		/** @var Tribe__Tickets__Commerce__PayPal__Gateway $gateway */
		$gateway = tribe( 'tickets.commerce.paypal.gateway' );
		/** @var Tribe__Tickets__Commerce__PayPal__Handler__Interface $handler */
		$handler = $gateway->build_handler();

		return tribe_is_truthy( tribe_get_option( 'ticket-paypal-enable', false ) )
		       && 'complete' === $handler->get_config_status();
	}

Top ↑

Changelog

Changelog
Version Description
4.7 Introduced.