📄 paypal.php
字号:
<?//////////////////////////// COPYRIGHT NOTICE ////////////////////////////////////// This script is part of BosClassifieds, a software application by BosDev, Inc //// Use of any kind of part or all of this script or modification of this //// script requires a license from BosDev, Inc. Use or modification of //// this script without a license constitutes Software Piracy and will //// result in legal action from BosDev, Inc. All rights reserved. //// http://www.bosdev.com sales@bosdev.com //// //// BosClassifieds Copyright 2004, BosDev, Inc. ////////////////////////////////////////////////////////////////////////////////////function paymentForm($adArray,$fee) { global $SystemOptions,$Languages,$insUrl; $form = <<<ENDFORM <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="{$SystemOptions['payment_info_1']}"> <input type="hidden" name="item_name" value="{$Languages['payment']['paymenttitle']} {$insUrl}"> <input type="hidden" name="amount" value="$fee"> <input type="hidden" name="return" value="{$insUrl}payment.php?ad=$adArray"> <input type="hidden" name="cancel_return" value="{$insUrl}"> <input type="hidden" name="currency_code" value="{$Languages['currency']['code']}"> <input type="hidden" name="notify_url" value="{$insUrl}payment.php"> <input type="hidden" name="rm" value="2"> <div align="center"><input type="submit" value="{$Languages['payment']['sendpayment']}"></div> </form>ENDFORM; return $form; }function getPaymentResult($vars) { $status = array(); //Post back to PayPal to ensure it's real $req = 'cmd=_notify-validate'; foreach ($vars 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, $errstr, 30); if (!$fp) { // HTTP ERROR $status[1] = 0; } else { fputs ($fp, $header . $req); while(!feof($fp)) { $info[]=@fgets($fp, 1024); } fclose($fp); $info=implode(",",$info); if(eregi("VERIFIED",$info)) { if($vars['payment_status'] == "Completed") { $status[1] = 1; } elseif($vars['payment_status'] == "Pending") { $status[1] = 1; } else { $status[1] = 0; } } elseif (eregi("INVALID",$info)) { $status[1] = 0; } } return $status; }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -