mirror of
https://github.com/NecroticBamboo/QRBee.git
synced 2025-12-21 12:11:53 +00:00
31 lines
795 B
C#
31 lines
795 B
C#
namespace QRBee.Core.Data
|
|
{
|
|
public record PaymentRequest
|
|
{
|
|
|
|
public ClientToMerchantResponse ClientResponse
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Convert PaymentRequest to string
|
|
/// </summary>
|
|
/// <returns>Converted string</returns>
|
|
public string AsString() => ClientResponse.AsQRCodeString();
|
|
|
|
public static PaymentRequest FromString(string input)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(input))
|
|
{
|
|
throw new ApplicationException("The input is wrong!");
|
|
}
|
|
|
|
//doesn't work
|
|
var response = ClientToMerchantResponse.FromString(input);
|
|
return new PaymentRequest(){ClientResponse = response};
|
|
}
|
|
}
|
|
}
|