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

PaymentIntent::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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