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;
 6 
 7 use Psr\Log\LoggerInterface;
 8 use Symfony\Component\Validator\Validator\ValidatorInterface;
 9 use Team3\PayU\Communication\ClientAdapterFactory;
10 use Team3\PayU\Communication\ClientInterface;
11 use Team3\PayU\Communication\HttpStatusParser\HttpStatusParser;
12 use Team3\PayU\Communication\Process\ResponseDeserializer\ResponseDeserializer;
13 use Team3\PayU\Communication\Process\ResponseDeserializer\ResponseDeserializerFactory;
14 use Team3\PayU\Serializer\SerializerFactory;
15 use Team3\PayU\Serializer\SerializerInterface;
16 use Team3\PayU\ValidatorBuilder\ValidatorBuilder;
17 
18 /**
19  * {@inheritdoc}
20  */
21 class RequestProcessFactory implements RequestProcessFactoryInterface
22 {
23     /**
24      * @param LoggerInterface $logger
25      *
26      * @return RequestProcess
27      */
28     public function build(LoggerInterface $logger)
29     {
30         $requestProcess = new RequestProcess(
31             $this->getDeserializer($logger),
32             $this->getClient($logger),
33             $this->getValidator(),
34             new HttpStatusParser()
35         );
36 
37         return $requestProcess;
38     }
39 
40     /**
41      * @param LoggerInterface $logger
42      *
43      * @return ResponseDeserializer
44      */
45     private function getDeserializer(LoggerInterface $logger)
46     {
47         $deserializerFactory = new ResponseDeserializerFactory();
48 
49         return $deserializerFactory->build($logger);
50     }
51 
52     /**
53      * @param LoggerInterface $logger
54      *
55      * @return SerializerInterface
56      */
57     private function getSerializer(LoggerInterface $logger)
58     {
59         $serializerFactory = new SerializerFactory();
60 
61         return $serializerFactory->build($logger);
62     }
63 
64     /**
65      * @param LoggerInterface $logger
66      *
67      * @return ClientInterface
68      */
69     private function getClient(LoggerInterface $logger)
70     {
71         $clientAdapterFactory = new ClientAdapterFactory();
72 
73         return $clientAdapterFactory->build(
74             $this->getSerializer($logger),
75             $logger
76         );
77     }
78 
79     /**
80      * @return ValidatorInterface
81      */
82     private function getValidator()
83     {
84         $validatorBuilder = new ValidatorBuilder();
85 
86         return $validatorBuilder->getValidator();
87     }
88 }
89 
PayU integration by Krzysztof Gzocha API documentation generated by ApiGen