| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace addons\Store\common\logic\notify;
- use addons\Store\common\models\StoreOrder;
- use addons\Store\common\models\StoreVideoOrder;
- use common\models\order\Order;
- use common\traits\ErrorTrait;
- use Exception;
- class VideoOrderNotify
- {
- use ErrorTrait;
- public function notify($order_info)
- {
- try {
- $order = StoreVideoOrder::findOne(['order_no' => $order_info['order_no']]);
- $res = StoreVideoOrder::pay($order,$order_info['pay_type']);
- if($res === false) throw new Exception(Order::getStaticError());
- return true;
- } catch (Exception $e) {
- echo $e->getMessage();
- $this->setStaticError($e->getMessage());
- return false;
- }
- }
- }
|