php 5.3是否存在任何已知的问题,从而阻止php SDK工作


is there any known issue with php 5.3 that prevent php SDK from working?

我不得不将Paypal Payment pro集成到客户的网站上。我开始在我的服务器上安装贝宝php SDK。它运行在php5.2.17上,似乎运行得很完美。

当我完成测试时,我将SDK从服务器移到了运行php5.3.2的客户端服务器上,但由于某种原因,它不起作用。

一开始我们确信这是权限问题,因为脚本无法写入paypal.log文件

大约一周以来,我们一直在与托管公司合作解决这个问题。一个想法是将服务器回滚到5.2.17(以mach我的服务器的php版本)。这一变化解决了这个问题,但服务器上的其他网站也被搞砸了,这迫使我们回到5.3.2

我一直在四处寻找解决方案。我在这里找到了一个解决方案:PHP 5.3.1上的PayPal错误消息与梨包装有关。

有人知道SDK是否需要任何特殊的pear包才能工作吗?

以下是一些技术信息:

当我尝试doDirectPayment示例时,当错误报告设置为-1 时,我得到了以下错误

其中5或6个:

Warning: error_log(../PayPal.log) [function.error-log]: failed to open stream: Permission denied in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-cart/paypal/lib/PPLoggingManager.php on line 60

1个:

Strict Standards: Only variables should be passed by reference in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-cart/paypal/lib/PPUtils.php on line 99

其中约12个:

Strict Standards: Non-static method PPUtils::convertXmlObjToArr() should not be called statically in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-cart/paypal/lib/PPUtils.php on line 99

和5小时中的2小时:

Notice: Class string not found. in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-cart/paypal/lib/PPXmlMessage.php on line 172

请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" ><soapenv:Header><ns:RequesterCredentials><ebl:Credentials><ebl:Username>yanivk_1359660748_biz_api1.gmail.com</ebl:Username><ebl:Password>1359660807</ebl:Password><ebl:Signature>AYWZfz56bBT.eby8WGW6PcSYJuLGAJAkQp0g-4el58kjzrOUFVSWTpE5</ebl:Signature></ebl:Credentials></ns:RequesterCredentials></soapenv:Header><soapenv:Body><ns:DoDirectPaymentReq><ns:DoDirectPaymentRequest><ebl:DoDirectPaymentRequestDetails><ebl:PaymentDetails><ebl:OrderTotal><ebl:currencyID>USD</ebl:currencyID><ebl:value>1.00</ebl:value></ebl:OrderTotal><ebl:ShipToAddress><ebl:Name>John Doe</ebl:Name><ebl:Street1>1 Main St</ebl:Street1><ebl:CityName>San Jose</ebl:CityName><ebl:StateOrProvince>CA</ebl:StateOrProvince><ebl:Country>US</ebl:Country><ebl:PostalCode>95131</ebl:PostalCode></ebl:ShipToAddress></ebl:PaymentDetails><ebl:CreditCard><ebl:CreditCardType>Visa</ebl:CreditCardType><ebl:CreditCardNumber>4079305435163119</ebl:CreditCardNumber><ebl:ExpMonth>01</ebl:ExpMonth><ebl:ExpYear>2014</ebl:ExpYear><ebl:CardOwner><ebl:PayerName><ebl:FirstName>John</ebl:FirstName><ebl:LastName>Doe</ebl:LastName></ebl:PayerName><ebl:PayerCountry>US</ebl:PayerCountry><ebl:Address><ebl:Name>John Doe</ebl:Name><ebl:Street1>1 Main St</ebl:Street1><ebl:CityName>San Jose</ebl:CityName><ebl:StateOrProvince>CA</ebl:StateOrProvince><ebl:Country>US</ebl:Country><ebl:PostalCode>95131</ebl:PostalCode></ebl:Address></ebl:CardOwner><ebl:CVV2>962</ebl:CVV2></ebl:CreditCard></ebl:DoDirectPaymentRequestDetails><ebl:Version>94.0</ebl:Version></ns:DoDirectPaymentRequest></ns:DoDirectPaymentReq></soapenv:Body></soapenv:Envelope>

响应:

<?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"><Username xsi:type="xs:string"></Username><Password xsi:type="xs:string"></Password><Signature xsi:type="xs:string"></Signature><Subject xsi:type="xs:string"></Subject></Credentials></RequesterCredentials></SOAP-ENV:Header><SOAP-ENV:Body id="_0"><DoDirectPaymentResponse xmlns="urn:ebay:api:PayPalAPI"><Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2013-02-10T23:51:36Z</Timestamp><Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack><CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">ccaa89a0e921f</CorrelationID><Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"><ShortMessage xsi:type="xs:string">Transaction refused because of an invalid argument. See additional error messages for details.</ShortMessage><LongMessage xsi:type="xs:string">Order total is invalid.</LongMessage><ErrorCode xsi:type="xs:token">10401</ErrorCode><SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode></Errors><Version xmlns="urn:ebay:apis:eBLBaseComponents">94.0</Version><Build xmlns="urn:ebay:apis:eBLBaseComponents">5060305</Build><Amount xsi:type="cc:BasicAmountType" currencyID="USD">0.00</Amount></DoDirectPaymentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

我知道这是一个非常具体的问题,熟悉这个问题的人的可能性很低,但我不得不问。

谢谢。

要解决这些错误中的每一个:

Warning: error_log(../PayPal.log) [function.error-log]: failed to open stream: Permission
denied in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-
cart/paypal/lib/PPLoggingManager.php on line 60

这将表明在所述路径上存在许可问题。确保该文件存在,并且对您的www root(或运行Apache服务的任何用户)具有适当的权限。

Strict Standards: Only variables should be passed by reference in 
/home/brando/public_html/wp-content/plugins/ownapainting-shopping-
cart/paypal/lib/PPUtils.php on line 99

这表明变量的使用不是最佳实践。我可以更深入地了解这一点,但基本上,有些东西是通过引用传递的,而不是通过值传递的(在谷歌上搜索差异)。

Strict Standards: Non-static method PPUtils::convertXmlObjToArr() should not be called 
statically in /home/brando/public_html/wp-content/plugins/ownapainting-shopping-
cart/paypal/lib/PPUtils.php on line 99

静态方法是类中的一种方法,可以在不实例化整个类的情况下调用该方法。此方法似乎尚未定义为静态,但正在用作静态。

Notice: Class string not found. in /home/brando/public_html/wp-
content/plugins/ownapainting-shopping-cart/paypal/lib/PPXmlMessage.php on line 172

另一个有严格标准的问题。

基本上对于最后3个,将错误报告从E_STRICT|E_ALL更改为仅E_ALL。它不会永远解决这些问题,但它会阻止它们出现在客户面前。

最终的解决方案是简单地不使用PayPal SDK。不建议真的使用这个。SDK引发的问题比任何事情都多。以下是我在人们开始集成PayPal时给他们的一些入门信息。它应该有帮助:

Getting Started: https://www.x.com/developers/paypal/documentation-tools/paypal-payments-pro/paypal-payments-pro-getting-started-guide 
API Reference Guide: https://www.x.com/developers/paypal/documentation-tools/api?qt-api_references=1#qt-api_references 
Sample Code: https://www.x.com/developers/paypal/documentation-tools/paypal-code-samples 

请使用NVP,而不是SOAP。SOAP过于臃肿,完全没有必要。