}
if ($processor_data['processor_params']['mode'] == 'test') {
    $service->SetTestMode(TRUE);
}
if ($transaction_types[$trans_type] == 'AUTH_CAPTURE') {
    $service_response = $service->PerformPurchase($request, $response);
    $transaction_type = 'sale';
} elseif ($transaction_types[$trans_type] == 'AUTH_ONLY') {
    $service_response = $service->PerformAuthOnly($request, $response);
    $transaction_type = 'auth';
}
// Gateway answered
$pp_response = array();
if ($response->Get(GatewayResponse::RESPONSE_CODE()) == GatewayCodes__RESPONSE_SUCCESS) {
    // check CVV2 response
    $cvv_code = $response->Get(GatewayResponse::CVV2_CODE());
    switch ($cvv_code) {
        case 'N':
        case 'P':
        case 'S':
        case 'U':
            $pp_response['order_status'] = 'F';
            $pp_response['reason_text'] = $processor_error['cvv'][$cvv_code];
            break;
        default:
            $pp_response['order_status'] = 'P';
            $pp_response['reason_text'] = '';
            break;
    }
} else {
    $pp_response['order_status'] = 'F';