- avsZip => substr($_->zip, 0, 10),
- avsAddress1 => substr($_->address1, 0, 30),
- avsAddress2 => substr($_->address2, 0, 30),
- avsCity => substr($_->city, 0, 20),
- avsState => $_->state,
- avsName => substr($_->first . ' ' . $_->last, 0, 30),
- avsCountryCode => ( $paymentech_countries{ $_->country }
- ? $_->country
- : ''
- ),
- orderID => $_->paybatchnum,
- amount => $_->amount * 100,
+ avsZip => bytes_substr($_->zip, 0, 10),
+ avsAddress1 => bytes_substr($_->address1, 0, 30),
+ avsAddress2 => bytes_substr($_->address2, 0, 30),
+ avsCity => bytes_substr($_->city, 0, 20),
+ avsState => bytes_substr($_->state, 0, 2),
+ avsName => bytes_substr($_->first. ' '. $_->last, 0, 30),
+ ( $paymentech_countries{ $_->country }
+ ? ( avsCountryCode => $_->country )
+ : ()
+ ),
+ orderID => $_->paybatchnum,
+ amount => $_->amount * 100,