Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 134 forks source link

401 Unauthorized when creating kyc page #603

Closed H4ck-M3 closed 1 year ago

H4ck-M3 commented 1 year ago

Hello, i'm still in the middle of testing with the sandbox

My issue is that when i try to create the kyc page i get a 401 unauthorized through the code, but when i copy the url and the file in base64 format from the endpoint documentation in postman i get 204 which is good Note that the same endpoint documentation base64 encoded file do not work in my code because i still get the 401

Please can you find what is wrong ?... bellow is the code

` $base64_file = base64_encode(file_get_contents($request->file('kyc')->path())); $base_url = "https://api.sandbox.mangopay.com"; $client_id = "myclientid";

        $url = $base_url."/v2.01/".$client_id."/users/".$user_id."/kyc/documents/".$kyc_id."/pages";
        $upload_response = Http::post($url, [
            "File" => $base64_file,
        ]);

        dd($upload_response);

`

H4ck-M3 commented 1 year ago

I just had to specify the authorization