Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Controller_Orders::validate_selected_gateway( string $gateway_id, LLMS_Access_Plan $plan )

Validate a gateway can be used to process the current action / transaction.


Parameters Parameters

$gateway_id

(string) (Required) Gateway's id.

$plan

(LLMS_Access_Plan) (Required) Instance of the LLMS_Access_Plan related to the action/transaction.


Top ↑

Return Return

(WP_Error|LLMS_Payment_Gateway) WP_Error or LLMS_Payment_Gateway subclass.


Top ↑

Source Source

File: includes/controllers/class.llms.controller.orders.php

		/**
		 * Fired when a LifterLMS order or transaction changes status.
		 *
		 * The first dynamic portion of this hook, `$post_type`, refers to the unprefixed object post type ('order|transaction').
		 * The second dynamic portion of this hook, `$new_status`, refers to the new object status.
		 *
		 * @since Unknown
		 *
		 * @param LLMS_Order|LLMS_Transaction $object     The LifterLMS order or transaction instance.
		 * @param string                      $old_status The previous order or transaction status.
		 * @param string                      $new_status The new order or transaction status.
		 */
		do_action( "lifterlms_{$post_type}_status_{$new_status}", $obj, $old_status, $new_status );

	}

	/**
	 * Validate a gateway can be used to process the current action / transaction.
	 *
	 * @since 3.10.0
	 *
	 * @param string           $gateway_id Gateway's id.
	 * @param LLMS_Access_Plan $plan       Instance of the LLMS_Access_Plan related to the action/transaction.
	 * @return WP_Error|LLMS_Payment_Gateway WP_Error or LLMS_Payment_Gateway subclass.
	 */
	private function validate_selected_gateway( $gateway_id, $plan ) {

		$gateway = llms()->payment_gateways()->get_gateway_by_id( $gateway_id );
		$err     = new WP_Error();

		// Valid gateway.
		if ( is_subclass_of( $gateway, 'LLMS_Payment_Gateway' ) ) {



Top ↑

Changelog Changelog

Changelog
Version Description
3.10.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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