mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Remove Legacy Status from the code (#5982)
This commit is contained in:
@@ -349,7 +349,24 @@ namespace BTCPayServer.Data
|
||||
if (blob["defaultPaymentMethod"] is not (null or { Type : JTokenType.Null }))
|
||||
blob["defaultPaymentMethod"] = MigrationExtensions.MigratePaymentMethodId(blob["defaultPaymentMethod"].Value<string>());
|
||||
blob.Remove("derivationStrategies");
|
||||
|
||||
Status = Status switch
|
||||
{
|
||||
"new" => "New",
|
||||
"paid" => "Processing",
|
||||
"complete" or "confirmed" => "Settled",
|
||||
"expired" => "Expired",
|
||||
null or "invalid" => "Invalid",
|
||||
_ => throw new NotSupportedException($"Unknown Status for invoice ({Status})")
|
||||
};
|
||||
ExceptionStatus = ExceptionStatus switch
|
||||
{
|
||||
"marked" => "Marked",
|
||||
"paidLate" => "PaidLate",
|
||||
"paidPartial" => "PaidPartial",
|
||||
"paidOver" => "PaidOver",
|
||||
null or "" => "",
|
||||
_ => throw new NotSupportedException($"Unknown ExceptionStatus for invoice ({ExceptionStatus})")
|
||||
};
|
||||
blob["version"] = 3;
|
||||
Blob2 = blob.ToString(Formatting.None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user