Advertisement
Kikku80

Untitled

Aug 14th, 2019
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 11.95 KB | None | 0 0
  1. using MongoDB.Bson.Serialization.Attributes;
  2. using System;
  3. using MongoDB.Bson;
  4.  
  5. namespace EMS.Processor.RPC.Data
  6. {
  7.     /// <summary>
  8.     /// Request message used to initiate a request via the IPC named pipe channel
  9.     /// </summary>
  10.     public class TransactionRequest : ITransactionRequest, EMS.Broker.Messages.Core.Interfaces.IRequestMessage
  11.     {
  12.         #region RPC Request Message Interface
  13.                        
  14.         /// <summary>
  15.         /// Message Caller
  16.         /// </summary>
  17.         public string Caller { get; set; }
  18.  
  19.         /// <summary>
  20.         /// Message Broker unique identifier
  21.         /// </summary>
  22.         [BsonId]
  23.         public Guid CorrelationId { get; set; }
  24.  
  25.         #endregion
  26.  
  27.         /// <summary>
  28.         /// Caller's source
  29.         /// </summary>
  30.         public TransactionSourceType Source { get; set; }
  31.  
  32.         /// <summary>
  33.         /// Gets or sets the transaction type, Sales, Credit etc.
  34.         /// </summary>
  35.         public MessageTransactionType TransactionType { get; set; }
  36.  
  37.         /// <summary>
  38.         /// Gets or sets the Acquirer Vendor ID, which is used to push notifications to ACQ 2.0 (Phase 1)
  39.         /// </summary>
  40.         public string AcquirerVendorId { get; set; }
  41.        
  42.         /// <summary>
  43.         /// Gets or sets the Card Acceptor profile to use for the current merchant account
  44.         /// </summary>
  45.         public string CardAcceptorId { get; set; }
  46.  
  47.         /// <summary>
  48.         /// Gets or sets Card Number
  49.         /// </summary>
  50.         public string CardNumber { get; set; }
  51.  
  52.         /// <summary>
  53.         /// Gets or sets Amount of Purchase
  54.         /// </summary>
  55.         public string Amount { get; set; }
  56.        
  57.         /// <summary>
  58.         /// Amount to be Adjusted. Used when sending Partial Reversal Sales
  59.         /// </summary>
  60.         public string AdjustedAmount { get; set; }
  61.  
  62.         /// <summary>
  63.         /// Gets or sets Currency code in ISO 4217 numeric format
  64.         /// </summary>
  65.         public ushort CurrencyCode { get; set; }
  66.  
  67.         /// <summary>
  68.         /// Gets or sets Date when transaction was processed
  69.         /// </summary>
  70.         public DateTime TransactionDate { get; set; }
  71.  
  72.         /// <summary>
  73.         /// Gets or sets Card Expiry Date
  74.         /// </summary>
  75.         public DateTime? ExpiryDate { get; set; }
  76.        
  77.         /// <summary>
  78.         /// Gets or sets Parent transaction Id. Not required by all transactions.
  79.         /// </summary>
  80.         public string ParentTransactionId { get; set; }
  81.  
  82.         /// <summary>
  83.         /// Gets or sets POS Request data
  84.         /// </summary>
  85.         public POSRequest POSRequest { get; set; }
  86.  
  87.         /// <summary>
  88.         /// Gets or sets Fields related to Ecommerce request
  89.         /// </summary>
  90.         public EcommerceRequest EcommerceRequest { get; set; }
  91.  
  92.         /// <summary>
  93.         /// Gets or sets IP Address of the caller, invoking the Web API, or POS Listener
  94.         /// </summary>
  95.         public string CallerIPAddress { get; set; }
  96.  
  97.         /// <summary>
  98.         /// DCC related details, whether to get a DCC quotation for a particular currency or proceed with a previously quoted DCC amount
  99.         /// </summary>
  100.         public DCCRequest DCC { get; set; }
  101.     }
  102.  
  103.     /// <summary>
  104.     /// POS Request class.
  105.     /// </summary>
  106.     public class POSRequest : IPOSRequest
  107.     {
  108.        
  109.         /// <summary>
  110.         /// Gets or sets Card Sequence Number
  111.         /// </summary>
  112.         [BsonIgnore]
  113.         public string CardSequenceNumber { get; set; }
  114.  
  115.         /// <summary>
  116.         /// Gets or sets Processing Code
  117.         /// </summary>
  118.         public string ProcessingCode { get; set; }
  119.  
  120.         /// <summary>
  121.         /// Gets or sets PIN Block
  122.         /// </summary>
  123.         [BsonIgnore]
  124.         public byte[] PINBlock { get; set; }
  125.  
  126.         /// <summary>
  127.         /// Gets or sets ICC Related Data
  128.         /// </summary>
  129.         [BsonIgnoreIfDefault]
  130.         public byte[] ICCRelatedData { get; set; }
  131.  
  132.         /// <summary>
  133.         /// Gets or sets Invoice Number
  134.         /// </summary>
  135.         [BsonIgnoreIfDefault]
  136.         public string InvoiceNumber { get; set; }
  137.  
  138.         /// <summary>
  139.         /// Gets or sets Batch Number
  140.         /// </summary>
  141.         public string BatchNumber { get; set; }
  142.  
  143.         /// <summary>
  144.         /// Gets or sets Cashback amount, or null if not used
  145.         /// </summary>
  146.         public long? CashbackAmount { get; set; }
  147.  
  148.         /// <summary>
  149.         /// Gets or sets Card Acceptor Terminal ID which uniquely identifies a terminal at the card acceptor location of acquiring institutions or merchant POS systems.
  150.         /// </summary>
  151.         public string TerminalID { get; set; }
  152.  
  153.         /// <summary>
  154.         /// Gets or sets POS Entry mode
  155.         /// </summary>
  156.         public POSEntryMode POSEntryMode { get; set; }
  157.  
  158.         /// <summary>
  159.         /// Gets or sets POS Condition Code
  160.         /// </summary>
  161.         public POSConditionCodeEnum? POSConditionCode { get; set; }
  162.  
  163.         /// <summary>
  164.         /// Gets or sets Track 2 Data
  165.         /// </summary>
  166.         [BsonIgnore]
  167.         public string Track2Data { get; set; }
  168.  
  169.         /// <summary>
  170.         /// Gets or sets isPOSReversal which is used to indicate that the message request is a POS initialized reversal.
  171.         /// </summary>
  172.         [BsonIgnoreIfDefault]
  173.         public bool isPOSReversal { get; set; }
  174.  
  175.         /// <summary>
  176.         /// Gets or sets CVV2 which is used to indicate that CVV2 was entered and what type of CVV2
  177.         /// </summary>
  178.         [BsonIgnoreIfDefault]
  179.         public CVV2Entry CVV2 { get; set; }
  180.  
  181.         /// <summary>
  182.         /// Gets or sets auth ID value which is used to link to a parent transaction
  183.         /// </summary>
  184.         [BsonIgnoreIfDefault]
  185.         public string AuthId { get; set; }
  186.  
  187.         /// <summary>
  188.         /// This property indicates whether it was an offline approved sale
  189.         /// </summary>
  190.         [BsonIgnoreIfDefault]
  191.         public bool isOfflineSale { get; set; }
  192.  
  193.         /// <summary>
  194.         /// Response code for offline sale. Valid values are:
  195.         /// Authorization Response Code ( off-line ) Value
  196.         /// Offline approved Y1
  197.         /// Offline declined Z1
  198.         /// Unable to go online, offline approved Y3
  199.         /// Unable to go online, offline declined Z3
  200.         /// </summary>
  201.         [BsonIgnoreIfDefault]
  202.         public string OfflineSaleResponseCode { get; set; }
  203.     }
  204.  
  205.     /// <summary>
  206.     /// Ecommerce request.
  207.     /// </summary>
  208.     public class EcommerceRequest : IEcommerceRequest
  209.     {
  210.         /// <summary>
  211.         /// Gets or sets Response Code, used in void transactions
  212.         /// </summary>
  213.         [BsonIgnoreIfDefault]
  214.         public string VoidResponseCode { get; set; }
  215.  
  216.         /// <summary>
  217.         /// Gets or sets Cardholder Name
  218.         /// </summary>
  219.         [BsonIgnore]
  220.         public string CardholderName { get; set; }
  221.  
  222.         /// <summary>
  223.         /// Gets or sets Cardholder Address
  224.         /// </summary>
  225.         [BsonIgnore]
  226.         public string CardholderAddress { get; set; }
  227.  
  228.         /// <summary>
  229.         /// Gets or sets Cardholder City
  230.         /// </summary>
  231.         [BsonIgnore]
  232.         public string CardholderCity { get; set; }
  233.  
  234.         /// <summary>
  235.         /// Gets or sets Cardholder Postal Code
  236.         /// </summary>
  237.         [BsonIgnore]
  238.         public string CardholderPostalCode { get; set; }
  239.  
  240.         /// <summary>
  241.         /// Gets or sets Cardholder Country
  242.         /// </summary>
  243.         [BsonIgnore]
  244.         public string CardholderCountry { get; set; }
  245.  
  246.         /// <summary>
  247.         /// Gets or sets Cardholder IP
  248.         /// </summary>
  249.         [BsonIgnore]
  250.         public string CardholderIPAddress { get; set; }
  251.  
  252.         /// <summary>
  253.         /// Gets or sets Cardholder email
  254.         /// </summary>
  255.         [BsonIgnore]
  256.         public string CardholderEmail { get; set; }
  257.  
  258.         /// <summary>
  259.         ///  Gets or sets Cvc2 associated with Cardholder BIN
  260.         /// </summary>
  261.         [BsonIgnore]
  262.         public string Cvc2 { get; set; }
  263.  
  264.         /// <summary>
  265.         /// Gets or sets Cardholder Authentication Verification Value (CAVV) for 3-D Secure transactions.
  266.         /// </summary>
  267.         [BsonIgnore]
  268.         public string CAVV { get; set; }
  269.  
  270.         /// <summary>
  271.         /// Gets or sets Transaction ID or XID, generated by the Merchant server to identify the transaction. The XID is used in conjunction with field CAVV
  272.         /// </summary>
  273.         [BsonIgnore]
  274.         public string XID { get; set; }
  275.  
  276.         /// <summary>
  277.         /// Gets or sets Electronic Commerce Indicator flag will be set whenever CAVV transactions are processed
  278.         /// </summary>
  279.         [BsonIgnoreIfDefault]
  280.         public string ECIFlag { get; set; }
  281.  
  282.         /// <summary>
  283.         /// Indicates whether Recurring Billing or Payments on transaction is in place. If set to true, transaction is a recurring payment.
  284.         /// </summary>
  285.         [BsonIgnoreIfDefault]
  286.         public bool IsRecurBilling { get; set; }
  287.  
  288.         /// <summary>
  289.         /// Gets or sets Order Number
  290.         /// </summary>
  291.         [BsonIgnoreIfDefault]
  292.         public string OrderNumber { get; set; }
  293.  
  294.         /// <summary>
  295.         /// Gets or sets whether transaction has to be AVS verified
  296.         /// </summary>
  297.         [BsonIgnoreIfDefault]
  298.         public bool IsAVS { get; set; }
  299.  
  300.         /// <summary>
  301.         /// Gets or sets MasterCard Payment Transaction.
  302.         /// </summary>
  303.         [BsonIgnoreIfDefault]
  304.         public PaymentTransaction PaymentTransaction { get; set; }
  305.  
  306.         /// <summary>
  307.         /// Gets or sets MoneySend recipient.
  308.         /// </summary>
  309.         [BsonIgnoreIfDefault]
  310.         public RecipientData MoneySendRecipient { get; set; }
  311.  
  312.         /// <summary>
  313.         /// Gets or sets MoneySend payer.
  314.         /// </summary>
  315.         [BsonIgnoreIfDefault]
  316.         public SenderData MoneySendPayer { get; set; }
  317.  
  318.         /// <summary>
  319.         /// Gets or sets VISA Direct Transaction.
  320.         /// </summary>
  321.         [BsonIgnoreIfDefault]
  322.         public VisaDirectTransaction VisaDirectTransaction { get; set; }
  323.  
  324.         /// <summary>
  325.         /// Indicates whether transaction is going to be MOTO or E-Commerce. If set to true, then transaction is MOTO.
  326.         /// </summary>
  327.         [BsonIgnoreIfDefault]
  328.         public MotoTransaction Moto { get; set; }
  329.  
  330.         /// <summary>
  331.         /// Gets or sets Advice Reason Code which is used for MasterCard Ecommerce Post Authorization transactions.
  332.         /// </summary>
  333.         [BsonIgnoreIfDefault]
  334.         public AdviceReasonCodeType_AdviceReasonCode? AdviceReasonCode { get; set; }
  335.  
  336.         /// <summary>
  337.         /// Gets or sets Advice Detail Code used for MasterCard Ecommerce Post Authorization transactions. This field is optional.
  338.         /// </summary>
  339.         [BsonIgnoreIfDefault]
  340.         public AdviceReasonCodeType_AdviceDetailCode? AdviceDetailCode { get; set; }
  341.  
  342.         /// <summary>
  343.         /// Advice Detail Text is optional and may be used to contain textual information supplementary to the Advice Detail Code.
  344.         /// Used in MasterCard Ecommerce Post Authorization transactions.
  345.         /// </summary>
  346.         [BsonIgnoreIfDefault]
  347.         public string AdviceDetailText { get; set; }
  348.     }
  349.  
  350.     public class DCCRequest
  351.     {
  352.         /// <summary>
  353.         /// The card's currency in ISO numerice format. This value is optional and POS might not report this value.
  354.         /// </summary>
  355.         public ushort? CardCurrency { get; set; }
  356.  
  357.         public ushort BuyingCurrency { get; set; }
  358.  
  359.         public string BuyingAmount { get; set; }
  360.  
  361.         /// <summary>
  362.         /// Conversion Token obtained through DCC Quote
  363.         /// </summary>
  364.         public Guid ConversionToken { get; set; }                        
  365.  
  366.     }
  367. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement