Passed
Push — master ( 0a093e...5b59e5 )
by Carl
02:51
created

Card::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
/**
3
 * Created by Carl Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Copyright © 2017 PartFire Ltd. All rights reserved.
6
 *
7
 * User:    Carl Owens
8
 * Date:    17/01/2017
9
 * Time:    16:25
10
 * File:    Card.php
11
 **/
12
13
namespace PartFire\MangoPayBundle\Services;
14
15
use PartFire\MangoPayBundle\Models\CardRegistrationsQueryInterface;
16
17
class Card
18
{
19
    /**
20
     * @var CardRegistrationsQueryInterface
21
     */
22
    private $cardQuery;
23
24
    public function __construct(CardRegistrationsQueryInterface $cardQuery)
25
    {
26
        $this->cardQuery = $cardQuery;
27
    }
28
29
    /**
30
     * @param string $userId
31
     * @param string $currency
32
     * @param string $cardType
33
     * @param string $tag
34
     * @return null|\PartFire\MangoPayBundle\Models\DTOs\Card
35
     * Create a card registration
36
     */
37
    public function create(string $userId, string $currency, string $cardType, string $tag)
38
    {
39
        return $this->cardQuery->create($userId, $currency, $cardType, $tag);
40
    }
41
42
    /**
43
     * @param $cardRegisteredId
44
     * update cardRegister after payment form
45
     * @param $registrationData
46
     */
47
    public function update(string $cardRegisteredId, string $registrationData)
48
    {
49
50
51
        return $this->cardQuery->update($cardRegisteredId, $registrationData);
52
53
54
    }
55
}
56