Completed
Push — master ( 3377ec...b18ded )
by Tharanga
02:10
created

AmazonConnectionFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 9 1
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date 17-02-2019
5
 */
6
7
namespace TSK\SSO\ThirdParty\Amazon;
8
9
use TSK\SSO\Http\CurlRequest;
10
use TSK\SSO\ThirdParty\VendorConnection;
11
use TSK\SSO\ThirdParty\VendorConnectionFactory;
12
13
/**
14
 * @package TSK\SSO\ThirdParty\Amazon
15
 */
16
class AmazonConnectionFactory implements VendorConnectionFactory
17
{
18
    /**
19
     * Returns a Amazon Connection instance using given credentials. Visit the following link for credentials.
20
     * @see https://sellercentral.amazon.com/hz/home
21
     *
22
     * @param string $clientId the client id which can be generated at the third party portal
23
     * @param string $clientSecret this can be found similar to the clientId
24
     * @param string $callbackUrl the url to callback after a third party auth attempt
25
     * @return VendorConnection
26
     */
27 1
    public function get($clientId, $clientSecret, $callbackUrl)
28
    {
29 1
        return new AmazonConnection(
30 1
            new AmazonApiConfiguration(
31 1
                $clientId,
32 1
                $clientSecret,
33
                $callbackUrl
34 1
            ),
35 1
            new CurlRequest()
36 1
        );
37
    }
38
}
39