- }
- # fill in error_message if there is is an error
- if ( !$self->is_success && exists($response->{AdditionalResponseData})) {
- $self->error_message('Error '.$response->{ResponseCode}.': '.$response->{AdditionalResponseData});
- }elsif ( !$self->is_success && exists($response->{Receipt}) ) {
- $self->error_message('Error '.$response->{ResponseCode}.': '.(exists($response->{Receipt})) ? $response->{Receipt} : '');
+ } else { # fill in error_message if there is is an error
+ $self->error_message( 'Error '.$response->{ResponseCode}.': '.
+ ( $response->{AdditionalResponseData}
+ || $response->{Receipt}
+ || $response->{ResultCode}
+ )
+ );