Test Failed
Push — master ( 3dd85e...34f16b )
by Devin
04:34 queued 10s
created

Review   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A approve() 0 7 1
1
<?php
2
3
namespace Stripe;
4
5
/**
6
 * Class Review
7
 *
8
 * @property string $id
9
 * @property string $object
10
 * @property string $billing_zip
11
 * @property string $charge
12
 * @property string $closed_reason
13
 * @property int $created
14
 * @property string $ip_address
15
 * @property mixed $ip_address_location
16
 * @property bool $livemode
17
 * @property bool $open
18
 * @property string $opened_reason
19
 * @property string $payment_intent
20
 * @property string $reason
21
 * @property mixed $session
22
 *
23
 * @package Stripe
24
 */
25
class Review extends ApiResource
26
{
27
    const OBJECT_NAME = "review";
28
29
    use ApiOperations\All;
30
    use ApiOperations\Retrieve;
31
32
    /**
33
     * Possible string representations of the current, the opening or the closure reason of the review.
34
     * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to
35
     * determine where these are apply.
36
     * @link https://stripe.com/docs/api/radar/reviews/object
37
     */
38
    const REASON_APPROVED          = 'approved';
39
    const REASON_DISPUTED          = 'disputed';
40
    const REASON_MANUAL            = 'manual';
41
    const REASON_REFUNDED          = 'refunded';
42
    const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud';
43
    const REASON_RULE              = 'rule';
44
45
    /**
46
     * @param array|string|null $options
47
     *
48
     * @return Review The approved review.
49
     */
50
    public function approve($params = null, $options = null)
51
    {
52
        $url = $this->instanceUrl() . '/approve';
53
        list($response, $opts) = $this->_request('post', $url, $params, $options);
54
        $this->refreshFrom($response, $opts);
55
        return $this;
56
    }
57
}
58