|
@@ -27,77 +27,9 @@ class PayNotifyServices
|
|
|
* @param string|null $order_id 订单id
|
|
|
* @return bool
|
|
|
*/
|
|
|
- public function wechatDeposit(string $order_id = null, string $trade_no = null)
|
|
|
+ public function wechatProduct(string $order_id = null, string $trade_no = null)
|
|
|
{
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->depositPaySuccess($orderInfo->toArray(), PayServices::WEIXIN_PAY, ['deposit_trade_no' => $trade_no]);
|
|
|
- } catch (\Exception $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * 支付宝支付异步回调处理事件
|
|
|
- * @param string|null $order_id
|
|
|
- * @param string|null $trade_no
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function alipayDeposit(string $order_id = null, string $trade_no = null)
|
|
|
- {
|
|
|
- if (!$order_id || !$trade_no) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->depositPaySuccess($orderInfo->toArray(), PayServices::ALIAPY_PAY, ['deposit_trade_no' => $trade_no]);
|
|
|
- } catch (\Throwable $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
-
|
|
|
- * 订单定金支付成功之后
|
|
|
- * @param string|null $order_id 订单id
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function wechatMiddle(string $order_id = null, string $trade_no = null)
|
|
|
- {
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->middlePaySuccess($orderInfo->toArray(), PayServices::WEIXIN_PAY, ['middle_trade_no' => $trade_no]);
|
|
|
- } catch (\Exception $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -107,79 +39,8 @@ class PayNotifyServices
|
|
|
* @param string|null $trade_no
|
|
|
* @return bool
|
|
|
*/
|
|
|
- public function alipayMiddle(string $order_id = null, string $trade_no = null)
|
|
|
+ public function alipayProduct(string $order_id = null, string $trade_no = null)
|
|
|
{
|
|
|
- if (!$order_id || !$trade_no) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->middlePaySuccess($orderInfo->toArray(), PayServices::ALIAPY_PAY, ['middle_trade_no' => $trade_no]);
|
|
|
- } catch (\Throwable $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * 订单定金支付成功之后
|
|
|
- * @param string|null $order_id 订单id
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function wechatFinal(string $order_id = null, string $trade_no = null)
|
|
|
- {
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->finalPaySuccess($orderInfo->toArray(), PayServices::WEIXIN_PAY, ['final_trade_no' => $trade_no]);
|
|
|
- } catch (\Exception $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
-
|
|
|
- * 支付宝支付异步回调处理事件
|
|
|
- * @param string|null $order_id
|
|
|
- * @param string|null $trade_no
|
|
|
- * @return bool
|
|
|
- */
|
|
|
- public function alipayFinal(string $order_id = null, string $trade_no = null)
|
|
|
- {
|
|
|
- if (!$order_id || !$trade_no) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- try {
|
|
|
-
|
|
|
- $services = app()->make(DecorationServices::class);
|
|
|
-
|
|
|
- $orderServices = app()->make(DecorationOrderServices::class);
|
|
|
- $orderInfo = $orderServices->getOne(['order_id' => $order_id]);
|
|
|
- if (!$orderInfo) {
|
|
|
- $orderInfo = $orderServices->getOne(['unique' => $order_id]);
|
|
|
- if (!$orderInfo) return true;
|
|
|
- }
|
|
|
- if ($orderInfo->step > 0) return true;
|
|
|
- return $services->finalPaySuccess($orderInfo->toArray(), PayServices::ALIAPY_PAY, ['final_trade_no' => $trade_no]);
|
|
|
- } catch (\Throwable $e) {
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|
|
|
}
|