public static boolean isPaymentType(GenericValue payment,String inputTypeId) throws GenericEntityException {
  if (payment == null) {
    return false;
  }
  GenericValue paymentType=payment.getRelatedOne("PaymentType",true);
  if (paymentType == null) {
    throw new GenericEntityException("Cannot find PaymentType for paymentId " + payment.getString("paymentId"));
  }
  String paymentTypeId=paymentType.getString("paymentTypeId");
  if (inputTypeId.equals(paymentTypeId)) {
    return true;
  }
  return isPaymentTypeRecurse(paymentType,inputTypeId);
}

public static boolean isPaymentType ( GenericValue payment , String inputTypeId ) throws GenericEntityException { if ( payment == null ) { return false ; } GenericValue paymentType = payment . getRelatedOne ( "PaymentType" , true ) ; if ( paymentType == null ) { throw new GenericEntityException ( "Cannot find PaymentType for paymentId " + payment . getString ( "paymentId" ) ) ; } String paymentTypeId = paymentType . getString ( "paymentTypeId" ) ; if ( inputTypeId . equals ( paymentTypeId ) ) { return true ; } return isPaymentTypeRecurse ( paymentType , inputTypeId ) ; }
checks if a payment is of a specified paymenttype . paymenttypeid . return false if payment is null . it ' s better to use the more specific calls like istaxpayment ( ) .
