|
/*
* 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;
}
}
}
|
Loading...