Adyen .net API Library v32.1.3
What's Changed
We've significantly improved how the Adyen .NET library handles enum values to ensure your applications remain stable when we add new enum values to our APIs.
Technical Implementation
- Null Return Strategy: Unknown enum values now return
nullinstead of throwing exceptions
Forward Compatibility
Before this release, if the API returned an enum value your SDK didn't recognize, your application would crash with a JsonSerializationException. Now:
- ✅ Unknown values →
null(application continues running) - ✅ Known values → Proper enum (existing behavior preserved)
- ✅ Null values →
null
📝 Example Scenario
// API returns new enum value "NewPaymentMethod" that your SDK version doesn't know about
var json = @"{ ""paymentMethod"": { ""type"": ""NewPaymentMethod"" } }";
// Before v32.1.3: Would throw JsonSerializationException
// After v32.1.3: Returns null, application continues
var paymentRequest = JsonOperation.Deserialize<PaymentRequest>(json);
// paymentRequest.PaymentMethod.Type will be null🔍 What This Means for You
- No Breaking Changes: Existing code continues to work unchanged
- Resilient Applications: Your apps won't crash when we add new payment methods, risk profiles, or other enum values
- Graceful Degradation: You can check for
nullvalues and implement fallback logic - Future-Proof: Upgrade to newer API versions without immediate SDK updates
💡 Best Practice
When working with nullable enum properties, add null checks:
if (paymentRequest.Channel != null)
{
// Process known channel
ProcessChannel(paymentRequest.Channel.Value);
}
else
{
// Handle unknown or null channel
LogUnknownChannel();
}This enhancement ensures your integration remains stable as we continuously expand our API capabilities.
Other Changes 🖇️
- feat: handle unknown enum values gracefully by @galesky-a in #1235
- [Patch 32.1.3] Code generation: update services and models by @AdyenAutomationBot in #1248
- Release v32.1.3 by @galesky-a in #1268
Full Changelog: v32.1.2...v32.1.3