public function mark_referral_complete($transaction, $old_status, $old_status_cleared, $new_status) { $new_status = it_exchange_get_transaction_status($transaction->ID); $new_status_cleared = it_exchange_transaction_is_cleared_for_delivery($transaction->ID); if ($new_status != $old_status && !$old_status_cleared && $new_status_cleared) { $this->complete_referral($transaction->ID); } }
/** * Returns a boolean. Is this transaction a status that warrants delivery of any products attached to it? * * @since unreleased * * @param boolean $cleared passed in through WP filter. Ignored here. * @param mixed $transaction * * @return boolean */ public static function transaction_is_cleared_for_delivery($cleared, $transaction) { return Pronamic_WP_Pay_Extensions_IThemesExchange_IThemesExchange::ORDER_STATUS_PAID === it_exchange_get_transaction_status($transaction); }