PHP SoapClient的贝宝SETEX pressCheckout身份验证失败 [英] PHP soapClient for Paypal SetExpressCheckout Authentication Failure

查看:282
本文介绍了PHP SoapClient的贝宝SETEX pressCheckout身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是当前的SOAP消息发送到SOAP API贝宝:

This is current Soap message send to 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>

我这个实例和SoapClient PHP5:

I instantiated this 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);

但是,当我打电话给SETEX pressCheckout贝宝SOAP服务,我收到以下的SOAP消息:

But when I called SetExpressCheckout paypal soap service, i receive the following soap message :

<?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证书...
我不明白为什么我的code不起作用。

Nevertheless, I used the API credentials of my business account test... I don't understand why my code doesnt work.

的错误是:您没有权限,使这个API调用,但怎么有可能?因为我用了正确的端点服务(沙盒)?

The error is : 'You do not have permissions to make this API call', but how it's possible? Because i use the correct endpoint service (sandbox) ?

有人能帮助我吗?

推荐答案

如果要连接到沙盒API端点必须使用沙盒测试帐户的API证书。结果
您可以通过创建 https://developer.paypal.com/ >测试帐户> $ P $测试帐户pconfigured。

You must use the API credentials of a Sandbox test account if you're connecting to the Sandbox API endpoint.
You can create a test account via https://developer.paypal.com/ > Test accounts > preconfigured.

这篇关于PHP SoapClient的贝宝SETEX pressCheckout身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆