コード例 #1
0
        protected override void ParseResponse(BinaryReader br)
        {
            base.ParseResponse(br);

            if (DeviceResponseCode == "000000")
            {
                HostResponse       = new HostResponse(br);
                TransactionType    = ((TransactionType)Int32.Parse(br.ReadToCode(ControlCodes.FS))).ToString().Replace("_", " ");
                AmountResponse     = new AmountResponse(br);
                AccountResponse    = new AccountResponse(br);
                TraceResponse      = new TraceResponse(br);
                AvsResponse        = new AvsResponse(br);
                CommercialResponse = new CommercialResponse(br);
                EcomResponse       = new EcomSubGroup(br);
                ExtDataResponse    = new ExtDataSubGroup(br);

                MapResponse();
            }
        }
コード例 #2
0
ファイル: PaxDevice.cs プロジェクト: hps/heartland-dotnet
        internal CreditResponse DoCredit(string txnType, AmountRequest amounts, AccountRequest accounts, TraceRequest trace, AvsRequest avs, CashierSubGroup cashier, CommercialRequest commercial, EcomSubGroup ecom, ExtDataSubGroup extData)
        {
            var response = DoTransaction(PAX_MSG_ID.T00_DO_CREDIT, txnType, amounts, accounts, trace, avs, cashier, commercial, ecom, extData);

            return(new CreditResponse(response));
        }
コード例 #3
0
        public override CreditResponse Execute()
        {
            base.Execute();

            var amounts = new AmountRequest {
                TransactionAmount = "{0:c}".FormatWith(amount).ToNumeric(),
                TipAmount         = "{0:c}".FormatWith(gratuity).ToNumeric()
            };

            var account = new AccountRequest();

            if (card != null)
            {
                account.AccountNumber = card.Number;
                account.EXPD          = "{0}{1}".FormatWith(card.ExpMonth, card.ExpYear);
                account.CvvCode       = card.Cvv;
            }
            if (allowDuplicates)
            {
                account.DupOverrideFlag = "1";
            }

            // Avs Sub Group
            var avs = new AvsRequest();

            if (address != null)
            {
                avs.ZipCode = address.Zip;
                avs.Address = address.Address;
            }

            // Trace Sub Group
            var trace = new TraceRequest {
                ReferenceNumber = referenceNumber.ToString()
            };

            if (details != null)
            {
                trace.InvoiceNumber = details.InvoiceNumber;
            }
            if (!string.IsNullOrEmpty(authCode))
            {
                trace.AuthCode = authCode;
            }


            var cashier    = new CashierSubGroup();
            var commercial = new CommercialRequest();
            var ecom       = new EcomSubGroup();

            // Additional Info sub group
            var additionalInfo = new ExtDataSubGroup();

            if (requestMultiUseToken)
            {
                additionalInfo[EXT_DATA.TOKEN_REQUEST] = "1";
            }
            if (transactionId.HasValue)
            {
                additionalInfo[EXT_DATA.HOST_REFERENCE_NUMBER] = transactionId.Value.ToString();
            }
            if (token != null)
            {
                additionalInfo[EXT_DATA.TOKEN] = token;
            }
            if (signatureCapture)
            {
                additionalInfo[EXT_DATA.SIGNATURE_CAPTURE] = "1";
            }

            return(service.DoCredit(PAX_TXN_TYPE.AUTH, amounts, account, trace, avs, cashier, commercial, ecom, additionalInfo));
        }