using System.Threading; using System.Threading.Tasks; namespace Darkmatter.Fonepay { /// /// Public facade. Auto-loads config + secrets via . /// Caller never touches credentials. /// public sealed class FonepayClient { private readonly FonepayApiClient _api; public FonepayClient() : this(FonepayConfig.Load()) { } public FonepayClient(FonepayConfigSO config) { var signer = new HmacSha512Signer(config.GetSecretKey()); _api = new FonepayApiClient(config, signer); } /// /// Request a new QR code. The returned URL is valid for 15 minutes. Call GetStatusAsync() to check if the QR code has been paid. /// /// /// /// public Task PostQRAsync(QrRequest req, CancellationToken ct = default) => _api.PostQRAsync(req, ct); /// /// Check if a QR code has been paid. Call after PostQRAsync() to check if the QR code has been paid. Returns "PAID" if successful, "UNPAID" if not yet paid, or an error message if the PRN is invalid or expired. /// /// /// /// public Task GetStatusAsync(string prn, CancellationToken ct = default) => _api.GetStatusAsync(prn, ct); /// /// Request a tax refund. Returns "REFUND_SUCCESS" if successful, or an error message if the PRN is invalid, expired, or not eligible for refund. /// /// /// /// public Task PostTaxRefundAsync(TaxRefundRequest req, CancellationToken ct = default) => _api.PostTaxRefundAsync(req, ct); } }