Completed
Pull Request — master (#6)
by Cesar
01:39
created

AbstractBraintreeService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 5
1
<?php
2
3
namespace App\Service\Braintree;
4
5
use Braintree\Gateway;
6
use Psr\Log\LoggerInterface;
7
8
/**
9
 * Class AbstractBraintreeService
10
 * @package App\Service\Braintree
11
 */
12
abstract class AbstractBraintreeService
13
{
14
    /**
15
     * @var LoggerInterface
16
     */
17
    protected $logger;
18
19
    /**
20
     * @var Gateway
21
     */
22
    protected $gateway;
23
24
    /**
25
     * AbstractBraintreeService constructor.
26
     * @param string $environment
27
     * @param string $merchantId
28
     * @param string $publicKey
29
     * @param string $privateKey
30
     * @param LoggerInterface $logger
31
     */
32
    public function __construct(
33
        string $environment,
34
        string $merchantId,
35
        string $publicKey,
36
        string $privateKey,
37
        LoggerInterface $logger
38
    ) {
39
        $this->logger = $logger;
40
        $this->gateway = new Gateway([
41
            'environment' => $environment,
42
            'merchantId' => $merchantId,
43
            'publicKey' => $publicKey,
44
            'privateKey' => $privateKey
45
        ]);
46
    }
47
}
48