H5頁面喚起支付寶實現支付功能


<?php

#php判斷微信還是支付寶

 

/*$tel=isset($_GET["tel"])?$_GET["tel"]:'';

$userId = '';

switch ($tel)

{

case '你的支付寶賬號': $userId = '這里改成你的userId'; break;

 


}*/

 

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == true) {

$browser = 'WeChat';//微信瀏覽器

} else if (strpos($_SERVER['HTTP_USER_AGENT'], 'AlipayClient') == true) {

echo '11111111111';

header("Location: alipays://platformapi/startapp?appId=09999988&actionType=toAccount&goBack=NO&amount=1.00&userId=支付寶賬號userId&memo=轉賬測試");

exit;

$browser = 'Alipay';//支付寶瀏覽器

} else {

$browser = "Other";//不是微信和支付寶

}

//header("Location:alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https://qr.alipay.com/a7x03476g3ncihbvk0hs59f");

?>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width,minimum-scale=1.0, maximum-scale=1.0">

<title></title>

<meta name='description' content=''/>

<meta name='keywords' content=''/>

<style type="text/css">

body {

margin: 50px;text-align:center;

}

textarea {width:350px;height:400px;border: 0 none;outline-style: none;resize:none}

</style>

</head>

 

<body>
技術支持1260770160
</body>

</html>

技術支持  1260770160,歡迎交流。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM