Files
chuanqi-qycq-web/pay/api.php

75 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2025-07-10 23:55:26 +08:00
<?php
/**
天天支付 www.ttfk.cc
亲手写的代码。请保留信息!
对得起自己的职业操守!
**/
require_once("config.php");
require_once("lib/sub.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>支付中心</title>
</head>
<?php
/**************************请求参数**************************/
$notify_url = "http://".$_SERVER['HTTP_HOST']."/pay/notify_url.php";
//需http://格式的完整路径,不能加?id=123这类自定义参数
//页面跳转同步通知页面路径
$return_url = "https://www.youtube.com";
//需http://格式的完整路径,不能加?id=123这类自定义参数不能写成http://localhost/
//商户订单号
$out_trade_no = 'zs_'.$_POST['WIDout_trade_no'];
//商户网站订单系统中唯一订单号,必填
//支付方式
$type = $_POST['type'];
//商品名称
$name = $_POST['game_name'];
//付款金额
$money = $_POST['money'];
//站点名称
$sitename = $yxm;
//必填
//订单描述
/************************************************************/
//构造要请求的参数数组,无需改动
$parameter = array(
"pid" => trim($alipay_config['partner']),
"type" => $type,
"notify_url" => $notify_url,
"return_url" => $return_url,
"out_trade_no" => $out_trade_no,
"name" => $name,
"money" => $money,
"sitename" => $sitename
);
//建立请求
$alipaySubmit = new AlipaySubmit($alipay_config);
$html_text = $alipaySubmit->buildRequestForm($parameter);
echo $html_text;
preg_match('@^(?:https://)?([^/]+)@i',
$alipay_config['apiurl'], $matches);
$host = $matches[1];
preg_match('/[^.]+\.[^.]+$/', $host, $matches);
if ($matches[0] !=$copy)
{
exit("&#24403;&#21069;&#97;&#112;&#105;&#26410;&#25480;&#26435;&#65281;&#35831;&#20351;&#29992;&#119;&#119;&#119;&#46;&#116;&#116;&#102;&#107;&#46;&#99;&#99;");
}
?>
</body>
</html>