Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using EMS.Processor.Processor.Data;
- using EMS.Processor.Database;
- using MongoDB.Bson.Serialization.Attributes;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using EMS.Processor.RPC.Data;
- namespace EMS.Processor.IDatabase
- {
- public interface ITransaction
- {
- /// <summary>
- /// Acquirer Reference Number. This uniquely identifies a transaction
- /// Transaction Id
- /// </summary>
- string TransactionId { get; set; }
- string ProcessorClusterId { get; set; }
- string ARN { get; }
- string RRN { get; set; }
- string ParentTransactionId { get; set; }
- string InvoiceNumber { get; set; }
- uint? BatchNumber { get; set; }
- MessageTransactionType TransactionType { get; set; }
- string STAN { get; set; }
- TransactionSourceType SourceType { get; set; }
- string Source { get; set; }
- EcommerceRequest EcommerceRequest { get; set; }
- PreAuthInfo PreAuthInfo { get; set; }
- long Amount { get; set; }
- ushort CurrencyCode { get; set; }
- DateTime TransactionDateTime { get; set; }
- TransactionVendorOptions Vendor { get; set; }
- Cardholder Cardholder { get; set; }
- TransactionLifeCycle LifeCycle { get; set; }
- TransactionStatus Status { get; set; }
- List<StatusUpdate> StatusHistory { get; set; }
- BinaryISOResponse ISOBinaryResponse { get; set; }
- CardSchemeMessageProperties CardSchemeRequestMessage { get; set; }
- string AuthorizationPlatformId { get; set; }
- string AuthorizationIdentificationResponse { get; set; }
- bool isPendingClearing { get; }
- string ExceptionMessage { get; set; }
- List<string> PartialReversals { get; set; }
- PINEntryType PINType { get; set; }
- /// <summary>
- /// Indicates which key from HSM is used to encrypt transaction data
- /// </summary>
- string DatabaseEncryptionKey { get; set; }
- DCCRequest DCC { get; set; }
- }
- /* TRANSACTION LIFECYCLE - STATUS EXPLAINED
- *
- * AuthorizationMessage:
- * - NotApproved
- * - POSPendingSettlement
- * - PendingPostAuthorization
- * - Captured
- * - Reversed
- *
- * FirstPresentment:
- * - ProcessForClearing
- * - SubmittedForClearing
- * - Captured
- * - Chargeback
- * - FileRetrieval
- * - ChargebackAccepted
- *
- * SecondPresentment:
- * - ProcessForClearing
- * - SubmittedForClearing
- * - Captured
- * - ArbitrationChargeback
- *
- */
- [Flags]
- public enum TransactionLifeCycle : int
- {
- [Description("Transaction at initial stage, auth message before going for clearing")]
- AuthorizationMessage = 1,
- [Description("First presentment lifecycle state")]
- FirstPresentment = 2,
- [Description("Second presentment lifecycle state")]
- SecondPresentment = 4,
- [Description("Transaction failed, due to an exception")]
- Exception = 8
- }
- [Flags]
- public enum TransactionStatus : int
- {
- [Description("Transaction was not approved, transaction rejected by auth response")]
- NotApproved = 1,
- [Description("Transaction is still pending waiting to be settled and then go for clearing. This status is only valid for POS transaction")]
- POSPendingSettlement = 2,
- [Description("Pre-authorization is pending post-authorization to be marked for clearing")]
- PendingPostAuthorization = 4,
- [Description("Transaction captured, cleared")]
- Captured = 8,
- [Description("Transaction reversed, void")]
- Reversed = 16,
- [Description("Transaction can be processed for clearing")]
- ProcessForClearing = 32,
- [Description("Submitted for clearing")]
- SubmittedForClearing = 64,
- [Description("Transaction earmarked as charge back")]
- Chargeback = 128,
- [Description("Chargeback accepted by merchant")]
- ChargebackAccepted = 256,
- [Description("Transaction decided by arbitration by authorization platform in favor of cardholder")]
- Arbitration = 512,
- [Description("File retrieval requested before issuing a chargeback")]
- FileRetrieval = 1024,
- [Description("MasterCard Advice message for Post auth was not approved")]
- PostAuthNotApproved = 2048,
- [Description("Transaction processing failed during Clearing cycle")]
- FailedDuringClearing = 4096,
- [Description("Transaction has been set as Represented")]
- ChargebackRepresented = 8192
- }
- public class BinaryISOResponse
- {
- [BsonIgnoreIfNull]
- public byte[] binaryMessage { get; set; }
- [BsonIgnoreIfDefault]
- public string ResponseCode { get; set; }
- }
- public class StatusUpdate
- {
- [BsonIgnoreIfNull]
- public TransactionStatus? Status { get; set; }
- [BsonIgnoreIfNull]
- public TransactionLifeCycle? LifeCycle { get; set; }
- public DateTime When { get; set; }
- }
- public class CardSchemeMessageProperties
- {
- [BsonIgnoreIfNull]
- public AdditionalPOSInformation AdditionalPosInformation { get; set; }
- [BsonIgnoreIfNull]
- public Processor.Data.POSEntryMode POSEntryMode { get; set; }
- [BsonIgnoreIfNull]
- public POSData POSData { get; set; }
- [BsonIgnoreIfNull]
- public POSDataCode POSDataCode { get; set; }
- [BsonIgnoreIfDefault]
- public string POSPINCaptureCode { get; set; }
- public ProcessingCode ProcessingCode { get; set; }
- }
- public class InvalidTransactionException : Exception
- {
- public InvalidTransactionException(string message)
- : base(message)
- {
- }
- }
- public class InvalidParentSaleTransactionException : InvalidTransactionException
- {
- public InvalidParentSaleTransactionException(string message) : base (message)
- {
- }
- }
- public class POSParentAlreadyCapturedException : InvalidTransactionException
- {
- public POSParentAlreadyCapturedException(string message)
- : base(message)
- {
- }
- }
- public class CreditParentTransactionNotCapturedException : InvalidTransactionException
- {
- public CreditParentTransactionNotCapturedException(string message)
- : base(message)
- {
- }
- }
- public class PartialCreditParentTransactionNotCapturedException : CreditParentTransactionNotCapturedException
- {
- public PartialCreditParentTransactionNotCapturedException(string message) : base(message)
- {
- }
- }
- public class InvalidFetchTransactionException : InvalidTransactionException
- {
- public InvalidFetchTransactionException(string message, string transactionId)
- : base(message)
- {
- TransactionId = transactionId;
- }
- public InvalidFetchTransactionException(string message) : base(message)
- {
- TransactionId = string.Empty;
- }
- public string TransactionId { get; set; }
- }
- public class PreAuthInfo
- {
- public bool isPreAuthPosted { get; set; }
- public long originalPreAuthAmount { get; set; }
- public DateTime TransactionDateTime { get; set; }
- }
- /// <summary>
- /// Inicates type of PIN whether Online, Offline or not available
- /// </summary>
- public enum PINEntryType
- {
- NotAvailable = 0, Online = 1, Offline = 2
- }
- }
Add Comment
Please, Sign In to add comment