LLMS_Controller_Orders::transaction_succeeded( LLMS_Transaction $txn )

When a transaction succeeds, update the parent order’s status.


Parameters Parameters

$txn

(LLMS_Transaction) (Required) Instance of the LLMS_Transaction.


Top ↑

Return Return

(void)


Top ↑

Source Source

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

	public function transaction_succeeded( $txn ) {

		// Get the order.
		$order = $txn->get_order();

		// Halt if legacy.
		if ( $order->is_legacy() ) {
			return; }

		// Update the status based on the order type.
		$status = $order->is_recurring() ? 'llms-active' : 'llms-completed';
		$order->set( 'status', $status );
		$order->set( 'last_retry_rule', '' ); // Retries should always start with tne first rule for new transactions.

		// Maybe schedule a payment.
		$order->maybe_schedule_payment();

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.10.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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