From bd5b36373c0b52b756c033ca07fcefe1aac60c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 7 Nov 2024 22:16:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=BF=90=E8=B4=B9=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeMini/Insurance.php | 210 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 WeMini/Insurance.php diff --git a/WeMini/Insurance.php b/WeMini/Insurance.php new file mode 100644 index 0000000..0a07384 --- /dev/null +++ b/WeMini/Insurance.php @@ -0,0 +1,210 @@ +callPostApi($url, [], true); + } + + /** + * 查询开通状态接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function queryOpen() + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/query_open?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, [], true); + } + + /** + * 投保接口(发货时投保) + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function createOrder($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/createorder?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 理赔接口 (收到用户退货后再触发) + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function claim($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/claim?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 申请充值订单号接口 (支持自定义金额) + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function createChargeId($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/createchargeid?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 申请支付接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function applyPay($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/applypay?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 拉取充值订单信息接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getPayOrderList($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/getpayorderlist?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + + /** + * 退款接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function refund($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/refund?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 拉取摘要接口 (查询当前保费、投保单量、理赔单量、账号余额等信息) + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getSummary($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/getsummary?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 拉取保单信息接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getOrderList($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/getorderlist?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 设置告警余额接口 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function updateNotifyFunds($data) + { + $url = 'https://api.weixin.qq.com/wxa/business/insurance_freight/update_notify_funds?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 创建退货 ID + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function returnAdd($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/no_worry_return/add?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查询退货 ID 状态 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function returnGet($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/no_worry_return/get?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } + + /** + * 查解绑退货 ID + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function returnUbind($data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/express/delivery/no_worry_return/unbind?access_token=ACCESS_TOKEN'; + return $this->callPostApi($url, $data, true); + } +} \ No newline at end of file