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\Configuration;
  6 
  7 use Team3\PayU\Configuration\Credentials\CredentialsInterface;
  8 
  9 /**
 10  * PayU API basic configuration
 11  * @package Team3\PayU\Configuration
 12  */
 13 class Configuration implements ConfigurationInterface
 14 {
 15     /**
 16      * @var string
 17      */
 18     protected $protocol;
 19 
 20     /**
 21      * @var string
 22      */
 23     protected $domain;
 24 
 25     /**
 26      * @var string
 27      */
 28     protected $path;
 29 
 30     /**
 31      * @var string
 32      */
 33     protected $version;
 34 
 35     /**
 36      * @var CredentialsInterface
 37      */
 38     protected $credentials;
 39 
 40     /**
 41      * @param CredentialsInterface $credentials
 42      * @param string               $protocol
 43      * @param string               $domain
 44      * @param string               $path
 45      * @param string               $version
 46      */
 47     public function __construct(
 48         CredentialsInterface $credentials,
 49         $protocol = 'https',
 50         $domain = 'secure.payu.com',
 51         $path = 'api',
 52         $version = 'v2_1'
 53     ) {
 54         $this->credentials = $credentials;
 55         $this->protocol = $protocol;
 56         $this->domain = $domain;
 57         $this->path = $path;
 58         $this->version = $version;
 59     }
 60 
 61     /**
 62      * @return string
 63      */
 64     public function getAPIUrl()
 65     {
 66         return sprintf(
 67             '%s://%s/%s/%s',
 68             $this->getProtocol(),
 69             $this->getDomain(),
 70             $this->getPath(),
 71             $this->getVersion()
 72         );
 73     }
 74 
 75     /**
 76      * @return string
 77      */
 78     public function getDomain()
 79     {
 80         return $this->domain;
 81     }
 82 
 83     /**
 84      * @return string
 85      */
 86     public function getPath()
 87     {
 88         return $this->path;
 89     }
 90 
 91     /**
 92      * @return string
 93      */
 94     public function getProtocol()
 95     {
 96         return $this->protocol;
 97     }
 98 
 99     /**
100      * @return string
101      */
102     public function getVersion()
103     {
104         return $this->version;
105     }
106 
107     /**
108      * @return CredentialsInterface
109      */
110     public function getCredentials()
111     {
112         return $this->credentials;
113     }
114 }
115 
PayU integration by Krzysztof Gzocha API documentation generated by ApiGen