PayU integration by Krzysztof Gzocha
  • Namespace
  • Class

Namespaces

  • Team3
    • PayU
      • Annotation
      • Communication
        • CurlRequestBuilder
        • HttpStatusParser
        • Notification
        • Process
          • NotificationProcess
          • ResponseDeserializer
        • Request
          • Model
        • Response
          • Model
        • Sender
      • Configuration
        • Credentials
      • Order
        • Autocomplete
          • Strategy
        • Model
          • Buyer
          • Money
          • Products
          • ShippingMethods
          • Traits
        • Transformer
          • UserOrder
            • Strategy
              • Product
              • ShippingMethod
      • PropertyExtractor
        • Reader
      • Serializer
      • SignatureCalculator
        • Encoder
          • Algorithms
          • Strategy
        • ParametersSorter
        • Validator
      • ValidatorBuilder

Classes

  • Team3\PayU\ValidatorBuilder\ValidatorBuilder

Interfaces

  • Team3\PayU\ValidatorBuilder\ValidatorBuilderInterface
 1 <?php
 2 /**
 3  * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl>
 4  */
 5 namespace Team3\PayU\Communication\Process\NotificationProcess;
 6 
 7 use Psr\Log\LoggerInterface;
 8 use Team3\PayU\Serializer\SerializerFactory;
 9 use Team3\PayU\Serializer\SerializerInterface;
10 use Team3\PayU\SignatureCalculator\Encoder\Algorithms\AlgorithmsProvider;
11 use Team3\PayU\SignatureCalculator\Encoder\EncoderFactory;
12 use Team3\PayU\SignatureCalculator\SignatureCalculator;
13 use Team3\PayU\SignatureCalculator\Validator\AlgorithmExtractor;
14 use Team3\PayU\SignatureCalculator\Validator\SignatureValidator;
15 
16 /**
17  * This factory will build {@link NotificationProcess}
18  *
19  * Class NotificationProcessFactory
20  * @package Team3\PayU\Communication\Process\NotificationProcess
21  */
22 class NotificationProcessFactory implements NotificationProcessFactoryInterface
23 {
24     /**
25      * @param LoggerInterface $logger
26      *
27      * @return NotificationProcess
28      */
29     public function build(LoggerInterface $logger)
30     {
31         return new NotificationProcess(
32             $this->getSerializer($logger),
33             $this->getSignatureValidator($logger),
34             new AlgorithmsProvider()
35         );
36     }
37 
38     /**
39      * @param LoggerInterface $logger
40      *
41      * @return SerializerInterface
42      */
43     private function getSerializer(LoggerInterface $logger)
44     {
45         $serializerFactory = new SerializerFactory();
46 
47         return $serializerFactory->build($logger);
48     }
49 
50     /**
51      * @param LoggerInterface $logger
52      *
53      * @return SignatureValidator
54      */
55     private function getSignatureValidator(LoggerInterface $logger)
56     {
57         $encoderFactory = new EncoderFactory();
58 
59         return new SignatureValidator(
60             new SignatureCalculator($encoderFactory->build($logger)),
61             new AlgorithmExtractor(),
62             new AlgorithmsProvider()
63         );
64     }
65 }
66 
PayU integration by Krzysztof Gzocha API documentation generated by ApiGen