获取患者订单支付数据 新增异常抓去
This commit is contained in:
parent
914ddb5abf
commit
0fc0b46a04
@ -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,17 +852,22 @@ 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);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_inquiry['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_inquiry['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,17 +969,21 @@ 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);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_product['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_product['payment_amount_total'] * 100), $user_info['open_id'], "问诊服务");
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1035,17 +1042,21 @@ 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);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_detection['payment_amount_total'] * 100), $user_info['open_id'], "检测服务");
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_detection['payment_amount_total'] * 100), $user_info['open_id'], "检测服务");
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1148,17 +1159,21 @@ 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);
|
||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_service_package['payment_amount_total'] * 100), $user_info['open_id'], "检测服务");
|
$prepay = $WechatPay->getJsapiPrepayId($order_no, (int)round($order_service_package['payment_amount_total'] * 100), $user_info['open_id'], "检测服务");
|
||||||
if (empty($prepay)) {
|
if (empty($prepay)) {
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序支付配置
|
||||||
|
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
||||||
|
}catch (\Throwable $e){
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取小程序支付配置
|
|
||||||
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user