forked from terrancy/PaySDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIOSSDK.php
46 lines (36 loc) · 1.33 KB
/
IOSSDK.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
class IOSSDK{
private $arrConfigSDK;
private $dirBaseSDK;
private $paySDK;
function __construct(){
$this->dirBaseSDK = dirname(__FILE__)."/IOSSDK";
$this->getConfigInit();
$this->getIOSPayInit();
}
function getConfigInit(){
$this->arrConfigSDK = require_once $this->dirBaseSDK."/config.inc.php";
}
function getIOSPayInit(){
require_once $this->dirBaseSDK."/ios.class.php";
$this->paySDK = new IOSPay();
}
function getPaySign($arrData,$ListUnset=array(),$ListUrlEncode=array()){
}
function verifyPaySign($arrData){
if(!empty($arrData)){
$tokenPay = $arrData['paytoken'];
if(strlen($tokenPay) >= 20){
$arrVerifyPayGetIfSandbox = json_decode($this->paySDK->curlByIOSPay($tokenPay),true);
if($arrVerifyPayGetIfSandbox['status'] == '21007'){
//若status == 21007为沙盒测试,重新请求下
$arrVerifyPayGetIfSandbox = json_decode($this->paySDK->curlByIOSPay($tokenPay,1),true);
}
}
}
$arrRst = empty($arrVerifyPayGetIfSandbox) ? array() : $arrVerifyPayGetIfSandbox;
return json_encode($arrRst);
}
function getSignature($arrData,$keyCP,$ListUnset=array(),$ListUrlEncode=array()){
}
}