|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Stripe; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class Dispute |
|
7
|
|
|
* |
|
8
|
|
|
* @property string $id |
|
9
|
|
|
* @property string $object |
|
10
|
|
|
* @property int $amount |
|
11
|
|
|
* @property BalanceTransaction[] $balance_transactions |
|
12
|
|
|
* @property string $charge |
|
13
|
|
|
* @property int $created |
|
14
|
|
|
* @property string $currency |
|
15
|
|
|
* @property mixed $evidence |
|
16
|
|
|
* @property mixed $evidence_details |
|
17
|
|
|
* @property bool $is_charge_refundable |
|
18
|
|
|
* @property bool $livemode |
|
19
|
|
|
* @property StripeObject $metadata |
|
20
|
|
|
* @property string $reason |
|
21
|
|
|
* @property string $status |
|
22
|
|
|
* |
|
23
|
|
|
* @package Stripe |
|
24
|
|
|
*/ |
|
25
|
|
View Code Duplication |
class Dispute extends ApiResource |
|
|
|
|
|
|
26
|
|
|
{ |
|
27
|
|
|
|
|
28
|
|
|
const OBJECT_NAME = "dispute"; |
|
29
|
|
|
|
|
30
|
|
|
use ApiOperations\All; |
|
31
|
|
|
use ApiOperations\Retrieve; |
|
32
|
|
|
use ApiOperations\Update; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Possible string representations of dispute reasons. |
|
36
|
|
|
* @link https://stripe.com/docs/api#dispute_object |
|
37
|
|
|
*/ |
|
38
|
|
|
const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; |
|
39
|
|
|
const REASON_CHECK_RETURNED = 'check_returned'; |
|
40
|
|
|
const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; |
|
41
|
|
|
const REASON_CUSTOMER_INITIATED = 'customer_initiated'; |
|
42
|
|
|
const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; |
|
43
|
|
|
const REASON_DUPLICATE = 'duplicate'; |
|
44
|
|
|
const REASON_FRAUDULENT = 'fraudulent'; |
|
45
|
|
|
const REASON_GENERAL = 'general'; |
|
46
|
|
|
const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; |
|
47
|
|
|
const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; |
|
48
|
|
|
const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; |
|
49
|
|
|
const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; |
|
50
|
|
|
const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; |
|
51
|
|
|
const REASON_UNRECOGNIZED = 'unrecognized'; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Possible string representations of dispute statuses. |
|
55
|
|
|
* @link https://stripe.com/docs/api#dispute_object |
|
56
|
|
|
*/ |
|
57
|
|
|
const STATUS_CHARGE_REFUNDED = 'charge_refunded'; |
|
58
|
|
|
const STATUS_LOST = 'lost'; |
|
59
|
|
|
const STATUS_NEEDS_RESPONSE = 'needs_response'; |
|
60
|
|
|
const STATUS_UNDER_REVIEW = 'under_review'; |
|
61
|
|
|
const STATUS_WARNING_CLOSED = 'warning_closed'; |
|
62
|
|
|
const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; |
|
63
|
|
|
const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; |
|
64
|
|
|
const STATUS_WON = 'won'; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @param array|string|null $options |
|
68
|
|
|
* |
|
69
|
|
|
* @return Dispute The closed dispute. |
|
70
|
|
|
*/ |
|
71
|
|
|
public function close($options = null) |
|
72
|
|
|
{ |
|
73
|
|
|
$url = $this->instanceUrl() . '/close'; |
|
74
|
|
|
list($response, $opts) = $this->_request('post', $url, null, $options); |
|
|
|
|
|
|
75
|
|
|
$this->refreshFrom($response, $opts); |
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.