Shared library introduced to common data classes.

This commit is contained in:
Andrey Shabarshov 2021-12-15 14:38:44 +00:00
parent 9c5ed39950
commit b9ef3f3317
6 changed files with 195 additions and 0 deletions

View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Core
{
public class ClientCardData
{
public string CardNumber
{
get;
init;
}
public string ExpirationDateMMYY
{
get;
init;
}
public string? ValidFrom
{
get;
set;
}
public string CardHolderName
{
get;
init;
}
public string CVC
{
get;
init;
}
public int? IssueNo
{
get;
set;
}
public string AsString() => $"{CardNumber}|{ExpirationDateMMYY}|{ValidFrom}|{CardHolderName}|{CVC}|{IssueNo}";
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Core.Data
{
public record ClientToMerchantResponse
{
public MerchantToClientRequest Request
{
get;
init;
}
public string ClientId
{
get;
init;
}
public DateTime TimeStampUTC
{
get;
init;
}
public string? ClientSignature
{
get;
set;
}
public string EncryptedClientCardData
{
get;
init;
}
public string AsString() => $"{Request.AsString()}|{ClientId}|{TimeStampUTC:O}";
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Core.Data
{
public record MerchantToClientRequest
{
public string TransactionId
{
get;
init;
}
public string Name
{
get;
init;
}
public decimal Amount
{
get;
init;
}
public DateTime TimeStampUTC
{
get;
init;
}
public string? MerchantSignature
{
get;
set;
}
public string AsString() => $"{TransactionId}|{Name}|{Amount:0.00}|{TimeStampUTC:O}";
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Core.Data
{
public record PaymentRequest
{
public ClientToMerchantResponse Request
{
get;
init;
}
public string AsString() => Request.AsString();
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Core.Data
{
public record PaymentResponse
{
public string ServerTransactionId
{
get;
init;
}
public PaymentRequest PaymentRequest
{
get;
init;
}
public string AsString() => $"{ServerTransactionId}|{PaymentRequest.AsString()}";
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>