Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GetExpressCheckoutDetails returns session expired (10411 error) in asp.net (only on some computers)

I got Paypal integrated in my asp.net web site, Its works perfectly on some computers, while others it doesnt.

EDIT: found the problem but looking for a solution

The problem is as fallowing:

Things seem to work fine I can pay with paypal and then when it calls GetExpressCheckoutDetails it returns 10411 error 'this express checkout session has expired'

I call GetExpressCheckoutDetails with the fallowing code:

public bool GetDetails(string token, ref NVPCodec decoder, ref string retMsg)
    {

        if (bSandbox)
        {
            pendpointurl = pendpointurl_SB;
            host = host_SB;
            SetCredentials(APIUsername_SB, APIPassword_SB, APISignature_SB);
        }

        NVPCodec encoder = new NVPCodec();
        encoder["METHOD"] = "GetExpressCheckoutDetails";
        encoder["TOKEN"] = token;

        string pStrrequestforNvp = encoder.Encode();
        string pStresponsenvp = HttpCall(pStrrequestforNvp);

        decoder = new NVPCodec();
        decoder.Decode(pStresponsenvp);

        string strAck = decoder["ACK"].ToLower();
        if (strAck != null && (strAck == "success" || strAck == "successwithwarning"))
        {
            return true;
        }
        else
        {

            retMsg = "ErrorCode=" + decoder["L_ERRORCODE0"] + "&" +
                "Desc=" + decoder["L_SHORTMESSAGE0"] + "&" +
                "Desc2=" + decoder["L_LONGMESSAGE0"];

            return false;
        }
    }

This only happens on some computers... and it happens right away not the session should not expire yet.

Any idea what I did wrong? Can any one please please help???

Thank you very very much!

like image 548
Ovi Avatar asked May 30 '13 07:05

Ovi


2 Answers

Are you using sandbox mode? I suspect it's causing the problem, while this shouldn't happen with real operations.

like image 127
Nznoonee Avatar answered Sep 23 '22 21:09

Nznoonee


Try to get the token from query, not from session:

use the function: Request.QueryString["token"];

Thanks, Çağlar

like image 39
user2435766 Avatar answered Sep 21 '22 21:09

user2435766