| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * MIT License | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | namespace SprykerEco\Yves\Computop\CheckoutPage\Process\Steps; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Spryker\Shared\Kernel\Transfer\AbstractTransfer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use SprykerEco\Shared\Computop\ComputopConfig; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use SprykerShop\Yves\CheckoutPage\Process\Steps\AbstractBaseStep; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | class ComputopPayNowInitStep extends AbstractBaseStep | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |      * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |     public function requireInput(AbstractTransfer $quoteTransfer): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |         if ( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |             !$quoteTransfer->getPayment() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |             || $quoteTransfer->getPayment()->getPaymentSelection() !== ComputopConfig::PAYMENT_METHOD_PAY_NOW | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |         ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |             return false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |         return true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |      * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     public function postCondition(AbstractTransfer $quoteTransfer): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |         return true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |     public function getTemplateVariables(AbstractTransfer $quoteTransfer): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         return [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |             'formAction' => $quoteTransfer->getPayment()->getComputopPayNow()->getUrl(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |             'encryptedData' => $quoteTransfer->getPayment()->getComputopPayNow()->getData(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |             'encryptedDataLength' => $quoteTransfer->getPayment()->getComputopPayNow()->getLen(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |             'merchantId' => $quoteTransfer->getPayment()->getComputopPayNow()->getMerchantId(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |             'brandOptions' => $this->getBrandOptions(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |         ]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |      * @return string[][] | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 61 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |     protected function getBrandOptions(): array | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |         return [ | 
            
                                                                        
                            
            
                                    
            
            
                | 65 |  |  |             'VISA' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 66 |  |  |                 'value' => 'VISA', | 
            
                                                                        
                            
            
                                    
            
            
                | 67 |  |  |                 'label' => 'Visa', | 
            
                                                                        
                            
            
                                    
            
            
                | 68 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 69 |  |  |             'MasterCard' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 70 |  |  |                 'value' => 'MasterCard', | 
            
                                                                        
                            
            
                                    
            
            
                | 71 |  |  |                 'label' => 'Master Card', | 
            
                                                                        
                            
            
                                    
            
            
                | 72 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 73 |  |  |             'AMEX' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 74 |  |  |                 'value' => 'AMEX', | 
            
                                                                        
                            
            
                                    
            
            
                | 75 |  |  |                 'label' => 'American Express', | 
            
                                                                        
                            
            
                                    
            
            
                | 76 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 77 |  |  |             'DINERS' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 78 |  |  |                 'value' => 'DINERS', | 
            
                                                                        
                            
            
                                    
            
            
                | 79 |  |  |                 'label' => 'Diners Club', | 
            
                                                                        
                            
            
                                    
            
            
                | 80 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 81 |  |  |             'JCB' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 82 |  |  |                 'value' => 'JCB', | 
            
                                                                        
                            
            
                                    
            
            
                | 83 |  |  |                 'label' => 'JCB', | 
            
                                                                        
                            
            
                                    
            
            
                | 84 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 85 |  |  |             'CBN' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 86 |  |  |                 'value' => 'CBN', | 
            
                                                                        
                            
            
                                    
            
            
                | 87 |  |  |                 'label' => 'CBN', | 
            
                                                                        
                            
            
                                    
            
            
                | 88 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 89 |  |  |             'SWITCH' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 90 |  |  |                 'value' => 'SWITCH', | 
            
                                                                        
                            
            
                                    
            
            
                | 91 |  |  |                 'label' => 'Switch', | 
            
                                                                        
                            
            
                                    
            
            
                | 92 |  |  |             ], | 
            
                                                                        
                            
            
                                    
            
            
                | 93 |  |  |             'SOLO' => [ | 
            
                                                                        
                            
            
                                    
            
            
                | 94 |  |  |                 'value' => 'SOLO', | 
            
                                                                        
                            
            
                                    
            
            
                | 95 |  |  |                 'label' => 'Solo', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |             ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |         ]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 99 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 100 |  |  |  | 
            
                        
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