mirror of
https://github.com/NecroticBamboo/QRBee.git
synced 2025-12-21 12:11:53 +00:00
Shared library introduced to common data classes.
This commit is contained in:
parent
9c5ed39950
commit
b9ef3f3317
51
QRBee.Core/ClientCardData.cs
Normal file
51
QRBee.Core/ClientCardData.cs
Normal 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}";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
44
QRBee.Core/Data/ClientToMerchantResponse.cs
Normal file
44
QRBee.Core/Data/ClientToMerchantResponse.cs
Normal 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}";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
44
QRBee.Core/Data/MerchantToClientRequest.cs
Normal file
44
QRBee.Core/Data/MerchantToClientRequest.cs
Normal 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}";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
21
QRBee.Core/Data/PaymentRequest.cs
Normal file
21
QRBee.Core/Data/PaymentRequest.cs
Normal 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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
26
QRBee.Core/Data/PaymentResponse.cs
Normal file
26
QRBee.Core/Data/PaymentResponse.cs
Normal 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()}";
|
||||||
|
}
|
||||||
|
}
|
||||||
9
QRBee.Core/QRBee.Core.csproj
Normal file
9
QRBee.Core/QRBee.Core.csproj
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Loading…
x
Reference in New Issue
Block a user