<?php
require_once("vendor/autoload.php");
global $_W;
global $_GPC;
$site_info = $_W["設定"]["網站"];
$current_module = $_W["current_module"];
/* *
* 建立付款訂單號碼
* @return string
*/
##function getPlatform()
{
$agent = new Jenssegers\Agent\Agent();
$isMobile = $agent->isMobile();
## if( $ isMobile ) { return "wap"; } return "pc";
function postXmlCurl($xml = "", $url = "", $second = 30)
# curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
問答 $cUR_
$data = curl_exec($ch); if( $data ) { curl_close($ch); return $ data; }## $error = curl_errno($ch); curl_close($ch);
## curl_close($ch);
$keyc = ($ckey_length ? ($operation == "DECODE" ? substr($string, 0, $ckey_length) : substr(md5(microtime()), 0 - $ckey_length)) : "");
$cryptkey = $keya 。 md5($keya . $keyc);
$key_length = strlen($cryptkey);
$string = ($operation == "DECODE" ? base64_decode(substr($string, $ ckey_length)) : sprintf(" 0d", ($expiry ? $expiry time() : 0)) .substr(md5($string . $keyb), 0, 16) . $string);
$string_length = strlen($string);
$result = "";
$box = range(0, 255);
$rndkey = array( ) ;
$i = 0;
while( $i <= 255 )
{
# $rndkey[$i] = ord($
$rndkey[$i] = ord($$i % $key_length]);
$i ;
}
# $j = $i = 0;
# $i < 256 $i < 256 )
{
$j = ($j $box[$i] $rndkey[$i]) % 256;
$tmp = $box [$i ];
$box[$i] = $box[$j];
$box[$j] = $tmp;
$i ; # #tmp;
$i ;
# }
$a = $j = $i = 0;
while( $i < $string_length )
## {### = ($a 1) % 256;
$j = ($j $box[$a]) % 256;
$tmp = $box[$a] ;
## $tmp = $box[$a] ;## $tmp = $box[$a] ;
#### $box[$a] = $box[$j];
$box[$j] = $tmp;
$result .= chr(ord ($string $i]) ^ $box[($box[$a] $box[$j]) % 256]);
$i ;
}
if ( $operation == "DECODE" )
{
if( (substr($result, 0, 10) == 0 || 0< substr($result, 0, 10) - time()) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16) )
{
return substr($result, 26);
//$content = postxmlcurl(array_merge($order_info, array( "host" => $_SERVER["HTTP_HOST"], "module" => $current_module["name"], "version" => ; $version" => $current_module["name"], "version" => ; $version" => $current_module["name"], "version" => ; current_module["version"], "site_id" => $site_info["key"], "domain" => $site_info["url"], "product_sn" => $product_sn, "app_id" = > $app_id, " token" => $token )), "http://auth.zunyue.me/api/fortunetelling/cesuan", 5);
$content = postXmlCurl(array_merge( $order_info, [
# 'product_id' => $product_sn,
'app_id' => $app_id,
://api.kuzhuti.cn/api/sm.php', 5);
if($content && $ content != "error"){
return $content;
}else{
return array("error_code"=>1,"error_msg"=>; '授權錯誤');
#ms; # }
}
#//付款下單計算簽章
function f_pay_sign ($paydata){
if (!is_array($paydata)) {
exit("資料錯誤");
}
$fpappkey = getconfig('ffpappkey',$pay)[ 'uid']);
$secretkey = getconfig('fpsecretkey',$paydata['uid']);
$str_sign=" appkey={$fpappkey}&order_no={$ paydata['order_no']}&secretkey={$secretkey}&total_fee={$paydata['total_fee']}&uid={$paydata['uid']}&";
$sign=md5($ str_sign);
return $sign;
}
//非同步回呼計算簽章
function f_notify_sign( $paydata)
{
if (!is_array($paydata)) {
exit("資料錯誤");
}
$fpappkey = getconfig('fpappkey',$paydata['uid']);
$secretkey = getconfig('fpsecretkey',$paydata[' uid']);
$str_sign="appkey={$fpappkey}&order_no={$paydata['order_no']}&secretkey={$secretkey}&me_pri={$paydata['me_pri']}&uid ={$paydata['uid']} &";
$sign=md5($str_sign);
# return $sign;
}
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_URL, $url);#
$ $curl, CURLOPT_URL, $url); $ $ # curl_close($curl); return $res;}{ $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $str = "";##o#(o#oo; i < $length ) { $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
## i ;
}
## return $str;}function mobileUrl($params = array( ) , $share_url = "")
{
全域$_W;
# $str = "";
$url .= "index.php?i =」。 $_W["單酸"] . $str 。 "&";
if( !empty($controller) )
if( !empty($action) )
{
$url## {
if( !empty($do) )
{
if( !empty($params) )
{
## }
### return return $url;
}
$sitescheme = ($ishttps ? "https://" : " http ://");
$sitepath = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], "/"));
$http_host = (empty($domain) ? $sitescheme . $_SERVER["HTTP_HOST"] : $domain);
$domain_url = htmlspecialchars($http_host . $sitepath);
#sitepath);」 ## if( substr($domain_url, -1) != "/" )
{
$domain_url .= "/";
$domain_url .= "/";
}##>
## $urls = parse_url($domain_url);
$urls["path"] = str_replace(array( "/web", "/app", "/付款/微信", "/付款/支付寶", "/付款/jueqiymf", "/api" ), "", $urls["path"]);
return $urls["scheme" ]。 「://」。 $urls["主機"] 。 ((!empty($urls["port"]) && $urls["port"] != "80" ? ":" 。$urls["port"] : "")) 。 $urls["path"];
}
##function qrcodeBase64($qrcode_resize, $share_url)
{
# $qrcode = new SimpleSoftwareIO\QrCode\BaconQrCodeGenerator();
return base64_encode($qrcode->format("png")->margin(0)->sizecode($qrcode->format("png")->margin(0)->sizecode($q-code_resize) ($share_url));
}
# # 返回false;# }
買的一個源碼,鬧的有點不愉快,擔心他把接口改掉,所以諮詢下各位牛人,這個怎麼能改成自己的接口
這是你呼叫的支付api的介面位址吧?例如微信支付請求的是:https://api.mch.weixin.qq.com/pay/unifiedorder,一般人家官方提供的介面是不會隨便更改的,可以看下人家官方文件。