Search code examples
xmlsoappaypalexpress-checkoutpaypal-soap

PayPal Express Checkout SOAP - Order Total Missing


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!


Solution

  • 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.