+ my $data_string = join("", values %post_data);
+
+ my $encap_character;
+ # The first set of characters here are recommended by authorize.net in their
+ # encapsulating character example.
+ # The second set we made up hoping they will work if the first fail.
+ # The third chr(31) is the binary 'unit separator' and is our final last
+ # ditch effort to find something not in the input.
+ foreach my $char( qw( | " ' : ; / \ - * ), '#', qw( ^ + < > [ ] ~), chr(31) ){
+ if( index($data_string, $char) == -1 ){ # found one.
+ $encap_character = $char;
+ last;
+ }
+ }
+
+ if(!$encap_character){
+ $self->is_success(0);
+ $self->error_message(
+ "DEBUG: Input contains all encapsulating characters."
+ . " Please remove | or ^ from your input if possible."
+ );
+ return;
+ }
+