|
|
@@ -8,6 +8,7 @@
|
|
|
|
|
|
namespace frontendApi\modules\v1\controllers;
|
|
|
|
|
|
+use common\helpers\Cache;
|
|
|
use common\helpers\Date;
|
|
|
use common\helpers\DingTalk;
|
|
|
use common\helpers\Form;
|
|
|
@@ -29,6 +30,7 @@ use common\models\ShopGoods;
|
|
|
use common\models\User;
|
|
|
use common\models\UserBonus;
|
|
|
use common\models\UserWallet;
|
|
|
+use Yii;
|
|
|
use yii\data\Pagination;
|
|
|
use yii\db\Query;
|
|
|
use yii\web\HttpException;
|
|
|
@@ -416,12 +418,17 @@ class ShopController extends BaseController {
|
|
|
// 订单ID
|
|
|
$paymentParams['RefNo'] = \Yii::$app->request->post('RefNo');
|
|
|
// 订单金额,元=>分
|
|
|
- $money = \Yii::$app->request->post('Amount'); // TODO:
|
|
|
- $amount = number_format(1, 2, '.', '');
|
|
|
+ $money = \Yii::$app->request->post('Amount');
|
|
|
+ // 马来币汇率
|
|
|
+ $exchangeRateMYR = floatval(Cache::getSystemConfig()['exchangeRateMYR']['VALUE'] ?? 0);
|
|
|
+ // 计算马来币
|
|
|
+ $amount = number_format($money * $exchangeRateMYR, 2, '.', '');
|
|
|
+ LoggerTool::info([$money, $amount]);
|
|
|
+// $amount = number_format(1, 2, '.', ''); // TODO: 测试
|
|
|
$paymentParams['Amount'] = str_replace('.', '', $amount);
|
|
|
|
|
|
// (Optional) (int)
|
|
|
- $paymentParams['PaymentId'] = ''; // TODO: 2=MYR
|
|
|
+ $paymentParams['PaymentId'] = '2'; // TODO: 2=MYR
|
|
|
// Product description. (length 100)
|
|
|
$paymentParams['ProdDesc'] = 'Pay for sales';
|
|
|
// Customer name. (length 100)
|