1

I know there are more than 20 questions about this, however none was helpful, and neither were the API docs nor some other paypal partner sites..

The XML/SOAP generated looks exactly like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:ebay:apis:eBLBaseComponents" 
    xmlns:ns2="urn:ebay:api:PayPalAPI">
  <SOAP-ENV:Header>
    <ns2:RequesterCredentials>
      <ns1:Credentials>
        <ns1:Username>[FILTERED]</ns1:Username>
        <ns1:Password>[FILTERED]</ns1:Password>
        <ns1:Signature>[FILTERED]</ns1:Signature>
      </ns1:Credentials>
    </ns2:RequesterCredentials>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns2:SetExpressCheckoutReq>
      <ns2:SetExpressCheckoutRequest>
        <ns1:Version>121.0</ns1:Version>
        <ns2:SetExpressCheckoutRequestDetails>
          <ns1:ReturnUrl>http://localhost/foo</ns1:ReturnUrl>
          <ns1:CancelUrl>http://localhost/bar</ns1:CancelUrl>
          <ns1:PaymentDetails>
            <ns1:OrderTotal currencyID="EUR">100000</ns1:OrderTotal>
          </ns1:PaymentDetails>
        </ns2:SetExpressCheckoutRequestDetails>
      </ns2:SetExpressCheckoutRequest>
    </ns2:SetExpressCheckoutReq>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However, I get "Order Total is missing", and I can't wrap my head around why it does not work. Any hints for me? Thanks in advance!

pdu
  • 10,295
  • 4
  • 58
  • 95

3 Answers3

1

I think your XML is not valid:

<ns1:OrderTotal currencyID="EUR">100000</ns2:OrderTotal>

It have to be ns1 in both tags.

Uri Agassi
  • 36,848
  • 14
  • 76
  • 93
Manuel S
  • 11
  • 1
0

I hit the same problem. The issue is that SetExpressCheckoutRequestDetails is in ns1 (eBLBaseComponents), not ns2 (PayPalAPI). Spent about six hours bashing my head in before finally figuring that out.

A. Wilcox
  • 1,782
  • 2
  • 12
  • 18
  • I'm already having it in `ns1`. Could you provide an XML example which you're sending for debugging purposes, as yours is working? – pdu Jun 26 '15 at 15:35
0

Solved it, with help from Andrew Wilcox' answer.

The offending part in the XML is <ns2:SetExpressCheckoutRequest>, which should be namespaced with ns1 instead of ns2.

pdu
  • 10,295
  • 4
  • 58
  • 95