Ejemplo n.º 1
0
        /// <summary>
        /// Method for builiding Transaction with Json Request,call the actual transaction execution method and call for Deseralize Json
        /// and Return the object.
        /// Returns the PayTraceBasicSaleResponse Type
        /// </summary>
        public PayTraceBasicSaleResponse SwipedSaleTrans(string token, SwipedSaleRequest swipedSaleRequest)
        {
            // Header details are available at Authentication header page.
            string methodUrl = ApiEndPointConfiguration.UrlSwipedSale;

            //converting request into JSON string
            var requestJSON = JsonSerializer.GetSeralizedString(swipedSaleRequest);

            //Optional - Display Json Request
            //System.Web.HttpContext.Current.Response.Write ("<br>" + "Json Request: " + requestJSON + "<br>");

            //call for actual request and response
            var payTraceResponse = new PayTraceResponse();
            var tempResponse     = payTraceResponse.ProcessTransaction(methodUrl, token, requestJSON);

            //Create and assign the deseralized object to appropriate response type
            var payTraceBasicSaleResponse = new PayTraceBasicSaleResponse();

            payTraceBasicSaleResponse = JsonSerializer.DeserializeResponse <PayTraceBasicSaleResponse>(tempResponse);

            //Assign the http error
            JsonSerializer.AssignError(tempResponse, (PayTraceBasicResponse)payTraceBasicSaleResponse);

            //Return the Desearlized object
            return(payTraceBasicSaleResponse);
        }
Ejemplo n.º 2
0
        protected SwipedSaleRequest BuildRequestFromFields(SwipedSaleRequest requestSwipedSale)
        {
            // Build Keyed Sale Request fields from the input source
            requestSwipedSale.Amount = 4.00;

            //Swipe value should be detected from Magnetic stripe reader(Credit Card reader Device)
            //this will include both track1 and track2 data
            requestSwipedSale.SwipeCcData = "%B4012881888818888^Demo/Customer^2412101001020001000000701000000?;4012881888818888=24121010010270100001?";
            //Following value will give an error
            //requestSwipedSale.swipe = "012881888818888^Demo/Customer^2412101001020001000000701000000?;4012881888818888=24121010010270100001?";

            return(requestSwipedSale);
        }
Ejemplo n.º 3
0
        public void BuildTransaction(string oAuth)
        {
            // Swiped Sale Request
            SwipedSaleRequest swipeSaleRequest = new SwipedSaleRequest();

            //Swiped Sale Transaction
            SwipedSaleGenerator swipedSaleGenerator = new SwipedSaleGenerator();

            //Assign the values to the Swiped Sale Request.
            swipeSaleRequest = BuildRequestFromFields(swipeSaleRequest);

            //Swiped Sale Request and display the result
            var result = swipedSaleGenerator.SwipedSaleTrans(oAuth, swipeSaleRequest);

            //process the Swiped Sale response
            WriteResults(result);
        }