Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
User automatically getting signed out after calling a SOAP API in Laravel 8

I'm working on a Laravel 8 project. Here I need to integrate a SOAP API. Calling of the url is working and callback url is also working. But problem is when I'm calling the API URL, user automatically getting signed out. Badly need to fix this issue. Here is my controller for calling the API. Thanks in advance.

public function dbblpay(Request $req){
    $errmsg = "";
    $userid = '*******';
    $pwd    = '**********';
    
    $dbblurl = "https://ecomtest.dutchbanglabank.com";
    
    try {   
            $txnrefnum = $req->payref;
            $clientIp = $_SERVER['REMOTE_ADDR'];
            $cardType = $req->optcard;
            $totalamount = $req->total; 
            
            $wsdlUrl = $dbblurl.'/ecomws/dbblecomtxn?wsdl';
            $options = array(
            'cache_wsdl' => 0,
            'trace' => 1,
            'stream_context' => stream_context_create(array(
                  'ssl' => array(
                        'verify_peer' => false,
                        'verify_peer_name' => false,
                        'allow_self_signed' => true
                  )
            )));
            $client = new SoapClient($wsdlUrl, $options);
            $cParameters = array(
            'userid' => $userid,
            'pwd' => $pwd,
            'amount' => $totalamount,
            'cardtype' => $cardType,
            'txnrefnum' => $txnrefnum,
            'clientip' => $clientIp
            );
    
            $result = $client->getransid($cParameters);
                
            foreach ($result as $value)
            $TRANSACTION_ID = "N/A"; 
            $part1 = "";
            $part2 = "";
            $errmsg = '';
            
            if (strpos($value,"TRANSACTION_ID") !== false) {
            
                $arr = explode(":",$value);
                $part1 = $arr[0];
                $part2 = $arr[1];
                if ($part1 == "TRANSACTION_ID") {
                    $TRANSACTION_ID = $part2;
                    $_SESSION['trans_id'] = $TRANSACTION_ID;
                    setcookie('trans_id',$TRANSACTION_ID,time()+300,"/");
                    $trans_id_en = urlencode($TRANSACTION_ID);
    
                    header("Location: ".$dbblurl."/ecomm2/ClientHandler?card_type=".$cardType."&trans_id=".$trans_id_en);
                    exit();
    
                } else {
                    $errmsg = $value;
                    return view('dbbl.dbblcheckout', compact('errmsg'));
                } 
           } else {
                $errmsg = $value;
                return view('dbbl.dbblcheckout', compact('errmsg'));
           }
    
    } catch(Exception $e) {
        $errmsg =  "System Problem";
    }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I figured out the problem for myself.

In the config/session.php file I changed the configuration from 'same_site' => "strict", to 'same_site' => "lax", And it worked for me.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda