PHP - Php - Suggestions Of Payment Method
Hello,
This whole time working online and what not, I always end up using PayPal as a payment method. How to I use credit cards as a payment method ... for free? Can someone please explain the process of payment via credit cards Thanks Similar Tutorials
My script has 3 classes (that are relevant to this discussion): DB, User and Validate. They are all in independent files and loaded automatically, when required, by an autoloader.
The error messages I am getting a Any pointers as to what I am doing wrong, or what I should be doing, would be most welcome. Hey, Within my experience of PHP, I have never had anything to do with making secure payments before. And this is a problem I can't seem to get around. I want to let people purchase a premium version of a game, and it will add their name to a PHP file or databse after they are redirected from PayPal to a special page that adds their username to the PHP file after typing it in. How would one make sure they don't just go to the webpage VIA the URL, and that they only came from the PHP redirect after purchase? Hi guys, i'm in a dead end with this. I'm more a design guy and i'm trying to implement these 2 payment gateways on a website i'm launching soon but don't know how to do it. I have the php sample files from bitpay and the other payment gateway (offline atm payments). I can implement a button for the payment but the php needed to receive payment notification, ipn or callback, and update user balance in the database it's way out of my knowlegde. Can someone give me a hand in implementing this? I have paypal runing but i'd like to have these other two options. Thanks in advance, Tiago Vasconcelos I am building program to manage payment/monthly payments. I've ran into an issue that I haven't been able to overcome and need some help. I've been lurking for a while and decided it was time to ask you guys...Here's the issue: I have a table 'payments' that contains scheduled payments that looks like: id clientid paymentduedate balance expected pending 367 112233 4/16/2011 1030.00 257.50 Y 368 112233 5/16/2011 1030.00 257.50 Y 369 112233 6/16/2011 1030.00 257.50 Y 370 112233 7/16/2011 1030.00 257.50 Y What I need to do that I haven't figured out is to adjust the expected amount according to the payment, update the status to N (not pending) without affecting the later expected payments. For example: they make a payment of $257.50, applies that to row 367, sets the status to N, but leaves the other status' to Y (for obvious reasons). the make a payment of $250.00, leaving the balance at $7.50, so lets add $7.50 to row 368, mark 367 status to N the make a payment of $300.00, leaving the expected balance at $0.00 for row 367, but adjust the balance for row 368 to $215.00 Any ideas? Thanks if the date of selling goods " $date = "2011/06/05"; and if we have payment after of $days = "15"; - (15 days), how to calculate when the last day for payment? Code: [Select] ${$payment['amount']} using the $ next to it doesn't work I am using itinside double quotes, any way I can get that dollar sign right next to it? This for people buying stuff off my forum i want the amount to show right by the $ dollar sign And im working inside double quotes only Hi, I've integrated paypal payment pro over my website. I don't know how can i test it. can any one help me out? my site address is : http://pacific-labs.com/paymybill.php Please help Hi I was playing with a poll, but for some reasons it won't email me(the bottom most part). Where did I go wrong? Also any suggestions on how to improve this? Thanks your the best guys! <?php include('config.php'); $name = strip_tags($_POST['name']); $email = $_POST['email']; $qst_id=strip_tags($_POST['qst_id']); //if no ajax $opt = strip_tags($_POST['opt']); $s_id = $_SERVER['REMOTE_ADDR']; //validate email if (!preg_match('/^.+@.+\..{2,3}$/',$email)); { $email = 'email was blocked'; } if (strlen($name) >= 50) { $name = 'name was blocked'; } if ($opt == '') { $vote ="no"; } elseif (($opt=='Yes') || ($opt=='No')) { $qt=mysql_query("insert into plus_poll_ans(s_id,qst_id,opt) values('".$s_id."','".$qst_id."','".$opt."')"); } else { $vote = "no"; } echo "<font size='2' face='Verdana' color='#000000' style='font-size:1.2em;'> Declaration of Faith</font>"; $qst_id=1; // change this to change the poll /* Find out the question first */ $fg=mysql_query("select qst from plus_poll where qst_id='".$qst_id."'"); $row=mysql_fetch_object($fg); echo "<br><b><br>$row->qst</b><br>"; // display the question /* for percentage calculation we will find out the total number of answers ( options submitted ) given by the visitors */ $rt=mysql_num_rows(mysql_query("select ans_id from plus_poll_ans where qst_id='".$qst_id."'")); /* Find out the answers and display the graph */ $query="select count(*) as no,qst,plus_poll_ans.opt from plus_poll,plus_poll_ans where plus_poll.qst_id=plus_poll_ans.qst_id and plus_poll.qst_id='".$qst_id."' group by opt desc "; $rs=mysql_query($query); //count the answers by yes or no $count= "SELECT opt, count(opt) FROM plus_poll_ans GROUP BY opt desc"; $result = mysql_query($count) or die(mysql_error()); //separate the results while($row = mysql_fetch_array($result)){ $total_opt[] = $row['count(opt)']; } // Print out result echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' >"; $i = 0; while($noticia = mysql_fetch_array($rs)){ echo "<tr> <td width='5%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>$noticia[opt]</font></td>"; $width2=$noticia['no'] *10 ; /// change here the multiplicaiton factor ////////// $ct=($noticia[no]/$rt)*100; $ct=sprintf ("%01.2f", $ct); // number formating echo " <td width='20%' bgcolor='#F1F1F1'> <font size='1' face='Verdana' color='#000000'>($ct %)</font></td><td width='60%' align='left' bgcolor='#F1F1F1'> <img src='graph.jpg' height=10 width=$width2>"; echo "</td><td width='15%' align='right'>"; echo "<font size='1' face='Verdana' color='#000000'>".$total_opt[$i]; echo " votes"; echo "</font></td>"; echo "</tr>"; echo "<tr> <td bgcolor='#ffffff' colspan=2>"; echo "</td>"; echo "</tr>"; $i=$i+1; } echo "<tr><td></td><td></td><td><font size='1' face='Verdana' color='#000000'>Total Votes:</font></td><td align='right'>"; //count the total votes $count = 'select count(ans_id) from plus_poll_ans'; $count = mysql_query($count); $count = mysql_fetch_array($count); $total_count = $count['count(ans_id)']; echo "<font size='1' face='Verdana' color='#000000'>".$total_count." votes</font>"; echo "</td></tr>"; echo "</table>"; echo "</font>"; if ($vote!='no') { $to = 'person1@example.com, person2@example.com'; $subject = 'Someone just made a declaration of faith'; $message = "Someone from the ip address ".$s_id; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: Vote Detector <website@example.com>'. "\r\n"; if ($name!='') { $message = $message." with the name ".$name; } if ($email!='') { $message = $message." with email ".$email; } $message = $message." voted "."yes<br/>"; $message = $message."total number of people who declared their faith: ".$total_count." people<br/>"; $message = $message."with a total of ".$total_opt[0]." people saying yes"; $message = $message." and a total of ".$total_opt[1]." people saying no<br/>"; mail($to, $subject, $message, $headers); } ?> what i want is to upload my informations to database when i press the submit button. but if any field is empty it should show a text that all fields are required but in the same page(up or down to the form). However with this code my database is not working>informations are not send to the database. why?Any sggesstions? Code: [Select] <?php // Start a session for error reporting session_start(); //Connect to database require("includes/connect_to_mysql.php"); //check if the button is pressed if(isset($_POST['submit'])){ // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "upload_form_images/"; // Get our POSTed variables $name = $_POST['name']; $surname = $_POST['surname']; $email = $_POST['email']; $city = $_POST['city']; $details = $_POST['details']; $price = $_POST['price']; $image = $_FILES['image']; // Sanitize our inputs $name = mysql_real_escape_string($name); $surname = mysql_real_escape_string($surname); $email = mysql_real_escape_string($email); $city = mysql_real_escape_string($city); $details = mysql_real_escape_string($details); $price = mysql_real_escape_string($price); $image['name'] = mysql_real_escape_string($image['name']); // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $name == "" || $surname == "" || $email == "" || $city == "" || $details == "" || $price == ""|| $image['name'] == "" ) { $_SESSION['error'] = "Te gjithe fushat duhet plotesuar"; echo "Te gjithe fushat duhet plotesuar"; header("Location: upload_form.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "Fotografite duhet te jene te formateve jpg, jpeg, bmp, gif, ose png"; header("Location: upload_form.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "Ju lutem nderroni emrin e fotos."; header("Location: upload_form.php"); exit; } /* // See if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM upload_form WHERE name='$name' LIMIT 1"); $productMatch = mysql_num_rows($sql); // count the output amount if ($productMatch > 0) { $_SESSION['error'] = 'Ju lutem nderroni emrin sepse egziston ne databaze'; header("Location: upload_form.php"); exit(); } */ // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $sql = "insert into people (name, surname, email, city, details, price, filename) values ('$name', '$surname', '$email', '$city', '$details', '$price', '" . $image['name'] . "')"; $result = mysql_query($sql) or die ("Futja e te dhenave ne databaze DESHTOI: " . mysql_error()); echo "Shtimi i te dhenave u krye me SUKSES"; exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Shtimi i te dhenave NUK u krye me Sukses. Ju lutem provoni perseri"; header("Location: upload_form.php"); exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Qiraja.com</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="all" /> <!--[if lte IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" media="all" /><![endif]--> <!--[if IE]><style type="text/css" media="screen"> #navigation ul li a em { top:32px; } </style><![endif]--> </head> <body> <!-- Header --> <div id="header"> <div class="shell"> <!-- Logo --> <h1 id="logo"><a href="#">Company Name</a></h1> <!-- End Logo --> <!-- Navigation --> <div id="navigation"> <ul> <li><a href="#">Prishtine<span><em></em></span></a></li> <li><a href="#">Prizren<span><em></em></span></a></li> <li><a href="#">Ferizaj<span><em></em></span></a></li> <li><a href="#">Peje<span><em></em></span></a></li> <li><a href="#">Mitrovice<span><em></em></span></a></li> <li><a href="#">Gjilan<span><em></em></span></a></li> <li class="last"><a href="#">Gjakove<span><em></em></span></a></li> </ul> </div> </div> </div> <div id="slider"> <div class="shell"> <!-- Slides --> <div class="slides"> <ul> <!-- Slide --> <li> <form action="upload_form.php" enctype="multipart/form-data" name="myForm" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="center">Name</td> <td width="80%"><label> <input name="name" type="text" id="name" size="25" /> </label></td> </tr> <tr> <td align="center">Surname</td> <td><label> <input name="surname" type="text" id="surname" size="25" /> </label></td> </tr> <tr> <td align="center">Email</td> <td><label> <input name="email" type="text" id="email" size="25" /> </label></td> </tr> <tr> <td align="center">City</td> <td><select name="city" id="city"> <option value=""></option> <option value="Prishtine">Prishtine</option> <option value="Prizren">Prizren</option> <option value="Ferizaj">Ferizaj</option> <option value="Peje">Peje</option> <option value="Mitrovice">Mitrovice</option> <option value="Gjilan">Gjilan</option> <option value="Gjakove">Gjakove</option> </select></td> </tr> <tr> <td align="center">Cmimi</td> <td><label> <input name="price" type="text" id="price" size="10" /> € </label></td> </tr> <tr> <td align="center">Fotografite</td> <td><label> <input type="file" name="image" id="image" /> </label></td> </tr> <tr> <td> </td> <td align="right"><label> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <input type="submit" name="submit" id="submit" value="Shto te dhenat" /> </label></td> </tr> </table> </form> </li> <!-- End Slide --> <!-- Slide --> <li> <div class="slide-info"> <h2><span>Reklamo</span> Shtepine</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam.</p> <p>Quisque quis vestibulum turpis. Sed venenatis ipsum laoreet elit pulvinar vitae pharetra massa dignissim. Curabitur ligula sapien, auctor ut porttitor a, ultricies lobortis dui. Suspendisse lacinia tellus a diam rutrum rhoncus. </p> <a href="#" class="more">read more</a></p> </div> <span class="slide-image image1"></span> </li> <!-- End Slide --> <!-- Slide --> <li> <div class="slide-info"> <h2><span>Reklamo</span> Apartmanin</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam.</p> <p>Quisque quis vestibulum turpis. Sed venenatis ipsum laoreet elit pulvinar vitae pharetra massa dignissim. Curabitur ligula sapien, auctor ut porttitor a, ultricies lobortis dui. Suspendisse lacinia tellus a diam rutrum rhoncus. </p> <a href="#" class="more">read more</a></p> </div> <span class="slide-image image1"></span> </li> <!-- End Slide --> </ul> </div> <!-- End Slides --> </div> </div> <!-- End Slider --> <!-- Slider Nav --> <div id="slider-navigation"> <div class="shell"> <ul> <li><a href="index.php" class="active">Kthehu ne fillim<strong>Home</strong><em class="ico1"></em></a></li> <li><a href="upload_form.php">Shto<strong>Upload</strong><em class="ico2"></em></a></li> <li class="last"><a href="contact_form.php">Kontakti<strong>Contact</strong><em class="ico3"></em></a></li> </ul> </div> </div> <!-- End Slider Nav --> <!-- Main --> <div id="main"> <div class="shell"> <!-- Cols --> <div class="cols"> <div class="cl"> </div> <!-- Col --> <div class="col"> <h3>Sed Turpis sem</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. Sed turpis sem, interdum sit amet egestas a, mattis non libero.<br /><a href="#" class="more">read more</a></p> <p>Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <!-- Col --> <div class="col"> <h3>Ligula amet augue</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. <br /><a href="#" class="more">read more</a></p> <p>Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <!-- Col --> <div class="col col-last"> <h3>Ligula amet augue</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam arcu ligula, faucibus eu imperdiet eu, bibendum sit amet augue. <br /><a href="#" class="more">read more</a></p> <p>Sed turpis sem, interdum sit amet egestas a, mattis non libero. Suspendisse tristique nisi sed justo accumsan vel mattis nulla fermentum. Etiam varius est id mi fermentum aliquam. <br /><a href="#" class="more">read more</a></p> </div> <!-- End Col --> <div class="cl"> </div> </div> <!-- End Cols --> </div> </div> </body> </html> Hello Friends, I am developing a website with frontend as php and backend MySQL. And i am about to integrate the Skipjack payment gateway. But due to lack of sufficient materials and knowledge about this gateway. I am having the problems in integrating this. So all i got is the encrypted FormBuilder html form code which displays a order button only. When it is clicked the form of skipjack loads. But those form fields are already present in the website. So all i need is to pass the form field value plus other values from my website to the skipjack website and to redirect back to my website when the payment is done. Is there any way to do so? Thanks in advance. STRANGESOUL Hi all,
I am building a website for my local motorclub.
we are wanting to start taking online payments for membership and events. I have built a members only area - the way to get access is for a member of staff to accept the registration. this is all fine for members who pay via cheque or simular.
I am wanting a sign up process to include the payment page, was going to use paypal as the merchant. So if people want to join the club they are able to do so and get immediate access to the members only page instead of waiting for staff to check if the payment has cleared then set up there account etc.
so basically i need a sign-up form (which is done) then a purchase button at the bottom, which takes the payment and then redirects to the website but 'tells my website the payment has been taken and to give full access'.
I cant really explain how i want it, but i hope you understand from what i have said.
Hi I will be making a php code which will verify if the user have successfully made the relevant payments. I have never worked on such scripts and this would be my first time. I was looking around and got a rough idea that payment processors do provide some kind of demos to test script functionality without actually making transactions. I was wondering if I can find some articles about PayPal and 2CheckOut payment processors and how to go around them. I believe 2checkout provide demos for testing purposes, does paypal? I only have a 2checkout account as I am from a non supported paypal country, but guess I can just make an account for testing purposes but offcourse no transactions will be there! I need an Event Registration Script that allows for payment with Paypal & saves form details and Paypal transaction ID to my MySQL DB After the payment has been finalized. I want to have ppl be able to register for camp, and with that choose if they want to preorder the new camp DVD, order last camps DVD, order both DVD's or neither DVD. I am not incredible gifted with PHP since I am new so please be gentle. What do you recommend? I would like to learn a little from this process instead of buying a completed script. Thanks Hi guys, I just want to know if any one has worked with streamline payment gateway before, we are building a cart for a customer, a in house built sulition, and just wanted some help / advice on how to process payments. The customer has picked streamline as their merchant Thank you I know paypal has some sort of php api, but I know nothing about it and where to find it. I want to create an app that will instantly pay users from my account after a certain action is deployed on my site. I know this is possible, a few years ago I was going to hire a programmer to do it, but he wanted to much... But how would I go about doing this? Idk where to begin. It seems like it would be pretty simple, but since Id be wokring with third party code, or even paypal in general I can see it being a little more difficult. Im sure itd be working with cURL? I'm trying to create a series of web pages that will lead to a FINAL SALE page. At that point, I require TWO things to happen. First, the customer must pay the displayed total. Second, some kind of automated receipt needs to be generated so that a script can allow the customer to progress further. An applicable example would be a customer navigating through web pages of paintings by different artists and then choosing to see Alfred's latest unreleased paintings for a $2 fee. After paying the $2, the next web page would validate receipt of the payment, and now allow the customer to access Alfred's gallery. Is there a template for this sort of thing? Obviously, an online payment would require a credit card. Any recommendations for service providers would be appreciated. I have contacted Pay Pal, but they seem trained to encourage Ebay type sales and insist that the email I receive as confirmation would be sufficient. However, that would require me to check my email and manually grant access to galleries without ever sleeping. LOL. I'm sure there is a more viable solution, but need some advice and guidance from those that have already traversed this obstacle. I am not sure what to look for to even get started. If some one could help point me in the right direction that would be appreciated.
I created a customer system that tracks contracts and invoices ect. Where do I start if I would want a customer to be able to go to the website, sign up, and their own version of the system would be created.
Do I just write a script that creates a new database with the correct credentials? Do all of the users access the same files but just have different database. Do I have to copy the directory of files to a specific folder for each customer?
I know there must be tons of websites that once you sign up for example a calendar app that keeps your data seperate from everyone else.
Any help is appreciated.
Thanks
Jack
Hi guys, I'm not really experienced with PHP to a high degree, very very basic knowledge. I took a website for a client which was an e-commerce website in need of a re-host? Sounds Simple enough. However when uploading the site i found it went to a secure server outside of the one I was hosting it on when it came to submitting the payment. I then had to get access to these files and get them working on locally on my server. This where I'm having trouble... It's easier to show you the problems rather than try and explain them. This is the original working version of the payment page: https://secure.wilkesdesign.com/egowear/pay.php And this is my version: http://www.egowear.co.uk/payment/pay.php Which is essentially a duplicate, all I have changed is the details for it accessing the database on the the server which is included in "inc_db.php" As well as updating the link in protx.php to the correct TermUrl. The rest is the same as the original If you go to the first page and enter no details and just click "Make Payment" at the bottom of the page, you should get several validation errors appear in red at the top of the page. Do exactly the same on my version, the second link. And nothing seems to happen, no errors nothing. I'll admit i'm quite out of my depth here now, and I'm betting it's just me missing something obvious. So if anyone has any ideas I'd really appreciate it . Best Regards Chris Source code for pay.php: Code: [Select] <?php ini_set('display_errors','1'); ini_set('display_startup_errors','1'); error_reporting(E_ALL ^ E_NOTICE); $homeURL = "http://www.egowear.co.uk/"; //$homeURL = "http://intranet.wilkesdb.com/ego/"; // include at the start of the script being called. //error_reporting(E_ALL); ini_set('display_errors', '1'); $asId = 1; include "includes/inc_db.php"; $db = new DB; $db1 = new DB; $vatRate = $db->getval("SELECT glValue FROM globals WHERE glId=1","glValue")+0; $xorCountry = 2; $orDelCountry="UK"; $orPayNote='Unconfirmed'; $orPaid=0.00; $header = "MIME-Versin: 1.0\r\n" . "Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n" . "From: Egowear <sales@egowear.co.uk>\r\n"; $header .= "Reply-To: Egowear <sales@egowear.co.uk>\r\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\r\n"; if($basketURL) { $basketArray = double_explode(":","|",$basketURL); //print_r($basketArray); $subTotal=$discount=$orDelCharge=0; $items = $subTotal = $totalWeight = 0; foreach ($basketArray as $key => $val) { $extraCost = 0; $prId = $val[0]; $qty = $val[1]; $prSize=$val[2]; $prColour=$val[3]; $extraCost = $val[5]; $db->query("SELECT prtName, prtPrice, prtImage, prColour, prPrtId, prVatable, IF(prWeight>0,prWeight,prtWeight) weight FROM products, prtypes WHERE prId='$prId' AND prtId=prPrtId"); $db->next_record(); list($prtName, $prPrice, $prtImage, $prColour, $prPrtId, $prVatable, $weight) = $db->Record; $prPrice = $prPrice + $extraCost; if($prVatable) $prPrice = calcVat($prPrice); $totalWeight += $qty*$weight; $items += $qty; $lineTotal = $qty*$prPrice; $subTotal += $lineTotal; } // calulate delivery (use function!!!!) $orDelChargeArray = getDelCharge($totalWeight, $xorCountry); //var_dump($orDelChargeArray); $deliveryTypesCount = count($orDelChargeArray); //echo "count: $deliveryTypesCount"; if (!$deliveryTypesCount) $orDelCharge = -1; elseif ($deliveryTypesCount==1) { list($crType) = array_keys($orDelChargeArray); $orDelCharge = $orDelChargeArray[$crType]; } if ($delOverride) $orDelCharge = $delOverride; $orVcId=0; if($xcnId) { $voucherCode = $db->getval("SELECT cnCurrentVoucherCode FROM contacts WHERE cnId='$xcnId'","cnCurrentVoucherCode"); if($voucherCode) { list($valid, $offerDescription, $vcDiscountPercent, $vcDiscountValue, $vcFreePostage, $vcMinValue, $orVcId) = validateVoucherCode($voucherCode, $xcnId); if($valid) { if($vcFreePostage) $orDelCharge=0; if($vcDiscountPercent>0) { if(!($vcMinValue>0) || ($subTotal>=$vcMinValue)) $discount = $subTotal*($vcDiscountPercent/100); } if($vcDiscountValue>0) { if(!($vcMinValue>0) || ($subTotal>=$vcMinValue)) $discount = $vcDiscountValue; } } } } $orTotal = round($subTotal+$orDelCharge-$discount,2); //$orTotal = round($subTotal*1.175,2); //echo formatnumber($subTotal).",".formatnumber($orDelCharge).",".formatnumber($discount); //$orTotal=0.01; } //echo "$subTotal<br />$orDelCharge<br />"; //echo "$orTotal<br />"; if ($sbmt) { // not used but leave in just in case!! if ($paypalOK) $ignorePayment = 1; // go with payment processing // first validate // validate fields if ($action!="callback") { if (strlen($cardHolder) < 2) $error = " • Enter the name as it appears on your card <br>"; if (!ereg("^[0-9]{10,20}", $cardNumber)) $error .= " • Please enter a valid card number <br>"; if ($startDate AND !ereg("^[0-9]{2}[0-9]{2}", $startDate)) $error .= " • Your start date is invalid <br>"; if (!ereg("^[0-9]{2}[0-9]{2}", $expiryDate)) $error .= " • Your expiry date is invalid <br>"; $billingAddress = $ccAddress1."\n\r".$ccAddress2."\n\r".$ccAddress3."\n\r".$ccTown; //if (strlen($billingAddress) < 10) $error .= " • Enter a valid billing address <br>"; $ccPostcode = strtoupper($ccPostcode); if($orDelCountry == "UK") { //if (!ereg("^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1}[[:space:]][0-9]{1}[A-Z]{2}", $ccPostcode)) $error .= " • Enter a valid billing postcode. (Ensure that you have included the space!) <br>"; } if (!ereg("^[0-9]{3,4}", $CV2)) $error .= " • You have missed out your CV2 number<br>"; $orDelPostcode = strtoupper($orDelPostcode); //if ($orDelCountry == "UK") if (!ereg("^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1}[[:space:]][0-9]{1}[A-Z]{2}", $orDelPostcode)) $error .= " • Your delivery postcode is invalid. (Ensure that you have included the space!) <br>"; // check if UK and BT (i.e. NI postcode) - should do this as part of the delivery package. //if ($orDelCountry == "UK" && substr($orDelPostcode, 0, 2) == "BT") $error .= " • You have selected UK postage. 'BT' postcodes are Northern Ireland and have different rates from mainland UK. Please click 'Cancel' and sellect the correct postal type."; if (strlen($orName) < 2) $error .= " • Please enter a customer name<br>"; if (strlen($orTel) < 5) $error .= " • Please tell us your telephone number<br>"; //if (strlen($orDelAddress1) < 2 || strlen($orDelTown) < 2) $error .= " • Please enter a valid customer address<br />"; if ($cnUsername) { $chkCnId = $db->getval("SELECT cnId FROM contacts WHERE cnUsername = '$cnUsername'", "cnId"); if ($cnUsername AND $chkCnId AND $chkCnId != $cnId) $error .= " • Your username is already in use by someone else. Please try another<br />"; } } //end if not callback // if(!eregi('^([a-z0-9\._-])+@([^\.]+\.[^\.]+)', $cnEmail, $matched)) $error .= " • Enter a valid email address<br>"; // second go with payment if (!$error) { /////////////////////////////////////// Payment not started yet so create order /////////////////////////////////// if(!isset($_GET['action']) && !($orId)) { //Add order if($xcnId>0) { // update contact $db->query("UPDATE contacts SET cnName='$cardHolder', cnEmail='$orEmail', cnAddress1='$ccAddress1', cnAddress2='$ccAddress2', cnAddress3='$ccAddress3', cnTown='$ccTown', cnPostcode='$ccPostcode' WHERE cnId='$xcnId'"); } else { $db->query("INSERT INTO contacts SET cnName='$cardHolder', cnUsername='$cnUsername', cnPassword='$cnPassword', cnEmail='$orEmail', cnAddress1='$ccAddress1', cnAddress2='$ccAddress2', cnAddress3='$ccAddress3', cnTown='$ccTown', cnPostcode='$ccPostcode', cnGroups='$cnGroups', cnPrefs='$cnPrefs'"); $xcnId = mysql_insert_id(); } if ($paypalOK) $orStatus = "Check Paypal Payment"; else $orStatus = "Payment Pending"; $db->query("INSERT INTO orders SET orCnId='$xcnId', orName='$orName', orDelAddress1='$orDelAddress1', orDelAddress2='$orDelAddress2', orDelAddress3='$orDelAddress3', orDelTown='$orDelTown', orDelCounty='$orDelCounty', orDelPostcode='$orDelPostcode', orDelCountry='$orDelCountry', orEmail='$orEmail', orDate=NOW(), orDelCharge='$orDelCharge', orDelType='$orDelType', orStatus='$orStatus', orVcId='$orVcId', orPayNote='$orPayNote', orPaid='$orPaid', orTotal='$orTotal', orDiscount='$discount', orTel='$orTel', orVatRate='$vatRate'"); $orId = mysql_insert_id(); $orVat=$orNet=0; foreach ($basketArray as $key => $val) { $flexString=""; $prId = $val[0]; $qty = $val[1]; $prSize=$val[2]; $flexString=$val[3]; $oiVat=$oiNet=0; $db->query("SELECT prtName, prtPrice, prtImage, prColour, prPrtId, prVatable, IF(prWeight>0,prWeight,prtWeight) weight FROM products, prtypes WHERE prId='$prId' AND prtId=prPrtId"); $db->next_record(); list($prtName, $prPrice, $prtImage, $prColour, $prPrtId, $prVatable, $weight) = $db->Record; $oiNet=$prPrice; if($prVatable) { $prPrice = calcVat($prPrice); $oiVat=$prPrice-$oiNet; $orVat+=$oiVat; } else $oiVat=0; if($qty) { $db->query("INSERT INTO orderitems SET oiOrId='$orId', oiPrId='$prId', oiQty='$qty',oiSize='$prSize',oiColour='$prColour', oiWidth='$prWidth',oiVat='$oiVat',oiNet='$oiNet',oiPriceEach='$prPrice', oiName='$prtName', oiFlexString='$flexString'"); $lineTotal = $qty*$prPrice; } } } $db->query("UPDATE orders SET orVat='$orVat', orNet='$orNet' WHERE orId='$orId'"); $vendorTxCode = "Order_".$orId; $billingAddress = substr($ccAddress1."\n\r".$ccAddress2."\n\r".$ccAddress3."\n\r".$ccTown,0,199); include("includes/protx.php"); $data = array ( 'VPSProtocol' => '2.22', 'TxType' => 'PAYMENT', 'Vendor' => 'egowear', 'VendorTxCode' => substr(substr($vendorTxCode,0,40-strlen(time())).'_'.time(),0,40), 'Amount' => number_format($orTotal,2), 'Currency' => "GBP", 'Description' => substr("Egowear Website Order: (".trim($typeDescrip).")",0,99), 'CardHolder' => substr($cardHolder,0,50), 'CardNumber' => substr($cardNumber,0,20), 'StartDate' => substr($startDate,0,4), 'ExpiryDate' => substr($expiryDate,0,4), 'IssueNumber' => substr($issueNumber,0,2), 'CV2' => substr($CV2,0,4), 'CardType' => substr($cardType,0,15), 'BillingAddress' => substr($billingAddress,0,199), 'BillingPostCode' => substr($ccPostcode,0,10), 'CustomerName' => substr($orName,0,99), 'CustomerEMail' => substr($orEmail,0,254), 'ContactNumber' => substr("",0,20), 'ClientIPAddress'=>$_SERVER['REMOTE_ADDR'] ); //echo $vendorTxCode; if($data) $optRequest = formatData($data); /////////////////////////////////////// Protx.php /////////////////////////////////// if(!isset($_GET['action'])) { $p = null; $response1 = _CompletePayment($p,$Vars,$optRequest,$orId); if(substr($response1,0,6)=="iframe") $iframecode=substr($response1,6); else if($response1) $error.=$response1; else $iframecode=0; } else if($_GET['action'] == 'callback') { $error .= __VerifyCallback($_POST, $Vars,null,$orId); } else if($_GET['action'] == 'callbacktest') { $optRequest = '... .. '; __VerifyCallback($p = null, $Vars, $optRequest); } else { $error.=('Invalid action'); } } // no error } else { // end submit if($xcnId && !$error && !$cardHolder) { $db->query("SELECT cnName, cnAddress1, cnAddress2, cnAddress3, cnTown, cnPostcode FROM contacts WHERE cnId='$xcnId'"); $db->next_record(); list($cardHolder, $ccAddress1, $ccAddress2, $ccAddress3, $ccTown, $ccPostcode) = $db->Record; /*$orName = $cardHolder; $orDelAddress1 = $ccAddress1; $orDelAddress2 = $ccAddress2; $orDelAddress3 = $ccAddress3; $orDelTown = $ccTown; $orDelPostcode = $ccPostcode;*/ } } // end no submit if($iframecode) echo $iframecode; else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Egowear</title> <link rel="stylesheet" type="text/css" href="includes/default.css"> <script language="javascript"> function goCopy() { document.getElementById('cardHolder').value = document.getElementById('orName').value; document.getElementById('ccAddress1').value = document.getElementById('orDelAddress1').value; document.getElementById('ccAddress2').value = document.getElementById('orDelAddress2').value; document.getElementById('ccAddress3').value = document.getElementById('orDelAddress3').value; document.getElementById('ccTown').value = document.getElementById('orDelTown').value; document.getElementById('ccPostcode').value =document.getElementById('orDelPostcode').value; } </script> <!--[if lt IE 7]><script defer type="text/javascript" src="pngfix.js"></script><![endif]--> </head> <body> <div align="center"> <? include "includes/nav.php"; ?> <div id="wrapper2" style="position:relative;z-index:1;top:25px"> <div align="left" id="<?= $theme ?>"> <div style="text-align:left;padding:18px 0px 0px 18px;overflow:hidden;"> <div style="float:right;padding:20px 160px 0px 0px;border:0px solid #000;width:535px;text-align:center;height:25px"> <h1><?= $wcTitle ?></h1> </div> <div><img src="images/logo.jpg" /></div> </div> <div align="left" class="pageMiddle"> <div style="position:relative;z-index:1;padding:2px 30px 10px 32px;" > <h1>Card Payment</h1> <form name="form1" method="post" action=""> <table id="tableSubCategories" style="width:100%;text-align:left;"> <tr id="trColumnTitles" > <td colspan="2" style=""><div style="background:#FF0000; color:#FFFFFF; font-weight:bold"><? echo $error ?></div></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Delivery Address:</strong></td> </tr> <tr > <td style="width:45%"><div align="right">Name*:</div></td> <td><input name="orName" type="text" id="orName" value="<? echo $orName ?>" size="40" maxlength="100"> </td> </tr> <tr> <td><div align="right">Delivery Address: *: </div></td> <td><input name="orDelAddress1" type="text" id="orDelAddress1" value="<? if($orDelAddress1) echo $orDelAddress1; else echo $orDelAddress1; ?>" size="50" maxlength="50"></td> </tr> <tr> <td> </td> <td><input name="orDelAddress2" type="text" id="orDelAddress2" value="<? if($orDelAddress2) echo $orDelAddress2; else echo $orDelAddress2; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right"> </div></td> <td><input name="orDelAddress3" type="text" id="orDelAddress3" value="<? if($orDelAddress3) echo $orDelAddress3; else echo $orDelAddress3; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Town:</div></td> <td><input name="orDelTown" type="text" id="orDelTown" value="<? if($orDelTown) echo $orDelTown; else echo $orDelTown; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Post Code<? if($orDelCountry == "UK") echo "*" ?>: </div></td> <td><input name="orDelPostcode" type="text" id="orDelPostcode" value="<? if($orDelPostcode) echo $orDelPostcode; else echo $orDelPostcode; ?>" size="10" maxlength="10"></td> </tr> <tr> <td><div align="right">County:</div></td> <td><input name="orDelCounty" type="text" id="orDelCounty" value="<? echo $orDelCounty ?>" size="40" maxlength="100"> </td> </tr> <tr> <td><div align="right">Email*:</div></td> <td><input name="orEmail" type="text" id="orEmail" value="<? echo $orEmail ?>" size="40" maxlength="100"></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Billing Address:</strong></td> </tr> <tr> <td><div align="right"> Credit Card Billing Address: *: </div></td> <td><input name="ccAddress1" type="text" id="ccAddress1" value="<? if($ccAddress1) echo $ccAddress1; else echo $orDelAddress1; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">[<a href="Javascript:goCopy();">click here to copy from delivery address </a>] </div></td> <td><input name="ccAddress2" type="text" id="ccAddress2" value="<? if($ccAddress2) echo $ccAddress2; else echo $orDelAddress2; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right"> </div></td> <td><input name="ccAddress3" type="text" id="ccAddress3" value="<? if($ccAddress3) echo $ccAddress3; else echo $orDelAddress3; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Town:</div></td> <td><input name="ccTown" type="text" id="ccTown" value="<? if($ccTown) echo $ccTown; else echo $orDelTown; ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Post Code<? if($orDelCountry == "UK") echo "*" ?>: </div></td> <td><input name="ccPostcode" type="text" id="ccPostcode" value="<? if($ccPostcode) echo $ccPostcode; else echo $orDelPostcode; ?>" size="10" maxlength="10"></td> </tr> <tr> <td><div align="right">Telephone No *: </div></td> <td><input name="orTel" type="text" id="orTel" value="<?= $orTel; ?>" size="14" maxlength="20"></td> </tr> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Card details:</strong></td> </tr> <tr> <td><div align="right">Payment amount: £</div></td> <td><input name="orTotal" type="text" id="orTotal" value="<? echo number_format($orTotal,2, ".", ""); ?>" size="20" maxlength="20" readonly=""></td> </tr> <tr> <td><div align="right">Card holder's name as it appears on your card*:</div></td> <td><input name="cardHolder" type="text" id="cardHolder" value="<? if($cardHolder) echo $cardHolder; else echo $orName ?>" size="50" maxlength="50"></td> </tr> <tr> <td><div align="right">Card Type*:</div></td> <td> <select name="cardType" id="cardType"> <option value="VISA" <? if($cardType=="VISA") echo "selected"; ?>>Visa</option> <option value="DELTA" <? if($cardType=="DELTA") echo "selected"; ?>>Visa Delta/Debit </option> <option value="MC" <? if($cardType=="MC") echo "selected"; ?>>Mastercard</option> <option value="SWITCH" <? if($cardType=="SWITCH") echo "selected"; ?>>Maestro</option> <option value="SOLO" <? if($cardType=="SOLO") echo "selected"; ?>>SOLO</option> <option value="UKE" <? if($cardType=="UKE") echo "selected"; ?>>Visa Electron</option> </select> </td> </tr> <tr> <td><div align="right">Card Number*:</div></td> <td><input name="cardNumber" type="text" id="cardNumber" value="<? echo $cardNumber ?>" size="20" maxlength="20"> (no spaces please)</td> </tr> <tr> <td><div align="right">Start Date:</div></td> <td><input name="startDate" type="text" id="startDate" value="<? echo $startDate ?>" size="4" maxlength="4"> (MMYY) Switch and Solo cards only </td> </tr> <tr> <td><div align="right">Expiry Date*:</div></td> <td><input name="expiryDate" type="text" id="expiryDate" value="<? echo $expiryDate ?>" size="4" maxlength="4"> (MMYY)</td> </tr> <tr> <td><div align="right">Issue Number:</div></td> <td><input name="issueNumber" type="text" id="issueNumber" value="<? echo $issueNumber ?>" size="2" maxlength="2"> Exactly as it appears on the card</td> </tr> <tr> <td><div align="right">CV2*: </div></td> <td><input name="CV2" type="text" id="CV2" value="<? echo $CV2 ?>" size="4" maxlength="4"> Last three digits on signature strip</td> </tr> <? if(!$xcnId) {?> <tr id="trColumnTitles" > <td colspan="2" style="background-color:#CCC"> <strong>Confirm order:</strong></td> </tr> <tr> <td colspan="2"> If you would like us to save your details for future orders create a username and password below: </td> </tr> <tr> <td colspan="2"><div style="float:left; width:10%">Username: </div><div style="float:left;"> <input name="cnUsername" type="text" id="cnUsername" value="<? echo $cnUsername ?>" size="40" maxlength="100"></div></td> </tr> <tr> <td colspan="2"><div style="float:left; width:10%">Password: </div><div style="float:left"> <input name="cnPassword" type="password" id="cnPassword" value="<? echo $cnPassword ?>" size="40" maxlength="100"></div></td> </tr> <? } ?> <tr > <td colspan="2"><input name="sbmt" type="hidden" id="sbmt" value="1"> <input type="submit" name="Submit" value="Make payment"> <? echo back($back); ?> <input name="paypalOK" type="hidden" id="paypalOK" value="0"></td> </tr> </table> <input type="hidden" name="basketURL" value="<?= double_implode(":","|",$basketArray); ?>" /> <input type="hidden" name="xcnId" value="<?= $xcnId ?>" /> <input type="hidden" name="orId" value="<?= $orId ?>" /> <input type="hidden" name="prSize" value="<?= $prSize?>" /> </form> </div> </div> <div style="position:absolute;"> <div style="position:relative;z-index:2;margin-top:5px;margin-left:35px" > <a style="text-decoration:none;background:none" href="http://www.egowear.co.uk/designer.php"><img src="images/spacer.gif" border="0" width="200" height="205" /></a> </div> </div> <img src="images/bot1.jpg" /> </div> </div> </div> </body> </html> <? } ?> Hi, Is there any one has integrated securenet payment gateway in php? Is yes, can any one provide me HTML code and php code for it? Looking foward i have made my own website suggestion box but when i start typing in on my websites search box google chrome automatically suggests other words and you can't see underneath. I don't want this to happen to other people viewing my website. Is there any sort of code i an put on my website to stop this? |