Refund   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 76
rs 10
c 0
b 0
f 0
ccs 10
cts 10
cp 1
wmc 5
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 4 1
A all() 0 4 1
A retrieve() 0 4 1
A create() 0 4 1
A update() 0 4 1
1
<?php namespace Arcanedev\Stripe\Resources;
2
3
use Arcanedev\Stripe\Contracts\Resources\Refund as RefundContract;
4
use Arcanedev\Stripe\StripeResource;
5
6
/**
7
 * Class     Refund
8
 *
9
 * @package  Arcanedev\Stripe\Resources
10
 * @author   ARCANEDEV <[email protected]>
11
 * @link     https://stripe.com/docs/api/php#refund_object
12
 *
13
 * @property  string                            id
14
 * @property  string                            object               // 'refund'
15
 * @property  int                               amount
16
 * @property  string                            balance_transaction
17
 * @property  string                            charge
18
 * @property  int                               created              // timestamp
19
 * @property  string                            currency
20
 * @property  string                            description
21
 * @property  \Arcanedev\Stripe\AttachedObject  metadata
22
 * @property  string                            reason
23
 * @property  string                            receipt_number
24
 */
25
class Refund extends StripeResource implements RefundContract
26
{
27
    /* ------------------------------------------------------------------------------------------------
28
     |  Main Functions
29
     | ------------------------------------------------------------------------------------------------
30
     */
31
    /**
32
     * List all refunds.
33
     * @link   https://stripe.com/docs/api/php#list_refunds
34
     *
35
     * @param  array|null         $params
36
     * @param  array|string|null  $options
37
     *
38
     * @return \Arcanedev\Stripe\Collection|array
39
     */
40 4
    public static function all($params = [], $options = null)
41
    {
42 4
        return self::scopedAll($params, $options);
43
    }
44
45
    /**
46
     * Retrieve a Refund by ID.
47
     * @link   https://stripe.com/docs/api/php#retrieve_refund
48
     *
49
     * @param  string             $id
50
     * @param  array|string|null  $options
51
     *
52
     * @return self
53
     */
54 4
    public static function retrieve($id, $options = null)
55
    {
56 4
        return self::scopedRetrieve($id, $options);
57
    }
58
59
    /**
60
     * Create a Refund.
61
     * @link   https://stripe.com/docs/api/php#create_refund
62
     *
63
     * @param  array|null         $params
64
     * @param  array|string|null  $options
65
     *
66
     * @return self
67
     */
68 8
    public static function create($params = [], $options = null)
69
    {
70 8
        return self::scopedCreate($params, $options);
71
    }
72
73
    /**
74
     * Update a Refund.
75
     * @link   https://stripe.com/docs/api/php#update_refund
76
     *
77
     * @param  string             $id
78
     * @param  array|null         $params
79
     * @param  array|string|null  $options
80
     *
81
     * @return self
82
     */
83 2
    public static function update($id, $params = [], $options = null)
84
    {
85 2
        return self::scopedUpdate($id, $params, $options);
86
    }
87
88
    /**
89
     * Update/Save a Refund.
90
     * @link   https://stripe.com/docs/api/php#update_refund
91
     *
92
     * @param  array|string|null  $options
93
     *
94
     * @return self
95
     */
96 4
    public function save($options = null)
97
    {
98 4
        return self::scopedSave($options);
99
    }
100
}
101