bonjour a tous ,
j'essaie d’intégrer l'API de Paiement Orange et la je bloque à la génération du token .
selon le tu tuto voici ce qu'il faut exécuter .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
curl -X POST -H "Authorization: Basic {consumer_key}" \
-d "grant_type=client_credentials" \
https://api.orange.com/oauth/v2/token
pour obtenir ce résultat
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
HTTP/1.1 200 OK
Content-Type: application/json
{
"token_type": "Bearer",
"access_token": "WI9VmGXfNB38s1e6A26Hob19AP2c",
"expires_in": "7776000"
}
voici ce que je fais
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
<?php 
 
  $headers = array(
    // Request headers
    'Authorization' => 'Basic YWtDc0dqbFhMRXI2dm1yd2pnUVhjdk53ZExiamdPdVQ6Y3dHcjNENFdZQ1BYT0V0UA==',
    'Content-Type' => 'application/json',
);
 
  $data = 'grant_type=client_credentials';
 
  $url='https://api.orange.com/oauth/v2/token';
 
    $ch = curl_init();
    $options = array(
                    CURLOPT_URL             => $url,
                    CURLOPT_POSTFIELDS      => $data,
                    CURLOPT_POST            => true,                    
                    CURLOPT_RETURNTRANSFER  => true,
                    CURLOPT_HEADER          => true
                  );
    curl_setopt_array( $ch, $options );
    $response = curl_exec($ch); 
 
    var_dump($response);
 
    curl_close($ch);
mais voici le résultat que j’obtiens
ligne 24:boolean false
Merci de votre aide .