您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 買粉絲視頻獲取wxv代碼(如何玩轉買粉絲買粉絲)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-05-29 15:11:46【】3人已围观
简介'total_fee'=>floatval($this->totalFee),//總金額'open_id'=>$this->openid,//用
'open_id'=>$this->openid,//用戶openid
'trade_type'=>$this->TRADETYPE,//交易類型
'body' =>$this->BODY, //商品信息
);
$parameters['sign'] = $this->getSign($parameters);
$xmlData = $this->arrayToXml($parameters);
$xml_result = $this->postXmlCurl($xmlData,'買粉絲s://api.mch.weixin.qq.買粉絲/pay/unifiedorder',60);
$result = $this->xmlToArray($xml_result);
return $result;
}
//數組轉字符串方法
protected function arrayToXml($arr){
$xml = "<xml>";
foreach ($arr as $key=>$val)
{
if (is_numeric($val)){
$xml.="<".$key.">".$val."</".$key.">";
}else{
$xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
}
}
$xml.="</xml>";
return $xml;
}
protected function xmlToArray($xml){
$array_data = json_de買粉絲de(json_en買粉絲de(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
return $array_data;
}
//發送xml請求方法
private static function postXmlCurl($xml, $url, $se買粉絲nd = 30)
{
$ch = curl_init();
//設置超時
curl_setopt($ch, CURLOPT_TIMEOUT, $se買粉絲nd);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); //嚴格校驗
//設置header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//要求結果為字符串且輸出到屏幕上
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//post提交方式
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_TIMEOUT, 40);
set_time_limit(0);
//運行curl
$data = curl_exec($ch);
//返回結果
if ($data) {
curl_close($ch);
return $data;
} else {
$error = curl_errno($ch);
curl_close($ch);
throw new WxPayException("curl出錯,錯誤碼:$error");
}
}
/
** 對要發送到買粉絲統一下單接口的數據進行簽名
*/
protected function getSign($Obj){
foreach ($Obj as $k => $v){
$Parameters[$k] = $v;
}
//簽名步驟一:按字典序排序參數
ksort($Parameters);
$String = $this->formatBizQueryParaMap($Parameters, false);
//簽名步驟二:在string后加入KEY
$String = $String."&key=".$this->KEY;
//簽名步驟三:MD5加密
$String = md5($String);
//簽名步驟四:所有字符轉為大寫
$result_ = strtoupper($String);
return $result_;
}
/
**排序并格式化參數方法,簽名時需要使用
*/
protected function formatBizQueryParaMap($paraMap, $urlen買粉絲de)
{
$buff = "";
ksort($paraMap);
foreach ($paraMap as $k => $v)
{
if($urlen買粉絲de)
{
$v = urlen買粉絲de($v);
}
//$buff .= strtolower($k) . "=" . $v . "&";
$buff .= $k . "=" . $v . "&";
}
$reqPar;
if (strlen($buff) > 0)
{
$reqPar = substr($buff, 0, strlen($buff)-1);
}
return $reqPar;
}
/
** 生成隨機字符串方法
*/
protected function createNoncestr($length = 32 ){
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
$str ="";
for ( $i = 0; $i < $length; $i++ ) {
$str.= substr($chars, mt_rand(0, strlen($chars)-1), 1);
}
return $str;
}
}
以上就是買粉絲支付的相關流程。在理清思路后,流程還是比較清晰和簡單的。重點在于需要注意一些細節問題,例如數據格式,加密方法等。
下面說一下買粉絲小程序退款的具體實現
二.退款
小程序退款的流程和付款相似,但有一些細節上的不同。
首先退款的步驟通常如下:
1.用戶前端點擊退款按鈕后,后端接收到用戶的退款請求通過商城后臺呈現給商戶,商戶確定允許退款后,后端再發起向買粉絲退款接口的請求來請求退款。
2.后端向買粉絲退款接口發送請求后,得到響應信息,確定退款是否完成,根據退款是否完成再去進行改變訂單狀態等業務邏輯。
退款的步驟相對買粉絲支付來說比較簡單。
值得注意的有以下兩點:
1.向買粉絲退款接口請求退款后,根據得到的響應是可以直接確
很赞哦!(564)
相关文章
- free youtube for windows 10 download(分布式容易發論文嗎)
- 脫排油煙機排煙管最佳長度(油煙機排煙管道最長限度多少米)
- 老版tiktok下載(tiktok去哪里可以看到?)
- 自建房油煙機排煙管道對著鄰居家院子怎么辦(自建房抽油煙機排煙管3.5米會影響排煙效果嗎?)
- GL8油管召回(別克商務車gl8發動機回油管路在什么位置,有圖嗎)
- free youtube downloader app for windows 10專業版(為什么我用Youtube Downloader HD 最新版的軟件 去下載Youtube 上的視頻 我把地址復制上去后)
- free download youtube for android官網中文(或下載器現在升級是什么軟件)
- 脫排油煙機管子可以用p V C管好還是不銹鋼管好(PVC煙管和不銹鋼煙管哪個好)
- 自制抽油管的制作視頻(如何制作遙控直升飛機?都需要什么?)
- 脫排油煙機排風管止回閥作用大嗎(排風扇前的風管上安裝止回閥,其目的是什么?)
热门文章
站长推荐
free youtube to mp3 converter app(免費下載歌曲軟件 全免費)
gl8回油管位置(別克gl8陸尊進油管和回油管在哪里)
能看油管的瀏覽器(蘋果手機上油管最簡單的辦法)
free youtube downloader mp3 appdata(為什么我用Youtube Downloader HD 最新版的軟件 去下載Youtube 上的視頻 我把地址復制上去后)
free youtube music downloader for windows 11(為什么我用Youtube Downloader HD 最新版的軟件 去下載Youtube 上的視頻 我把地址復制上去后)
fantasy free movies on youtube(求吸血鬼日記主要人物分析,要英文的,詳細點,有深度的。)
free youtube music download mp3 apple id(如何在youtubemusic中創建快捷指令)
free youtube music download mp3 app store(今日新聞淺談:Youtube Music 也加入串流音樂服務大混戰)