|
| 1 | +using Newtonsoft.Json; |
| 2 | +using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.ComponentModel.DataAnnotations; |
| 5 | +using System.Runtime.Serialization; |
| 6 | +using System.Text; |
| 7 | + |
| 8 | +namespace FikaAmazonAPI.AmazonSpApiSDK.Models.OrdersV20260101 |
| 9 | +{ |
| 10 | + /// <summary> |
| 11 | + /// Payment execution details for an order. |
| 12 | + /// </summary> |
| 13 | + [DataContract] |
| 14 | + public partial class PaymentExecution : IEquatable<PaymentExecution>, IValidatableObject |
| 15 | + { |
| 16 | + /// <summary> |
| 17 | + /// Initializes a new instance of the <see cref="PaymentExecution" /> class. |
| 18 | + /// </summary> |
| 19 | + public PaymentExecution() |
| 20 | + { |
| 21 | + } |
| 22 | + |
| 23 | + /// <summary> |
| 24 | + /// Initializes a new instance of the <see cref="PaymentExecution" /> class. |
| 25 | + /// </summary> |
| 26 | + /// <param name="paymentMethod">The payment method used for this payment execution (for example, CashOnDelivery, ConvenienceStore, CreditCard, Invoice, Pix, and so on).</param> |
| 27 | + /// <param name="paymentAmount">The monetary value of the payment execution.</param> |
| 28 | + /// <param name="acquirerId">The unique identifier of the payment processor or acquiring bank that authorizes the payment.</param> |
| 29 | + /// <param name="cardBrand">The card network or brand used in the payment transaction (for example, Visa or Mastercard).</param> |
| 30 | + /// <param name="authorizationCode">The unique code that confirms the payment authorization.</param> |
| 31 | + public PaymentExecution(string paymentMethod, Money paymentAmount, string acquirerId, string cardBrand, string authorizationCode) |
| 32 | + { |
| 33 | + this.PaymentMethod = paymentMethod; |
| 34 | + this.PaymentAmount = paymentAmount; |
| 35 | + this.AcquirerId = acquirerId; |
| 36 | + this.CardBrand = cardBrand; |
| 37 | + this.AuthorizationCode = authorizationCode; |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// The payment method used for this payment execution (for example, CashOnDelivery, ConvenienceStore, CreditCard, Invoice, Pix, and so on). |
| 42 | + /// </summary> |
| 43 | + /// <value>The payment method used for this payment execution (for example, CashOnDelivery, ConvenienceStore, CreditCard, Invoice, Pix, and so on).</value> |
| 44 | + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] |
| 45 | + public string PaymentMethod { get; set; } |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// The monetary value of the payment execution. |
| 49 | + /// </summary> |
| 50 | + /// <value>The monetary value of the payment execution.</value> |
| 51 | + [DataMember(Name = "paymentAmount", EmitDefaultValue = false)] |
| 52 | + public Money PaymentAmount { get; set; } |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// The unique identifier of the payment processor or acquiring bank that authorizes the payment. |
| 56 | + /// <br/><br/> |
| 57 | + /// Note: This attribute is only available for orders in the Brazil (BR) marketplace when the paymentMethod is CreditCard or Pix. |
| 58 | + /// </summary> |
| 59 | + /// <value>The unique identifier of the payment processor or acquiring bank that authorizes the payment.</value> |
| 60 | + [DataMember(Name = "acquirerId", EmitDefaultValue = false)] |
| 61 | + public string AcquirerId { get; set; } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// The card network or brand used in the payment transaction (for example, Visa or Mastercard). |
| 65 | + /// <br/><br/> |
| 66 | + /// Note: This attribute is only available for orders in the Brazil (BR) marketplace when the paymentMethod is CreditCard. |
| 67 | + /// </summary> |
| 68 | + /// <value>The card network or brand used in the payment transaction (for example, Visa or Mastercard).</value> |
| 69 | + [DataMember(Name = "cardBrand", EmitDefaultValue = false)] |
| 70 | + public string CardBrand { get; set; } |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// The unique code that confirms the payment authorization. |
| 74 | + /// <br/><br/> |
| 75 | + /// Note: This attribute is only available for orders in the Brazil (BR) marketplace when the paymentMethod is CreditCard or Pix. |
| 76 | + /// </summary> |
| 77 | + /// <value>The unique code that confirms the payment authorization.</value> |
| 78 | + [DataMember(Name = "authorizationCode", EmitDefaultValue = false)] |
| 79 | + public string AuthorizationCode { get; set; } |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// Returns the string presentation of the object |
| 83 | + /// </summary> |
| 84 | + /// <returns>String presentation of the object</returns> |
| 85 | + public override string ToString() |
| 86 | + { |
| 87 | + var sb = new StringBuilder(); |
| 88 | + sb.Append("class PaymentExecution {\n"); |
| 89 | + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); |
| 90 | + sb.Append(" PaymentAmount: ").Append(PaymentAmount).Append("\n"); |
| 91 | + sb.Append(" AcquirerId: ").Append(AcquirerId).Append("\n"); |
| 92 | + sb.Append(" CardBrand: ").Append(CardBrand).Append("\n"); |
| 93 | + sb.Append(" AuthorizationCode: ").Append(AuthorizationCode).Append("\n"); |
| 94 | + sb.Append("}\n"); |
| 95 | + return sb.ToString(); |
| 96 | + } |
| 97 | + |
| 98 | + /// <summary> |
| 99 | + /// Returns the JSON string presentation of the object |
| 100 | + /// </summary> |
| 101 | + /// <returns>JSON string presentation of the object</returns> |
| 102 | + public virtual string ToJson() |
| 103 | + { |
| 104 | + return JsonConvert.SerializeObject(this, Formatting.Indented); |
| 105 | + } |
| 106 | + |
| 107 | + /// <summary> |
| 108 | + /// Returns true if objects are equal |
| 109 | + /// </summary> |
| 110 | + /// <param name="obj">Object to be compared</param> |
| 111 | + /// <returns>Boolean</returns> |
| 112 | + public override bool Equals(object obj) |
| 113 | + { |
| 114 | + return this.Equals(obj as PaymentExecution); |
| 115 | + } |
| 116 | + |
| 117 | + /// <summary> |
| 118 | + /// Returns true if PaymentExecution instances are equal |
| 119 | + /// </summary> |
| 120 | + /// <param name="input">Instance of PaymentExecution to be compared</param> |
| 121 | + /// <returns>Boolean</returns> |
| 122 | + public bool Equals(PaymentExecution input) |
| 123 | + { |
| 124 | + if (input == null) |
| 125 | + return false; |
| 126 | + |
| 127 | + return |
| 128 | + ( |
| 129 | + this.PaymentMethod == input.PaymentMethod || |
| 130 | + (this.PaymentMethod != null && |
| 131 | + this.PaymentMethod.Equals(input.PaymentMethod)) |
| 132 | + ) && |
| 133 | + ( |
| 134 | + this.PaymentAmount == input.PaymentAmount || |
| 135 | + (this.PaymentAmount != null && |
| 136 | + this.PaymentAmount.Equals(input.PaymentAmount)) |
| 137 | + ) && |
| 138 | + ( |
| 139 | + this.AcquirerId == input.AcquirerId || |
| 140 | + (this.AcquirerId != null && |
| 141 | + this.AcquirerId.Equals(input.AcquirerId)) |
| 142 | + ) && |
| 143 | + ( |
| 144 | + this.CardBrand == input.CardBrand || |
| 145 | + (this.CardBrand != null && |
| 146 | + this.CardBrand.Equals(input.CardBrand)) |
| 147 | + ) && |
| 148 | + ( |
| 149 | + this.AuthorizationCode == input.AuthorizationCode || |
| 150 | + (this.AuthorizationCode != null && |
| 151 | + this.AuthorizationCode.Equals(input.AuthorizationCode)) |
| 152 | + ); |
| 153 | + } |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// Gets the hash code |
| 157 | + /// </summary> |
| 158 | + /// <returns>Hash code</returns> |
| 159 | + public override int GetHashCode() |
| 160 | + { |
| 161 | + unchecked // Overflow is fine, just wrap |
| 162 | + { |
| 163 | + int hashCode = 41; |
| 164 | + if (this.PaymentMethod != null) |
| 165 | + hashCode = hashCode * 59 + this.PaymentMethod.GetHashCode(); |
| 166 | + if (this.PaymentAmount != null) |
| 167 | + hashCode = hashCode * 59 + this.PaymentAmount.GetHashCode(); |
| 168 | + if (this.AcquirerId != null) |
| 169 | + hashCode = hashCode * 59 + this.AcquirerId.GetHashCode(); |
| 170 | + if (this.CardBrand != null) |
| 171 | + hashCode = hashCode * 59 + this.CardBrand.GetHashCode(); |
| 172 | + if (this.AuthorizationCode != null) |
| 173 | + hashCode = hashCode * 59 + this.AuthorizationCode.GetHashCode(); |
| 174 | + return hashCode; |
| 175 | + } |
| 176 | + } |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// To validate all properties of the instance |
| 180 | + /// </summary> |
| 181 | + /// <param name="validationContext">Validation context</param> |
| 182 | + /// <returns>Validation Result</returns> |
| 183 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 184 | + { |
| 185 | + yield break; |
| 186 | + } |
| 187 | + } |
| 188 | + |
| 189 | +} |
0 commit comments