2013-03-22 97 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

相关问题