0

我正在尝试将 PayPal 模块集成到我们基于 osCommerce 的站点中 - 一个使用 PayPal DoDirectPayment (SOAP) API 通过 PayPal 执行信用卡授权/付款的插件。到目前为止,我有:

  • 安装模块并让它工作
  • 在启用 PaymentsPro 的 PayPal 沙盒中设置商家帐户
  • 使用信用卡在 Sandbox 中创建买家帐户
  • 已验证我们网站上的帐单地址与存储在 PayPal Sandbox 中的买家帐户的信用卡地址相匹配

我能够一直进行结帐流程;但是,每次交易失败时都会出现以下错误消息。

无效数据 (10540)
由于地址无效,无法处理交易。

我已经使用步进调试(通过 XDEBUG)来验证结帐表单中指定的地址信息是否已传递到 cUrl 请求中。在发送前不久出现的 SOAP 请求下方查找:

注意潜在的敏感信息已被更改;但是,我直接将 PayPal Sandbox 中的地址与我们网站上的地址进行了比较——它们是相同的,并且符合此处找到的 API 文档中列出的字段规范。第 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: xxxxxxxxxx@gmail.com</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>xxxxxxxxxx@gmail.com</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>

从目标 SandBox 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>

这个问题(无法使用 PayPal 模块处理交易)表明 SandBox 存在等待可以解决的问题……但是我的帐户是在 19 日创建的,但我仍然收到相同的基于地址的神秘拒绝。

我还搜索了(沙盒上的 paypal 直接付款错误)和(Paypal 网站付款 Pro DoDirect 付款集成问题。由于商家配置无效,无法处理此交易)但没有发现任何用处。

任何帮助,将不胜感激。

4

1 回答 1

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>
于 2013-03-25T13:35:37.153 回答