TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11-02-2010, 10:34 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Nov 2010
Posts: 1
Thanks: 0
utech is on a distinguished road
Default Paypal, Payment Standard & IPN

Hi all,

i don't seem to receive the verified status for the below code!

Checkout Page

HTML Code:
<form action='https://www.paypal.com/cgi-bin/webscr' target='_blank' method='post'>
<input type='hidden' name='cmd' value='_cart'>
<input type='hidden' name='upload' value='1'>
<input type='hidden' name='return' value='http://www.xx.com/confirm.php'>
<input type='hidden' name='business' value='xx@xx.com'>
<input type='hidden' name='custom' value='1.141'>
<input type='hidden' name='receipt_id' value='12345'>
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='notify_url' value='http://www.xx.com/confirm.php'>

Confirm Page

PHP Code:
<?php
session_start
();
require_once(
'includes/config/config.inc.php');

$req 'cmd=_notify-validate';

foreach (
$_POST as $key => $value){
    
$value urlencode(stripslashes($value));
    
$req .= "&$key=$value";
}

$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 ('ssl://www.paypal.com'443$errno$errstr30);

$custom $_POST['custom'];
$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'];
$receipt_id $_POST['receipt_id'];

if (!
$fp){
     
//Message
}else{
    
fputs ($fp$header $req);
    while (!
feof($fp)){
        
$res fgets ($fp1024);
        if (
strcmp ($res"VERIFIED") == 0){
            
$Itemid explode(","$custom);
            
$size_counter_array sizeof($Itemid);
            foreach(
$Itemid as $item_new){
                
$count_len substr_count($item_new'.');

                    list(
$items_quantity$item_product_id) = split('[.]'$item_new);
                    )
$QuerySuccess = (bool)@mysql_query("UPDATE store set quantity=(quantity - $items_quantity) WHERE id='".$item_product_id."'");
                    if(
QuerySuccess) echo "Success";
                }
            }
        }else if (
strcmp ($res"INVALID") == 0){
            
//echo 2;
        
}
    }
    
fclose ($fp);
    
setcookie($receipt_id,""time()-60"/");
}
?>
Thanks.
utech is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Payment issues... Aaron Absolute Beginners 9 10-18-2012 02:22 PM
Paypal Integration dhaval Absolute Beginners 1 12-25-2009 08:27 PM
Paypal Integration dhaval General 1 12-25-2009 07:13 PM
Paypal and My site Need Help! tego10122 Advanced PHP Programming 2 12-13-2009 06:45 PM
payment gateway sarmenhb General 3 07-10-2008 06:16 PM


All times are GMT. The time now is 10:28 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design