-
Notifications
You must be signed in to change notification settings - Fork 114
/
PaymentsResponse.cs
319 lines (288 loc) · 22.5 KB
/
PaymentsResponse.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Adyen.Model.Checkout
{
/// <summary>
/// PaymentsResponse
/// </summary>
[DataContract]
public partial class PaymentsResponse : IEquatable<PaymentsResponse>, IValidatableObject
{
/// <summary>
/// The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/developers/development-resources/payments-with-pending-status). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state.
/// </summary>
/// <value>The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/developers/development-resources/payments-with-pending-status). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state.</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum ResultCodeEnum
{
/// <summary>
/// Enum Authorised for value: Authorised
/// </summary>
[EnumMember(Value = "Authorised")]
Authorised = 1,
/// <summary>
/// Enum PartiallyAuthorised for value: PartiallyAuthorised
/// </summary>
[EnumMember(Value = "PartiallyAuthorised")]
PartiallyAuthorised = 2,
/// <summary>
/// Enum Refused for value: Refused
/// </summary>
[EnumMember(Value = "Refused")]
Refused = 3,
/// <summary>
/// Enum Error for value: Error
/// </summary>
[EnumMember(Value = "Error")]
Error = 4,
/// <summary>
/// Enum Cancelled for value: Cancelled
/// </summary>
[EnumMember(Value = "Cancelled")]
Cancelled = 5,
/// <summary>
/// Enum Received for value: Received
/// </summary>
[EnumMember(Value = "Received")]
Received = 6,
/// <summary>
/// Enum RedirectShopper for value: RedirectShopper
/// </summary>
[EnumMember(Value = "RedirectShopper")]
RedirectShopper = 7,
/// <summary>
/// Enum IdentifyShopper for value: IdentifyShopper
/// </summary>
[EnumMember(Value = "IdentifyShopper")]
IdentifyShopper = 8,
/// <summary>
/// Enum ChallengeShopper for value: ChallengeShopper
/// </summary>
[EnumMember(Value = "ChallengeShopper")]
ChallengeShopper = 9,
/// <summary>
/// Enum PresentToShopper for value: PresentToShopper
/// </summary>
[EnumMember(Value = "PresentToShopper")]
PresentToShopper = 10
}
/// <summary>
/// The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/developers/development-resources/payments-with-pending-status). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state.
/// </summary>
/// <value>The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/developers/development-resources/payments-with-pending-status). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state.</value>
[DataMember(Name="resultCode", EmitDefaultValue=false)]
public ResultCodeEnum? ResultCode { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="PaymentsResponse" /> class.
/// </summary>
/// <param name="AdditionalData">This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**..</param>
/// <param name="Details">When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint..</param>
/// <param name="FraudResult">The fraud result properties of the payment..</param>
/// <param name="PaymentData">When non-empty, contains a value that you must submit to the `/payments/details` endpoint..</param>
/// <param name="PspReference">Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > `pspReference` is returned only for non-redirect payment methods..</param>
/// <param name="Redirect">When the payment flow requires a redirect, this object contains information about the redirect URL..</param>
/// <param name="RefusalReason">If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values..</param>
/// <param name="RefusalReasonCode">Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/developers/development-resources/response-handling#authorisationrefusalreasons)..</param>
/// <param name="ResultCode">The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/developers/development-resources/payments-with-pending-status). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state..</param>
public PaymentsResponse(Dictionary<string, string> AdditionalData = default(Dictionary<string, string>), List<InputDetail> Details = default(List<InputDetail>), FraudResult FraudResult = default(FraudResult), string PaymentData = default(string), string PspReference = default(string), Redirect Redirect = default(Redirect), string RefusalReason = default(string), string RefusalReasonCode = default(string), ResultCodeEnum? ResultCode = default(ResultCodeEnum?))
{
this.AdditionalData = AdditionalData;
this.Details = Details;
this.FraudResult = FraudResult;
this.PaymentData = PaymentData;
this.PspReference = PspReference;
this.Redirect = Redirect;
this.RefusalReason = RefusalReason;
this.RefusalReasonCode = RefusalReasonCode;
this.ResultCode = ResultCode;
}
/// <summary>
/// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.
/// </summary>
/// <value>This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.</value>
[DataMember(Name="additionalData", EmitDefaultValue=false)]
public Dictionary<string, string> AdditionalData { get; set; }
/// <summary>
/// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint.
/// </summary>
/// <value>When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint.</value>
[DataMember(Name="details", EmitDefaultValue=false)]
public List<InputDetail> Details { get; set; }
/// <summary>
/// The fraud result properties of the payment.
/// </summary>
/// <value>The fraud result properties of the payment.</value>
[DataMember(Name="fraudResult", EmitDefaultValue=false)]
public FraudResult FraudResult { get; set; }
/// <summary>
/// When non-empty, contains a value that you must submit to the `/payments/details` endpoint.
/// </summary>
/// <value>When non-empty, contains a value that you must submit to the `/payments/details` endpoint.</value>
[DataMember(Name="paymentData", EmitDefaultValue=false)]
public string PaymentData { get; set; }
/// <summary>
/// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > `pspReference` is returned only for non-redirect payment methods.
/// </summary>
/// <value>Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > `pspReference` is returned only for non-redirect payment methods.</value>
[DataMember(Name="pspReference", EmitDefaultValue=false)]
public string PspReference { get; set; }
/// <summary>
/// When the payment flow requires a redirect, this object contains information about the redirect URL.
/// </summary>
/// <value>When the payment flow requires a redirect, this object contains information about the redirect URL.</value>
[DataMember(Name="redirect", EmitDefaultValue=false)]
public Redirect Redirect { get; set; }
/// <summary>
/// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.
/// </summary>
/// <value>If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.</value>
[DataMember(Name="refusalReason", EmitDefaultValue=false)]
public string RefusalReason { get; set; }
/// <summary>
/// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/developers/development-resources/response-handling#authorisationrefusalreasons).
/// </summary>
/// <value>Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/developers/development-resources/response-handling#authorisationrefusalreasons).</value>
[DataMember(Name="refusalReasonCode", EmitDefaultValue=false)]
public string RefusalReasonCode { get; set; }
[DataMember(Name="outputDetails", EmitDefaultValue=false)]
public Dictionary<string, string> OutputDetails;
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class PaymentsResponse {\n");
sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n");
sb.Append(" Details: ").Append(Details).Append("\n");
sb.Append(" FraudResult: ").Append(FraudResult).Append("\n");
sb.Append(" PaymentData: ").Append(PaymentData).Append("\n");
sb.Append(" PspReference: ").Append(PspReference).Append("\n");
sb.Append(" Redirect: ").Append(Redirect).Append("\n");
sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n");
sb.Append(" RefusalReasonCode: ").Append(RefusalReasonCode).Append("\n");
sb.Append(" ResultCode: ").Append(ResultCode).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as PaymentsResponse);
}
/// <summary>
/// Returns true if PaymentsResponse instances are equal
/// </summary>
/// <param name="input">Instance of PaymentsResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(PaymentsResponse input)
{
if (input == null)
return false;
return
(
this.AdditionalData == input.AdditionalData ||
this.AdditionalData != null &&
this.AdditionalData.SequenceEqual(input.AdditionalData)
) &&
(
this.Details == input.Details ||
this.Details != null &&
this.Details.SequenceEqual(input.Details)
) &&
(
this.FraudResult == input.FraudResult ||
(this.FraudResult != null &&
this.FraudResult.Equals(input.FraudResult))
) &&
(
this.PaymentData == input.PaymentData ||
(this.PaymentData != null &&
this.PaymentData.Equals(input.PaymentData))
) &&
(
this.PspReference == input.PspReference ||
(this.PspReference != null &&
this.PspReference.Equals(input.PspReference))
) &&
(
this.Redirect == input.Redirect ||
(this.Redirect != null &&
this.Redirect.Equals(input.Redirect))
) &&
(
this.RefusalReason == input.RefusalReason ||
(this.RefusalReason != null &&
this.RefusalReason.Equals(input.RefusalReason))
) &&
(
this.RefusalReasonCode == input.RefusalReasonCode ||
(this.RefusalReasonCode != null &&
this.RefusalReasonCode.Equals(input.RefusalReasonCode))
) &&
(
this.ResultCode == input.ResultCode ||
(this.ResultCode != null &&
this.ResultCode.Equals(input.ResultCode))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.AdditionalData != null)
hashCode = hashCode * 59 + this.AdditionalData.GetHashCode();
if (this.Details != null)
hashCode = hashCode * 59 + this.Details.GetHashCode();
if (this.FraudResult != null)
hashCode = hashCode * 59 + this.FraudResult.GetHashCode();
if (this.PaymentData != null)
hashCode = hashCode * 59 + this.PaymentData.GetHashCode();
if (this.PspReference != null)
hashCode = hashCode * 59 + this.PspReference.GetHashCode();
if (this.Redirect != null)
hashCode = hashCode * 59 + this.Redirect.GetHashCode();
if (this.RefusalReason != null)
hashCode = hashCode * 59 + this.RefusalReason.GetHashCode();
if (this.RefusalReasonCode != null)
hashCode = hashCode * 59 + this.RefusalReasonCode.GetHashCode();
if (this.ResultCode != null)
hashCode = hashCode * 59 + this.ResultCode.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}