Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 由于返回和取消URL无效,PayPal setExpressCheckout调用失败_Php_Paypal_Paypal Sandbox - Fatal编程技术网

Php 由于返回和取消URL无效,PayPal setExpressCheckout调用失败

Php 由于返回和取消URL无效,PayPal setExpressCheckout调用失败,php,paypal,paypal-sandbox,Php,Paypal,Paypal Sandbox,我目前正在将PayPal Express Checkout集成到我们的网站中。我们正在使用osCommerce(PHP)的安装和setExpressCheckout的SOAP实现。令人费解的是,我的快速签出代码在本地环境中正常工作 但是,;一旦委托给我们的开发服务器,同样的快速签出代码就不再有效了 下面是我的本地开发环境向PayPal沙箱端点发起的一个成功SOAP请求,用于快速签出 <?xml version="1.0" encoding="utf-8"?> <soap:Env

我目前正在将PayPal Express Checkout集成到我们的网站中。我们正在使用osCommerce(PHP)的安装和setExpressCheckout的SOAP实现。令人费解的是,我的快速签出代码在本地环境中正常工作

但是,;一旦委托给我们的开发服务器,同样的快速签出代码就不再有效了

下面是我的本地开发环境向PayPal沙箱端点发起的一个成功SOAP请求,用于快速签出

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
  <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">
    <Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
      <Username>xxxxxxxxxxxxxxxxxxxxxxxxxxx</Username>
      <Password>xxxxxxxxxxxxxxxx</Password>
    </Credentials>
  </RequesterCredentials>
</soap:Header>
<soap:Body>
  <SetExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI">
    <SetExpressCheckoutRequest>
      <Version xmlns="urn:ebay:apis:eBLBaseComponents">98.0</Version>
      <SetExpressCheckoutRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">
        <ReturnURL>http://localhost/checkout_shipping.php?action=express_checkout&amp;site=xxxxx</ReturnURL>
        <CancelURL>http://localhost/checkout_shipping.php?ec_cancel=1&amp;site=xxxxx</CancelURL>
        <ReqConfirmShipping>1</ReqConfirmShipping>
        <NoShipping>0</NoShipping>
        <AddressOverride>0</AddressOverride>
        <LocaleCode>US</LocaleCode>
        <PageStyle></PageStyle>
        <cpp-header-image></cpp-header-image>
        <cpp-header-border-color></cpp-header-border-color>
        <cpp-header-back-color></cpp-header-back-color>
        <cpp-payflow-color></cpp-payflow-color>
        <PaymentAction>Sale</PaymentAction>
        <PaymentDetails>
          <OrderTotal currencyID="USD">6.47</OrderTotal>
          <ItemTotal currencyID="USD">2.48</ItemTotal>
          <ShippingTotal currencyID="USD">3.99</ShippingTotal>
          <HandlingTotal currencyID="USD"></HandlingTotal>
          <TaxTotal currencyID="USD">0</TaxTotal>
          <Custom>Phone: xxxxxxxxxx -- Email: xxxx.xxxxx@gmail.com</Custom>
          <InvoiceID></InvoiceID>
          <NotifyURL></NotifyURL>
          <ButtonSource>PAYPAL_BUTTON_SOURCE</ButtonSource>
          <ShipToAddress>
            <Name></Name>
            <Street1>xxxx Park Forest Circle</Street1>
            <Street2></Street2>
            <CityName>Clermont</CityName> 
            <StateOrProvince>OH</StateOrProvince>
            <PostalCode>xxx03</PostalCode>
            <Country>US</Country>
          </ShipToAddress>
          <PaymentDetailsItem><Name>Product XYZ</Name><Amount currencyID="USD">2.48</Amount><Number>-</Number><Quantity>1</Quantity></PaymentDetailsItem>
        </PaymentDetails>
      </SetExpressCheckoutRequestDetails>
    </SetExpressCheckoutRequest> 
  </SetExpressCheckoutReq>
</soap:Body>
</soap:Envelope>
此请求将导致以下响应(同样,返回的var_dump()):

在检查了PayPal API文档之后,我无法找到任何关于API端点在有效URL中查找内容的特定准则

我也检查了,但没有看到任何与我的特定问题有关的内容


如果任何人有任何关于返回和取消url的错误信息,或者更详细地解释setExpressCheckout API的正确格式url,这将非常有用。

似乎PayPal API端点不喜欢域/url中的下划线,因此:

http://localhost/checkout_shipping.php?action=express_checkout&amp;site=xxxxx
是有效的,但这个

http://wpp_mod.testosc.storename.com/checkout_shipping.php?action=express_checkout&site=xxxxx

不是;因为我们在开发服务器的域名中有一个下划线。这很不方便,但可以更正。

“主机名中不允许有下划线。在DNS中,主机名是A或MX记录的名称字段,或者是SOA和NS记录的数据字段。因此,有许多DNS条目不是主机名。”——。域名可以,A-records不能。因此它被认为是无效的。
Array (
    [Security] => 
    [RequesterCredentials] => 
        Array ( [0] => 
            Array ( 
                [Credentials] => 
                    Array ( [0] => 
                        Array ( 
                            [Username] => 
                            [Password] => 
                            [Signature] => 
                            [Subject] => 
                        ) 
                    ) 
                ) 
            ) 
    [SetExpressCheckoutResponse] => 
        Array ( [0] => 
            Array ( 
                [Timestamp] => 2013-04-02T14:30:46Z 
                [Ack] => Failure 
                [CorrelationID] => 44f876829f4cb 
                [Errors] => 
                    Array ( [0] => Array ( 
                            [ShortMessage] => Transaction refused because of an invalid argument. See additional error messages for details. 
                            [LongMessage] => ReturnURL is invalid. 
                            [ErrorCode] => 10471 
                            [SeverityCode] => Error ) 
                        [1] => Array ( 
                            [ShortMessage] => Transaction refused because of an invalid argument. See additional error messages for details. 
                            [LongMessage] => CancelURL is invalid. 
                            [ErrorCode] => 10472 
                            [SeverityCode] => Error ) 
                    ) 
                [Version] => 98.0 
                [Build] => 5613839 
            ) 
        ) 
)
http://localhost/checkout_shipping.php?action=express_checkout&amp;site=xxxxx
http://wpp_mod.testosc.storename.com/checkout_shipping.php?action=express_checkout&site=xxxxx