From 42120803b33aabfdc090129beb4951aaf1218a2b Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Wed, 20 Dec 2023 16:04:39 +0000 Subject: [PATCH] false[adyen-sdk-automation] automated change --- Adyen/Model/TransferWebhooks/IssuedCard.cs | 59 ++++- .../TransferWebhooks/PartyIdentification.cs | 6 + Adyen/Model/TransferWebhooks/TransferData.cs | 4 +- Adyen/Model/TransferWebhooks/TransferEvent.cs | 40 +-- .../TransferNotificationCounterParty.cs | 184 +++++++++++++ .../TransferNotificationMerchantData.cs | 243 ++++++++++++++++++ Adyen/Model/Transfers/IssuedCard.cs | 59 ++++- Adyen/Model/Transfers/PartyIdentification.cs | 6 + Adyen/Model/Transfers/RestServiceError.cs | 5 +- .../Model/Transfers/ReturnTransferResponse.cs | 10 +- Adyen/Model/Transfers/TransferInfo.cs | 6 + .../Transfers/UltimatePartyIdentification.cs | 6 + .../Service/Transfers/TransactionsService.cs | 4 +- Adyen/Service/Transfers/TransfersService.cs | 16 +- 14 files changed, 587 insertions(+), 61 deletions(-) create mode 100644 Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs create mode 100644 Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs diff --git a/Adyen/Model/TransferWebhooks/IssuedCard.cs b/Adyen/Model/TransferWebhooks/IssuedCard.cs index 3f43e03b3..dd570c79c 100644 --- a/Adyen/Model/TransferWebhooks/IssuedCard.cs +++ b/Adyen/Model/TransferWebhooks/IssuedCard.cs @@ -179,26 +179,53 @@ public enum TypeEnum /// /// Initializes a new instance of the class. /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation**. /// Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**.. /// Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments.. /// relayedAuthorisationData. + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments.. + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme.. /// **issuedCard** (default to TypeEnum.IssuedCard). /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information.. - public IssuedCard(PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) + public IssuedCard(string authorisationType = default(string), PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), string schemeTraceId = default(string), string schemeUniqueTransactionId = default(string), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) { + this.AuthorisationType = authorisationType; this.PanEntryMode = panEntryMode; this.ProcessingType = processingType; this.RelayedAuthorisationData = relayedAuthorisationData; + this.SchemeTraceId = schemeTraceId; + this.SchemeUniqueTransactionId = schemeUniqueTransactionId; this.Type = type; this.ValidationFacts = validationFacts; } + /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + [DataMember(Name = "authorisationType", EmitDefaultValue = false)] + public string AuthorisationType { get; set; } + /// /// Gets or Sets RelayedAuthorisationData /// [DataMember(Name = "relayedAuthorisationData", EmitDefaultValue = false)] public RelayedAuthorisationData RelayedAuthorisationData { get; set; } + /// + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + /// + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + [DataMember(Name = "schemeTraceId", EmitDefaultValue = false)] + public string SchemeTraceId { get; set; } + + /// + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + /// + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + [DataMember(Name = "schemeUniqueTransactionId", EmitDefaultValue = false)] + public string SchemeUniqueTransactionId { get; set; } + /// /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. /// @@ -214,9 +241,12 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class IssuedCard {\n"); + sb.Append(" AuthorisationType: ").Append(AuthorisationType).Append("\n"); sb.Append(" PanEntryMode: ").Append(PanEntryMode).Append("\n"); sb.Append(" ProcessingType: ").Append(ProcessingType).Append("\n"); sb.Append(" RelayedAuthorisationData: ").Append(RelayedAuthorisationData).Append("\n"); + sb.Append(" SchemeTraceId: ").Append(SchemeTraceId).Append("\n"); + sb.Append(" SchemeUniqueTransactionId: ").Append(SchemeUniqueTransactionId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ValidationFacts: ").Append(ValidationFacts).Append("\n"); sb.Append("}\n"); @@ -254,6 +284,11 @@ public bool Equals(IssuedCard input) return false; } return + ( + this.AuthorisationType == input.AuthorisationType || + (this.AuthorisationType != null && + this.AuthorisationType.Equals(input.AuthorisationType)) + ) && ( this.PanEntryMode == input.PanEntryMode || this.PanEntryMode.Equals(input.PanEntryMode) @@ -267,6 +302,16 @@ public bool Equals(IssuedCard input) (this.RelayedAuthorisationData != null && this.RelayedAuthorisationData.Equals(input.RelayedAuthorisationData)) ) && + ( + this.SchemeTraceId == input.SchemeTraceId || + (this.SchemeTraceId != null && + this.SchemeTraceId.Equals(input.SchemeTraceId)) + ) && + ( + this.SchemeUniqueTransactionId == input.SchemeUniqueTransactionId || + (this.SchemeUniqueTransactionId != null && + this.SchemeUniqueTransactionId.Equals(input.SchemeUniqueTransactionId)) + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -288,12 +333,24 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.AuthorisationType != null) + { + hashCode = (hashCode * 59) + this.AuthorisationType.GetHashCode(); + } hashCode = (hashCode * 59) + this.PanEntryMode.GetHashCode(); hashCode = (hashCode * 59) + this.ProcessingType.GetHashCode(); if (this.RelayedAuthorisationData != null) { hashCode = (hashCode * 59) + this.RelayedAuthorisationData.GetHashCode(); } + if (this.SchemeTraceId != null) + { + hashCode = (hashCode * 59) + this.SchemeTraceId.GetHashCode(); + } + if (this.SchemeUniqueTransactionId != null) + { + hashCode = (hashCode * 59) + this.SchemeUniqueTransactionId.GetHashCode(); + } hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ValidationFacts != null) { diff --git a/Adyen/Model/TransferWebhooks/PartyIdentification.cs b/Adyen/Model/TransferWebhooks/PartyIdentification.cs index 3c9fb92cc..dc570de7d 100644 --- a/Adyen/Model/TransferWebhooks/PartyIdentification.cs +++ b/Adyen/Model/TransferWebhooks/PartyIdentification.cs @@ -264,6 +264,12 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Reference (string) maxLength + if (this.Reference != null && this.Reference.Length > 150) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Reference, length must be less than 150.", new [] { "Reference" }); + } + yield break; } } diff --git a/Adyen/Model/TransferWebhooks/TransferData.cs b/Adyen/Model/TransferWebhooks/TransferData.cs index 828bec58a..f8829b67c 100644 --- a/Adyen/Model/TransferWebhooks/TransferData.cs +++ b/Adyen/Model/TransferWebhooks/TransferData.cs @@ -862,7 +862,7 @@ protected TransferData() { } /// tracking. /// transactionRulesResult. /// The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**.. - public TransferData(ResourceReference accountHolder = default(ResourceReference), Amount amount = default(Amount), ResourceReference balanceAccount = default(ResourceReference), string balancePlatform = default(string), List balances = default(List), CategoryEnum category = default(CategoryEnum), TransferDataCategoryData categoryData = default(TransferDataCategoryData), CounterpartyV3 counterparty = default(CounterpartyV3), DateTime creationDate = default(DateTime), string description = default(string), DirectionEnum? direction = default(DirectionEnum?), List events = default(List), string id = default(string), PaymentInstrument paymentInstrument = default(PaymentInstrument), ReasonEnum? reason = default(ReasonEnum?), string reference = default(string), string referenceForBeneficiary = default(string), int? sequenceNumber = default(int?), StatusEnum status = default(StatusEnum), TransferNotificationTransferTracking tracking = default(TransferNotificationTransferTracking), TransactionRulesResult transactionRulesResult = default(TransactionRulesResult), TypeEnum? type = default(TypeEnum?)) + public TransferData(ResourceReference accountHolder = default(ResourceReference), Amount amount = default(Amount), ResourceReference balanceAccount = default(ResourceReference), string balancePlatform = default(string), List balances = default(List), CategoryEnum category = default(CategoryEnum), TransferDataCategoryData categoryData = default(TransferDataCategoryData), TransferNotificationCounterParty counterparty = default(TransferNotificationCounterParty), DateTime creationDate = default(DateTime), string description = default(string), DirectionEnum? direction = default(DirectionEnum?), List events = default(List), string id = default(string), PaymentInstrument paymentInstrument = default(PaymentInstrument), ReasonEnum? reason = default(ReasonEnum?), string reference = default(string), string referenceForBeneficiary = default(string), int? sequenceNumber = default(int?), StatusEnum status = default(StatusEnum), TransferNotificationTransferTracking tracking = default(TransferNotificationTransferTracking), TransactionRulesResult transactionRulesResult = default(TransactionRulesResult), TypeEnum? type = default(TypeEnum?)) { this.Amount = amount; this.Category = category; @@ -930,7 +930,7 @@ protected TransferData() { } /// Gets or Sets Counterparty /// [DataMember(Name = "counterparty", EmitDefaultValue = false)] - public CounterpartyV3 Counterparty { get; set; } + public TransferNotificationCounterParty Counterparty { get; set; } /// /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. diff --git a/Adyen/Model/TransferWebhooks/TransferEvent.cs b/Adyen/Model/TransferWebhooks/TransferEvent.cs index 92d2fdd62..f89dfc829 100644 --- a/Adyen/Model/TransferWebhooks/TransferEvent.cs +++ b/Adyen/Model/TransferWebhooks/TransferEvent.cs @@ -584,14 +584,12 @@ public enum TypeEnum /// The list of the balance mutation per event.. /// originalAmount. /// The reason for the transfer status.. - /// SchemeTraceID retrieved from scheme.. - /// SchemeUniqueTransactionID retrieved from scheme.. /// The status of the transfer event.. /// The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes.. /// The type of the transfer event. Possible values: **accounting**, **tracking**.. /// The date when the tracking status was updated.. /// A future date, when the funds are expected to be deducted from or credited to the balance account.. - public TransferEvent(Amount amount = default(Amount), List amountAdjustments = default(List), DateTime bookingDate = default(DateTime), DateTime estimatedArrivalTime = default(DateTime), string id = default(string), Modification modification = default(Modification), List mutations = default(List), Amount originalAmount = default(Amount), ReasonEnum? reason = default(ReasonEnum?), string schemeTraceID = default(string), string schemeUniqueTransactionID = default(string), StatusEnum? status = default(StatusEnum?), string transactionId = default(string), TypeEnum? type = default(TypeEnum?), DateTime updateDate = default(DateTime), DateTime valueDate = default(DateTime)) + public TransferEvent(Amount amount = default(Amount), List amountAdjustments = default(List), DateTime bookingDate = default(DateTime), DateTime estimatedArrivalTime = default(DateTime), string id = default(string), Modification modification = default(Modification), List mutations = default(List), Amount originalAmount = default(Amount), ReasonEnum? reason = default(ReasonEnum?), StatusEnum? status = default(StatusEnum?), string transactionId = default(string), TypeEnum? type = default(TypeEnum?), DateTime updateDate = default(DateTime), DateTime valueDate = default(DateTime)) { this.Amount = amount; this.AmountAdjustments = amountAdjustments; @@ -602,8 +600,6 @@ public enum TypeEnum this.Mutations = mutations; this.OriginalAmount = originalAmount; this.Reason = reason; - this.SchemeTraceID = schemeTraceID; - this.SchemeUniqueTransactionID = schemeUniqueTransactionID; this.Status = status; this.TransactionId = transactionId; this.Type = type; @@ -664,20 +660,6 @@ public enum TypeEnum [DataMember(Name = "originalAmount", EmitDefaultValue = false)] public Amount OriginalAmount { get; set; } - /// - /// SchemeTraceID retrieved from scheme. - /// - /// SchemeTraceID retrieved from scheme. - [DataMember(Name = "schemeTraceID", EmitDefaultValue = false)] - public string SchemeTraceID { get; set; } - - /// - /// SchemeUniqueTransactionID retrieved from scheme. - /// - /// SchemeUniqueTransactionID retrieved from scheme. - [DataMember(Name = "schemeUniqueTransactionID", EmitDefaultValue = false)] - public string SchemeUniqueTransactionID { get; set; } - /// /// The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. /// @@ -716,8 +698,6 @@ public override string ToString() sb.Append(" Mutations: ").Append(Mutations).Append("\n"); sb.Append(" OriginalAmount: ").Append(OriginalAmount).Append("\n"); sb.Append(" Reason: ").Append(Reason).Append("\n"); - sb.Append(" SchemeTraceID: ").Append(SchemeTraceID).Append("\n"); - sb.Append(" SchemeUniqueTransactionID: ").Append(SchemeUniqueTransactionID).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" TransactionId: ").Append(TransactionId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -804,16 +784,6 @@ public bool Equals(TransferEvent input) this.Reason == input.Reason || this.Reason.Equals(input.Reason) ) && - ( - this.SchemeTraceID == input.SchemeTraceID || - (this.SchemeTraceID != null && - this.SchemeTraceID.Equals(input.SchemeTraceID)) - ) && - ( - this.SchemeUniqueTransactionID == input.SchemeUniqueTransactionID || - (this.SchemeUniqueTransactionID != null && - this.SchemeUniqueTransactionID.Equals(input.SchemeUniqueTransactionID)) - ) && ( this.Status == input.Status || this.Status.Equals(input.Status) @@ -881,14 +851,6 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.OriginalAmount.GetHashCode(); } hashCode = (hashCode * 59) + this.Reason.GetHashCode(); - if (this.SchemeTraceID != null) - { - hashCode = (hashCode * 59) + this.SchemeTraceID.GetHashCode(); - } - if (this.SchemeUniqueTransactionID != null) - { - hashCode = (hashCode * 59) + this.SchemeUniqueTransactionID.GetHashCode(); - } hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.TransactionId != null) { diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs b/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs new file mode 100644 index 000000000..db16ac37d --- /dev/null +++ b/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs @@ -0,0 +1,184 @@ +/* +* Transfer webhooks +* +* +* The version of the OpenAPI document: 4 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.TransferWebhooks +{ + /// + /// TransferNotificationCounterParty + /// + [DataContract(Name = "TransferNotificationCounterParty")] + public partial class TransferNotificationCounterParty : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id).. + /// bankAccount. + /// merchant. + /// Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).. + public TransferNotificationCounterParty(string balanceAccountId = default(string), BankAccountV3 bankAccount = default(BankAccountV3), TransferNotificationMerchantData merchant = default(TransferNotificationMerchantData), string transferInstrumentId = default(string)) + { + this.BalanceAccountId = balanceAccountId; + this.BankAccount = bankAccount; + this.Merchant = merchant; + this.TransferInstrumentId = transferInstrumentId; + } + + /// + /// Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + /// + /// Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + [DataMember(Name = "balanceAccountId", EmitDefaultValue = false)] + public string BalanceAccountId { get; set; } + + /// + /// Gets or Sets BankAccount + /// + [DataMember(Name = "bankAccount", EmitDefaultValue = false)] + public BankAccountV3 BankAccount { get; set; } + + /// + /// Gets or Sets Merchant + /// + [DataMember(Name = "merchant", EmitDefaultValue = false)] + public TransferNotificationMerchantData Merchant { get; set; } + + /// + /// Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + /// + /// Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] + public string TransferInstrumentId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TransferNotificationCounterParty {\n"); + sb.Append(" BalanceAccountId: ").Append(BalanceAccountId).Append("\n"); + sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); + sb.Append(" Merchant: ").Append(Merchant).Append("\n"); + sb.Append(" TransferInstrumentId: ").Append(TransferInstrumentId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TransferNotificationCounterParty); + } + + /// + /// Returns true if TransferNotificationCounterParty instances are equal + /// + /// Instance of TransferNotificationCounterParty to be compared + /// Boolean + public bool Equals(TransferNotificationCounterParty input) + { + if (input == null) + { + return false; + } + return + ( + this.BalanceAccountId == input.BalanceAccountId || + (this.BalanceAccountId != null && + this.BalanceAccountId.Equals(input.BalanceAccountId)) + ) && + ( + this.BankAccount == input.BankAccount || + (this.BankAccount != null && + this.BankAccount.Equals(input.BankAccount)) + ) && + ( + this.Merchant == input.Merchant || + (this.Merchant != null && + this.Merchant.Equals(input.Merchant)) + ) && + ( + this.TransferInstrumentId == input.TransferInstrumentId || + (this.TransferInstrumentId != null && + this.TransferInstrumentId.Equals(input.TransferInstrumentId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BalanceAccountId != null) + { + hashCode = (hashCode * 59) + this.BalanceAccountId.GetHashCode(); + } + if (this.BankAccount != null) + { + hashCode = (hashCode * 59) + this.BankAccount.GetHashCode(); + } + if (this.Merchant != null) + { + hashCode = (hashCode * 59) + this.Merchant.GetHashCode(); + } + if (this.TransferInstrumentId != null) + { + hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs b/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs new file mode 100644 index 000000000..b147586a4 --- /dev/null +++ b/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs @@ -0,0 +1,243 @@ +/* +* Transfer webhooks +* +* +* The version of the OpenAPI document: 4 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.TransferWebhooks +{ + /// + /// TransferNotificationMerchantData + /// + [DataContract(Name = "TransferNotificationMerchantData")] + public partial class TransferNotificationMerchantData : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the merchant's acquirer.. + /// The city where the merchant is located.. + /// The country where the merchant is located.. + /// The merchant category code.. + /// The merchant identifier.. + /// The name of the merchant's shop or service.. + /// The merchant postal code.. + public TransferNotificationMerchantData(string acquirerId = default(string), string city = default(string), string country = default(string), string mcc = default(string), string merchantId = default(string), string name = default(string), string postalCode = default(string)) + { + this.AcquirerId = acquirerId; + this.City = city; + this.Country = country; + this.Mcc = mcc; + this.MerchantId = merchantId; + this.Name = name; + this.PostalCode = postalCode; + } + + /// + /// The unique identifier of the merchant's acquirer. + /// + /// The unique identifier of the merchant's acquirer. + [DataMember(Name = "acquirerId", EmitDefaultValue = false)] + public string AcquirerId { get; set; } + + /// + /// The city where the merchant is located. + /// + /// The city where the merchant is located. + [DataMember(Name = "city", EmitDefaultValue = false)] + public string City { get; set; } + + /// + /// The country where the merchant is located. + /// + /// The country where the merchant is located. + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country { get; set; } + + /// + /// The merchant category code. + /// + /// The merchant category code. + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } + + /// + /// The merchant identifier. + /// + /// The merchant identifier. + [DataMember(Name = "merchantId", EmitDefaultValue = false)] + public string MerchantId { get; set; } + + /// + /// The name of the merchant's shop or service. + /// + /// The name of the merchant's shop or service. + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// The merchant postal code. + /// + /// The merchant postal code. + [DataMember(Name = "postalCode", EmitDefaultValue = false)] + public string PostalCode { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TransferNotificationMerchantData {\n"); + sb.Append(" AcquirerId: ").Append(AcquirerId).Append("\n"); + sb.Append(" City: ").Append(City).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantId: ").Append(MerchantId).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TransferNotificationMerchantData); + } + + /// + /// Returns true if TransferNotificationMerchantData instances are equal + /// + /// Instance of TransferNotificationMerchantData to be compared + /// Boolean + public bool Equals(TransferNotificationMerchantData input) + { + if (input == null) + { + return false; + } + return + ( + this.AcquirerId == input.AcquirerId || + (this.AcquirerId != null && + this.AcquirerId.Equals(input.AcquirerId)) + ) && + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantId == input.MerchantId || + (this.MerchantId != null && + this.MerchantId.Equals(input.MerchantId)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PostalCode == input.PostalCode || + (this.PostalCode != null && + this.PostalCode.Equals(input.PostalCode)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcquirerId != null) + { + hashCode = (hashCode * 59) + this.AcquirerId.GetHashCode(); + } + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantId != null) + { + hashCode = (hashCode * 59) + this.MerchantId.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PostalCode != null) + { + hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/Transfers/IssuedCard.cs b/Adyen/Model/Transfers/IssuedCard.cs index d110b8298..c29283d6b 100644 --- a/Adyen/Model/Transfers/IssuedCard.cs +++ b/Adyen/Model/Transfers/IssuedCard.cs @@ -179,26 +179,53 @@ public enum TypeEnum /// /// Initializes a new instance of the class. /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation**. /// Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**.. /// Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments.. /// relayedAuthorisationData. + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments.. + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme.. /// **issuedCard** (default to TypeEnum.IssuedCard). /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information.. - public IssuedCard(PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) + public IssuedCard(string authorisationType = default(string), PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), string schemeTraceId = default(string), string schemeUniqueTransactionId = default(string), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) { + this.AuthorisationType = authorisationType; this.PanEntryMode = panEntryMode; this.ProcessingType = processingType; this.RelayedAuthorisationData = relayedAuthorisationData; + this.SchemeTraceId = schemeTraceId; + this.SchemeUniqueTransactionId = schemeUniqueTransactionId; this.Type = type; this.ValidationFacts = validationFacts; } + /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + /// + /// The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + [DataMember(Name = "authorisationType", EmitDefaultValue = false)] + public string AuthorisationType { get; set; } + /// /// Gets or Sets RelayedAuthorisationData /// [DataMember(Name = "relayedAuthorisationData", EmitDefaultValue = false)] public RelayedAuthorisationData RelayedAuthorisationData { get; set; } + /// + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + /// + /// The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + [DataMember(Name = "schemeTraceId", EmitDefaultValue = false)] + public string SchemeTraceId { get; set; } + + /// + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + /// + /// The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + [DataMember(Name = "schemeUniqueTransactionId", EmitDefaultValue = false)] + public string SchemeUniqueTransactionId { get; set; } + /// /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. /// @@ -214,9 +241,12 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class IssuedCard {\n"); + sb.Append(" AuthorisationType: ").Append(AuthorisationType).Append("\n"); sb.Append(" PanEntryMode: ").Append(PanEntryMode).Append("\n"); sb.Append(" ProcessingType: ").Append(ProcessingType).Append("\n"); sb.Append(" RelayedAuthorisationData: ").Append(RelayedAuthorisationData).Append("\n"); + sb.Append(" SchemeTraceId: ").Append(SchemeTraceId).Append("\n"); + sb.Append(" SchemeUniqueTransactionId: ").Append(SchemeUniqueTransactionId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ValidationFacts: ").Append(ValidationFacts).Append("\n"); sb.Append("}\n"); @@ -254,6 +284,11 @@ public bool Equals(IssuedCard input) return false; } return + ( + this.AuthorisationType == input.AuthorisationType || + (this.AuthorisationType != null && + this.AuthorisationType.Equals(input.AuthorisationType)) + ) && ( this.PanEntryMode == input.PanEntryMode || this.PanEntryMode.Equals(input.PanEntryMode) @@ -267,6 +302,16 @@ public bool Equals(IssuedCard input) (this.RelayedAuthorisationData != null && this.RelayedAuthorisationData.Equals(input.RelayedAuthorisationData)) ) && + ( + this.SchemeTraceId == input.SchemeTraceId || + (this.SchemeTraceId != null && + this.SchemeTraceId.Equals(input.SchemeTraceId)) + ) && + ( + this.SchemeUniqueTransactionId == input.SchemeUniqueTransactionId || + (this.SchemeUniqueTransactionId != null && + this.SchemeUniqueTransactionId.Equals(input.SchemeUniqueTransactionId)) + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -288,12 +333,24 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.AuthorisationType != null) + { + hashCode = (hashCode * 59) + this.AuthorisationType.GetHashCode(); + } hashCode = (hashCode * 59) + this.PanEntryMode.GetHashCode(); hashCode = (hashCode * 59) + this.ProcessingType.GetHashCode(); if (this.RelayedAuthorisationData != null) { hashCode = (hashCode * 59) + this.RelayedAuthorisationData.GetHashCode(); } + if (this.SchemeTraceId != null) + { + hashCode = (hashCode * 59) + this.SchemeTraceId.GetHashCode(); + } + if (this.SchemeUniqueTransactionId != null) + { + hashCode = (hashCode * 59) + this.SchemeUniqueTransactionId.GetHashCode(); + } hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ValidationFacts != null) { diff --git a/Adyen/Model/Transfers/PartyIdentification.cs b/Adyen/Model/Transfers/PartyIdentification.cs index 631a19dd9..69c0ee90f 100644 --- a/Adyen/Model/Transfers/PartyIdentification.cs +++ b/Adyen/Model/Transfers/PartyIdentification.cs @@ -264,6 +264,12 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Reference (string) maxLength + if (this.Reference != null && this.Reference.Length > 150) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Reference, length must be less than 150.", new [] { "Reference" }); + } + yield break; } } diff --git a/Adyen/Model/Transfers/RestServiceError.cs b/Adyen/Model/Transfers/RestServiceError.cs index bf7f80378..131f1f8a6 100644 --- a/Adyen/Model/Transfers/RestServiceError.cs +++ b/Adyen/Model/Transfers/RestServiceError.cs @@ -45,7 +45,7 @@ protected RestServiceError() { } /// A unique URI that identifies the specific occurrence of the problem.. /// Detailed explanation of each validation error, when applicable.. /// A unique reference for the request, essentially the same as `pspReference`.. - /// JSON response payload.. + /// response. /// The HTTP status code. (required). /// A short, human-readable summary of the problem type. (required). /// A URI that identifies the problem type, pointing to human-readable documentation on this problem type. (required). @@ -98,9 +98,8 @@ protected RestServiceError() { } public string RequestId { get; set; } /// - /// JSON response payload. + /// Gets or Sets Response /// - /// JSON response payload. [DataMember(Name = "response", EmitDefaultValue = false)] public Object Response { get; set; } diff --git a/Adyen/Model/Transfers/ReturnTransferResponse.cs b/Adyen/Model/Transfers/ReturnTransferResponse.cs index bca0c5697..4d8205390 100644 --- a/Adyen/Model/Transfers/ReturnTransferResponse.cs +++ b/Adyen/Model/Transfers/ReturnTransferResponse.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.Transfers public partial class ReturnTransferResponse : IEquatable, IValidatableObject { /// - /// The resulting status of the return. For example: **authorised**, **booked**, **error**. + /// The resulting status of the return. Possible values: **Authorised**, **Declined**. /// - /// The resulting status of the return. For example: **authorised**, **booked**, **error**. + /// The resulting status of the return. Possible values: **Authorised**, **Declined**. [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { @@ -55,9 +55,9 @@ public enum StatusEnum /// - /// The resulting status of the return. For example: **authorised**, **booked**, **error**. + /// The resulting status of the return. Possible values: **Authorised**, **Declined**. /// - /// The resulting status of the return. For example: **authorised**, **booked**, **error**. + /// The resulting status of the return. Possible values: **Authorised**, **Declined**. [DataMember(Name = "status", EmitDefaultValue = false)] public StatusEnum? Status { get; set; } /// @@ -65,7 +65,7 @@ public enum StatusEnum /// /// The unique identifier of the return.. /// Your internal reference for the return.. - /// The resulting status of the return. For example: **authorised**, **booked**, **error**.. + /// The resulting status of the return. Possible values: **Authorised**, **Declined**.. /// The unique identifier of the original transfer.. public ReturnTransferResponse(string id = default(string), string reference = default(string), StatusEnum? status = default(StatusEnum?), string transferId = default(string)) { diff --git a/Adyen/Model/Transfers/TransferInfo.cs b/Adyen/Model/Transfers/TransferInfo.cs index a1337bec0..dc1dfc484 100644 --- a/Adyen/Model/Transfers/TransferInfo.cs +++ b/Adyen/Model/Transfers/TransferInfo.cs @@ -371,6 +371,12 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Description (string) maxLength + if (this.Description != null && this.Description.Length > 140) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Description, length must be less than 140.", new [] { "Description" }); + } + // Reference (string) maxLength if (this.Reference != null && this.Reference.Length > 80) { diff --git a/Adyen/Model/Transfers/UltimatePartyIdentification.cs b/Adyen/Model/Transfers/UltimatePartyIdentification.cs index c1f4dcabe..64fee7c04 100644 --- a/Adyen/Model/Transfers/UltimatePartyIdentification.cs +++ b/Adyen/Model/Transfers/UltimatePartyIdentification.cs @@ -264,6 +264,12 @@ public override int GetHashCode() /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // Reference (string) maxLength + if (this.Reference != null && this.Reference.Length > 150) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Reference, length must be less than 150.", new [] { "Reference" }); + } + yield break; } } diff --git a/Adyen/Service/Transfers/TransactionsService.cs b/Adyen/Service/Transfers/TransactionsService.cs index fbb17f6b4..d9856add0 100644 --- a/Adyen/Service/Transfers/TransactionsService.cs +++ b/Adyen/Service/Transfers/TransactionsService.cs @@ -58,7 +58,7 @@ public interface ITransactionsService /// /// Get a transaction /// - /// - Unique identifier of the transaction. + /// - The unique identifier of the transaction. /// - Additional request options. /// . Model.Transfers.Transaction GetTransaction(string id, RequestOptions requestOptions = default); @@ -66,7 +66,7 @@ public interface ITransactionsService /// /// Get a transaction /// - /// - Unique identifier of the transaction. + /// - The unique identifier of the transaction. /// - Additional request options. /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. /// Task of . diff --git a/Adyen/Service/Transfers/TransfersService.cs b/Adyen/Service/Transfers/TransfersService.cs index fd29e17b0..f80b91328 100644 --- a/Adyen/Service/Transfers/TransfersService.cs +++ b/Adyen/Service/Transfers/TransfersService.cs @@ -27,21 +27,21 @@ public interface ITransfersService /// /// Return a transfer /// - /// - The unique identifier of the transfer to be returned. + /// - The unique identifier of the transfer to be returned. /// - /// - Additional request options. /// . - Model.Transfers.ReturnTransferResponse ReturnTransfer(string id, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default); + Model.Transfers.ReturnTransferResponse ReturnTransfer(string transferId, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default); /// /// Return a transfer /// - /// - The unique identifier of the transfer to be returned. + /// - The unique identifier of the transfer to be returned. /// - /// - Additional request options. /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. /// Task of . - Task ReturnTransferAsync(string id, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + Task ReturnTransferAsync(string transferId, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); /// /// Transfer funds @@ -74,14 +74,14 @@ public TransfersService(Client client) : base(client) _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } - public Model.Transfers.ReturnTransferResponse ReturnTransfer(string id, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default) + public Model.Transfers.ReturnTransferResponse ReturnTransfer(string transferId, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default) { - return ReturnTransferAsync(id, returnTransferRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + return ReturnTransferAsync(transferId, returnTransferRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - public async Task ReturnTransferAsync(string id, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + public async Task ReturnTransferAsync(string transferId, ReturnTransferRequest returnTransferRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + $"/transfers/{id}/returns"; + var endpoint = _baseUrl + $"/transfers/{transferId}/returns"; var resource = new ServiceResource(this, endpoint); return await resource.RequestAsync(returnTransferRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); }