protected function checkPaymentTransactionStatus(PaymentTransaction $paymentTransaction)
    {
        if (!$paymentTransaction->isFinished())
        {
            throw new ValidationException('Only finished payment transaction can be used for create-card-ref-id');
        }

        if (!$paymentTransaction->getPayment()->isPaid())
        {
            throw new ValidationException("Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first");
        }
    }
protected function checkPaymentTransactionStatus(PaymentTransaction $paymentTransaction)
    {
        if (!$paymentTransaction->isFinished())
        {
            throw new ValidationException('Only finished payment transaction can be used for create-card-ref-id');
        }

        if (!$paymentTransaction->getPayment()->isPaid())
        {
            throw new ValidationException("Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first");
        }
    }
protected function checkPaymentTransactionStatus ( PaymentTransaction $ paymentTransaction ) { if ( ! $ paymentTransaction -> isFinished ( ) ) { throw new ValidationException ( 'Only finished payment transaction can be used for create-card-ref-id' ) ; } if ( ! $ paymentTransaction -> getPayment ( ) -> isPaid ( ) ) { throw new ValidationException ( "Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first" ) ; } }
Check, if payment transaction is finished and payment is not new.

@param       PaymentTransaction      $paymentTransaction     Payment transaction for checking
Check if payment transaction is finished and payment is not new .