0
Google App Engine은 cURL을 사용할 수 없으므로 사용할 수 없습니다. 내 전화를 구조화되는 방법을 잘 모르겠어요 https://developer.paypal.com/docs/integration/direct/make-your-first-callPHP에서 cURL없이 PayPal API 호출하기
:
나는의 2 단계에서 액세스 토큰을 얻기 위해 노력하고 있어요. 지금까지이 있습니다$data = array(
'grant_type' => 'client_credentials',
'client_id' => $sandbox_client_id,
'secret' => $sandbox_secret
);
$data = json_encode($data);
$context = [
'http' => [
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
'Accept: application/json' . "\r\n" .
'Accept-Language: en_US' . "\r\n"
,
'content' => $data
]
];
$context = stream_context_create($context);
$response = file_get_contents('https://api.sandbox.paypal.com/v1/oauth2/token', false, $context);
echo $response;
이 반환
Warning: file_get_contents(https://api.sandbox.paypal.com/v1/oauth2/token): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in C:\folder\php\paypal\test.php on line 28
어떤 통찰력을 감사합니다!