贝宝。发票。沙箱。 “内部错误”

时间:2014-02-12 17:57:54

标签: php curl paypal sandbox

尝试制作PayPal开票应用程序。 经典API,没有REST。

我能够通过Sandbox身份验证问题和APP ID问题。 现在我面临着死胡同。

获取错误520002 - 来自PayPal的内部错误

没有错误描述或我可以在其上找到的任何内容......

Paypal通知显示没有停机时间:(

以下是通话详情(以防万一)

端点:

https://svcs.sandbox.paypal.com/Invoice/CreateInvoice

cUrl标头(已更换凭据):

X-PAYPAL-SECURITY-USERID: --myuserid--_api1.hotmail.com
X-PAYPAL-SECURITY-PASSWORD: 1-------5
X-PAYPAL-SECURITY-SIGNATURE: ---------------------------------------------------
X-PAYPAL-SECURITY-SUBJECT: 
X-PAYPAL-SECURITY-VERSION: 98.0
X-PAYPAL-REQUEST-DATA-FORMAT: XML
X-PAYPAL-RESPONSE-DATA-FORMAT: XML
X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T
X-PAYPAL-DEVICE-ID: 
X-PAYPAL-DEVICE-IPADDRESS: --my-ip--
X-PAYPAL-SANDBOX-EMAIL-ADDRESS: 

收到回复

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/pt">
<responseEnvelope>
<timestamp>2014-02-12T09:53:18.054-08:00</timestamp>
<ack>Failure</ack>
<correlationId>e9c370e69f506</correlationId>
<build>9180443</build>
</responseEnvelope>
<error>
    <errorId>520002</errorId>
    <domain>PLATFORM</domain>
    <subdomain>Application</subdomain>
    <severity>Error</severity>
    <category>Application</category>
    <message>Internal Error</message>
</error>
</ns3:FaultMessage>

结束发布的XML:

<?xml version="1.0" encoding="utf-8"?>
<CreateInvoiceRequest xmlns="http://svcs.paypal.com/types/ap">
<requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
</requestEnvelope>
<invoice xmlns="">
    <merchantEmail xmlns="">[email]</merchantEmail>
    <payerEmail xmlns="">[payer-email]</payerEmail>
    <number xmlns="">218755-2014FebWed-140558</number>
    <merchantInfo xmlns="">
        <businessName xmlns="">businessName.com</businessName>
        <phone xmlns="">123-1231234</phone>
        <website xmlns="">http://www.businessName.com</website>
        <customValue xmlns="">Toll Free : 1-888-123-1231</customValue>
        <address xmlns="">
            <line1 xmlns="">6890 rue paypal</line1>
            <city xmlns="">PayPal city</city>
            <state xmlns="">QC</state>
            <postalCode xmlns="">H1H1H1</postalCode>
            <countryCode xmlns="">CA</countryCode>
        </address>
    </merchantInfo>
    <itemList xmlns="">
        <item xmlns="">
            <name xmlns="">GEN0071</name>
            <description xmlns="">Special order item (Dress)</description>
            <quantity xmlns="">1</quantity>
            <unitPrice xmlns="">10.00</unitPrice>
        </item>
    </itemList>
    <currencyCode xmlns="">CAD</currencyCode>
    <invoiceDate xmlns="">2014-02-12</invoiceDate>
    <dueDate xmlns="">2014-02-12</dueDate>
    <paymentTerms xmlns="">DueOnReceipt</paymentTerms>
    <discountAmount xmlns="">0.00</discountAmount>
    <billingInfo xmlns="">
        <firstName xmlns="">B</firstName>
        <lastName xmlns="">K</lastName>
        <businessName xmlns=""></businessName>
        <phone xmlns="">123-9867</phone>
        <address xmlns="">
            <line1 xmlns="">9203 rue buyer</line1>
            <city xmlns="">Buyer city</city>
            <state xmlns="">QC</state>
            <postalCode xmlns="">N2N2N2</postalCode>
            <countryCode xmlns="">CA</countryCode>
        </address>
    </billingInfo>
    <shippingInfo xmlns="">
        <firstName xmlns="">B</firstName>
        <lastName xmlns="">K</lastName>
        <businessName xmlns=""></businessName>
        <phone xmlns="">123-9867</phone>
        <address xmlns="">
            <line1 xmlns="">9203 rue buyer</line1>
            <city xmlns="">Buyer city</city>
            <state xmlns="">QC</state>
            <postalCode xmlns="">N2N2N2</postalCode>
            <countryCode xmlns="">CA</countryCode>
        </address>
    </shippingInfo>
    <shippingAmount xmlns="">0.00</shippingAmount>
    <logoUrl xmlns="">http://www.businessName.com/images/logo.png</logoUrl>
    <referrerCode xmlns="">PHPClass</referrerCode>
</invoice>
</CreateInvoiceRequest>

1 个答案:

答案 0 :(得分:0)

以下是CreateAndSendInvoice请求的示例,该请求返回成功的响应。

<?xml version="1.0" encoding="utf-8"?>
<CreateAndSendInvoiceRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <invoice xmlns="">
    <merchantEmail xmlns="">sandbo_1215254764_biz@angelleye.com</merchantEmail>
    <payerEmail xmlns="">payer@email.com</payerEmail>
    <number xmlns="">ABCZ-122345678</number>
    <merchantInfo xmlns="">
      <firstName xmlns="">Tester</firstName>
      <lastName xmlns="">Testerson</lastName>
      <businessName xmlns="">Testers, LLC</businessName>
      <phone xmlns="">555-555-5555</phone>
      <fax xmlns="">555-555-5556</fax>
      <website xmlns="">http://www.domain.com</website>
      <customValue xmlns="">Some custom info.</customValue>
    </merchantInfo>
    <itemList xmlns=""><item xmlns="">
      <name xmlns="">Test Widget 1</name>
      <description xmlns="">This is a test widget #1</description>
      <date xmlns="">2012-02-18</date>
      <quantity xmlns="">1</quantity>
      <unitPrice xmlns="">10.00</unitPrice>
      </item><item xmlns="">
      <name xmlns="">Test Widget 2</name>
      <description xmlns="">This is a test widget #2</description>
      <date xmlns="">2012-02-18</date>
      <quantity xmlns="">2</quantity>
      <unitPrice xmlns="">20.00</unitPrice>
      </item></itemList>
    <currencyCode xmlns="">USD</currencyCode>
    <paymentTerms xmlns="">DueOnReceipt</paymentTerms>
    <note xmlns="">This is a test invoice.</note>
    <merchantMemo xmlns="">This is a test invoice.</merchantMemo>
    <shippingAmount xmlns="">10.00</shippingAmount>
    <logoUrl xmlns="">https://www.usbswiper.com/images/angelley-clients/cpp-header-image.jpg</logoUrl>
    <referrerCode xmlns="">AngellEYE_PHPClass</referrerCode>
  </invoice>
</CreateAndSendInvoiceRequest>

我会比较你的,看看你是否发现可能导致你的问题的明显差异。例如,如果您在错误的位置使用XML元素,可能会导致PayPal出现内部错误,就像您所看到的那样。