Retrieve a 2checkout order details using php / curl?

Hello,

I am trying to write a script to check if payments are active or have been stopped. I am using php and curl.

PHP Code:
$cologin     "username";
    
$copassword "password";
    
    
$ch curl_init();
    
curl_setopt($chCURLOPT_VERBOSE1); ########### debug
    
curl_setopt($chCURLOPT_URL'https://www.2checkout.com/2co/login');
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)');
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
    
curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_HEADER1);
    
curl_setopt($chCURLOPT_COOKIEJAR"my_cookies1.txt");  //initiates cookie file if needed
    
curl_setopt($chCURLOPT_COOKIEFILE"my_cookies1.txt");  // Uses cookies from previous session if exist
    
$result=curl_exec ($ch);
    
curl_close ($ch);
    
    
// GET COOKIE
    
eregi("TCOID\=([0-9a-z]+)"$result$regs);
    
$tcoid $regs[1];
    
    print 
$result;
    
    exit;
    
    
$ch curl_init();
    
curl_setopt($chCURLOPT_VERBOSE1); ########### debug
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS'username='.$cologin.'&password='.$copassword.'&TCOID='.$tcoid);
    
curl_setopt($chCURLOPT_URL'https://www.2checkout.com/2co/login?TCOID='.$tcoid);
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)');
    
curl_setopt($chCURLOPT_REFERER'https://www.2checkout.com/2co/login?TCOID='.$tcoid);
    
curl_setopt($chCURLOPT_COOKIEJAR"my_cookies.txt");  //initiates cookie file if needed
    
curl_setopt($chCURLOPT_COOKIEFILE"my_cookies.txt");  // Uses cookies from previous session if exist
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
    
curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
    
curl_setopt($chCURLOPT_HEADER1);
    
$result=curl_exec  ($ch);
    
curl_close ($ch);
    
    print 
$result
can anyone advise or assist? Has anyone else done this before?

 

 

 

 

Top