diff --git a/QRBee.Core/ClientCardData.cs b/QRBee.Core/ClientCardData.cs new file mode 100644 index 0000000..f5c180e --- /dev/null +++ b/QRBee.Core/ClientCardData.cs @@ -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}"; + + } +} diff --git a/QRBee.Core/Data/ClientToMerchantResponse.cs b/QRBee.Core/Data/ClientToMerchantResponse.cs new file mode 100644 index 0000000..64e762b --- /dev/null +++ b/QRBee.Core/Data/ClientToMerchantResponse.cs @@ -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}"; + + } +} diff --git a/QRBee.Core/Data/MerchantToClientRequest.cs b/QRBee.Core/Data/MerchantToClientRequest.cs new file mode 100644 index 0000000..8176107 --- /dev/null +++ b/QRBee.Core/Data/MerchantToClientRequest.cs @@ -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}"; + + } +} diff --git a/QRBee.Core/Data/PaymentRequest.cs b/QRBee.Core/Data/PaymentRequest.cs new file mode 100644 index 0000000..10a5f40 --- /dev/null +++ b/QRBee.Core/Data/PaymentRequest.cs @@ -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(); + + } +} diff --git a/QRBee.Core/Data/PaymentResponse.cs b/QRBee.Core/Data/PaymentResponse.cs new file mode 100644 index 0000000..1f53944 --- /dev/null +++ b/QRBee.Core/Data/PaymentResponse.cs @@ -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()}"; + } +} diff --git a/QRBee.Core/QRBee.Core.csproj b/QRBee.Core/QRBee.Core.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/QRBee.Core/QRBee.Core.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + +