|
@@ -13,7 +13,7 @@ class Yspay
|
|
|
$class = new Chinaums();
|
|
|
|
|
|
# 查看当前余额
|
|
|
- $cash = $class->query(false);
|
|
|
+ $cash = $class->query('89810007372107A');
|
|
|
|
|
|
echo $cash;die;
|
|
|
return $cash;
|
|
@@ -23,7 +23,7 @@ class Yspay
|
|
|
{
|
|
|
$order = Dever::order();
|
|
|
|
|
|
- $result = $this->action(false, $order, 2, 10);
|
|
|
+ $result = $this->action('89810007372107A', $order, 2, 1);
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
@@ -43,24 +43,29 @@ class Yspay
|
|
|
{
|
|
|
$msg = Dever::input();
|
|
|
Dever::log($msg, 'yspay');
|
|
|
- $order = Dever::input('order');
|
|
|
+ $order = $msg['order'];
|
|
|
|
|
|
+ if (!$order) {
|
|
|
+ echo 'FAILED';die;
|
|
|
+ }
|
|
|
$where['order_num'] = $order;
|
|
|
$order = Dever::db('shop/sell_order')->find($where);
|
|
|
-
|
|
|
$class = new Chinaums();
|
|
|
|
|
|
if ($order && $order['withdraw'] == 1) {
|
|
|
- $content = Dever::input('content');
|
|
|
+ $content = $msg['content'];
|
|
|
|
|
|
$content = $class->privateDecrypt($content);
|
|
|
|
|
|
- if ($content && isset($content['responseCode']) && $content['responseCode'] == '000000') {
|
|
|
+ if ($content && isset($content['responseCode']) && ($content['responseCode'] == '000000' || $content['responseCode'] == '000001')) {
|
|
|
Dever::db('shop/sell_order')->update(array('where_id' => $order['id'], 'withdraw' => 2));
|
|
|
+ echo 'SUCCESS';die;
|
|
|
} else {
|
|
|
Dever::load('shop/lib/cron')->yspayOne($order);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ echo 'FAILED';die;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -169,12 +174,14 @@ class Chinaums
|
|
|
*/
|
|
|
public function privateDecrypt($encryptData)
|
|
|
{
|
|
|
+ print_r($encryptData);
|
|
|
$content = pack('H*', $encryptData);
|
|
|
$result = '';
|
|
|
foreach (str_split($content, 256) as $block) {
|
|
|
openssl_private_decrypt($block, $dataDecrypt, $this->formatRsaKey($this->private_key_pkcs1), OPENSSL_PKCS1_PADDING);
|
|
|
$result .= $dataDecrypt;
|
|
|
}
|
|
|
+ echo $result;die;
|
|
|
$result = Dever::json_decode($result);
|
|
|
return $result;
|
|
|
}
|