支付方式修改

This commit is contained in:
2025-03-11 13:12:35 +08:00
parent f332b9e7cf
commit 45ea296727

View File

@@ -178,12 +178,25 @@ class ProductOrderSubmitForm extends BaseModel
$orderInfo['Id'] = $productOrder['order_no'];
$orderInfo['businessType'] = '100007';
$orderInfo['goodsList'] = $goods;
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
'order_no' => $pay_order_no,
'openId' => \Yii::$app->user->identity->openid,
'orderInfo' => $orderInfo,
'total_pay_price' => $productOrder['total_pay_price'],
]);
if ($productOrder->prescription->category?? 1 === 2) {
if ($productOrder->delivery_method === 0) {
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
'order_no' => $pay_order_no,
'openId' => \Yii::$app->user->identity->openid,
'orderInfo' => $orderInfo,
'total_pay_price' => $productOrder['trans_expenses'],
]);
}
} else {
$eplResult = EplPayService::getInstance()->WxJsapiPayment([
'order_no' => $pay_order_no,
'openId' => \Yii::$app->user->identity->openid,
'orderInfo' => $orderInfo,
'total_pay_price' => $productOrder['total_pay_price'],
]);
}
if(!isset($eplResult['returnCode']) || $eplResult['returnCode'] != '0000'){
throw new Exception($eplResult['returnMsg']);
}