@@ -263,9 +263,12 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | foreach( $codes as $code ) |
| 265 | 265 | { |
| 266 | - try { |
|
| 266 | + try |
|
| 267 | + { |
|
| 267 | 268 | $newOrder->addCoupon( $code ); |
| 268 | - } catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) { |
|
| 269 | + } |
|
| 270 | + catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) |
|
| 271 | + { |
|
| 269 | 272 | $newOrder->deleteCoupon( $code ); |
| 270 | 273 | } |
| 271 | 274 | } |
@@ -381,7 +384,9 @@ discard block |
||
| 381 | 384 | $context->setUserId( $order->getCustomerId() ); |
| 382 | 385 | $context->setGroupIds( $customerItem->getGroups() ); |
| 383 | 386 | } |
| 384 | - catch( \Exception $e ) {} // Subscription without account |
|
| 387 | + catch( \Exception $e ) |
|
| 388 | + { |
|
| 389 | +} // Subscription without account |
|
| 385 | 390 | |
| 386 | 391 | return $context; |
| 387 | 392 | } |
@@ -567,9 +572,11 @@ discard block |
||
| 567 | 572 | } |
| 568 | 573 | catch( \Exception $e ) |
| 569 | 574 | { |
| 570 | - if( $e->getCode() < 1 ) // not a soft error |
|
| 575 | + if( $e->getCode() < 1 ) { |
|
| 576 | + // not a soft error |
|
| 571 | 577 | { |
| 572 | 578 | $item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_PAYMENT ); |
| 579 | + } |
|
| 573 | 580 | |
| 574 | 581 | if( $this->ends() ) { |
| 575 | 582 | $item->setDateEnd( date_create()->format( 'Y-m-d H:i:s' ) ); |