Passed
Push — master ( 531052...a5945b )
by Tharanga
06:10
created

StripeConnectionFactory::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date   15-02-2021
5
 */
6
7
namespace TSK\SSO\ThirdParty\Stripe;
8
9
use TSK\SSO\ThirdParty\VendorConnection;
10
use TSK\SSO\ThirdParty\VendorConnectionFactory;
11
12
/**
13
 * @package TSK\SSO\ThirdParty\Spotify
14
 */
15
class StripeConnectionFactory implements VendorConnectionFactory
16
{
17
    /**
18
     * Returns a Stripe Connection instance using given credentials. Visit the following links for credentials.
19
     * @see https://dashboard.stripe.com/apikeys
20
     * @see https://dashboard.stripe.com/settings/applications
21
     *
22
     * @param string $clientId     the client id which can be generated at the Stripe 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
     *
26
     * @return VendorConnection
27
     */
28 1
    public function get($clientId, $clientSecret, $callbackUrl)
29
    {
30 1
        return new StripeConnection(
31 1
            new StripeConfiguration(
32 1
                $clientId,
33 1
                $clientSecret,
34
                $callbackUrl
35 1
            )
36 1
        );
37
    }
38
}
39