OrderReturn::all()   A
last analyzed

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
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php namespace Arcanedev\Stripe\Resources;
2
3
use Arcanedev\Stripe\Contracts\Resources\OrderReturn as OrderReturnContract;
4
use Arcanedev\Stripe\StripeResource;
5
6
/**
7
 * Class     OrderReturn
8
 *
9
 * @package  Arcanedev\Stripe\Resources
10
 * @author   ARCANEDEV <[email protected]>
11
 * @link     https://stripe.com/docs/api/php#order_return_object
12
 *
13
 * @property  string                                  id
14
 * @property  string                                  object    // 'order_return'
15
 * @property  int                                     amount
16
 * @property  int                                     created   // timestamp
17
 * @property  string                                  currency
18
 * @property  array                                   items
19
 * @property  bool                                    livemode
20
 * @property  string                                  order
21
 * @property  string                                  refund
22
 */
23
class OrderReturn extends StripeResource implements OrderReturnContract
24
{
25
    /* -----------------------------------------------------------------
26
     |  Main Methods
27
     | -----------------------------------------------------------------
28
     */
29
30
    /**
31
     * This is a special case because the order returns endpoint has an underscore in it.
32
     * The parent `className` function strips underscores.
33
     *
34
     * @param  string  $class
35
     *
36
     * @return string
37
     */
38
    public static function className($class = '')
39
    {
40
        return 'order_return';
41
    }
42
43
    /**
44
     * Retrieve an order return.
45
     * @link   https://stripe.com/docs/api/php#retrieve_order_return
46
     *
47
     * @param  string             $id
48
     * @param  array|string|null  $options
49
     *
50
     * @return self
51
     */
52
    public static function retrieve($id, $options = null)
53
    {
54
        return self::scopedRetrieve($id, $options);
55
    }
56
57
    /**
58
     * List all order returns.
59
     * @link   https://stripe.com/docs/api/php#list_order_returns
60
     *
61
     * @param  array|null         $params
62
     * @param  array|string|null  $options
63
     *
64
     * @return \Arcanedev\Stripe\Collection|array
65
     */
66
    public static function all($params = [], $options = null)
67
    {
68
        return self::scopedAll($params, $options);
69
    }
70
}
71