success) { return; } if ($transaction->type === 'refund' && $transaction->wasRecentlyCreated) { OrderRefunded::dispatch($transaction->order, $transaction); return; } if ($transaction->type === 'capture' && $transaction->wasChanged('type')) { OrderCaptured::dispatch($transaction->order, $transaction); } } }