예제 #1
0
        public override GiftResponse Execute()
        {
            base.Execute();

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

            var account = new AccountRequest {
                AccountNumber = card != null ? card.Value : null
            };
            var trace = new TraceRequest
            {
                ReferenceNumber = referenceNumber.ToString(),
                InvoiceNumber   = details != null ? details.InvoiceNumber : null
            };

            var cashier = new CashierSubGroup();
            var extData = new ExtDataSubGroup();

            var messageId = currency == currencyType.USD ? PAX_MSG_ID.T06_DO_GIFT : PAX_MSG_ID.T08_DO_LOYALTY;

            return(service.DoGift(messageId, PAX_TXN_TYPE.SALE_REDEEM, amounts, account, trace, cashier, extData));
        }
예제 #2
0
        public override DebitResponse Execute()
        {
            base.Execute();

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

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

            var cashier = new CashierSubGroup();

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

            if (transactionId != null)
            {
                extData[EXT_DATA.HOST_REFERENCE_NUMBER] = transactionId.ToString();
            }
            return(service.DoDebit(PAX_TXN_TYPE.RETURN, amounts, account, trace, cashier, extData));
        }
예제 #3
0
        public override DebitResponse Execute()
        {
            base.Execute();

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

            var account = new AccountRequest();

            if (allowDuplicates)
            {
                account.DupOverrideFlag = "1";
            }
            // Trace Sub Group
            var trace = new TraceRequest
            {
                ReferenceNumber = referenceNumber.ToString()
            };

            if (details != null)
            {
                trace.InvoiceNumber = details.InvoiceNumber;
            }

            var cashier = new CashierSubGroup();

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

            return(service.DoDebit(PAX_TXN_TYPE.SALE_REDEEM, amounts, account, trace, cashier, extData));
        }
예제 #4
0
        public override GiftResponse Execute()
        {
            base.Execute();

            var account = new AccountRequest {
                AccountNumber = card != null ? card.Value : null
            };
            var trace = new TraceRequest {
                ReferenceNumber = referenceNumber.ToString()
            };
            var cashier = new CashierSubGroup();
            var extData = new ExtDataSubGroup();

            var messageId = currency == currencyType.USD ? PAX_MSG_ID.T06_DO_GIFT : PAX_MSG_ID.T08_DO_LOYALTY;

            return(service.DoGift(messageId, PAX_TXN_TYPE.BALANCE, new AmountRequest(), account, trace, cashier, extData));
        }
        public override GiftResponse Execute()
        {
            base.Execute();

            var amounts = new AmountRequest {
                TransactionAmount = "{0:c}".FormatWith(amount).ToNumeric()
            };
            var account = new AccountRequest {
                AccountNumber = card != null ? card.Value : null
            };
            var trace = new TraceRequest {
                ReferenceNumber = referenceNumber.ToString()
            };
            var cashier = new CashierSubGroup();
            var extData = new ExtDataSubGroup();

            // TODO : Change to TransactionType RETURN when terminal adds support for it
            var messageId = currency == currencyType.USD ? PAX_MSG_ID.T06_DO_GIFT : PAX_MSG_ID.T08_DO_LOYALTY;

            return(service.DoGift(messageId, PAX_TXN_TYPE.ADD, amounts, account, trace, cashier, extData));
        }
예제 #6
0
        internal CheckSubResponse DoCheck(string txnType, AmountRequest amounts, CheckSubGroup check, TraceRequest trace, CashierSubGroup cashier, ExtDataSubGroup extData)
        {
            var response = DoTransaction(PAX_MSG_ID.T12_DO_CHECK, txnType, amounts, check, trace, cashier, extData);

            return(new CheckSubResponse(response));
        }
예제 #7
0
        internal CashResponse DoCash(string txnType, AmountRequest amounts, TraceRequest trace, CashierSubGroup cashier)
        {
            var response = DoTransaction(PAX_MSG_ID.T10_DO_CASH, txnType, amounts, trace, cashier, new ExtDataSubGroup());

            return(new CashResponse(response));
        }
예제 #8
0
        internal GiftResponse DoGift(string messageId, string txnType, AmountRequest amounts, AccountRequest accounts, TraceRequest trace, CashierSubGroup cashier, ExtDataSubGroup extData = null)
        {
            var response = DoTransaction(messageId, txnType, amounts, accounts, trace, cashier, extData);

            return(new GiftResponse(response));
        }
예제 #9
0
        internal EbtResponse DoEBT(string txnType, AmountRequest amounts, AccountRequest accounts, TraceRequest trace, CashierSubGroup cashier)
        {
            var response = DoTransaction(PAX_MSG_ID.T04_DO_EBT, txnType, accounts, trace, cashier, new ExtDataSubGroup());

            return(new EbtResponse(response));
        }
예제 #10
0
        internal DebitResponse DoDebit(string txnType, AmountRequest amounts, AccountRequest accounts, TraceRequest trace, CashierSubGroup cashier, ExtDataSubGroup extData)
        {
            var response = DoTransaction(PAX_MSG_ID.T02_DO_DEBIT, txnType, amounts, accounts, trace, cashier, extData);

            return(new DebitResponse(response));
        }
예제 #11
0
        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));
        }
예제 #12
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));
        }