@@ -104,7 +104,7 @@ public function decideToRefundPartFromProductWithPayment(
104104 $ paymentMethod ->getId (),
105105 ''
106106 ));
107- } catch ( \ Exception $ exception ) {
107+ } catch ( \ InvalidArgumentException | OrderNotFound $ exception ) {
108108 return ;
109109 }
110110 }
@@ -145,7 +145,7 @@ public function tryToRefundPartOfOrderShipment(int $amount, PaymentMethodInterfa
145145 $ this ->commandBus ->dispatch (new RefundUnits (
146146 $ this ->order ->getNumber (), [], [new ShipmentRefund ($ shippingAdjustment ->getId (), $ amount )], $ paymentMethod ->getId (), ''
147147 ));
148- } catch ( \ Exception $ exception ) {
148+ } catch ( \ InvalidArgumentException | OrderNotFound $ exception ) {
149149 return ;
150150 }
151151 }
@@ -222,7 +222,7 @@ public function shouldNotBeAbleToRefundUnitWithProduct(int $unitNumber, string $
222222 1 ,
223223 ''
224224 ));
225- } catch ( \ Exception $ exception ) {
225+ } catch ( \ InvalidArgumentException | OrderNotFound $ exception ) {
226226 return ;
227227 }
228228
@@ -245,7 +245,7 @@ public function shouldNotBeAbleToRefundOrderShipment(): void
245245 1 ,
246246 ''
247247 ));
248- } catch ( \ Exception $ exception ) {
248+ } catch ( \ InvalidArgumentException | OrderNotFound $ exception ) {
249249 return ;
250250 }
251251
@@ -265,7 +265,7 @@ public function shouldStillBeAbleToRefundOrderShipment(PaymentMethodInterface $p
265265 $ this ->commandBus ->dispatch (new RefundUnits (
266266 $ this ->order ->getNumber (), [], [new ShipmentRefund ($ shippingAdjustment ->getId (), $ remainingTotal )], $ paymentMethod ->getId (), ''
267267 ));
268- } catch ( \ Exception $ exception ) {
268+ } catch ( \ InvalidArgumentException | OrderNotFound $ exception ) {
269269 throw new \Exception ('RefundUnits command should not fail ' );
270270 }
271271 }
0 commit comments