@@ -454,6 +454,18 @@ public CheckoutPaymentMethod(PaymentDetails actualInstance)
454
454
this . ActualInstance = actualInstance ?? throw new ArgumentException ( "Invalid instance found. Must not be null." ) ;
455
455
}
456
456
457
+ /// <summary>
458
+ /// Initializes a new instance of the <see cref="CheckoutPaymentMethod" /> class
459
+ /// with the <see cref="PseDetails" /> class
460
+ /// </summary>
461
+ /// <param name="actualInstance">An instance of PseDetails.</param>
462
+ public CheckoutPaymentMethod ( PseDetails actualInstance )
463
+ {
464
+ this . IsNullable = false ;
465
+ this . SchemaType = "oneOf" ;
466
+ this . ActualInstance = actualInstance ?? throw new ArgumentException ( "Invalid instance found. Must not be null." ) ;
467
+ }
468
+
457
469
/// <summary>
458
470
/// Initializes a new instance of the <see cref="CheckoutPaymentMethod" /> class
459
471
/// with the <see cref="RatepayDetails" /> class
@@ -764,6 +776,10 @@ public override Object ActualInstance
764
776
{
765
777
this . _actualInstance = value ;
766
778
}
779
+ else if ( value . GetType ( ) == typeof ( PseDetails ) )
780
+ {
781
+ this . _actualInstance = value ;
782
+ }
767
783
else if ( value . GetType ( ) == typeof ( RatepayDetails ) )
768
784
{
769
785
this . _actualInstance = value ;
@@ -818,7 +834,7 @@ public override Object ActualInstance
818
834
}
819
835
else
820
836
{
821
- 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, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails" ) ;
837
+ 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, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PseDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails" ) ;
822
838
}
823
839
}
824
840
}
@@ -1173,6 +1189,16 @@ public PaymentDetails GetPaymentDetails()
1173
1189
return ( PaymentDetails ) this . ActualInstance ;
1174
1190
}
1175
1191
1192
+ /// <summary>
1193
+ /// Get the actual instance of `PseDetails`. If the actual instance is not `PseDetails`,
1194
+ /// the InvalidClassException will be thrown
1195
+ /// </summary>
1196
+ /// <returns>An instance of PseDetails</returns>
1197
+ public PseDetails GetPseDetails ( )
1198
+ {
1199
+ return ( PseDetails ) this . ActualInstance ;
1200
+ }
1201
+
1176
1202
/// <summary>
1177
1203
/// Get the actual instance of `RatepayDetails`. If the actual instance is not `RatepayDetails`,
1178
1204
/// the InvalidClassException will be thrown
@@ -1594,6 +1620,13 @@ public static CheckoutPaymentMethod FromJson(string jsonString)
1594
1620
matchedTypes . Add ( "PaymentDetails" ) ;
1595
1621
match ++ ;
1596
1622
}
1623
+ // Check if the jsonString type enum matches the PseDetails type enums
1624
+ if ( ContainsValue < PseDetails . TypeEnum > ( type ) )
1625
+ {
1626
+ newCheckoutPaymentMethod = new CheckoutPaymentMethod ( JsonConvert . DeserializeObject < PseDetails > ( jsonString , CheckoutPaymentMethod . SerializerSettings ) ) ;
1627
+ matchedTypes . Add ( "PseDetails" ) ;
1628
+ match ++ ;
1629
+ }
1597
1630
// Check if the jsonString type enum matches the RatepayDetails type enums
1598
1631
if ( ContainsValue < RatepayDetails . TypeEnum > ( type ) )
1599
1632
{
0 commit comments