# some vendors encode the account number as the SAN.
# starting with the san value, then the account value,
# treat each as a san, then an acct number until the first success
- for my $buyer ( ($msg_hash->{buyer_san}, $msg_hash->{buyer_acct}) ) {
+ for my $buyer ( ($msg_hash->{buyer_san},
+ $msg_hash->{buyer_acct}, $msg_hash->{buyer_ident}) ) {
+
next unless $buyer;
# some vendors encode the SAN as "$SAN $vendcode"
message_type => qr/^UNH\+[A-z0-9]+\+(\S{6})/,
buyer_san => qr/^NAD\+BY\+([^:]+)::31B/,
buyer_acct => qr/^NAD\+BY\+([^:]+)::91/,
+ buyer_ident => qr/^NAD\+BY\+([^:]+)::9$/, # alternate SAN
buyer_code => qr/^RFF\+API:(\S+)/,
vendor_san => qr/^NAD\+SU\+([^:]+)::31B/,
vendor_acct => qr/^NAD\+SU\+([^:]+)::91/,
+ vendor_ident => qr/^NAD\+SU\+([^:]+)::9$/, # alternate SAN
purchase_order => qr/^RFF\+ON:(\S+)/,
invoice_ident => qr/^BGM\+380\+([^\+]+)/,
total_billed => qr/^MOA\+86:([^:]+)/,