diff --git a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs index 08b9d6588..873ea143b 100644 --- a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs +++ b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs @@ -346,6 +346,18 @@ public CheckoutPaymentMethod(OpenInvoiceDetails actualInstance) this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of PayByBankDetails. + public CheckoutPaymentMethod(PayByBankDetails actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + /// /// Initializes a new instance of the class /// with the class @@ -644,6 +656,10 @@ public override Object ActualInstance { this._actualInstance = value; } + else if (value.GetType() == typeof(PayByBankDetails)) + { + this._actualInstance = value; + } else if (value.GetType() == typeof(PayPalDetails)) { this._actualInstance = value; @@ -706,7 +722,7 @@ public override Object ActualInstance } else { - throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); + throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); } } } @@ -971,6 +987,16 @@ public OpenInvoiceDetails GetOpenInvoiceDetails() return (OpenInvoiceDetails)this.ActualInstance; } + /// + /// Get the actual instance of `PayByBankDetails`. If the actual instance is not `PayByBankDetails`, + /// the InvalidClassException will be thrown + /// + /// An instance of PayByBankDetails + public PayByBankDetails GetPayByBankDetails() + { + return (PayByBankDetails)this.ActualInstance; + } + /// /// Get the actual instance of `PayPalDetails`. If the actual instance is not `PayPalDetails`, /// the InvalidClassException will be thrown @@ -1349,6 +1375,13 @@ public static CheckoutPaymentMethod FromJson(string jsonString) matchedTypes.Add("OpenInvoiceDetails"); match++; } + // Check if the jsonString type enum matches the PayByBankDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayByBankDetails"); + match++; + } // Check if the jsonString type enum matches the PayPalDetails type enums if (ContainsValue(type)) { diff --git a/Adyen/Model/Checkout/PayByBankDetails.cs b/Adyen/Model/Checkout/PayByBankDetails.cs new file mode 100644 index 000000000..b34dca7de --- /dev/null +++ b/Adyen/Model/Checkout/PayByBankDetails.cs @@ -0,0 +1,183 @@ +/* +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* 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.Checkout +{ + /// + /// PayByBankDetails + /// + [DataContract(Name = "PayByBankDetails")] + public partial class PayByBankDetails : IEquatable, IValidatableObject + { + /// + /// **paybybank** + /// + /// **paybybank** + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Paybybank for value: paybybank + /// + [EnumMember(Value = "paybybank")] + Paybybank = 1 + + } + + + /// + /// **paybybank** + /// + /// **paybybank** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PayByBankDetails() { } + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier.. + /// The PayByBank issuer value of the shopper's selected bank.. + /// **paybybank** (required) (default to TypeEnum.Paybybank). + public PayByBankDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.Paybybank) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } + + /// + /// The PayByBank issuer value of the shopper's selected bank. + /// + /// The PayByBank issuer value of the shopper's selected bank. + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { 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 PayByBankDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); + sb.Append(" Issuer: ").Append(Issuer).Append("\n"); + sb.Append(" Type: ").Append(Type).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 PayByBankDetails); + } + + /// + /// Returns true if PayByBankDetails instances are equal + /// + /// Instance of PayByBankDetails to be compared + /// Boolean + public bool Equals(PayByBankDetails input) + { + if (input == null) + { + return false; + } + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.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/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs index 7dcb649bb..e38e7b45c 100644 --- a/Adyen/Model/Checkout/PaymentDetails.cs +++ b/Adyen/Model/Checkout/PaymentDetails.cs @@ -219,371 +219,365 @@ public enum TypeEnum [EnumMember(Value = "molpay_ebanking_VN")] MolpayEbankingVN = 30, - /// - /// Enum Paybybank for value: paybybank - /// - [EnumMember(Value = "paybybank")] - Paybybank = 31, - /// /// Enum EbankingFI for value: ebanking_FI /// [EnumMember(Value = "ebanking_FI")] - EbankingFI = 32, + EbankingFI = 31, /// /// Enum MolpayEbankingMY for value: molpay_ebanking_MY /// [EnumMember(Value = "molpay_ebanking_MY")] - MolpayEbankingMY = 33, + MolpayEbankingMY = 32, /// /// Enum MolpayEbankingDirectMY for value: molpay_ebanking_direct_MY /// [EnumMember(Value = "molpay_ebanking_direct_MY")] - MolpayEbankingDirectMY = 34, + MolpayEbankingDirectMY = 33, /// /// Enum Swish for value: swish /// [EnumMember(Value = "swish")] - Swish = 35, + Swish = 34, /// /// Enum Pix for value: pix /// [EnumMember(Value = "pix")] - Pix = 36, + Pix = 35, /// /// Enum Walley for value: walley /// [EnumMember(Value = "walley")] - Walley = 37, + Walley = 36, /// /// Enum WalleyB2b for value: walley_b2b /// [EnumMember(Value = "walley_b2b")] - WalleyB2b = 38, + WalleyB2b = 37, /// /// Enum Alma for value: alma /// [EnumMember(Value = "alma")] - Alma = 39, + Alma = 38, /// /// Enum Paypo for value: paypo /// [EnumMember(Value = "paypo")] - Paypo = 40, + Paypo = 39, /// /// Enum Scalapay for value: scalapay /// [EnumMember(Value = "scalapay")] - Scalapay = 41, + Scalapay = 40, /// /// Enum Scalapay3x for value: scalapay_3x /// [EnumMember(Value = "scalapay_3x")] - Scalapay3x = 42, + Scalapay3x = 41, /// /// Enum Scalapay4x for value: scalapay_4x /// [EnumMember(Value = "scalapay_4x")] - Scalapay4x = 43, + Scalapay4x = 42, /// /// Enum MolpayFpx for value: molpay_fpx /// [EnumMember(Value = "molpay_fpx")] - MolpayFpx = 44, + MolpayFpx = 43, /// /// Enum Konbini for value: konbini /// [EnumMember(Value = "konbini")] - Konbini = 45, + Konbini = 44, /// /// Enum DirectEbanking for value: directEbanking /// [EnumMember(Value = "directEbanking")] - DirectEbanking = 46, + DirectEbanking = 45, /// /// Enum Boletobancario for value: boletobancario /// [EnumMember(Value = "boletobancario")] - Boletobancario = 47, + Boletobancario = 46, /// /// Enum Neteller for value: neteller /// [EnumMember(Value = "neteller")] - Neteller = 48, + Neteller = 47, /// /// Enum Paysafecard for value: paysafecard /// [EnumMember(Value = "paysafecard")] - Paysafecard = 49, + Paysafecard = 48, /// /// Enum Cashticket for value: cashticket /// [EnumMember(Value = "cashticket")] - Cashticket = 50, + Cashticket = 49, /// /// Enum Ikano for value: ikano /// [EnumMember(Value = "ikano")] - Ikano = 51, + Ikano = 50, /// /// Enum Karenmillen for value: karenmillen /// [EnumMember(Value = "karenmillen")] - Karenmillen = 52, + Karenmillen = 51, /// /// Enum Oasis for value: oasis /// [EnumMember(Value = "oasis")] - Oasis = 53, + Oasis = 52, /// /// Enum Warehouse for value: warehouse /// [EnumMember(Value = "warehouse")] - Warehouse = 54, + Warehouse = 53, /// /// Enum PrimeiropayBoleto for value: primeiropay_boleto /// [EnumMember(Value = "primeiropay_boleto")] - PrimeiropayBoleto = 55, + PrimeiropayBoleto = 54, /// /// Enum Mada for value: mada /// [EnumMember(Value = "mada")] - Mada = 56, + Mada = 55, /// /// Enum Benefit for value: benefit /// [EnumMember(Value = "benefit")] - Benefit = 57, + Benefit = 56, /// /// Enum Knet for value: knet /// [EnumMember(Value = "knet")] - Knet = 58, + Knet = 57, /// /// Enum Omannet for value: omannet /// [EnumMember(Value = "omannet")] - Omannet = 59, + Omannet = 58, /// /// Enum GopayWallet for value: gopay_wallet /// [EnumMember(Value = "gopay_wallet")] - GopayWallet = 60, + GopayWallet = 59, /// /// Enum KcpNaverpay for value: kcp_naverpay /// [EnumMember(Value = "kcp_naverpay")] - KcpNaverpay = 61, + KcpNaverpay = 60, /// /// Enum OnlinebankingIN for value: onlinebanking_IN /// [EnumMember(Value = "onlinebanking_IN")] - OnlinebankingIN = 62, + OnlinebankingIN = 61, /// /// Enum Fawry for value: fawry /// [EnumMember(Value = "fawry")] - Fawry = 63, + Fawry = 62, /// /// Enum Atome for value: atome /// [EnumMember(Value = "atome")] - Atome = 64, + Atome = 63, /// /// Enum Moneybookers for value: moneybookers /// [EnumMember(Value = "moneybookers")] - Moneybookers = 65, + Moneybookers = 64, /// /// Enum Naps for value: naps /// [EnumMember(Value = "naps")] - Naps = 66, + Naps = 65, /// /// Enum Nordea for value: nordea /// [EnumMember(Value = "nordea")] - Nordea = 67, + Nordea = 66, /// /// Enum BoletobancarioBradesco for value: boletobancario_bradesco /// [EnumMember(Value = "boletobancario_bradesco")] - BoletobancarioBradesco = 68, + BoletobancarioBradesco = 67, /// /// Enum BoletobancarioItau for value: boletobancario_itau /// [EnumMember(Value = "boletobancario_itau")] - BoletobancarioItau = 69, + BoletobancarioItau = 68, /// /// Enum BoletobancarioSantander for value: boletobancario_santander /// [EnumMember(Value = "boletobancario_santander")] - BoletobancarioSantander = 70, + BoletobancarioSantander = 69, /// /// Enum BoletobancarioBancodobrasil for value: boletobancario_bancodobrasil /// [EnumMember(Value = "boletobancario_bancodobrasil")] - BoletobancarioBancodobrasil = 71, + BoletobancarioBancodobrasil = 70, /// /// Enum BoletobancarioHsbc for value: boletobancario_hsbc /// [EnumMember(Value = "boletobancario_hsbc")] - BoletobancarioHsbc = 72, + BoletobancarioHsbc = 71, /// /// Enum MolpayMaybank2u for value: molpay_maybank2u /// [EnumMember(Value = "molpay_maybank2u")] - MolpayMaybank2u = 73, + MolpayMaybank2u = 72, /// /// Enum MolpayCimb for value: molpay_cimb /// [EnumMember(Value = "molpay_cimb")] - MolpayCimb = 74, + MolpayCimb = 73, /// /// Enum MolpayRhb for value: molpay_rhb /// [EnumMember(Value = "molpay_rhb")] - MolpayRhb = 75, + MolpayRhb = 74, /// /// Enum MolpayAmb for value: molpay_amb /// [EnumMember(Value = "molpay_amb")] - MolpayAmb = 76, + MolpayAmb = 75, /// /// Enum MolpayHlb for value: molpay_hlb /// [EnumMember(Value = "molpay_hlb")] - MolpayHlb = 77, + MolpayHlb = 76, /// /// Enum MolpayAffinEpg for value: molpay_affin_epg /// [EnumMember(Value = "molpay_affin_epg")] - MolpayAffinEpg = 78, + MolpayAffinEpg = 77, /// /// Enum MolpayBankislam for value: molpay_bankislam /// [EnumMember(Value = "molpay_bankislam")] - MolpayBankislam = 79, + MolpayBankislam = 78, /// /// Enum MolpayPublicbank for value: molpay_publicbank /// [EnumMember(Value = "molpay_publicbank")] - MolpayPublicbank = 80, + MolpayPublicbank = 79, /// /// Enum FpxAgrobank for value: fpx_agrobank /// [EnumMember(Value = "fpx_agrobank")] - FpxAgrobank = 81, + FpxAgrobank = 80, /// /// Enum Touchngo for value: touchngo /// [EnumMember(Value = "touchngo")] - Touchngo = 82, + Touchngo = 81, /// /// Enum Maybank2uMae for value: maybank2u_mae /// [EnumMember(Value = "maybank2u_mae")] - Maybank2uMae = 83, + Maybank2uMae = 82, /// /// Enum Duitnow for value: duitnow /// [EnumMember(Value = "duitnow")] - Duitnow = 84, + Duitnow = 83, /// /// Enum Promptpay for value: promptpay /// [EnumMember(Value = "promptpay")] - Promptpay = 85, + Promptpay = 84, /// /// Enum TwintPos for value: twint_pos /// [EnumMember(Value = "twint_pos")] - TwintPos = 86, + TwintPos = 85, /// /// Enum AlipayHk for value: alipay_hk /// [EnumMember(Value = "alipay_hk")] - AlipayHk = 87, + AlipayHk = 86, /// /// Enum AlipayHkWeb for value: alipay_hk_web /// [EnumMember(Value = "alipay_hk_web")] - AlipayHkWeb = 88, + AlipayHkWeb = 87, /// /// Enum AlipayHkWap for value: alipay_hk_wap /// [EnumMember(Value = "alipay_hk_wap")] - AlipayHkWap = 89, + AlipayHkWap = 88, /// /// Enum AlipayWap for value: alipay_wap /// [EnumMember(Value = "alipay_wap")] - AlipayWap = 90, + AlipayWap = 89, /// /// Enum Balanceplatform for value: balanceplatform /// [EnumMember(Value = "balanceplatform")] - Balanceplatform = 91 + Balanceplatform = 90 }