Completed
Push — master ( 08c142...8763db )
by ARCANEDEV
9s
created

Source::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php namespace Arcanedev\Stripe\Resources;
2
3
use Arcanedev\Stripe\Contracts\Resources\Source as SourceContract;
4
use Arcanedev\Stripe\StripeResource;
5
6
/**
7
 * Class     Source
8
 *
9
 * @package  Arcanedev\Stripe\Resources
10
 * @author   ARCANEDEV <[email protected]>
11
 *
12
 * @property  string  type
13
 */
14
class Source extends StripeResource implements SourceContract
15
{
16
    /* ------------------------------------------------------------------------------------------------
17
     |  Main Functions
18
     | ------------------------------------------------------------------------------------------------
19
     */
20
    /**
21
     * List all Sources.
22
     *
23
     * @param  array|null         $params
24
     * @param  array|string|null  $options
25
     *
26
     * @return \Arcanedev\Stripe\Collection|array
27
     */
28
    public static function all($params = [], $options = null)
29
    {
30
        return self::scopedAll($params, $options);
31
    }
32
33
    /**
34
     * Retrieve a Source.
35
     *
36
     * @param  string             $id
37
     * @param  array|string|null  $options
38
     *
39
     * @return self
40
     */
41 4
    public static function retrieve($id, $options = null)
42
    {
43 4
        return self::scopedRetrieve($id, $options);
44
    }
45
46
    /**
47
     * Create a Source.
48
     *
49
     * @param  array|null         $params
50
     * @param  array|string|null  $options
51
     *
52
     * @return self
53
     */
54 2
    public static function create($params = null, $options = null)
55
    {
56 2
        return self::scopedCreate($params, $options);
57
    }
58
59
    /**
60
     * Verify the bank account.
61
     *
62
     * @param  array|null         $params
63
     * @param  array|string|null  $options
64
     *
65
     * @return self
66
     */
67 2
    public function verify($params = null, $options = null)
68
    {
69 2
        list($response, $opts) = $this->request('post', $this->instanceUrl() . '/verify', $params, $options);
70 2
        $this->refreshFrom($response, $opts);
71
72 2
        return $this;
73
    }
74
75
    /**
76
     * Update a source.
77
     *
78
     * @param  string             $id
79
     * @param  array|null         $params
80
     * @param  array|string|null  $options
81
     *
82
     * @return self
83
     */
84
    public static function update($id, $params = null, $options = null)
85
    {
86
        return self::scopedUpdate($id, $params, $options);
87
    }
88
89
    /**
90
     * Save a source.
91
     *
92
     * @param array|string|null $options
93
     *
94
     * @return self
95
     */
96
    public function save($options = null)
97
    {
98
        return $this->scopedSave($options);
99
    }
100
}
101