src/PHPDish/Bundle/PaymentBundle/Service/PaymentManager.php
public function notifyPayment($qrId)
    {
        $payment = $this->findPaymentByQrId($qrId);
        if (!$payment) {
            return null;
        }
        //已经成功的不再通知
        if ($payment->getStatus() === PaymentInterface::STATUS_OK) {
            return null;
        }
        $payment->setStatus(PaymentInterface::STATUS_OK)
            ->setUpdatedAt(Carbon::now()); //交易状态

        $this->savePayment($payment);

        //触发交易完成事件
        $this->eventDispatcher->dispatch(PaymentEvent::PAYMENT_PAID, new PaymentEvent($payment));
        return $payment;
    }
public function notifyPayment($qrId)
    {
        $payment = $this->findPaymentByQrId($qrId);
        if (!$payment) {
            return null;
        }
        //已经成功的不再通知
        if ($payment->getStatus() === PaymentInterface::STATUS_OK) {
            return null;
        }
        $payment->setStatus(PaymentInterface::STATUS_OK)
            ->setUpdatedAt(Carbon::now()); //交易状态

        $this->savePayment($payment);

        //触发交易完成事件
        $this->eventDispatcher->dispatch(PaymentEvent::PAYMENT_PAID, new PaymentEvent($payment));
        return $payment;
    }
{@inheritdoc}