-
Notifications
You must be signed in to change notification settings - Fork 566
/
Dispute.cs
180 lines (158 loc) · 7.24 KB
/
Dispute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// File generated from our OpenAPI spec
namespace Stripe
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;
/// <summary>
/// A dispute occurs when a customer questions your charge with their card issuer. When this
/// happens, you're given the opportunity to respond to the dispute with evidence that shows
/// that the charge is legitimate. You can find more information about the dispute process
/// in our <a href="https://stripe.com/docs/disputes">Disputes and Fraud</a> documentation.
///
/// Related guide: <a href="https://stripe.com/docs/disputes">Disputes and Fraud</a>.
/// </summary>
public class Dispute : StripeEntity<Dispute>, IHasId, IHasMetadata, IHasObject, IBalanceTransactionSource
{
/// <summary>
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }
/// <summary>
/// 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).
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }
/// <summary>
/// List of zero, one, or two balance transactions that show funds withdrawn and reinstated
/// to your Stripe account as a result of this dispute.
/// </summary>
[JsonProperty("balance_transactions")]
public List<BalanceTransaction> BalanceTransactions { get; set; }
#region Expandable Charge
/// <summary>
/// (ID of the Charge)
/// ID of the charge that was disputed.
/// </summary>
[JsonIgnore]
public string ChargeId
{
get => this.InternalCharge?.Id;
set => this.InternalCharge = SetExpandableFieldId(value, this.InternalCharge);
}
/// <summary>
/// (Expanded)
/// ID of the charge that was disputed.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Charge Charge
{
get => this.InternalCharge?.ExpandedObject;
set => this.InternalCharge = SetExpandableFieldObject(value, this.InternalCharge);
}
[JsonProperty("charge")]
[JsonConverter(typeof(ExpandableFieldConverter<Charge>))]
internal ExpandableField<Charge> InternalCharge { get; set; }
#endregion
/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("created")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
/// <summary>
/// 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>.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
[JsonProperty("evidence")]
public DisputeEvidence Evidence { get; set; }
[JsonProperty("evidence_details")]
public DisputeEvidenceDetails EvidenceDetails { get; set; }
/// <summary>
/// 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.
/// </summary>
[JsonProperty("is_charge_refundable")]
public bool IsChargeRefundable { get; set; }
/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
/// the object exists in test mode.
/// </summary>
[JsonProperty("livemode")]
public bool Livemode { get; set; }
/// <summary>
/// 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.
/// </summary>
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
/// <summary>
/// Network-dependent reason code for the dispute.
/// </summary>
[JsonProperty("network_reason_code")]
public string NetworkReasonCode { get; set; }
#region Expandable PaymentIntent
/// <summary>
/// (ID of the PaymentIntent)
/// ID of the PaymentIntent that was disputed.
/// </summary>
[JsonIgnore]
public string PaymentIntentId
{
get => this.InternalPaymentIntent?.Id;
set => this.InternalPaymentIntent = SetExpandableFieldId(value, this.InternalPaymentIntent);
}
/// <summary>
/// (Expanded)
/// ID of the PaymentIntent that was disputed.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public PaymentIntent PaymentIntent
{
get => this.InternalPaymentIntent?.ExpandedObject;
set => this.InternalPaymentIntent = SetExpandableFieldObject(value, this.InternalPaymentIntent);
}
[JsonProperty("payment_intent")]
[JsonConverter(typeof(ExpandableFieldConverter<PaymentIntent>))]
internal ExpandableField<PaymentIntent> InternalPaymentIntent { get; set; }
#endregion
/// <summary>
/// Reason given by cardholder for dispute. Possible values are <c>bank_cannot_process</c>,
/// <c>check_returned</c>, <c>credit_not_processed</c>, <c>customer_initiated</c>,
/// <c>debit_not_authorized</c>, <c>duplicate</c>, <c>fraudulent</c>, <c>general</c>,
/// <c>incorrect_account_details</c>, <c>insufficient_funds</c>,
/// <c>product_not_received</c>, <c>product_unacceptable</c>, <c>subscription_canceled</c>,
/// or <c>unrecognized</c>. Read more about <a
/// href="https://stripe.com/docs/disputes/categories">dispute reasons</a>.
/// </summary>
[JsonProperty("reason")]
public string Reason { get; set; }
/// <summary>
/// Current status of dispute. Possible values are <c>warning_needs_response</c>,
/// <c>warning_under_review</c>, <c>warning_closed</c>, <c>needs_response</c>,
/// <c>under_review</c>, <c>charge_refunded</c>, <c>won</c>, or <c>lost</c>.
/// One of: <c>charge_refunded</c>, <c>lost</c>, <c>needs_response</c>, <c>under_review</c>,
/// <c>warning_closed</c>, <c>warning_needs_response</c>, <c>warning_under_review</c>, or
/// <c>won</c>.
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }
}
}