Completed
Push — master ( b6f7ca...4aea47 )
by Olivier
03:30
created

PaymentIntent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 6 1
A all() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Shapin\Stripe\Api;
11
12
use Shapin\Stripe\Configuration;
13
use Shapin\Stripe\Exception;
14
use Shapin\Stripe\Model\PaymentIntent\Item;
15
use Shapin\Stripe\Model\PaymentIntent\PaymentIntent as PaymentIntentModel;
16
use Shapin\Stripe\Model\PaymentIntent\PaymentIntentCollection;
17
use Symfony\Component\Config\Definition\Processor;
18
19
final class PaymentIntent extends HttpApi
20
{
21
    /**
22
     * @throws Exception
23
     */
24 1
    public function get(string $id)
25
    {
26 1
        $response = $this->httpGet("/v1/payment_intents/$id");
27
28 1
        return $this->hydrator->hydrate($response, PaymentIntentModel::class);
29
    }
30
31
    /**
32
     * @throws Exception
33
     */
34 1
    public function all(array $params = [])
35
    {
36 1
        $response = $this->httpGet('/v1/payment_intents', $params);
37
38 1
        return $this->hydrator->hydrate($response, PaymentIntentCollection::class);
39
    }
40
}
41