26 lines
951 B
C#
26 lines
951 B
C#
using AMREZ.EOP.Abstractions.Applications.UseCases.Payments.SlipVerification.BankDetect;
|
|
using AMREZ.EOP.Application.UseCases.Payments.SlipVerification.QrDecode;
|
|
using SkiaSharp;
|
|
|
|
namespace AMREZ.EOP.Application.UseCases.Payments.SlipVerification.BankDetect;
|
|
|
|
public static class BankDetect
|
|
{
|
|
// SCB=014, KBank=004
|
|
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;
|
|
}
|
|
}
|