|
@@ -126,7 +126,7 @@ class Yspay extends Core
|
|
|
$request['mid'] = $this->config['mid'];
|
|
|
$request['tid'] = $this->config['tid'];
|
|
|
$request['instMid'] = 'MINIDEFAULT';
|
|
|
- $request['totalAmount'] = $cash * 100;
|
|
|
+ $request['totalAmount'] = round($cash * 100, 2);
|
|
|
//$request['totalAmount'] = 100;
|
|
|
$request['subAppId'] = $this->config['sub_appid'];
|
|
|
$request['requestTimestamp'] = date("Y-m-d H:i:s");
|
|
@@ -135,12 +135,12 @@ class Yspay extends Core
|
|
|
$request['tradeType'] = 'MINI';
|
|
|
|
|
|
if ($other) {
|
|
|
- $request['originalAmount'] = $other['oprice'] * 100;
|
|
|
+ $request['originalAmount'] = round($other['oprice'] * 100, 2);
|
|
|
$request['divisionFlag'] = true;
|
|
|
# 平台分账金额
|
|
|
$other['per'] = $other['per'] && $other['per'] >= 0 ? $other['per'] : 0;
|
|
|
$other['per'] = $other['per']/100;
|
|
|
- $request['platformAmount'] = $request['totalAmount'] * $other['per'];
|
|
|
+ $request['platformAmount'] = round($request['totalAmount'] * $other['per'], 2);
|
|
|
$request['subOrders'] = array();
|
|
|
$request['subOrders']['mid'] = $other['mid'];
|
|
|
if (isset($this->config['prefix']) && $this->config['prefix']) {
|
|
@@ -149,7 +149,7 @@ class Yspay extends Core
|
|
|
$request['subOrders']['merOrderId'] = $other['order_id'];
|
|
|
}
|
|
|
|
|
|
- $request['subOrders']['totalAmount'] = $request['totalAmount'] - $request['platformAmount'];
|
|
|
+ $request['subOrders']['totalAmount'] = round($request['totalAmount'] - $request['platformAmount'], 2);
|
|
|
$request['subOrders'] = array($request['subOrders']);
|
|
|
}
|
|
|
if (!$openid) {
|
|
@@ -216,13 +216,13 @@ class Yspay extends Core
|
|
|
|
|
|
$request['subAppId'] = $this->config['appid'];
|
|
|
$request['requestTimestamp'] = date("Y-m-d H:i:s");
|
|
|
- $request['refundAmount'] = $cash * 100;
|
|
|
+ $request['refundAmount'] = round($cash * 100, 2);
|
|
|
|
|
|
if (isset($order['param']['other']) && $order['param']['other']) {
|
|
|
$other = $order['param']['other'];
|
|
|
$other['per'] = $other['per'] && $other['per'] >= 0 ? $other['per'] : 0;
|
|
|
$other['per'] = $other['per']/100;
|
|
|
- $request['platformAmount'] = $request['refundAmount'] * $other['per'];
|
|
|
+ $request['platformAmount'] = round($request['refundAmount'] * $other['per'], 2);
|
|
|
$request['subOrders'] = array();
|
|
|
$request['subOrders']['mid'] = $other['mid'];
|
|
|
if (isset($this->config['prefix']) && $this->config['prefix']) {
|
|
@@ -237,7 +237,7 @@ class Yspay extends Core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $request['subOrders']['totalAmount'] = $request['refundAmount'] - $request['platformAmount'];
|
|
|
+ $request['subOrders']['totalAmount'] = round($request['refundAmount'] - $request['platformAmount'], 2);
|
|
|
$request['subOrders'] = array($request['subOrders']);
|
|
|
}
|
|
|
|