| 1 |
<?php |
| 2 |
|
| 3 |
// File generated from our OpenAPI spec |
| 4 |
|
| 5 |
namespace Stripe; |
| 6 |
|
| 7 |
/** |
| 8 |
* A dispute occurs when a customer questions your charge with their card issuer. |
| 9 |
* When this happens, you're given the opportunity to respond to the dispute with |
| 10 |
* evidence that shows that the charge is legitimate. You can find more information |
| 11 |
* about the dispute process in our <a href="/docs/disputes">Disputes and Fraud</a> |
| 12 |
* documentation. |
| 13 |
* |
| 14 |
* Related guide: <a href="https://stripe.com/docs/disputes">Disputes and |
| 15 |
* Fraud</a>. |
| 16 |
* |
| 17 |
* @property string $id Unique identifier for the object. |
| 18 |
* @property string $object String representing the object's type. Objects of the same type share the same value. |
| 19 |
* @property int $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). |
| 20 |
* @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. |
| 21 |
* @property string|\Stripe\Charge $charge ID of the charge that was disputed. |
| 22 |
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 23 |
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. |
| 24 |
* @property \Stripe\StripeObject $evidence |
| 25 |
* @property \Stripe\StripeObject $evidence_details |
| 26 |
* @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. |
| 27 |
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. |
| 28 |
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format. |
| 29 |
* @property null|string $network_reason_code Network-dependent reason code for the dispute. |
| 30 |
* @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. |
| 31 |
* @property string $reason Reason given by cardholder for dispute. Possible values are <code>bank_cannot_process</code>, <code>check_returned</code>, <code>credit_not_processed</code>, <code>customer_initiated</code>, <code>debit_not_authorized</code>, <code>duplicate</code>, <code>fraudulent</code>, <code>general</code>, <code>incorrect_account_details</code>, <code>insufficient_funds</code>, <code>product_not_received</code>, <code>product_unacceptable</code>, <code>subscription_canceled</code>, or <code>unrecognized</code>. Read more about <a href="https://stripe.com/docs/disputes/categories">dispute reasons</a>. |
| 32 |
* @property string $status Current status of dispute. Possible values are <code>warning_needs_response</code>, <code>warning_under_review</code>, <code>warning_closed</code>, <code>needs_response</code>, <code>under_review</code>, <code>charge_refunded</code>, <code>won</code>, or <code>lost</code>. |
| 33 |
*/ |
| 34 |
class Dispute extends ApiResource |
| 35 |
{ |
| 36 |
const OBJECT_NAME = 'dispute'; |
| 37 |
|
| 38 |
use ApiOperations\All; |
| 39 |
use ApiOperations\Retrieve; |
| 40 |
use ApiOperations\Update; |
| 41 |
|
| 42 |
const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; |
| 43 |
const REASON_CHECK_RETURNED = 'check_returned'; |
| 44 |
const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; |
| 45 |
const REASON_CUSTOMER_INITIATED = 'customer_initiated'; |
| 46 |
const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; |
| 47 |
const REASON_DUPLICATE = 'duplicate'; |
| 48 |
const REASON_FRAUDULENT = 'fraudulent'; |
| 49 |
const REASON_GENERAL = 'general'; |
| 50 |
const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; |
| 51 |
const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; |
| 52 |
const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; |
| 53 |
const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; |
| 54 |
const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; |
| 55 |
const REASON_UNRECOGNIZED = 'unrecognized'; |
| 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 null|array|string $opts |
| 68 |
* |
| 69 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 70 |
* |
| 71 |
* @return \Stripe\Dispute the closed dispute |
| 72 |
*/ |
| 73 |
// TODO: add $params to standardize signature |
| 74 |
public function close($opts = null) |
| 75 |
{ |
| 76 |
$url = $this->instanceUrl() . '/close'; |
| 77 |
list($response, $opts) = $this->_request('post', $url, null, $opts); |
| 78 |
$this->refreshFrom($response, $opts); |
| 79 |
|
| 80 |
return $this; |
| 81 |
} |
| 82 |
} |
| 83 |
|