2013-03-22 347 views
0

我試圖將PayPal模塊集成到我們的基於osCommerce的站點 - 一個使用PayPal DoDirectPayment(SOAP)API通過PayPal執行信用卡授權/付款的插件。到目前爲止,我有:PayPal DoDirectPayment(SOAP API)事務由於無效地址而失敗

  • 安裝的模塊,並得到它的工作
  • 設立在貝寶沙箱是啓用PaymentsPro
  • ,建立買家帳戶中沙盒用信用卡
  • 驗證的商家帳戶我們網站上的帳單地址匹配地址爲 存儲在買家帳戶的PayPal沙盒中的信用卡

我可以一直行動通過gh結帳過程;但每次事務失敗時都會顯示以下錯誤消息。

無效數據(10540)
由於地址無效,無法處理事務。

我已經使用了步驟調試(通過XDEBUG)來驗證結帳表單中指定的地址信息是否傳入了cUrl請求。查找下面的SOAP請求,因爲它在發送之前不久顯示:

請注意,潛在的敏感信息已被更改;然而我直接比較了PayPal Sandbox中的地址和我們網站上的地址 - 它們是相同的,並符合API文檔here中列出的字段規範。 42頁,高達

<?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>login_api1.company.com</Username> 
     <Password>xxxxxxxxxxxxxxxx</Password> 
     <Subject></Subject> 
     </Credentials> 
    </RequesterCredentials> 
    </soap:Header> 
    <soap:Body> 
    <DoDirectPaymentReq xmlns="urn:ebay:api:PayPalAPI"> 
     <DoDirectPaymentRequest> 
     <Version xmlns="urn:ebay:apis:eBLBaseComponents">2.0</Version> 
     <DoDirectPaymentRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents"> 
      <PaymentAction>Sale</PaymentAction> 
      <PaymentDetails> 
      <OrderTotal currencyID="USD">13.96</OrderTotal> 
      <OrderDescription>Order placed on March 21, 2013, 2:01 pm by (ID: xx339)</OrderDescription> 
      <ItemTotal currencyID="USD">8.45</ItemTotal> 
      <ShippingTotal currencyID="USD">4.51</ShippingTotal> 
      <HandlingTotal currencyID="USD"></HandlingTotal> 
      <TaxTotal currencyID="USD">1</TaxTotal> 
      <Custom>Phone: xxx-xxx-xxxx -- Email: [email protected]</Custom> 
      <InvoiceID></InvoiceID> 
      <NotifyURL></NotifyURL> 
      <ButtonSource></ButtonSource> 
      <ShipToAddress> 
       <Name></Name> 
       <Street1>1313 Park Forest</Street1> 
       <Street2></Street2> 
       <CityName>Batavia</CityName> 
       <StateOrProvince>OH</StateOrProvince> 
       <PostalCode>45103</PostalCode> 
       <Country>US</Country> 
      </ShipToAddress> 
      <PaymentDetailsItem> 
       <Name>Custom Poker Deck</Name> 
       <Amount currencyID="USD">5.67</Amount> 
       <Number>-</Number> 
       <Quantity>1</Quantity> 
      </PaymentDetailsItem> 
      <PaymentDetailsItem> 
       <Name>BRAWL Deck</Name> 
       <Amount currencyID="USD">3.78</Amount> 
       <Number>-</Number> 
       <Quantity>1</Quantity> 
      </PaymentDetailsItem> 
      <PaymentDetailsItem> 
       <Name>Order Total Discrepancy</Name> 
       <Amount currencyID="USD">-1.00</Amount> 
       <Number>-</Number> 
       <Quantity>1</Quantity> 
      </PaymentDetailsItem> 
      </PaymentDetails> 
      <CreditCard> 
      <CardOwner> 
       <Payer>[email protected]</Payer> 
       <PayerName> 
       <FirstName>John</FirstName> 
       <LastName>Doe</LastName> 
       </PayerName> 
       <Address> 
       <Street1>1313 Park Forest</Street1> 
       <Street2></Street2> 
       <CityName>Batavia</CityName> 
       <StateOrProvince>OH</StateOrProvince> 
       <PostalCode>45103</PostalCode> 
       <Country>US</Country> 
       </Address> 
      </CardOwner> 
      <CreditCardType>Visa</CreditCardType> 
      <CreditCardNumber>4711505238313977</CreditCardNumber>    
      <ExpMonth>03</ExpMonth> 
      <ExpYear>2018</ExpYear> 
      <CVV2>000</CVV2>    
      </CreditCard> 
      <IPAddress>127.0.0.1</IPAddress> 
      <MerchantSessionId>iou1mhmkuo1lnmd8e0vvpfbmp5</MerchantSessionId> 
     </DoDirectPaymentRequestDetails> 
     </DoDirectPaymentRequest> 
    </DoDirectPaymentReq> 
    </soap:Body> 
</soap:Envelope> 

從目標區API端點(https://api.sandbox.paypal.com/2.0)收到的響應返回是:

<?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-03-22T20:24:12Z</Timestamp> 
      <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack> 
      <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">94b4190427bbe</CorrelationID> 
      <Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"> 
       <ShortMessage xsi:type="xs:string">Invalid Data</ShortMessage> 
       <LongMessage xsi:type="xs:string">The transaction cannot be processed due to an invalid address.</LongMessage> 
       <ErrorCode xsi:type="xs:token">10540</ErrorCode> 
       <SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode> 
      </Errors> 
      <Version xmlns="urn:ebay:apis:eBLBaseComponents">2.0</Version> 
      <Build xmlns="urn:ebay:apis:eBLBaseComponents">5479129</Build> 
      <Amount xsi:type="cc:BasicAmountType" currencyID="USD">13.96</Amount> 
     </DoDirectPaymentResponse> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

這個問題(Cannot process transaction using PayPal module)認爲,它與沙箱中的問題等待可以解決...但是我的賬戶是在19日創建的,我仍然得到了相同的神祕地址拒絕。

我也洗過(paypal direct payment error on sandbox)和(Paypal Website payment Pro DoDirect Payment Integration issue.This transaction cannot be processed due to an invalid merchant configuration),但沒有找到任何有用的東西。

任何幫助,將不勝感激。

+0

你能否提供完整的API回覆,以便我能夠查看導致問題的原因。 – 2013-03-22 20:16:38

+0

沒問題;我已經添加了由cUrl請求檢索到的響應 – Dogoferis 2013-03-22 20:30:07

回答

1

請求正在出錯,因爲您沒有將船名傳遞給地址字段。您需要在此處插入名稱,然後該請求應該適用於您。我運行了一些測試,一旦名稱被插入,測試就會順利進行。我也在使用98.0版本,它應該是最新版本。您目前將其設置爲2.0。

<ShipToAddress> 
<Name></Name> 
<Street1>1313 Park Forest</Street1> 
<Street2></Street2> 
<CityName>Batavia</CityName> 
<StateOrProvince>OH</StateOrProvince> 
<PostalCode>45103</PostalCode> 
<Country>US</Country> 
</ShipToAddress> 
+0

這樣做了;謝謝! – Dogoferis 2013-03-26 14:17:33

相關問題