|
- <?php
- if (!defined('DEDEMEMBER')) exit('dedebiz');
-
-
- $strSpid = $payment_userid[0];
-
- $strSpkey = $payment_key[0];
-
- if(!isset($BankType)) $BankType = 0;
- $BankType = preg_replace("#[^0-9]#","",$BankType);
- if($BankType < 1) $BankType = 0;
- $strBankType= $BankType;
- $strCmdNo = "1";
- $strBillDate= date('Ymd');
-
- if(!isset($pname)) $pname = '服务购买';
- $strDesc = $pname;
-
- $strBuyerId = "";
-
- $strSaler = $payment_userid[0];
-
- if($payment_exp[0] < 0) $payment_exp[0] = 0;
- $piice_ex = $price*$payment_exp[0];
- $price = $price+$piice_ex;
-
- $strTotalFee = $price*100;
- if( $strTotalFee < 1){
- $dsql->Close();
- exit('金额不对');
- }
- $strSpBillNo = $buyid;;
-
- $strTransactionId = $strSpid.$strBillDate.time();
-
- $strFeeType = "1";
-
- $strRetUrl = $cfg_basehost."/user/paycenter/tenpay/notify_handler.php";
-
- $strAttach = "my_magic_string";
-
- $strSignText = "cmdno=".$strCmdNo."&date=".$strBillDate."&bargainor_id=".$strSaler .
- "&transaction_id=".$strTransactionId."&sp_billno=".$strSpBillNo.
- "&total_fee=".$strTotalFee."&fee_type=".$strFeeType."&return_url=".$strRetUrl .
- "&attach=".$strAttach."&key=".$strSpkey;
- $strSign = strtoupper(md5($strSignText));
-
- $strRequest = "cmdno=".$strCmdNo."&date=".$strBillDate."&bargainor_id=".$strSaler.
- "&transaction_id=".$strTransactionId."&sp_billno=".$strSpBillNo.
- "&total_fee=".$strTotalFee."&fee_type=".$strFeeType."&return_url=".$strRetUrl.
- "&attach=".$strAttach."&bank_type=".$strBankType."&desc=".$strDesc.
- "&purchaser_id=".$strBuyerId.
- "&sign=".$strSign ;
- $strRequestUrl = "https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi?".$strRequest;
- if($cfg_soft_lang == 'utf-8')
- {
- $strRequestUrl = utf82gb($strRequestUrl);
- echo '<html>
- <head>
- <title>转到财付通支付页面</title>
- </head>
- <body onload="document.tenpay.submit();">
- <form name="tenpay" action="paycenter/tenpay/tenpay_gbk_page.php?strReUrl='.urlencode($strRequestUrl).'" method="post">
- </form>
- </body>
- </html>';
- } else {
- echo '<html>
- <head>
- <title>转到财付通支付页面</title>
- </head>
- <body onload="document.tenpay.submit();">
- <form name="tenpay" action="'.$strRequestUrl.'" method="post">
- </form>
- </body>
- </html>';
- }
- exit;
|