diff --git a/packages/payment/src/Application/Listeners/RefundChannelListener.php b/packages/payment/src/Application/Listeners/RefundChannelListener.php index 96e9fda5..16384d59 100644 --- a/packages/payment/src/Application/Listeners/RefundChannelListener.php +++ b/packages/payment/src/Application/Listeners/RefundChannelListener.php @@ -3,16 +3,13 @@ namespace RedJasmine\Payment\Application\Listeners; -use Illuminate\Contracts\Queue\ShouldQueueAfterCommit; -use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Support\Facades\Log; use RedJasmine\Payment\Application\Jobs\ChannelRefundJob; use RedJasmine\Payment\Domain\Events\Refunds\RefundCreatedEvent; -class RefundChannelListener implements ShouldQueueAfterCommit +class RefundChannelListener { - use InteractsWithQueue; - public function __construct() { } @@ -20,6 +17,8 @@ public function __construct() public function handle($event) : void { + + if ($event instanceof RefundCreatedEvent) { // 调度任务 ChannelRefundJob::dispatch($event->refund->refund_no); diff --git a/packages/payment/src/Domain/Events/Refunds/AbstractRefundEvent.php b/packages/payment/src/Domain/Events/Refunds/AbstractRefundEvent.php index 2c05c2aa..9b9a77ab 100644 --- a/packages/payment/src/Domain/Events/Refunds/AbstractRefundEvent.php +++ b/packages/payment/src/Domain/Events/Refunds/AbstractRefundEvent.php @@ -2,10 +2,11 @@ namespace RedJasmine\Payment\Domain\Events\Refunds; +use Illuminate\Contracts\Events\ShouldDispatchAfterCommit; use Illuminate\Foundation\Events\Dispatchable; use RedJasmine\Payment\Domain\Models\Refund; -abstract class AbstractRefundEvent +abstract class AbstractRefundEvent implements ShouldDispatchAfterCommit { use Dispatchable; diff --git a/packages/payment/src/Domain/Events/Trades/AbstractTradeEvent.php b/packages/payment/src/Domain/Events/Trades/AbstractTradeEvent.php index 69f59d2c..1dfc5c91 100644 --- a/packages/payment/src/Domain/Events/Trades/AbstractTradeEvent.php +++ b/packages/payment/src/Domain/Events/Trades/AbstractTradeEvent.php @@ -2,10 +2,11 @@ namespace RedJasmine\Payment\Domain\Events\Trades; +use Illuminate\Contracts\Events\ShouldDispatchAfterCommit; use Illuminate\Foundation\Events\Dispatchable; use RedJasmine\Payment\Domain\Models\Trade; -abstract class AbstractTradeEvent +abstract class AbstractTradeEvent implements ShouldDispatchAfterCommit { use Dispatchable;