|
@@ -155,8 +155,6 @@ class Chinaums
|
|
|
|
|
|
$result = Dever::curl($url, $body, 'post');
|
|
$result = Dever::curl($url, $body, 'post');
|
|
$decryptData = $this->privateDecrypt($result);
|
|
$decryptData = $this->privateDecrypt($result);
|
|
- print_r($content);
|
|
|
|
- print_r($decryptData);die;
|
|
|
|
if (isset($decryptData['responseCode']) && ($decryptData['responseCode'] == '000000' || $decryptData['responseCode'] == '000001')) {
|
|
if (isset($decryptData['responseCode']) && ($decryptData['responseCode'] == '000000' || $decryptData['responseCode'] == '000001')) {
|
|
return 'ok';
|
|
return 'ok';
|
|
} else {
|
|
} else {
|
|
@@ -174,14 +172,12 @@ class Chinaums
|
|
*/
|
|
*/
|
|
public function privateDecrypt($encryptData)
|
|
public function privateDecrypt($encryptData)
|
|
{
|
|
{
|
|
- print_r($encryptData);
|
|
|
|
$content = pack('H*', $encryptData);
|
|
$content = pack('H*', $encryptData);
|
|
$result = '';
|
|
$result = '';
|
|
foreach (str_split($content, 256) as $block) {
|
|
foreach (str_split($content, 256) as $block) {
|
|
openssl_private_decrypt($block, $dataDecrypt, $this->formatRsaKey($this->private_key_pkcs1), OPENSSL_PKCS1_PADDING);
|
|
openssl_private_decrypt($block, $dataDecrypt, $this->formatRsaKey($this->private_key_pkcs1), OPENSSL_PKCS1_PADDING);
|
|
$result .= $dataDecrypt;
|
|
$result .= $dataDecrypt;
|
|
}
|
|
}
|
|
- echo $result;die;
|
|
|
|
$result = Dever::json_decode($result);
|
|
$result = Dever::json_decode($result);
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|