24 lines
842 B
C#
24 lines
842 B
C#
using AMREZ.EOP.Application.UseCases.Payments.SlipVerification.QrDecode;
|
|
using SkiaSharp;
|
|
|
|
namespace AMREZ.EOP.Application.UseCases.Payments.SlipVerification.BankDetect;
|
|
|
|
public static class ParserBankDetect
|
|
{
|
|
public static string? FromQrText(string? raw)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(raw)) return null;
|
|
|
|
var id = TransRefParser.TryExtract(raw);
|
|
if (string.IsNullOrEmpty(id)) return null;
|
|
|
|
// เคสสลิป SCB มักขึ้นต้น "20..." (ปี+วันเวลา) → เดาว่า 014
|
|
if (id.StartsWith("20")) return "014";
|
|
|
|
// KBank มักเป็นตัวเลขยาวตามด้วยอักษร (เช่น 015275114427ATF02456) → เดา 004
|
|
if (id.Any(char.IsLetter)) return "004";
|
|
|
|
return null;
|
|
}
|
|
}
|