日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

使用php實現(xiàn)快錢支付功能(3)_PHP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:關(guān)于php 接口問題(php接口主要也就是運(yùn)用curl,curl函數(shù))
本篇文章是對php中的接口問題(php接口主要也就是運(yùn)用curl,curl函數(shù))進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下 接口問題 php調(diào)用接口最主要的就是使用curl抓取信息 復(fù)制代碼 代碼如下: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //url地址 curl_setopt($c


models/BillResponse.php
BillResponse.php

復(fù)制代碼 代碼如下:
<?php
class Application_Model_BillResponse
{
/*
* __construct()構(gòu)造函數(shù)
* 生成19個參數(shù)及值,可能有一個參數(shù)的值為空,$this->errCode的值可能為空
*/
public function __construct($response){
$KeyOrders = array('merchantAcctId','version','language','signType','payType','bankId','orderId','orderTime','orderAmount',
'dealId','bankDealId','dealTime','payAmount','fee','ext1','ext2','payResult','errCode', 'signMsg');
foreach($KeyOrders as $key){
$this->{$key} = $response[$key];
}
}
/*
* 檢查簽名字符串
* 快錢返回的簽名字符串是$this->signMsg
* 使用base64對前面字符串進(jìn)行解碼
* 驗證使用快錢給的公鑰驗證
* 快錢那邊他們把返回來的參數(shù)值不為空的使用私鑰加密生成了$this->signMsg
* 快錢給了我們私鑰對應(yīng)的公鑰,我們使用這個公鑰來驗證。1成功,0失敗,-1錯誤。
*/
public function checkSignMsg(){
$KeyOrders = array('merchantAcctId','version','language','signType','payType','bankId','orderId','orderTime','orderAmount',
'dealId','bankDealId','dealTime','payAmount','fee','ext1','ext2','payResult','errCode',);
foreach($KeyOrders as $key){
if(''==$this->{$key}){continue;}
$params[$key] = $this->{$key};
}
//$pub_key_id 公鑰
$pub_key_id = openssl_get_publickey(file_get_contents("99bill-rsa.cer", "r"));
return openssl_verify(urldecode(http_build_query($params)), base64_decode($this->signMsg), $pub_key_id);
}
public function isSuccess(){
//$this->payResult成功時10,失敗時11
return '10'==$this->payResult;
}
public function getOrderId(){
return str_replace('XXX', '', $this->orderId);
}
}


需要一個公鑰和一個私鑰,這個不是一對的
都是一半
99bill-rsa.cer
99bill-rsa.pem

分享:基于simple_html_dom的使用小結(jié)
本篇文章對simple html dom的使用進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下 復(fù)制代碼 代碼如下: P簡單范例 ?phpinclude simple_html_dom.php ; //加載simple_html_dom.php文件 $html = file_get_html('http://www.google.com/'); //獲取html$dom = new simple_html_dom()

共3頁上一頁123下一頁
來源:模板無憂//所屬分類:PHP教程/更新時間:2013-07-03
相關(guān)PHP教程