| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * This file is part of the Marlon Ogone package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * (c) Marlon BVBA <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | namespace Ogone\Ecommerce; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use Ogone\AbstractPaymentRequest; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use Ogone\ShaComposer\ShaComposer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | class EcommercePaymentRequest extends AbstractPaymentRequest | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |     const TEST = "https://secure.ogone.com/ncol/test/orderstandard_utf8.asp"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |     const PRODUCTION = "https://secure.ogone.com/ncol/prod/orderstandard_utf8.asp"; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 22 | 56 |  |     public function __construct(ShaComposer $shaComposer) | 
            
                                                                        
                            
            
                                    
            
            
                | 23 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 24 | 56 |  |         $this->shaComposer = $shaComposer; | 
            
                                                                        
                            
            
                                    
            
            
                | 25 | 56 |  |         $this->ogoneUri = self::TEST; | 
            
                                                                        
                            
            
                                    
            
            
                | 26 | 56 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 | 7 |  |     public function getRequiredFields() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |         return array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 | 7 |  |             'pspid', 'currency', 'amount', 'orderid' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 | 7 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 | 6 |  |     public function getValidOgoneUris() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 | 6 |  |         return array(self::TEST, self::PRODUCTION); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     public function setAlias(Alias $alias) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |         $this->parameters['aliasOperation'] = $alias->getAliasOperation(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |         $this->parameters['aliasusage'] = $alias->getAliasUsage(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |         $this->parameters['alias'] = $alias->getAlias(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 | 4 |  |     protected function getValidOperations() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |         return array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 | 4 |  |             self::OPERATION_REQUEST_AUTHORIZATION, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 | 4 |  |             self::OPERATION_REQUEST_DIRECT_SALE, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 | 4 |  |             self::OPERATION_REQUEST_PRE_AUTHORIZATION, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 | 4 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 55 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 56 |  |  |  |