🐛 Fix afdian webhook

This commit is contained in:
LittleSheep 2025-06-23 02:31:22 +08:00
parent 9444913b72
commit c338512c16

View File

@ -100,11 +100,11 @@ public class SubscriptionService(
switch (provider) switch (provider)
{ {
case "afdian": case "afdian":
var afdianPlans = cfgSection.GetValue<Dictionary<string, string>>("Afdian"); // Get the Afdian section first, then bind it to a dictionary
var afdianPlans = cfgSection.GetSection("Afdian").Get<Dictionary<string, string>>();
logger.LogInformation("Afdian plans configuration: {Plans}", JsonSerializer.Serialize(afdianPlans)); logger.LogInformation("Afdian plans configuration: {Plans}", JsonSerializer.Serialize(afdianPlans));
if (afdianPlans != null && afdianPlans.TryGetValue(subscriptionIdentifier, out var planName)) if (afdianPlans != null && afdianPlans.TryGetValue(subscriptionIdentifier, out var planName))
subscriptionIdentifier = planName; subscriptionIdentifier = planName;
currency = "cny"; currency = "cny";
break; break;
} }