| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * Apache OSL-2 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | namespace SprykerEco\Zed\AmazonPay\Communication\Plugin\Oms\Command; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Generated\Shared\Transfer\AmazonpayCallTransfer; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use Orm\Zed\Sales\Persistence\SpySalesOrder; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use SprykerEco\Shared\AmazonPay\AmazonPayConfig; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  * @method \SprykerEco\Zed\AmazonPay\Business\AmazonPayFacadeInterface getFacade() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | class ReauthorizeExpiredOrderCommandPlugin extends AbstractAmazonpayCommandPlugin | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |      * @param array $salesOrderItems | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |      * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |      * @param \Spryker\Zed\Oms\Business\Util\ReadOnlyArrayObject $data | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |     public function run(array $salesOrderItems, SpySalesOrder $orderEntity, ReadOnlyArrayObject $data) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |         $amazonpayCallTransfers = $this->groupSalesOrderItemsByAuthId($salesOrderItems); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |         $customerEmail = $orderEntity->getEmail() ?? $orderEntity->getCustomer()->getEmail(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |         foreach ($amazonpayCallTransfers as $amazonpayCallTransfer) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |             $this->updateCallTransfer($amazonpayCallTransfer, $orderEntity, $customerEmail); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |             $this->getFacade()->reauthorizeExpiredOrder($amazonpayCallTransfer); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         return []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |      * @param \Generated\Shared\Transfer\AmazonpayCallTransfer $amazonpayCallTransfer | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |      * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |      * @param string $customerEmail | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |      * @return void | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 46 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |     protected function updateCallTransfer(AmazonpayCallTransfer $amazonpayCallTransfer, SpySalesOrder $orderEntity, $customerEmail) | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  |         $amazonpayCallTransfer->setShippingAddress($this->buildAddressTransfer($orderEntity->getShippingAddress())) | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |             ->setBillingAddress($this->buildAddressTransfer($orderEntity->getBillingAddress())); | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  |         $amazonpayCallTransfer->setEmail($customerEmail); | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |         $amazonpayCallTransfer->setRequestedAmount( | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |             $this->getRequestedAmountByOrderAndItems($orderEntity, $amazonpayCallTransfer->getItems()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |      * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |     protected function getAffectingRequestedAmountItemsStateFlag() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |         return AmazonPayConfig::OMS_FLAG_NOT_AUTH; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 64 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 65 |  |  |  | 
            
                        
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths