Completed
Push — master ( cbc921...0b1729 )
by Aimeos
02:05
created
common/src/Controller/Common/Product/Import/Csv/Processor/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
27 27
 	 * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor
28 28
 	 */
29
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
-		\Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null );
29
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping,
30
+		\Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null);
31 31
 
32 32
 
33 33
 	/**
@@ -37,5 +37,5 @@  discard block
 block discarded – undo
37 37
 	 * @param array $data List of CSV fields with position as key and data as value
38 38
 	 * @return array List of data which hasn't been imported
39 39
 	 */
40
-	public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data );
40
+	public function process(\Aimeos\MShop\Product\Item\Iface $product, array $data);
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
controller/common/src/Controller/Common/Product/Import/Csv/Cache/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 *
25 25
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
26 26
 	 */
27
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context );
27
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context);
28 28
 
29 29
 	/**
30 30
 	 * Returns the item or ID for the given code
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 	 * @param string|null $type Item type if used and required
34 34
 	 * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found
35 35
 	 */
36
-	public function get( $code, $type = null );
36
+	public function get($code, $type = null);
37 37
 
38 38
 	/**
39 39
 	 * Adds the item or ID to the cache
40 40
 	 *
41 41
 	 * @param \Aimeos\MShop\Common\Item\Iface $item Item object
42 42
 	 */
43
-	public function set( \Aimeos\MShop\Common\Item\Iface $item );
43
+	public function set(\Aimeos\MShop\Common\Item\Iface $item);
44 44
 }
Please login to merge, or discard this patch.
controller/common/src/Controller/Common/Product/Import/Csv/Cache/Base.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
29 29
 	 */
30
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
30
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context)
31 31
 	{
32 32
 		$this->context = $context;
33 33
 	}
Please login to merge, or discard this patch.
controller/common/tests/bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@
 block discarded – undo
11 11
  * Set error reporting to maximum
12 12
  */
13 13
 error_reporting( -1 );
14
-ini_set( 'display_errors', '1' );
14
+ini_set('display_errors', '1');
15 15
 
16
-date_default_timezone_set( 'UTC' );
16
+date_default_timezone_set('UTC');
17 17
 
18 18
 /**
19 19
  * Set locale settings to reasonable defaults
20 20
  */
21
-setlocale( LC_ALL, 'en_US.UTF-8' );
22
-setlocale( LC_NUMERIC, 'POSIX' );
23
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
24
-setlocale( LC_TIME, 'POSIX' );
21
+setlocale(LC_ALL, 'en_US.UTF-8');
22
+setlocale(LC_NUMERIC, 'POSIX');
23
+setlocale(LC_CTYPE, 'en_US.UTF-8');
24
+setlocale(LC_TIME, 'POSIX');
25 25
 
26 26
 /*
27 27
  * Set include path for tests
28 28
  */
29
-define( 'PATH_TESTS', __DIR__ );
29
+define('PATH_TESTS', __DIR__);
30 30
 
31 31
 require_once 'TestHelperCntl.php';
32 32
 \TestHelperCntl::bootstrap();
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Cleanup/Unpaid/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/order/cleanup/unpaid/name
36 36
 		 * Class name of the used order cleanup unpaid scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.07
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/order/cleanup/unpaid/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the order cleanup unpaid controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/order/cleanup/unpaid/decorators/excludes
155 155
 		 * @see controller/jobs/order/cleanup/unpaid/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unpaid' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unpaid');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Cleanup/Unfinished/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/order/cleanup/unfinished/name
36 36
 		 * Class name of the used order cleanup unfinished scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.03
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/order/cleanup/unfinished/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unfinished\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/order/cleanup/unfinished/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the order cleanup unfinished controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/order/cleanup/unfinished/decorators/excludes
155 155
 		 * @see controller/jobs/order/cleanup/unfinished/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unfinished' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unfinished');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Service/Async/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/order/service/async/name
36 36
 		 * Class name of the used order service async scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.07
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/order/service/async/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/order/service/async/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Async\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/order/service/async/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the order service async controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/order/service/async/decorators/excludes
155 155
 		 * @see controller/jobs/order/service/async/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'order/service/async' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'order/service/async');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Service/Payment/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/order/service/payment/name
36 36
 		 * Class name of the used order service payment scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.07
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/order/service/payment/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/order/service/payment/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Payment\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Payment\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Order\\Service\\Payment\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/order/service/payment/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the order service payment controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/order/service/payment/decorators/excludes
155 155
 		 * @see controller/jobs/order/service/payment/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'order/service/payment' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'order/service/payment');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Order/Service/Payment/Standard.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -120,8 +120,7 @@  discard block
 block discarded – undo
120 120
 					{
121 121
 						$capdate = date( 'Y-m-d 00:00:00', time() - 86400 * $capDays );
122 122
 						$expr[] = $orderSearch->compare( '<=', 'order.datepayment', $capdate );
123
-					}
124
-					else
123
+					} else
125 124
 					{
126 125
 						$expr[] = $orderSearch->compare( '==', 'order.statusdelivery', $status );
127 126
 					}
@@ -144,8 +143,7 @@  discard block
 block discarded – undo
144 143
 							try
145 144
 							{
146 145
 								$serviceProvider->capture( $orderItem );
147
-							}
148
-							catch( \Exception $e )
146
+							} catch( \Exception $e )
149 147
 							{
150 148
 								$str = 'Error while capturing payment for order with ID "%1$s": %2$s';
151 149
 								$context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) );
@@ -157,8 +155,7 @@  discard block
 block discarded – undo
157 155
 						$orderSearch->setSlice( $orderStart );
158 156
 					}
159 157
 					while( $orderCount >= $orderSearch->getSliceSize() );
160
-				}
161
-				catch( \Exception $e )
158
+				} catch( \Exception $e )
162 159
 				{
163 160
 					$str = 'Error while capturing payments for service with ID "%1$s": %2$s';
164 161
 					$context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) );
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Capture authorized payments' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Capture authorized payments');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time');
44 44
 	}
45 45
 
46 46
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		 * @category User
69 69
 		 * @category Developer
70 70
 		 */
71
-		$days = $config->get( 'controller/jobs/order/service/payment/limit-days', 90 );
72
-		$date = date( 'Y-m-d 00:00:00', time() - 86400 * $days );
71
+		$days = $config->get('controller/jobs/order/service/payment/limit-days', 90);
72
+		$date = date('Y-m-d 00:00:00', time() - 86400 * $days);
73 73
 
74 74
 		/** controller/jobs/order/service/payment/capture-days
75 75
 		 * Automatically capture payments after the configured amount of days
@@ -84,90 +84,90 @@  discard block
 block discarded – undo
84 84
 		 * @category User
85 85
 		 * @category Developer
86 86
 		 */
87
-		$capDays = $config->get( 'controller/jobs/order/service/payment/capture-days', null );
87
+		$capDays = $config->get('controller/jobs/order/service/payment/capture-days', null);
88 88
 
89 89
 
90
-		$serviceManager = \Aimeos\MShop::create( $context, 'service' );
90
+		$serviceManager = \Aimeos\MShop::create($context, 'service');
91 91
 		$serviceSearch = $serviceManager->createSearch();
92
-		$serviceSearch->setConditions( $serviceSearch->compare( '==', 'service.type', 'payment' ) );
92
+		$serviceSearch->setConditions($serviceSearch->compare('==', 'service.type', 'payment'));
93 93
 
94
-		$orderManager = \Aimeos\MShop::create( $context, 'order' );
94
+		$orderManager = \Aimeos\MShop::create($context, 'order');
95 95
 		$orderSearch = $orderManager->createSearch();
96 96
 
97
-		$status = array( \Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED );
97
+		$status = array(\Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED);
98 98
 		$start = 0;
99 99
 
100 100
 		do
101 101
 		{
102
-			$serviceItems = $serviceManager->searchItems( $serviceSearch );
102
+			$serviceItems = $serviceManager->searchItems($serviceSearch);
103 103
 
104
-			foreach( $serviceItems as $serviceItem )
104
+			foreach ($serviceItems as $serviceItem)
105 105
 			{
106 106
 				try
107 107
 				{
108
-					$serviceProvider = $serviceManager->getProvider( $serviceItem, $serviceItem->getType() );
108
+					$serviceProvider = $serviceManager->getProvider($serviceItem, $serviceItem->getType());
109 109
 
110
-					if( !$serviceProvider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE ) ) {
110
+					if (!$serviceProvider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE)) {
111 111
 						continue;
112 112
 					}
113 113
 
114 114
 
115 115
 					$expr = [];
116
-					$expr[] = $orderSearch->compare( '>', 'order.datepayment', $date );
116
+					$expr[] = $orderSearch->compare('>', 'order.datepayment', $date);
117 117
 
118
-					if( $capDays !== null )
118
+					if ($capDays !== null)
119 119
 					{
120
-						$capdate = date( 'Y-m-d 00:00:00', time() - 86400 * $capDays );
121
-						$expr[] = $orderSearch->compare( '<=', 'order.datepayment', $capdate );
120
+						$capdate = date('Y-m-d 00:00:00', time() - 86400 * $capDays);
121
+						$expr[] = $orderSearch->compare('<=', 'order.datepayment', $capdate);
122 122
 					}
123 123
 					else
124 124
 					{
125
-						$expr[] = $orderSearch->compare( '==', 'order.statusdelivery', $status );
125
+						$expr[] = $orderSearch->compare('==', 'order.statusdelivery', $status);
126 126
 					}
127 127
 
128
-					$expr[] = $orderSearch->compare( '==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED );
129
-					$expr[] = $orderSearch->compare( '==', 'order.base.service.code', $serviceItem->getCode() );
130
-					$expr[] = $orderSearch->compare( '==', 'order.base.service.type', 'payment' );
128
+					$expr[] = $orderSearch->compare('==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED);
129
+					$expr[] = $orderSearch->compare('==', 'order.base.service.code', $serviceItem->getCode());
130
+					$expr[] = $orderSearch->compare('==', 'order.base.service.type', 'payment');
131 131
 
132
-					$orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) );
132
+					$orderSearch->setConditions($orderSearch->combine('&&', $expr));
133 133
 
134 134
 
135 135
 					$orderStart = 0;
136 136
 
137 137
 					do
138 138
 					{
139
-						$orderItems = $orderManager->searchItems( $orderSearch );
139
+						$orderItems = $orderManager->searchItems($orderSearch);
140 140
 
141
-						foreach( $orderItems as $orderItem )
141
+						foreach ($orderItems as $orderItem)
142 142
 						{
143 143
 							try
144 144
 							{
145
-								$serviceProvider->capture( $orderItem );
145
+								$serviceProvider->capture($orderItem);
146 146
 							}
147
-							catch( \Exception $e )
147
+							catch (\Exception $e)
148 148
 							{
149 149
 								$str = 'Error while capturing payment for order with ID "%1$s": %2$s';
150
-								$context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) );
150
+								$context->getLogger()->log(sprintf($str, $orderItem->getId(), $e->getMessage()));
151 151
 							}
152 152
 						}
153 153
 
154
-						$orderCount = count( $orderItems );
154
+						$orderCount = count($orderItems);
155 155
 						$orderStart += $orderCount;
156
-						$orderSearch->setSlice( $orderStart );
156
+						$orderSearch->setSlice($orderStart);
157 157
 					}
158
-					while( $orderCount >= $orderSearch->getSliceSize() );
158
+					while ($orderCount >= $orderSearch->getSliceSize());
159 159
 				}
160
-				catch( \Exception $e )
160
+				catch (\Exception $e)
161 161
 				{
162 162
 					$str = 'Error while capturing payments for service with ID "%1$s": %2$s';
163
-					$context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) );
163
+					$context->getLogger()->log(sprintf($str, $serviceItem->getId(), $e->getMessage()));
164 164
 				}
165 165
 			}
166 166
 
167
-			$count = count( $serviceItems );
167
+			$count = count($serviceItems);
168 168
 			$start += $count;
169
-			$serviceSearch->setSlice( $start );
169
+			$serviceSearch->setSlice($start);
170 170
 		}
171
-		while( $count >= $serviceSearch->getSliceSize() );
171
+		while ($count >= $serviceSearch->getSliceSize());
172 172
 	}
173 173
 }
Please login to merge, or discard this patch.