1 <?php
2 3 4
5 namespace Team3\PayU\Configuration\Credentials;
6
7 use Team3\PayU\SignatureCalculator\Encoder\Algorithms\AlgorithmInterface;
8 use Team3\PayU\SignatureCalculator\Encoder\Algorithms\Md5Algorithm;
9
10 class Credentials implements CredentialsInterface
11 {
12 13 14
15 protected $merchantPosId;
16
17 18 19
20 protected $privateKey;
21
22 23 24
25 protected $signatureAlgorithm;
26
27 28 29 30
31 protected $encryptionProtocols;
32
33 34 35 36 37 38
39 public function __construct(
40 $merchantPosId,
41 $privateKey,
42 AlgorithmInterface $signatureAlgorithm = null,
43 $encryptionProtocols = 'TLSv1'
44 ) {
45 $this->merchantPosId = $merchantPosId;
46 $this->privateKey = $privateKey;
47
48 if (null === $signatureAlgorithm) {
49 $signatureAlgorithm = new Md5Algorithm();
50 }
51
52 $this->signatureAlgorithm = $signatureAlgorithm;
53 $this->encryptionProtocols = $encryptionProtocols;
54 }
55
56 57 58
59 public function getMerchantPosId()
60 {
61 return $this->merchantPosId;
62 }
63
64 65 66
67 public function getPrivateKey()
68 {
69 return $this->privateKey;
70 }
71
72 73 74
75 public function getSignatureAlgorithm()
76 {
77 return $this->signatureAlgorithm;
78 }
79
80 81 82
83 public function getEncryptionProtocols()
84 {
85 return $this->encryptionProtocols;
86 }
87 }
88