| 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\Business\Order; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Generated\Shared\Transfer\AmazonpayPaymentTransfer; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use Generated\Shared\Transfer\CheckoutErrorTransfer; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Generated\Shared\Transfer\CheckoutResponseTransfer; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use Generated\Shared\Transfer\QuoteTransfer; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction\TransactionCollectionInterface; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 16 |  |  | class Placement implements PlacementInterface | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  | { | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  |      * @var \SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction\TransactionCollectionInterface | 
            
                                                                        
                            
            
                                    
            
            
                | 20 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 21 |  |  |     protected $confirmationTransactionCollection; | 
            
                                                                        
                            
            
                                    
            
            
                | 22 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 23 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 24 |  |  |      * @param \SprykerEco\Zed\AmazonPay\Business\Payment\Handler\Transaction\TransactionCollectionInterface $confirmationTransactionCollection | 
            
                                                                        
                            
            
                                    
            
            
                | 25 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 26 |  |  |     public function __construct( | 
            
                                                                        
                            
            
                                    
            
            
                | 27 |  |  |         TransactionCollectionInterface $confirmationTransactionCollection | 
            
                                                                        
                            
            
                                    
            
            
                | 28 |  |  |     ) { | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  |         $this->confirmationTransactionCollection = $confirmationTransactionCollection; | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  |      * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |      * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  |      * | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  |      * @return bool | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  |     public function placeOrder(QuoteTransfer $quoteTransfer, CheckoutResponseTransfer $checkoutResponseTransfer) | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  |         if ($quoteTransfer->getAmazonpayPayment() === null) { | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  |             return true; | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  |         $this->confirmationTransactionCollection->execute($quoteTransfer); | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 46 |  |  |         if ($quoteTransfer->getAmazonpayPayment()->getResponseHeader()->getIsSuccess()) { | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |             return true; | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |         $checkoutResponseTransfer->setIsSuccess(false); | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  |         $checkoutResponseTransfer->addError( | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |             $this->createCheckoutErrorFromAmazonPaymentResponse( | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |                 $quoteTransfer->getAmazonpayPayment() | 
            
                                                                        
                            
            
                                    
            
            
                | 54 |  |  |             ) | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |         ); | 
            
                                                                        
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  |         return false; | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |      * @param \Generated\Shared\Transfer\AmazonpayPaymentTransfer $amazonpayPaymentTransfer | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |      * | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |      * @return \Generated\Shared\Transfer\CheckoutErrorTransfer | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |     protected function createCheckoutErrorFromAmazonPaymentResponse(AmazonpayPaymentTransfer $amazonpayPaymentTransfer) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |         $checkoutErrorTransfer = new CheckoutErrorTransfer(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         $checkoutErrorTransfer->setMessage($amazonpayPaymentTransfer->getResponseHeader()->getErrorMessage()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 70 |  |  |         return $checkoutErrorTransfer; | 
            
                                                                        
                                                                
            
                                    
            
            
                | 71 |  |  |     } | 
            
                                                                        
                                                                
            
                                    
            
            
                | 72 |  |  | } | 
            
                                                                        
                                                                
            
                                    
            
            
                | 73 |  |  |  | 
            
                        
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