Question

I am currently integrating PayPal Adaptive Payments (Express Checkout) in the lightbox, on my website. Everything is going fine -> users can pay, but whenever someone paid for an item, using the express checkout, this is the response:

API RESPONSE:

TIMESTAMP = 2014-03-06T20:10:30Z
CORRELATIONID = 505b77f3bea1
ACK = Failure
VERSION = 97.0
BUILD = 9917844
L_ERRORCODE0 = 10400
L_ERRORCODE1 = 10406
L_SHORTMESSAGE0 = Transaction refused because of an invalid argument. See additional error messages for details.
L_SHORTMESSAGE1 = Transaction refused because of an invalid argument. See additional error messages for details.
L_LONGMESSAGE0 = Order total is missing.
L_LONGMESSAGE1 = The PayerID value is invalid.
L_SEVERITYCODE0 = Error
L_SEVERITYCODE1 = Error

This is the script:

$nvps = array();
$nvps["VERSION"] = "97.0";

// Single-item purchase
$nvps["METHOD"] = "SetExpressCheckout";
$nvps["RETURNURL"] = "http://www.zerogravityprogramming.com/PayPal/Articles/DigitalGoodsExpressCheckout/App/success.php"; // server
$nvps["CANCELURL"] = "http://www.zerogravityprogramming.com/PayPal/Articles/DigitalGoodsExpressCheckout/App/fail.html"; // server

$nvps["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
$nvps["PAYMENTREQUEST_0_NOTIFYURL"] = "http://www.yourdomain.com/PayPal/YourPayPalListener.php";
$nvps["PAYMENTREQUEST_0_AMT"] = "$Price";
$nvps["PAYMENTREQUEST_0_CURRENCYCODE"] = "USD";
$nvps["PAYMENTREQUEST_0_ITEMAMT"] = "$Price";
$nvps["L_PAYMENTREQUEST_0_NAME0"] = "$Desc";
$nvps["L_PAYMENTREQUEST_0_NUMBER0"] = "$Item";
$nvps["L_PAYMENTREQUEST_0_AMT0"] = "$Price";
$nvps["L_PAYMENTREQUEST_0_QTY0"] = "1";
$nvps["L_PAYMENTREQUEST_0_ITEMCATEGORY0"] = "Digital"; // specific to Digital Goods

// Since it's a digital good (and not physical), we don't need a shipping address.
$nvps["REQCONFIRMSHIPPING"] = "0";
$nvps["NOSHIPPING"] = "1";

The $Price, $Desc, and $Item variables, all have a value - so that is not the problem.

Can anyone figure it out?

Thanks in advance :)

Was it helpful?

Solution

I see that you are making this API request from Sandbox. The setexpressCheckout API respnse was "successful" The GetExpressCheckoutDetailsRequest we got a response from you with the error message :

Express Checkout token was issued for a merchant account other than yours.

This is caused mainly due to : you are using different API credentials for SetExpressCheckout and DoExpressCheckoutPayment.

I think you are processing something inside your Return URL which is doing some API calls which is wrong.

I have tested here:

VERSION = 97.0
METHOD = SetExpressCheckout
RETURNURL = http://www.zerogravityprogramming.com/PayPal/Articles/DigitalGoodsExpressCheckout/App/success.php
CANCELURL = http://www.zerogravityprogramming.com/PayPal/Articles/DigitalGoodsExpressCheckout/App/fail.html

PAYMENTREQUEST_0_PAYMENTACTION = Sale
PAYMENTREQUEST_0_NOTIFYURL = http://www.yourdomain.com/PayPal/YourPayPalListener.php
PAYMENTREQUEST_0_AMT = 20.00
PAYMENTREQUEST_0_CURRENCYCODE = USD
PAYMENTREQUEST_0_ITEMAMT = 20.00
L_PAYMENTREQUEST_0_NAME0 = Test
L_PAYMENTREQUEST_0_NUMBER0 =23
L_PAYMENTREQUEST_0_AMT0 = 20.00
L_PAYMENTREQUEST_0_QTY0 = 1
L_PAYMENTREQUEST_0_ITEMCATEGORY0 = Digital
REQCONFIRMSHIPPING = 0
NOSHIPPING = 1

NVP Response:
TOKEN=EC-3S848778KN463980F
TIMESTAMP=2014-03-07T02:53:56Z
CORRELATIONID=fbc726f1a782e
ACK=Success
VERSION=97.0
BUILD=9917844 


VERSION = 84.0
METHOD = DoExpressCheckoutPayment
TOKEN = EC-3S848778KN463980F
PAYMENTACTION = Sale
PAYERID = ZK5AUW8MWY9CW
AMT = 20.00




NVP Response:
TOKEN=EC-3S848778KN463980F
SUCCESSPAGEREDIRECTREQUESTED=false
TIMESTAMP=2014-03-07T02:57:05Z
CORRELATIONID=c7aac043d49fa
ACK=Success
VERSION=84.0
BUILD=9917844
TRANSACTIONID=0L15028545229094V
TRANSACTIONTYPE=expresscheckout
PAYMENTTYPE=instant
ORDERTIME=2014-03-07T02:57:04Z
AMT=20.00
FEEAMT=0.88
TAXAMT=0.00
CURRENCYCODE=USD
PAYMENTSTATUS=Completed
PENDINGREASON=None
REASONCODE=None
PROTECTIONELIGIBILITY=Ineligible
INSURANCEOPTIONSELECTED=false
SHIPPINGOPTIONISDEFAULT=false
PAYMENTINFO_0_TRANSACTIONID=0L15028545229094V
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout
PAYMENTINFO_0_PAYMENTTYPE=instant
PAYMENTINFO_0_ORDERTIME=2014-03-07T02:57:04Z
PAYMENTINFO_0_AMT=20.00
PAYMENTINFO_0_FEEAMT=0.88
PAYMENTINFO_0_TAXAMT=0.00
PAYMENTINFO_0_CURRENCYCODE=USD
PAYMENTINFO_0_PAYMENTSTATUS=Completed
PAYMENTINFO_0_PENDINGREASON=None
PAYMENTINFO_0_REASONCODE=None
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=XTV2XWLQDBBUL
PAYMENTINFO_0_ERRORCODE=0
PAYMENTINFO_0_ACK=Success 

OTHER TIPS

Have you provided the PayerId in the DoExpressCheckoutPayment ?
PAYERID (Required) Unique PayPal buyer account identification number as returned in the GetExpressCheckoutDetails response.
Character length and limitations: 13 single-byte alphanumeric characters

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top