新增分配医生队列
This commit is contained in:
@@ -109,7 +109,7 @@ class WechatPay
|
||||
"out_trade_no" => $out_trade_no, // 商户系统内部订单号
|
||||
"appid" => $this->config['app_id'],
|
||||
"description" => "问诊服务",
|
||||
"notify_url" => env('DOMAIN_NAME_DEV') . $this->config['notify_url'],
|
||||
"notify_url" => env('DOMAIN_NAME_DEV') . $this->config['pay_notify_url'],
|
||||
"amount" => [
|
||||
"total" => $total,//订单总金额,单位为分。
|
||||
"currency" => "CNY"
|
||||
@@ -144,6 +144,8 @@ class WechatPay
|
||||
* 获取小程序支付配置
|
||||
* @param string $prepay_id 预支付交易会话标识
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getAppletsPayConfig(string $prepay_id): array
|
||||
{
|
||||
@@ -166,5 +168,37 @@ class WechatPay
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款接口
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function refund(array $options)
|
||||
{
|
||||
try {
|
||||
$app = $this->createApp();
|
||||
|
||||
$options = [
|
||||
"notify_url " => env('DOMAIN_NAME_DEV') . $this->config['refund_notify_url'],
|
||||
];
|
||||
|
||||
$response = $app->getClient()->postJson("v3/refund/domestic/refunds", $options);
|
||||
if ($response->isFailed()) {
|
||||
// 出错了,处理异常
|
||||
$result = $response->toArray(false);
|
||||
if(empty($result)){
|
||||
// 返回值为空
|
||||
throw new BusinessException("发起退款失败");
|
||||
}
|
||||
if (!empty($result['code'])){
|
||||
throw new BusinessException($result['message']);
|
||||
}
|
||||
throw new BusinessException("发起退款失败");
|
||||
}
|
||||
|
||||
return $response->toArray(false);
|
||||
} catch (\Exception $e) {
|
||||
throw new BusinessException($e->getMessage(), HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user