def check_payment_transaction_status(payment_transaction)
      unless payment_transaction.finished?
        raise ValidationError, 'Only finished payment transaction can be used for create-card-ref-id'
      end

      unless payment_transaction.payment.paid?
        raise ValidationError, "Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first"
      end
    end
def check_payment_transaction_status(payment_transaction)
      unless payment_transaction.finished?
        raise ValidationError, 'Only finished payment transaction can be used for create-card-ref-id'
      end

      unless payment_transaction.payment.paid?
        raise ValidationError, "Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first"
      end
    end
Check, if payment transaction is finished and payment is not new.

 @param    payment_transaction   [PaymentTransaction]    Payment transaction for validation