llms_can_gateway_be_used_for_plan( string $gateway_id, LLMS_Access_Plan $plan )

Determine if a gateway can be used for a given LLMS_Access_Plan.


Parameters Parameters

$gateway_id

(string) (Required) LLMS_Payment_Gateway ID.

$plan

(LLMS_Access_Plan) (Required) The access plan.


Top ↑

Return Return

(WP_Error|bool) WP_Error on error, true on success.


Top ↑

Source Source

File: includes/functions/llms.functions.order.php

function llms_can_gateway_be_used_for_plan( $gateway_id, $plan ) {

	$can_be_used = llms_can_gateway_be_used_for_plan_or_order( $gateway_id, $plan, true, ( 'manual' !== $gateway_id ) );

	/**
	 * Filters whether or not a gateway can be used for a given access plan.
	 *
	 * @since 3.29.0
	 * @since 7.0.0 The filter now runs on all possible return values instead of running only when the gateway can be used.
	 *
	 * @param boolean|WP_Error $can_be_used Whether or not the gateway can be used for the plan. This value will be `true`
	 *                                      when the gateway can be used an an error object when it cannot.
	 * @param string           $gateway_id  The LLMS_Payment_Gateway ID.
	 * @param LLMS_Access_plan $plan        The access plan object.
	 */
	return apply_filters( 'llms_can_gateway_be_used_for_plan', $can_be_used, $gateway_id, $plan );

}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Updated to utilize llms_can_gateway_be_used_for_plan_or_order().
3.29.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.