Пример #1
0
        /// <summary>
        /// Private method to call the gateway
        /// </summary>
        /// <param name="gateway">Payment gateway to call</param>
        /// <returns></returns>
        private string CallGateway(string gateway)
        {
            String           result    = String.Empty;
            GatewayProcessor processor = GatewayLoader.GetProcessor(gateway);

            result = processor.ProcessCard(this.OrderNumber,
                                           this.CustomerID,
                                           this.OrderTotal,
                                           this.UseLiveTransactions,
                                           this.TransactionMode,
                                           this.BillingAddress,
                                           this.CV2,
                                           this.ShippingAddress,
                                           this.CAVV,
                                           this.ECI,
                                           this.XID,
                                           out m_avsResult,
                                           out m_authorizationResult,
                                           out m_authorizationCode,
                                           out m_authorizationTransactionID,
                                           out m_transactionCommand,
                                           out m_transactionResponse);

            // set the gatewayused property so we know for sure which gateway was called!
            m_gatewayUsed = gateway;

            return(result);
        }
Пример #2
0
        public string ProcessTransaction(int OrderNumber, int CustomerID, decimal OrderTotal, bool useLiveTransactions, TransactionModeEnum TransactionMode, Address UseBillingAddress, string CardExtraCode, Address UseShippingAddress, string CAVV, string ECI, string XID, out string AVSResult, out string AuthorizationResult, out string AuthorizationCode, out string AuthorizationTransID, out string TransactionCommandOut, out string TransactionResponse)
        {
            Processors.GatewayProcessor sn = GatewayLoader.GetProcessor("SecureNetV4");
            if (sn == null)
            {
                throw new ArgumentException("Gateway processor \"SecureNetV4\" must be present to process vault transactions.");
            }

            UseBillingAddress.CardNumber = "";//set card to empty to trigger vault transaction

            return(sn.ProcessCard(OrderNumber, CustomerID, OrderTotal, useLiveTransactions, TransactionMode, UseBillingAddress, CardExtraCode, UseShippingAddress, CAVV, ECI, XID, out AVSResult, out AuthorizationResult, out AuthorizationCode, out AuthorizationTransID, out TransactionCommandOut, out TransactionResponse));
        }