获取患者订单支付数据 新增异常抓去

This commit is contained in:
2024-06-26 14:51:44 +08:00
parent 914ddb5abf
commit 0fc0b46a04
+17 -2
View File
@@ -769,8 +769,6 @@ class PatientOrderService extends BaseService
/** /**
* 获取患者订单支付数据 * 获取患者订单支付数据
* @return array * @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function getPatientOrderPayInfo(): array public function getPatientOrderPayInfo(): array
{ {
@@ -854,6 +852,7 @@ class PatientOrderService extends BaseService
$result['discount_amount'] = 0; // 优惠金额 $result['discount_amount'] = 0; // 优惠金额
if ($order_inquiry['payment_amount_total'] > 0) { if ($order_inquiry['payment_amount_total'] > 0) {
try {
// 发起支付 // 发起支付
$WechatPay = new WechatPay(1, 1); $WechatPay = new WechatPay(1, 1);
@@ -865,6 +864,10 @@ class PatientOrderService extends BaseService
// 获取小程序支付配置 // 获取小程序支付配置
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
}catch (\Throwable $e){
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
}
} }
} }
@@ -966,6 +969,7 @@ class PatientOrderService extends BaseService
}*/ }*/
if ($order_product['payment_amount_total'] > 0) { if ($order_product['payment_amount_total'] > 0) {
try {
// 发起支付 // 发起支付
$WechatPay = new WechatPay(1, 2); $WechatPay = new WechatPay(1, 2);
@@ -977,6 +981,9 @@ class PatientOrderService extends BaseService
// 获取小程序支付配置 // 获取小程序支付配置
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
}catch (\Throwable $e){
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
}
} }
} }
@@ -1035,6 +1042,7 @@ class PatientOrderService extends BaseService
$result['discount_amount'] = 0; $result['discount_amount'] = 0;
if ($order_detection['payment_amount_total'] > 0) { if ($order_detection['payment_amount_total'] > 0) {
try {
// 发起支付 // 发起支付
$WechatPay = new WechatPay(1, 3); $WechatPay = new WechatPay(1, 3);
@@ -1046,6 +1054,9 @@ class PatientOrderService extends BaseService
// 获取小程序支付配置 // 获取小程序支付配置
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
}catch (\Throwable $e){
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
}
} }
} }
@@ -1148,6 +1159,7 @@ class PatientOrderService extends BaseService
} }
if ($order_service_package['payment_amount_total'] > 0) { if ($order_service_package['payment_amount_total'] > 0) {
try {
// 发起支付 // 发起支付
$WechatPay = new WechatPay(1, 4); $WechatPay = new WechatPay(1, 4);
@@ -1159,6 +1171,9 @@ class PatientOrderService extends BaseService
// 获取小程序支付配置 // 获取小程序支付配置
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
}catch (\Throwable $e){
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
}
} }
} }