ApiOperations
2 months ago
Apps
2 months ago
Billing
2 months ago
BillingPortal
2 months ago
Checkout
2 months ago
Climate
2 months ago
Entitlements
2 months ago
EventData
2 months ago
Events
2 months ago
Exception
2 months ago
FinancialConnections
2 months ago
Forwarding
2 months ago
HttpClient
2 months ago
Identity
2 months ago
Issuing
2 months ago
Radar
2 months ago
Reporting
2 months ago
Service
2 months ago
Sigma
2 months ago
Tax
2 months ago
Terminal
2 months ago
TestHelpers
2 months ago
Treasury
2 months ago
Util
2 months ago
V2
2 months ago
Account.php
2 months ago
AccountLink.php
2 months ago
AccountSession.php
2 months ago
ApiRequestor.php
2 months ago
ApiResource.php
2 months ago
ApiResponse.php
2 months ago
ApplePayDomain.php
2 months ago
Application.php
2 months ago
ApplicationFee.php
2 months ago
ApplicationFeeRefund.php
2 months ago
Balance.php
2 months ago
BalanceTransaction.php
2 months ago
BankAccount.php
2 months ago
BaseStripeClient.php
2 months ago
BaseStripeClientInterface.php
2 months ago
Capability.php
2 months ago
Card.php
2 months ago
CashBalance.php
2 months ago
Charge.php
2 months ago
Collection.php
2 months ago
ConfirmationToken.php
2 months ago
ConnectCollectionTransfer.php
2 months ago
CountrySpec.php
2 months ago
Coupon.php
2 months ago
CreditNote.php
2 months ago
CreditNoteLineItem.php
2 months ago
Customer.php
2 months ago
CustomerBalanceTransaction.php
2 months ago
CustomerCashBalanceTransaction.php
2 months ago
CustomerSession.php
2 months ago
Discount.php
2 months ago
Dispute.php
2 months ago
EphemeralKey.php
2 months ago
ErrorObject.php
2 months ago
Event.php
2 months ago
ExchangeRate.php
2 months ago
File.php
2 months ago
FileLink.php
2 months ago
FundingInstructions.php
2 months ago
Invoice.php
2 months ago
InvoiceItem.php
2 months ago
InvoiceLineItem.php
2 months ago
InvoiceRenderingTemplate.php
2 months ago
LineItem.php
2 months ago
LoginLink.php
2 months ago
Mandate.php
2 months ago
OAuth.php
2 months ago
OAuthErrorObject.php
2 months ago
PaymentIntent.php
2 months ago
PaymentLink.php
2 months ago
PaymentMethod.php
2 months ago
PaymentMethodConfiguration.php
2 months ago
PaymentMethodDomain.php
2 months ago
Payout.php
2 months ago
Person.php
2 months ago
Plan.php
2 months ago
Price.php
2 months ago
Product.php
2 months ago
ProductFeature.php
2 months ago
PromotionCode.php
2 months ago
Quote.php
2 months ago
Reason.php
2 months ago
RecipientTransfer.php
2 months ago
Refund.php
2 months ago
RelatedObject.php
2 months ago
RequestTelemetry.php
2 months ago
ReserveTransaction.php
2 months ago
Review.php
2 months ago
SearchResult.php
2 months ago
SetupAttempt.php
2 months ago
SetupIntent.php
2 months ago
ShippingRate.php
2 months ago
SingletonApiResource.php
2 months ago
Source.php
2 months ago
SourceMandateNotification.php
2 months ago
SourceTransaction.php
2 months ago
Stripe.php
2 months ago
StripeClient.php
2 months ago
StripeClientInterface.php
2 months ago
StripeObject.php
2 months ago
StripeStreamingClientInterface.php
2 months ago
Subscription.php
2 months ago
SubscriptionItem.php
2 months ago
SubscriptionSchedule.php
2 months ago
TaxCode.php
2 months ago
TaxDeductedAtSource.php
2 months ago
TaxId.php
2 months ago
TaxRate.php
2 months ago
ThinEvent.php
2 months ago
Token.php
2 months ago
Topup.php
2 months ago
Transfer.php
2 months ago
TransferReversal.php
2 months ago
UsageRecord.php
2 months ago
UsageRecordSummary.php
2 months ago
Webhook.php
2 months ago
WebhookEndpoint.php
2 months ago
WebhookSignature.php
2 months ago
Dispute.php
133 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace ProfilePressVendor\Stripe; |
| 5 | |
| 6 | /** |
| 7 | * A dispute occurs when a customer questions your charge with their card issuer. |
| 8 | * When this happens, you have the opportunity to respond to the dispute with |
| 9 | * evidence that shows that the charge is legitimate. |
| 10 | * |
| 11 | * Related guide: <a href="https://stripe.com/docs/disputes">Disputes and fraud</a> |
| 12 | * |
| 13 | * @property string $id Unique identifier for the object. |
| 14 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 15 | * @property int $amount Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). |
| 16 | * @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. |
| 17 | * @property string|\Stripe\Charge $charge ID of the charge that's disputed. |
| 18 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 19 | * @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>. |
| 20 | * @property string[] $enhanced_eligibility_types List of eligibility types that are included in <code>enhanced_evidence</code>. |
| 21 | * @property \Stripe\StripeObject $evidence |
| 22 | * @property \Stripe\StripeObject $evidence_details |
| 23 | * @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. |
| 24 | * @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. |
| 25 | * @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. |
| 26 | * @property null|string $network_reason_code Network-dependent reason code for the dispute. |
| 27 | * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's disputed. |
| 28 | * @property null|\Stripe\StripeObject $payment_method_details |
| 29 | * @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>. Learn more about <a href="https://stripe.com/docs/disputes/categories">dispute reasons</a>. |
| 30 | * @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>won</code>, or <code>lost</code>. |
| 31 | */ |
| 32 | class Dispute extends ApiResource |
| 33 | { |
| 34 | const OBJECT_NAME = 'dispute'; |
| 35 | use ApiOperations\Update; |
| 36 | const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; |
| 37 | const REASON_CHECK_RETURNED = 'check_returned'; |
| 38 | const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; |
| 39 | const REASON_CUSTOMER_INITIATED = 'customer_initiated'; |
| 40 | const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; |
| 41 | const REASON_DUPLICATE = 'duplicate'; |
| 42 | const REASON_FRAUDULENT = 'fraudulent'; |
| 43 | const REASON_GENERAL = 'general'; |
| 44 | const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; |
| 45 | const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; |
| 46 | const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; |
| 47 | const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; |
| 48 | const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; |
| 49 | const REASON_UNRECOGNIZED = 'unrecognized'; |
| 50 | const STATUS_LOST = 'lost'; |
| 51 | const STATUS_NEEDS_RESPONSE = 'needs_response'; |
| 52 | const STATUS_UNDER_REVIEW = 'under_review'; |
| 53 | const STATUS_WARNING_CLOSED = 'warning_closed'; |
| 54 | const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; |
| 55 | const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; |
| 56 | const STATUS_WON = 'won'; |
| 57 | /** |
| 58 | * Returns a list of your disputes. |
| 59 | * |
| 60 | * @param null|array $params |
| 61 | * @param null|array|string $opts |
| 62 | * |
| 63 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 64 | * |
| 65 | * @return \Stripe\Collection<\Stripe\Dispute> of ApiResources |
| 66 | */ |
| 67 | public static function all($params = null, $opts = null) |
| 68 | { |
| 69 | $url = static::classUrl(); |
| 70 | return static::_requestPage($url, \ProfilePressVendor\Stripe\Collection::class, $params, $opts); |
| 71 | } |
| 72 | /** |
| 73 | * Retrieves the dispute with the given ID. |
| 74 | * |
| 75 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 76 | * @param null|array|string $opts |
| 77 | * |
| 78 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 79 | * |
| 80 | * @return \Stripe\Dispute |
| 81 | */ |
| 82 | public static function retrieve($id, $opts = null) |
| 83 | { |
| 84 | $opts = \ProfilePressVendor\Stripe\Util\RequestOptions::parse($opts); |
| 85 | $instance = new static($id, $opts); |
| 86 | $instance->refresh(); |
| 87 | return $instance; |
| 88 | } |
| 89 | /** |
| 90 | * When you get a dispute, contacting your customer is always the best first step. |
| 91 | * If that doesn’t work, you can submit evidence to help us resolve the dispute in |
| 92 | * your favor. You can do this in your <a |
| 93 | * href="https://dashboard.stripe.com/disputes">dashboard</a>, but if you prefer, |
| 94 | * you can use the API to submit evidence programmatically. |
| 95 | * |
| 96 | * Depending on your dispute type, different evidence fields will give you a better |
| 97 | * chance of winning your dispute. To figure out which evidence fields to provide, |
| 98 | * see our <a href="/docs/disputes/categories">guide to dispute types</a>. |
| 99 | * |
| 100 | * @param string $id the ID of the resource to update |
| 101 | * @param null|array $params |
| 102 | * @param null|array|string $opts |
| 103 | * |
| 104 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 105 | * |
| 106 | * @return \Stripe\Dispute the updated resource |
| 107 | */ |
| 108 | public static function update($id, $params = null, $opts = null) |
| 109 | { |
| 110 | self::_validateParams($params); |
| 111 | $url = static::resourceUrl($id); |
| 112 | list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); |
| 113 | $obj = \ProfilePressVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 114 | $obj->setLastResponse($response); |
| 115 | return $obj; |
| 116 | } |
| 117 | /** |
| 118 | * @param null|array $params |
| 119 | * @param null|array|string $opts |
| 120 | * |
| 121 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 122 | * |
| 123 | * @return \Stripe\Dispute the closed dispute |
| 124 | */ |
| 125 | public function close($params = null, $opts = null) |
| 126 | { |
| 127 | $url = $this->instanceUrl() . '/close'; |
| 128 | list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 129 | $this->refreshFrom($response, $opts); |
| 130 | return $this; |
| 131 | } |
| 132 | } |
| 133 |