YooSERV Posted December 5, 2008 Share Posted December 5, 2008 (edited) Hello I need a callback script for my gateway script that I made. I'll sure share the gateway script after ! It's a phone gateway. You phone a number, you pay ~ 2€ (the client) and it gives you 1€ (the reseller). Script : <?php # Set the Gateway Variables $GATEWAYMODULE = array( "allopass_addfoundname" => "allopass_addfound", "allopass_addfoundvisiblename" => "Allopass", "allopass_addfoundtype" => "Invoices", # Invoices or CC ); function allopass_addfound_activate() { # Here you need to define the fields required to configure your gateway - vars: allopass_addfound, type, name, default value, friendly name, size, description defineGatewayField("allopass_addfound","text","urlvalid","","Url page validation","20",""); } function allopass_addfound_link($params) { # Gateway Specific Variables $gatewayusername = $params['username']; $gatewaytestmode = $params['testmode']; # Invoice Variables $invoiceid = $params['invoiceid']; $description = $params["description"]; $amount = $params['amount']; $duedate = $params['duedate']; # Client Variables $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phone']; # System Variables $companyname = $params['companyname']; $systemurl = $params['systemurl']; $currency = $params['currency']; # Enter your code submit to the gateway... $code = '<script type="text/javascript"> function rwf_ouvrir_popup(rwf_url){ var rwf_width = 300; var rwf_height = 390; var rwf_left = ((screen.width - rwf_width) / 2); window.open(rwf_url, "MicroPaiement", \'toolbar=0, location=0, directories=0, status=0, scrollbars=0,\' + \'resizable=1, copyhistory=0, menuBar=0, width=\'+rwf_width+\', height=\'+rwf_height+\',\'+ \'left=\'+rwf_left+\',top=40\'); } </script> <link href="http://data.rentabiliweb.com/css/popup2007/popup1_form.css" rel="stylesheet" type="text/css" /> <div id="rentabiliweb_form_popup"> <div id="rentabiliweb_form_popup_top"> <div id="rentabiliweb_form_popup_top_logo">YooSERV | 1 code = 1€</div> </div> <div id="rentabiliweb_form_popup_content"> <div id="rentabiliweb_form_popup_content_block_left"> <div id="rentabiliweb_form_popup_content_block_left_pays"> <div id="rentabiliweb_form_popup_content_block_left_pays_label">1€ sera créditer sur votre compte après validation du code.</div> <div id="rentabiliweb_form_popup_content_block_left_pays_flags"> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=fr&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/74.gif" alt="France" title="France" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=dt&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/238.gif" alt="France DOM TOM" title="France DOM TOM" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=be&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/22.gif" alt="Belgium" title="Belgium" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=ch&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/205.gif" alt="Switzerland" title="Switzerland" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=ca&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/38.gif" alt="Canada" title="Canada" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=lu&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/131.gif" alt="Luxembourg" title="Luxembourg" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=ro&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/180.gif" alt="Romania" title="Romania" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=de&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/5.gif" alt="Germany" title="Germany" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=es&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/63.gif" alt="Spain" title="Spain" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=it&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/114.gif" alt="Italy" title="Italy" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=uk&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/81.gif" alt="United KingDom" title="United KingDom" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=at&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/16.gif" alt="Austria" title="Austria" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=pl&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/171.gif" alt="Poland" title="Poland" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=nz&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/159.gif" alt="New Zealand" title="New Zealand" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=au&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/15.gif" alt="Australia" title="Australia" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=us&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/65.gif" alt="United States" title="United States" /> </a> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116&pays_code=nl&skin_color=blue2&default_language=fr&default_payment_type=audiotel\')"> <img src="http://data.rentabiliweb.com/i/form2007/flags/25_15/167.gif" alt="Netherlands" title="Netherlands" /> </a> </div> </div> <div id="rentabiliweb_form_popup_content_block_left_cb"> <div id="rentabiliweb_form_popup_content_block_left_cb_label"> Payer par carte bleue : </div> <div id="rentabiliweb_form_popup_content_block_left_cb_img"> <a href="javascript:void(0);" onclick="rwf_ouvrir_popup(\'http://composants.rentabiliweb.com/form/popup.php?doc_id=80842&site_id=345116\')" > <img src="http://data.rentabiliweb.com/i/form2007/imgs/cb.gif" alt="CB" /> </a> </div> </div> <div id="rentabiliweb_form_popup_content_block_left_code"> <form action="http://secure.rentabiliweb.com/micropaiement.php" method="get"> <div id="rentabiliweb_form_popup_content_block_left_code_label"> Saisissez votre code: </div> <div id="rentabiliweb_form_popup_content_block_left_code_input"> <input type="hidden" name="id" value="80842" /> <input type="text" name="code" value="" id="rentabiliweb_form_popup_content_block_left_code_input_code" /> </div> <div id="rentabiliweb_form_popup_content_block_left_code_button"> <input type="image" src="http://data.rentabiliweb.com/i/form2007/imgs/ok.gif" align="absmiddle" value="ok" name="submit" alt="Validez" /> </div> </form> </div> </div> </div> <div class="clear_both"></div> </div> '; return $code; } function allopass_addfound_capture($params) { # Gateway Specific Variables $gatewayusername = $params['username']; $gatewaytestmode = $params['testmode']; # Invoice Variables $invoiceid = $params['invoiceid']; $amount = $params['amount']; # Client Variables $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phone']; # Card Details $cardtype = $params['cardtype']; $cardnumber = $params['cardnum']; $cardexpiry = $params['cardexp']; # Format: MMYY $cardstart = $params['cardstart']; # Format: MMYY $cardissuenum = $params['cardissuenum']; # PERFORM TRANSACTION HERE # PUT TRANSACTION ID INTO $transid $transid = "12345"; # PUT RESULT INTO $result $gatewayresult = "success"; # PUT DEBUG DATE into $desc $debugdata = "Response Code => 1\nResult => Successful\nAVS Result => 0"; # Check Result if($gatewayresult=="success") { addInvoicePayment($invoiceid,$transid,$amount,$fees,"allopass_addfound","on"); logTransaction("allopass_addfound",$debugdata,"Successful"); sendMessage("Credit Card Payment Confirmation",$invoiceid); $result="success"; } else { logTransaction("allopass_addfound",$debugdata,"Declined"); sendMessage("Credit Card Payment Failed",$invoiceid); $result="declined"; } return $result; } ?> Ok so what I need is a callback script, so when the guy enter the code, it put "PAID" in green. What I can do with the script is : - Validate URL (when the code IS ok, it goes to a Validate URL) - The script won't go to the validate page if the code is wrong (auto verification included in the script) I also have a php script that (secure) verify in the validate URL if he has put a code before joining that URL. Here is it : <? /** * Protection micropaiement Rentabiliweb */ session_start(); // id du document protégé $idprotect = "80842"; // PHP5 avec register_long_arrays désactivé? if (!isset($HTTP_GET_VARS)) { $HTTP_SESSION_VARS = $_SESSION; $HTTP_SERVER_VARS = $_SERVER; $HTTP_GET_VARS = $_GET; } //construction de la requête if ($idprotect==$HTTP_GET_VARS[id]) { $requete = "http://secure.rentabiliweb.com/Micropaiement.php?act=ss&"; $requete .= $HTTP_SERVER_VARS['QUERY_STRING']; $requete .= "&REMOTE_ADDR=".$HTTP_SERVER_VARS['REMOTE_ADDR']; $tabrep = @file($requete); } else { unset($tabrep); } if($tabrep[0] == "OUI") { $HTTP_SESSION_VARS["RentaSess"] = true; HERE THE CODE OF PROTECTED DOCUMENT } else { $HTTP_SESSION_VARS["RentaSess"] = false; header("Location: URL IF NO CODE"); exit(0); } ?> Please accept :'((((( I'll be so glad! Edited December 5, 2008 by YooSERV 0 Quote Link to comment Share on other sites More sharing options...
Blazr Posted December 7, 2008 Share Posted December 7, 2008 Looks like a good idea, I really hope somebody can finish this... 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.