PHP soapClient для PayPal SetExpressCheckout Ошибка аутентификации

Это текущее сообщение о мыле, отправляемом в soap paypal API:

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:ns2="ebl:SetExpressCheckoutRequestDetails" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="urn:ebay:api:PayPalAPI" xmlns:ns4="ebl:UserIdPasswordType"> <SOAP-ENV:Header> <ns3:RequesterCredentials xsi:type="ns4:UserIdPasswordType"> <Username>xxxxx</Username> <Password>xxxxx</Password> <Signature>xxxxx</Signature> </ns3:RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns3:SetExpressCheckoutReq> <ns3:SetExpressCheckoutRequest> <ns1:Version>84.0</ns1:Version> <ns1:SetExpressCheckoutRequestDetails xsi:type="ns2:SetExpressCheckoutRequestDetailsType"> <ReturnUrl>url_to_/success.paypal.php</ReturnUrl> <CancelUrl>url_to_/cancel.paypal.php</CancelUrl> <LocaleCode>US</LocaleCode> </ns1:SetExpressCheckoutRequestDetails> </ns3:SetExpressCheckoutRequest> </ns3:SetExpressCheckoutReq> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

Я создал этот PHP5 SoapClient:

 //Endpoint $location = 'https://api-3t.sandbox.paypal.com/2.0/'; $uri = 'urn:ebay:api:PayPalAPI'; //SoapClient options $options = array('trace' => 1, 'exceptions' => 1, 'location'=>$location, 'uri'=>$uri); //My Soap Client $client =new SoapClient('https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl',$options); 

Но когда я позвонил в сервисе мыла SetExpressCheckout paypal, я получил следующее сообщение о мыле:

 <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"> <SOAP-ENV:Header> <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security> <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"> <Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"> </Credentials> </RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body id="_0"> <SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI"> <Timestamp xmlns="urn:ebay:apis:eBLBaseComponents"> 2012-01-13T12:09:01Z </Timestamp> <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack> <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents"> c8d551f118a1 </CorrelationID> <Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"> <ShortMessage xsi:type="xs:string"> Authentication/Authorization Failed </ShortMessage> <LongMessage xsi:type="xs:string"> You do not have permissions to make this API call </LongMessage> <ErrorCode xsi:type="xs:token">10002</ErrorCode> <SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents"> Error </SeverityCode> </Errors> <Version xmlns="urn:ebay:apis:eBLBaseComponents">84.0</Version> <Build xmlns="urn:ebay:apis:eBLBaseComponents">2271164</Build> </SetExpressCheckoutResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

Тем не менее, я использовал учетные данные API моего теста бизнес-аккаунта … Я не понимаю, почему мой код не работает.

Ошибка: «У вас нет прав на выполнение этого вызова API», но как это возможно? Потому что я использую правильную службу конечных точек (песочница)?

Кто-нибудь может мне помочь?

Вы должны использовать учетные данные API тестовой учетной записи Sandbox, если вы подключаетесь к конечной точке API Sandbox.
Вы можете создать тестовую учетную запись через https://developer.paypal.com/ > Контрольные учетные записи> предварительно сконфигурированные.