LLMS_Order::can_be_retried()

Determine if the order can be retried for recurring payments


Description Description


Return Return

(boolean)


Top ↑

Source Source

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

	public function can_be_retried() {

		// only recurring orders can be retried
		if ( ! $this->is_recurring() ) {
			return false;
		}

		if ( 'yes' !== get_option( 'lifterlms_recurring_payment_retry', 'yes' ) ) {
			return false;
		}

		// only active & on-hold orders qualify for a retry
		if ( ! in_array( $this->get( 'status' ), array( 'llms-active', 'llms-on-hold' ) ) ) {
			return false;
		}

		// if the gateway isn't active or the gateway doesn't support recurring retries
		$gateway = $this->get_gateway();
		if ( is_wp_error( $gateway ) || ! $gateway->supports( 'recurring_retry' ) ) {
			return false;
		}

		// if we're here, we can retry
		return true;

	}

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.





Permalink: