473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with taking out Payment verification please

2
Hi - Happy New Year!
I have a web-site which accepted paypal payment for membership. No-one's buying so I want to make it free. The page which inputs the member details into the database needs verification, and I want to bypass the verification, but I can't figure it out. Can anyone help. - I have pasted the script below.

Many thanks,
Jano
[php]
<? include("header.php"); ?>
<?
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);

// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];

if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
//check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
}
fclose ($fp);
}
if (strcmp ($res, "VERIFIED") == 0) {
echo "Payment Sucessful"; } else { echo "Payment Unsucessful"; }

?>
</form>
<?
include("con1.php");
$sql = mysql_query ("select * from genel where language='$language'");
$sonuc = mysql_fetch_array($sql) ;
?><br>

<tr><td colspan="3">
Üyelik işleminiz tamamlanmıştır.

</td></TR><br>
<form action="kabul.php" method="post" name="kabul">

<tr><td align="left" valign="top" width="150"> <? echo $sonuc[bbh]; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align="left" valign="top" width="150"><input type="text" name="user"></td></tr>

<tr><td align="left" valign="top"> <? echo $sonuc[bbk]; ?> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align="left" valign="top" width="150"><input type="text" name="email"></td></tr>
<tr><td align="center" colspan="2" valign="top"><br><input type="submit" name="subnmas" <? if($language=="Turkish") {?> value="Devam"<? }else { ?>value="Submit"<?}?>></td></tr>
</form>
<?
if ($subnmas){
include("con1.php");
$user="$HTTP_POST_VARS[user]";
$email="$HTTP_POST_VARS[email]";
$a=mysql_query("select * from uyeleryedek where username='$user' and email='$email'");
$kul_kontrol_et=mysql_num_rows($a);
if($kul_kontrol_et=="") {

echo "<SCRIPT>alert(\" Yazdığınız bilgilerle uyumlu kullanıcı bulanamadı. Lütfen tekrar deneyin. There is a problem. Please check your username has been entered correctly \");</SCRIPT>";

}else{
include("con1.php");
$sql = mysql_query ("select * from uyeleryedek where username='$user' and email='$email'");
$sonuc = mysql_fetch_array($sql) ;

include("con1.php");
mysql_query ("INSERT INTO uyeler (adsoyad, email, sirketadresi, sehirilce, ilce, vergidairesi, verginumarasi, telnum, faxnum, cepnum, dil, username, password, uyecesit, sure, baslamatarihi, bitistarihi,websayfasi ) VALUES ('$sonuc[adsoyad]', '$sonuc[email]', '$sonuc[sirketadresi]', '$sonuc[secilen]', '$sonuc[ilce]', '$sonuc[vergidairesi]', '$sonuc[verginumarasi]', '$sonuc[telnum]', '$sonuc[faxnum]', '$sonuc[cepnum]', '$sonuc[dil]', '$sonuc[username]', '$sonuc[password]', '$sonuc[uyecesit]','$sonuc[sure]','$sonuc[bugun]','$sonuc[bitis]','$sonuc[websayfasi]')");

echo "<SCRIPT>alert(\"İşleminiz başarıyla tamamlandı. / Your account succesfully. \");</SCRIPT>";
}

}

?>

<br>
<br>

Thank you for your payment.

<br><br>
Yaptiginiz odeme icin Tesekkur ederiz.
<br><br>
<? include("footer.php"); ?>[/php]
Jan 1 '07 #1
3 2145
ronverdonk
4,258 Expert 4TB
Please read the Posting Guidelines before you post in this forum!.
Especially the part about enclosing all code within code, html or php tags.
The page which inputs the member details into the database needs verification, and I want to bypass the verification
The script shown is (see your comment at the top of the code) called by the PayPal system. Paypal does not do that on its own, you must have requested that. And that piece of code is nowhere to be seen here.

So first you need to prevent that the request to Paypal is initiated by you.
Then this script will not be called ever.

Ronald :cool:
Jan 1 '07 #2
Jano
2
Please read the Posting Guidelines before you post in this forum!.
Especially the part about enclosing all code within code, html or php tags.

The script shown is (see your comment at the top of the code) called by the PayPal system. Paypal does not do that on its own, you must have requested that. And that piece of code is nowhere to be seen here.

So first you need to prevent that the request to Paypal is initiated by you.
Then this script will not be called ever.

Ronald :cool:

Hi Ronald,

Thanks for your reply. I've de-activated the paypal, my problem is that without the verification, the date of membership and the city the member is in is not recorded in the database, which makes a search inopperable. I don't know which piece of code activates the submit to the site database - my understanding is that the web designer rigged it so that without the verification, the membership would not activate.

Is there any way to make the information submit without the verification?

Once again, thanks for your time,

Jano
Jan 2 '07 #3
ronverdonk
4,258 Expert 4TB
As far as I can deduct from the code, and I have to say 'deduct' because it is not really structured and commented, you need a userid and an email address to pull the data from a table and then you insert all that data plus something else in another table.

So, instead of wading through this bunch of (mostly) redundant code and weeding out all Paypal relating things, I strongly suggest that you start this script from scratch. You can of course use parts of the code shown, but I wouldn't take things out of the logic, but start the logic in a new script. That cannot be too much work.

Only thing left is then: how to call this script yourself, because originally it is invoked by PayPal. So then you must, instead of invoking the Paypal system, call this script from your own code.

Ronald :cool:
Jan 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David Buckley | last post by:
I am writting a online shop for my mums shop in belfast they sell gothic clothing to see the setup so far you can go to www.cooljamdesign.com/ripoff My problem is which payment processer to go...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
0
by: Andy | last post by:
Hi, I'm currently developing my B2C application using ASP.NET. I have several questions regarding planning this application: In my application, I'll use my own shopping cart (developed totally...
3
by: promiscuoustx | last post by:
I am trying to get my program to compile, but it will not complete. At line 79 it states, cannot convert 'float()()' to 'float' in assignment. Here is my code. #include <iostream> #include...
22
by: pbd22 | last post by:
hi. I am having probelms with an update statement. every time i run it, "every" row updates, not just the one(s) intended. so, here is what i have. i have tried this with both AND and OR and...
1
by: Benton2862 | last post by:
I need help with and array for a program that acts like a cash register. The user will input an items price and then there payment. It will tell you the change and then tell you what kinda of change...
2
by: eskelies | last post by:
So here is my issue. I have a multiple IF statement in Excel 2003, which I am trying to convert to Access 2003. My error in Access has to do with the OR function , which is taking place inside the IF...
8
by: Energizer100 | last post by:
My assignment is LoanTable Background: When buying a home, a very important financial consideration that many buyers face is obtaining a qualifying loan from a financial institution. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.