| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace addons\DepositPresale\common\logic\notify;
- use addons\DepositPresale\common\models\DepositPresaleOrder;
- use common\models\order\Order;
- use common\traits\ErrorTrait;
- use Exception;
- /**
- * Class Notify
- * @Author: hua
- * @DateTime: 2021/10/18 9:39
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @package common\logic\notify
- */
- class Notify
- {
- use ErrorTrait;
- /**
- * @Author: hua
- * @DateTime: 2021/10/18 9:57
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param $order_info
- * @return bool
- */
- public function notify($order_info)
- {
- try {
- $order = DepositPresaleOrder::findOne(['order_no' => $order_info['order_no']]);
- $res = DepositPresaleOrder::pay($order,$order_info['pay_type']);
- if($res === false) throw new Exception(DepositPresaleOrder::getStaticError());
- return true;
- } catch (Exception $e) {
- echo $e->getMessage();
- $this->setStaticError($e->getMessage());
- return false;
- }
- }
- }
|