question: 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 ) ; }
target:  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().