vendor/codeages/biz-order-pay/src/Order/Status/Refund/OrderRefundContext.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Codeages\Biz\Order\Status\Refund;

use Codeages\Biz\Framework\Event\Event;
use Codeages\Biz\Order\Status\OrderStatusCallback;
use Codeages\Biz\Framework\Service\Exception\AccessDeniedException;
use Codeages\Biz\Framework\Service\Exception\InvalidArgumentException;
use Codeages\Biz\Framework\Service\Exception\NotFoundException;
use Codeages\Biz\Framework\Service\Exception\ServiceException;
use Codeages\Biz\Framework\Util\ArrayToolkit;

class OrderRefundContext
{
    protected $biz;
    protected $orderRefund;
    protected $status;

    function __construct($biz)
    {
        $this->biz = $biz;
    }

    public function setOrderRefund($orderRefund)
    {
        $this->orderRefund = $orderRefund;
        $this->status = $this->biz["order_refund_status.{$orderRefund['status']}"];

        $this->status->setOrderRefund($orderRefund);
    }

    public function getOrderRefund()
    {
        return $this->orderRefund;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function start($data)
    {
        try {
            $this->biz['db']->beginTransaction();
            $this->status = $this->biz["order_refund_status.".AuditingStatus::NAME];
            $orderRefund = $this->status->process($data);
            $this->biz['db']->commit();
        } catch (AccessDeniedException $e) {
            $this->biz['db']->rollback();
            throw $e;
        } catch (InvalidArgumentException $e) {
            $this->biz['db']->rollback();
            throw $e;
        } catch (NotFoundException $e) {
            $this->biz['db']->rollback();
            throw $e;
        } catch (\Exception $e) {
            $this->biz['db']->rollback();
            $this->biz['logger']->error($e);

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。