LLMS_Transaction::get_gateway()

Retrieves the payment gateway instance for the transactions payment gateway.


Return Return

(LLMS_Payment_Gateway|WP_Error)


Top ↑

Source Source

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

	public function get_gateway() {

		$gateways = llms()->payment_gateways();
		$gateway  = $gateways->get_gateway_by_id( $this->get( 'payment_gateway' ) );
		if ( $gateway && $gateway->is_enabled() || is_admin() ) {
			return $gateway;
		}

		// Translators: %s = The payment gateway ID.
		return new WP_Error(
			'error',
			sprintf(
				__( 'Payment gateway %s could not be located or is no longer enabled', 'lifterlms' ),
				$this->get( 'payment_gateway' )
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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