Addenda10 TransactionTypeCode
Addenda10 TransactionTypeCode
@@ -34,6 +34,7 @@ var (
// IAT
msgForeignExchangeIndicator = "is an invalid Foreign Exchange Indicator"
msgForeignExchangeReferenceIndicator = "is an invalid Foreign Exchange Reference Indicator"
+ msgAddenda10TransactionTypeCode = "is an invalid Addenda10 Transaction Type Code"
)
// validator is common validation and formatting of golang types to ach type strings
@@ -364,6 +365,21 @@ func (v *validator) isTransactionCode(code int) error {
return errors.New(msgTransactionCode)
}
+// isTransactionTypeCode verifies Addenda10 TransactionTypeCode is a valid value
+// ANN = Annuity, BUS = Business/Commercial, DEP = Deposit, LOA = Loan, MIS = Miscellaneous, MOR = Mortgage
+// PEN = Pension, RLS = Rent/Lease, REM = Remittance2, SAL = Salary/Payroll, TAX = Tax, TEL = Telephone-Initiated Transaction
+// WEB = Internet-Initiated Transaction, ARC = Accounts Receivable Entry, BOC = Back Office Conversion Entry,
+// POP = Point of Purchase Entry, RCK = Re-presented Check Entry
+func (v *validator) isTransactionTypeCode(s string) error {
+ switch s {
+ case "ANN", "BUS", "DEP", "LOA", "MIS", "MOR",
+ "PEN", "RLS", "REM", "SAL", "TAX", "TEL", "WEB",
+ "ARC", "BOC", "POP", "RCK":
+ return nil
+ }
+ return errors.New(msgAddenda10TransactionTypeCode)
+}
+
// isUpperAlphanumeric checks if string only contains ASCII alphanumeric upper case characters
func (v *validator) isUpperAlphanumeric(s string) error {
if upperAlphanumericRegex.MatchString(s) {
