Search code examples
phppaypalcheckoutexpressnvp

Paypal Checkout Express empty cart problem


I'm working on Paypal integration in my website, following Paypal's API specifications. I'm testing it in a sandbox, and after sending a SetExpressCheckout request like this:

CURRENCYCODE=EUR
&RETURNURL=http%3A%2F%2Fwww.xxxxxxxx
&CANCELURL=http%3A%2F%2Fwww.xxxxxxxx
&PAYMENTACTION=Sale
&L_PAYMENTREQUEST_0_NAME0=T-shirt+ring-spun+attillata%3B+taglia+L%3B+colore+Navy
&L_PAYMENTREQUEST_0_NUMBER0=0LLR7IQ-B0SIE+%28Product+%230LLR7IQ-B0SIE%29
&L_PAYMENTREQUEST_0_DESC0=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT0=1.90
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME1=T-shirt+ring-spun+attillata%3B+taglia+M%3B+colore+Dark+Heather
&L_PAYMENTREQUEST_0_NUMBER1=0LLR7IQ-2KEI1+%28Product+%230LLR7IQ-2KEI1%29
&L_PAYMENTREQUEST_0_DESC1=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT1=1.90
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_NAME2=T-shirt+ring-spun+attillata%3B+taglia+S%3B+colore+White
&L_PAYMENTREQUEST_0_NUMBER2=0LLR7IQ-TFOHI+%28Product+%230LLR7IQ-TFOHI%29
&L_PAYMENTREQUEST_0_DESC2=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT2=1.59
&L_PAYMENTREQUEST_0_QTY2=1
&ITEMAMT=5.39
&TAXAMT=1.08
&SHIPPINGAMT=0.00
&AMT=6.47
&ALLOWNOTE=1
&USER=XXXXXXXX
&PWD=XXXXXXXX
&SIGNATURE=XXXXXXXX
&METHOD=SetExpressCheckout
&VERSION=53.0

I forward the user to here, which is the token Paypal gives me back in response to my first request.

The problem is that, despite the successful request with all prices set in, I have an empty Paypal review page, with absolutely no prices into.

What am I missing?


Solution

  • Attack of the poor API docs! Paypal sure tried hard, but they fall short. I've fought this API and won! :)

    Change these values in what you already have... let me know if it takes care of the problem

    &PAYMENTREQUEST_0_PAYMENTACTION=Sale [[ <--- payment action ]]
    &PAYMENTREQUEST_0_CURRENCYCODE=EUR [[<-- currency code]]
    &PAYMENTREQUEST_0_ITEMAMT=5.39  [[<---- subtotal here]]
    &PAYMENTREQUEST_0_TAXAMT=1.08 [[<---- tax here]]
    &PAYMENTREQUEST_0_SHIPPINGAMT=0.00 [[<---- shipping here]]
    &PAYMENTREQUEST_0_AMT=6.47 [[<---- grand total here]]
    &PAYMENTREQUEST_0_ALLOWNOTE=1