OpenSource » SampleCode » NexPortWebApiClient
Clone URL:  
InvoicePaymentRequest.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
/* * NexPort Web API * * The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API. * * The version of the OpenAPI document: v1 * Contact: support@nexportcampus.com * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Text; using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; namespace NexportApi.Model { /// <summary> /// Information for creating an invoice payment /// </summary> [DataContract] public class InvoicePaymentRequest : IEquatable<InvoicePaymentRequest>, IValidatableObject { /// <summary> /// Cash=0; /// Check=1; /// PayPal=2; /// NopCommercePlugin=3; /// DiscountOrCoupon=4; /// Other=1000; /// </summary> /// <value> /// Cash=0; /// Check=1; /// PayPal=2; /// NopCommercePlugin=3; /// DiscountOrCoupon=4; /// Other=1000; /// </value> public enum PaymentProcessorEnum { /// <summary> /// Enum Cash for value: 0 /// </summary> [Display(Name = "Cash")] Cash = 0, /// <summary> /// Enum Check for value: 1 /// </summary> [Display(Name = "Check")] Check = 1, /// <summary> /// Enum PayPal for value: 2 /// </summary> [Display(Name = "PayPal")] PayPal = 2, /// <summary> /// Enum NopCommercePlugin for value: 3 /// </summary> [Display(Name = "NopCommerce Plugin")] NopCommercePlugin = 3, /// <summary> /// Enum DiscountOrCoupon for value: 4 /// </summary> [Display(Name = "Discount or Coupon")] DiscountOrCoupon = 4, /// <summary> /// Enum Other for value: 1000 /// </summary> [Display(Name = "Other")] Other = 1000 } /// <summary> /// Cash=0; /// Check=1; /// PayPal=2; /// NopCommercePlugin=3; /// DiscountOrCoupon=4; /// Other=1000; /// </summary> /// <value> /// Cash=0; /// Check=1; /// PayPal=2; /// NopCommercePlugin=3; /// DiscountOrCoupon=4; /// Other=1000; /// </value> [DataMember(Name = "payment_processor", EmitDefaultValue = true)] public PaymentProcessorEnum PaymentProcessor { get; set; } /// <summary> /// Initializes a new instance of the <see cref="InvoicePaymentRequest" /> class. /// </summary> [JsonConstructor] protected InvoicePaymentRequest() { } /// <summary> /// Initializes a new instance of the <see cref="InvoicePaymentRequest" /> class. /// </summary> /// <param name="invoiceId">Id of the invoice that the payment is for (required).</param> /// <param name="paymentCollectorId">Id of the user collecting payment (not used in 5.2; CurrentUser is used instead).</param> /// <param name="merchantAccountId">Id of the account that the payment goes to (required).</param> /// <param name="payeeId">Id of user that payment is being collected from (required).</param> /// <param name="paymentProcessor">Cash=0; Check=1; PayPal=2; NopCommercePlugin=3; DiscountOrCoupon=4; Other=1000; (required).</param> /// <param name="paymentProcessorTransactionId">Id to help track the transaction information for the payment processor (required).</param> /// <param name="amountUsd">Amount being paid (required).</param> /// <param name="utcPaymentDate">Date that the payment is made (required).</param> /// <param name="note">Optional note for the invoice payment.</param> public InvoicePaymentRequest(Guid invoiceId = default, Guid? paymentCollectorId = default, Guid merchantAccountId = default, Guid payeeId = default, PaymentProcessorEnum paymentProcessor = default, string paymentProcessorTransactionId = default, decimal amountUsd = default, DateTime utcPaymentDate = default, string note = default) { InvoiceId = invoiceId; MerchantAccountId = merchantAccountId; PayeeId = payeeId; PaymentProcessor = paymentProcessor; // to ensure "paymentProcessorTransactionId" is required (not null) PaymentProcessorTransactionId = paymentProcessorTransactionId ?? throw new ArgumentNullException(nameof(PaymentProcessorTransactionId), "paymentProcessorTransactionId is a required property for InvoicePaymentRequest and cannot be null"); AmountUsd = amountUsd; UtcPaymentDate = utcPaymentDate; PaymentCollectorId = paymentCollectorId; Note = note; } /// <summary> /// Id of the invoice that the payment is for /// </summary> /// <value>Id of the invoice that the payment is for</value> [DataMember(Name = "invoice_id", EmitDefaultValue = false)] public Guid InvoiceId { get; set; } /// <summary> /// Id of the user collecting payment (not used in 5.2; CurrentUser is used instead) /// </summary> /// <value>Id of the user collecting payment (not used in 5.2; CurrentUser is used instead)</value> [DataMember(Name = "payment_collector_id", EmitDefaultValue = false)] public Guid? PaymentCollectorId { get; set; } /// <summary> /// Id of the account that the payment goes to /// </summary> /// <value>Id of the account that the payment goes to</value> [DataMember(Name = "merchant_account_id", EmitDefaultValue = false)] public Guid MerchantAccountId { get; set; } /// <summary> /// Id of user that payment is being collected from /// </summary> /// <value>Id of user that payment is being collected from</value> [DataMember(Name = "payee_id", EmitDefaultValue = false)] public Guid PayeeId { get; set; } /// <summary> /// Id to help track the transaction information for the payment processor /// </summary> /// <value>Id to help track the transaction information for the payment processor</value> [DataMember(Name = "payment_processor_transaction_id", EmitDefaultValue = false)] public string PaymentProcessorTransactionId { get; set; } /// <summary> /// Amount being paid /// </summary> /// <value>Amount being paid</value> [DataMember(Name = "amount_usd", EmitDefaultValue = true)] public decimal AmountUsd { get; set; } /// <summary> /// Date that the payment is made /// </summary> /// <value>Date that the payment is made</value> [DataMember(Name = "utc_payment_date", EmitDefaultValue = false)] public DateTime UtcPaymentDate { get; set; } /// <summary> /// Optional note for the invoice payment /// </summary> /// <value>Optional note for the invoice payment</value> [DataMember(Name = "note", EmitDefaultValue = false)] public string Note { get; set; } /// <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 InvoicePaymentRequest {\n"); sb.Append(" InvoiceId: ").Append(InvoiceId).Append("\n"); sb.Append(" PaymentCollectorId: ").Append(PaymentCollectorId).Append("\n"); sb.Append(" MerchantAccountId: ").Append(MerchantAccountId).Append("\n"); sb.Append(" PayeeId: ").Append(PayeeId).Append("\n"); sb.Append(" PaymentProcessor: ").Append(PaymentProcessor).Append("\n"); sb.Append(" PaymentProcessorTransactionId: ").Append(PaymentProcessorTransactionId).Append("\n"); sb.Append(" AmountUsd: ").Append(AmountUsd).Append("\n"); sb.Append(" UtcPaymentDate: ").Append(UtcPaymentDate).Append("\n"); sb.Append(" Note: ").Append(Note).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 virtual 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 Equals(input as InvoicePaymentRequest); } /// <summary> /// Returns true if InvoicePaymentRequest instances are equal /// </summary> /// <param name="input">Instance of InvoicePaymentRequest to be compared</param> /// <returns>Boolean</returns> public bool Equals(InvoicePaymentRequest input) { if (input == null) return false; return ( InvoiceId == input.InvoiceId || (InvoiceId.Equals(input.InvoiceId)) ) && ( PaymentCollectorId == input.PaymentCollectorId || (PaymentCollectorId != null && PaymentCollectorId.Equals(input.PaymentCollectorId)) ) && ( MerchantAccountId == input.MerchantAccountId || (MerchantAccountId.Equals(input.MerchantAccountId)) ) && ( PayeeId == input.PayeeId || (PayeeId.Equals(input.PayeeId)) ) && ( PaymentProcessor == input.PaymentProcessor || PaymentProcessor.Equals(input.PaymentProcessor) ) && ( PaymentProcessorTransactionId == input.PaymentProcessorTransactionId || (PaymentProcessorTransactionId != null && PaymentProcessorTransactionId.Equals(input.PaymentProcessorTransactionId)) ) && ( AmountUsd == input.AmountUsd || AmountUsd.Equals(input.AmountUsd) ) && ( UtcPaymentDate == input.UtcPaymentDate || (UtcPaymentDate.Equals(input.UtcPaymentDate)) ) && ( Note == input.Note || (Note != null && Note.Equals(input.Note)) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; hashCode = hashCode * 59 + InvoiceId.GetHashCode(); if (PaymentCollectorId != null) hashCode = hashCode * 59 + PaymentCollectorId.GetHashCode(); hashCode = hashCode * 59 + MerchantAccountId.GetHashCode(); hashCode = hashCode * 59 + PayeeId.GetHashCode(); hashCode = hashCode * 59 + PaymentProcessor.GetHashCode(); if (PaymentProcessorTransactionId != null) hashCode = hashCode * 59 + PaymentProcessorTransactionId.GetHashCode(); hashCode = hashCode * 59 + AmountUsd.GetHashCode(); hashCode = hashCode * 59 + UtcPaymentDate.GetHashCode(); if (Note != null) hashCode = hashCode * 59 + Note.GetHashCode(); return hashCode; } } /// <summary> /// To validate all properties of the instance /// </summary> /// <param name="validationContext">Validation context</param> /// <returns>Validation Result</returns> IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } }