Closed codeom closed 2 years ago
I'm getting an error in my file which says Error: Class 'Dimafe6\BankID\Service\Controller' not found
Error: Class 'Dimafe6\BankID\Service\Controller' not found
I'm using this project in a Laravel framework version is 7,
Here what I did so far,
1) Added the package via using composer command 2) Created the Controller file to access the sign-in method.
When I try to test that controller file I'm getting that error.
Source file
<?php namespace App\Http\Controllers; namespace Dimafe6\BankID\Service; use Illuminate\Http\Request; class BankID extends Controller { public function signin(){ // Create BankIDService $bankIDService = new BankIDService( 'https://appapi2.test.bankid.com/rp/v5/', $_SERVER["REMOTE_ADDR"], [ 'verify' => false, 'cert' => 'PATH_TO_TEST_CERT.pem', ] ); // Signing. Step 1 - Get orderRef /** @var OrderResponse $response */ $response = $bankIDService->getSignResponse('my test code', 'User visible data'); // Signing. Step 2 - Collect orderRef. // Repeat until $collectResponse->status !== CollectResponse::STATUS_COMPLETED $collectResponse = $bankIDService->collectResponse($response->orderRef); if($collectResponse->status === CollectResponse::STATUS_COMPLETED) { return true; //Signed successfully } } public function test(){ return "hello"; } }
There is a folder in vendor folder which name dimafe6
Use this:
use Dimafe6\BankID\Service\BankIDService;
and remove:
namespace Dimafe6\BankID\Service;
I'm getting an error in my file which says
Error: Class 'Dimafe6\BankID\Service\Controller' not found
I'm using this project in a Laravel framework version is 7,
Here what I did so far,
1) Added the package via using composer command 2) Created the Controller file to access the sign-in method.
When I try to test that controller file I'm getting that error.
Source file
There is a folder in vendor folder which name dimafe6