|
|
|
@ -1,29 +1,34 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
function encrypt($plaintext) { |
|
|
|
$length = mb_strlen($plaintext); |
|
|
|
$ciphertext = ''; |
|
|
|
for ($i = 0; $i < $length; $i += 2) { |
|
|
|
$ciphertext .= mb_substr($plaintext, $i + 1, 1) . mb_substr($plaintext, $i, 1); |
|
|
|
} |
|
|
|
return $ciphertext; |
|
|
|
function encrypt($plaintext) { |
|
|
|
$length = mb_strlen($plaintext); |
|
|
|
$ciphertext = ''; |
|
|
|
for ($i = 0; $i < $length; $i += 2) { |
|
|
|
$ciphertext .= mb_substr($plaintext, $i + 1, 1) . mb_substr($plaintext, $i, 1); |
|
|
|
} |
|
|
|
return $ciphertext; |
|
|
|
} |
|
|
|
|
|
|
|
function decrypt($ciphertext) { |
|
|
|
$length = mb_strlen($ciphertext); |
|
|
|
$plaintext = ''; |
|
|
|
for ($i = 0; $i < $length; $i += 2) { |
|
|
|
$plaintext .= mb_substr($ciphertext, $i + 1, 1) . mb_substr($ciphertext, $i, 1); |
|
|
|
} |
|
|
|
return $plaintext; |
|
|
|
function decrypt($ciphertext) { |
|
|
|
$length = mb_strlen($ciphertext); |
|
|
|
$plaintext = ''; |
|
|
|
for ($i = 0; $i < $length; $i += 2) { |
|
|
|
$plaintext .= mb_substr($ciphertext, $i + 1, 1) . mb_substr($ciphertext, $i, 1); |
|
|
|
} |
|
|
|
// function pay() |
|
|
|
// { |
|
|
|
return $plaintext; |
|
|
|
} |
|
|
|
function pay($openid_crypt, $order_sn, $order_amount) |
|
|
|
{ |
|
|
|
session_start(); |
|
|
|
// $openid = $_SESSION['openid']; |
|
|
|
$openid = decrypt($_GET['openid']); |
|
|
|
$reqsn = $_GET['reqsn']; |
|
|
|
$trxamt = $_GET['trxamt']; |
|
|
|
// $openid = decrypt($_GET['openid']); |
|
|
|
// $reqsn = $_GET['reqsn']; |
|
|
|
// $trxamt = $_GET['trxamt']; |
|
|
|
|
|
|
|
$openid = decrypt($openid_crypt,); |
|
|
|
$reqsn = $order_sn; |
|
|
|
$trxamt = $order_amount; |
|
|
|
|
|
|
|
// var_dump($openid); |
|
|
|
// var_dump($reqsn); |
|
|
|
// var_dump($trxamt); |
|
|
|
@ -144,13 +149,13 @@ |
|
|
|
// die(); |
|
|
|
var_dump(json_decode($response_data)); |
|
|
|
$_SESSION['response_data_json'] = $response_data; |
|
|
|
// return $response_data; |
|
|
|
return $response_data; |
|
|
|
|
|
|
|
var_dump($_SESSION['user_id']); |
|
|
|
// var_dump($_SESSION['user_id']); |
|
|
|
// 跳回之前的地址 |
|
|
|
// header('Location: ' . $redirect_url); |
|
|
|
// exit; |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
// return pay(); |
|
|
|
?> |
|
|
|
|