If you are doing Authorize.net, you might have a look at Web2py's built-in 
functionality:
http://web2py.com/books/default/chapter/29/14#Authorize.Net

I think the fputs is just logging and is not strictly necessary.

The fopen() would probably be urllib.urlopen() in Python:
http://docs.python.org/library/urllib.html


On Tuesday, June 5, 2012 6:26:24 AM UTC-7, Hassan Alnatour wrote:
>
> Sure python ! is there another way  , am sorry i dont understand php and i 
> dont know what md5 is  , am trying to use a payment gateway but all 
> examples are in php  , anyone can help me with this  two ??
>
> create a page in my website that receives some variables that are fetched 
> in the URL  , the* first part* :
>
> $tranid = strtolower($_REQUEST['tranid']);
> $mid = $_REQUEST['mid'];
> $appid = $_REQUEST['appid'];
> $muid = $_REQUEST['muid'];
> $orderid = $_REQUEST['orderid'];
> $aamount = $_REQUEST['aamount'];
> $vvalue = $_REQUEST['vvalue'];
> $currency = strtolower($_REQUEST['currency']);
> $status = $_REQUEST['status'];
> $trandatetime = $_REQUEST['trandatetime'];
> $psignature = $_REQUEST['psignature'];
>
> is this means fetching the values from the URL and saving them in 
> local variables ? 
>
>
> *second part* :
>
> $fp = fopen("postback.txt","a+");    // saving results in a text file 
> because this page is called in the background, server to server call
> if(!$fp){
> print "could't open file";
> exit;
> }
>
> i dont understand this , i see that you opend a file but this if the file 
> didnt open or wasnt there to exit but what happend to that file why do this 
> ??
>
>
> *last part which i dont  understand a thing :*
> *
> *
> fputs($fp,"tranid - $tranid" . "\n");
> fputs($fp,"mid - $mid" . "\n");
> fputs($fp,"appid - $appid" . "\n");
> fputs($fp,"muid - $muid" . "\n");
> fputs($fp,"orderid - $orderid" . "\n");
> fputs($fp,"aamount - $aamount" . "\n");
> fputs($fp,"vvalue - $vvalue" . "\n");
> fputs($fp,"currency - $currency" . "\n");
> fputs($fp,"status - $status" . "\n");
> fputs($fp,"trandatetime - $trandatetime" . "\n");
> fputs($fp,"psignature - $psignature" . "\n");
>
>
> if($psignature == md5($appid . $tranid . $orderid . $muid . $currency . 
> $aamount . $vvalue . $status . $secret) && $status == "1"){
>  fputs($fp,"payment is OK\n"); 
> } else {
> fputs($fp,"payment didn't go through\n");
> }
>
> fputs($fp,"\n" . "---------------------------" . "\n\n");
> fclose($fp);
>
>
> what sis fputs ?? what is going on here !!!
>  

Reply via email to