public function getLastInitialTransactionAttempt() {
    $lastAttempt = null;

    if (isset($this->transactions) && is_array($this->transactions) && count($this->transactions) > 0) {
      // Return the entry with the highest timestamp with type sale, authorize,
      // or submission
      foreach ($this->transactions as $transaction) {
        if (in_array($transaction->getOperation(), array("sale", "authorize", "submission")) && $transaction->getRefTransactionID() == null) {
          if ($lastAttempt == null || $lastAttempt->getDate() < $transaction->getDate()) {
            $lastAttempt = $transaction;
          }
        }
      }
    }

    return $lastAttempt;
  }
public function getLastInitialTransactionAttempt() {
    $lastAttempt = null;

    if (isset($this->transactions) && is_array($this->transactions) && count($this->transactions) > 0) {
      // Return the entry with the highest timestamp with type sale, authorize,
      // or submission
      foreach ($this->transactions as $transaction) {
        if (in_array($transaction->getOperation(), array("sale", "authorize", "submission")) && $transaction->getRefTransactionID() == null) {
          if ($lastAttempt == null || $lastAttempt->getDate() < $transaction->getDate()) {
            $lastAttempt = $transaction;
          }
        }
      }
    }

    return $lastAttempt;
  }
public function getLastInitialTransactionAttempt ( ) { $ lastAttempt = null ; if ( isset ( $ this -> transactions ) && is_array ( $ this -> transactions ) && count ( $ this -> transactions ) > 0 ) { // Return the entry with the highest timestamp with type sale, authorize, // or submission foreach ( $ this -> transactions as $ transaction ) { if ( in_array ( $ transaction -> getOperation ( ) , array ( "sale" , "authorize" , "submission" ) ) && $ transaction -> getRefTransactionID ( ) == null ) { if ( $ lastAttempt == null || $ lastAttempt -> getDate ( ) < $ transaction -> getDate ( ) ) { $ lastAttempt = $ transaction ; } } } } return $ lastAttempt ; }
Return the last initial transaction attempt done for this payment.
Only returns sale, authorize or submission. Transactions with a referral
are not considered by this method, only initial transactions done by the
customer to complete the payment.

@return TransactionAttempt The last transaction attempt done for this
payment
Return the last initial transaction attempt done for this payment . Only returns sale authorize or submission . Transactions with a referral are not considered by this method only initial transactions done by the customer to complete the payment .