LLMS_Order::get_switch_source_action()

Retrieves the user action required when changing the order’s payment source.


Return Return

(null|string) Returns switch when the payment source can be switched and pay when payment on the new source is required before switching. A null return indicates that the order's payment source cannot be switched.


Top ↑

Source Source

File: includes/models/model.llms.order.php

	public function get_switch_source_action() {

		$action = null;
		if ( $this->can_switch_source() ) {
			$action = in_array( $this->get( 'status' ), array( 'llms-active', 'llms-pending-cancel' ), true ) ? 'switch' : 'pay';
		}

		/**
		 * Filters the required user action for the order when switching the order's payment source.
		 *
		 * @since 7.0.0
		 *
		 * @param null|string $action The switch action ID or `null` when the payment source cannot be switched.
		 * @param LLMS_Order  $order  The order object.
		 */
		return apply_filters( 'llms_order_switch_source_action', $action, $this );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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