2013-02-11 86 views
1

我必須將貝寶支付專業版整合到客戶的網站。我開始在我的服務器上安裝paypal php SDK。它運行在PHP 5.2.17上,似乎工作完美。是否有任何已知的問題與PHP 5.3,防止PHP SDK的工作?

當我完成測試後,我將SDK從我的服務器移動到運行php 5.3.2的客戶端服務器,並且由於某種原因它無法正常工作。

在開始我們確信那是權限問題,因爲腳本無法寫入paypal.log文件

大約一個星期,現在我們正在與託管公司合作,以解決這一問題。 其中一個想法是將服務器回滾到5.2.17(以加強我的服務器的php版本)。這個變化解決了這個問題,但是服務器上的其他網站受到了破壞,迫使我們回到5.3.2

我一直在尋找解決方案。我在這裏找到的一個解決方案是: PayPal error messages on PHP 5.3.1 與梨包有關。

任何人都知道是否需要任何特殊的梨套件才能使SDK工作?

下面是一些技術資料:

我收到以下錯誤,當我嘗試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

和2 5hose的:

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>

我知道這是一個非常具體的問題,有人熟悉這一問題的可能性很低,但我不得不問。

謝謝。

回答

0

爲了解決這些錯誤的:

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膨脹並且完全沒有必要。

+0

感謝您的努力 – 2013-02-13 02:40:53

+0

它解決了您的問題嗎? – Sugitime 2013-02-13 19:48:08

+0

nope。 2周對於那些廢話太過分了。我只是降級到5.3.1似乎工作正常 – 2013-02-13 20:30:36