Adyen .NET API Library v33.0.1
What's Changed
We've restricted the System.Net.Http package reference to net462 and netstandard2.0 only, avoiding unnecessary/incorrect dependency application on other target frameworks.
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.
This same implementation was released recently for the previous minor v32.1.3 so this release brings parity to the 33.0.x branch.
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();
}What's Changed
Fixes ⛑️
- fix: restrict System.Net.Http NuGet reference to net462 and netstanda… by @gcatanese in #1426
Other Changes 🖇️
- [Patch 33.0.1] feat: make enum deserialization safe and standardize nullable enum models by @galesky-a in #1425
- chore: release 33.0.1 by @galesky-a in #1430
Full Changelog: v33.0.0...v33.0.1