/// <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 PayTraceBasicResponse Type
        /// </summary>
        public PayTraceBasicResponse VoidTransactionTrans(string token, VoidTransactionRequest voidTranasactionRequest)
        {
            // Header details are available at Authentication header page.
            string methodUrl = ApiEndPointConfiguration.UrlVoidTransaction;

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

            //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 payTraceBasicResponse = new PayTraceBasicResponse();

            payTraceBasicResponse = JsonSerializer.DeserializeResponse <PayTraceBasicResponse>(tempResponse);

            //Assign the http error if any
            JsonSerializer.AssignError(tempResponse, payTraceBasicResponse);

            //Return the Desearlized object
            return(payTraceBasicResponse);
        }
Beispiel #2
0
        protected VoidTransactionRequest BuildRequestFromFields(VoidTransactionRequest requestVoidTransaction)
        {
            // Build void Transaction fields from the input source

            // Transaction_id value = Any unsettled Transaction ID.
            // Transaction_id should be collected from any previous API response which contains Transaction ID of any unsettled Transaction
            requestVoidTransaction.TransactionId = 105067320;
            // requestVoidTransaction.transaction_id =  104541685;
            return(requestVoidTransaction);
        }
Beispiel #3
0
        public void BuildTransaction(string oAuth)
        {
            // Void Transaction Request
            VoidTransactionRequest requestVoidTransaction = new VoidTransactionRequest();

            // for void Transaction Request execuation
            VoidTransactionGenerator VoidTransactionGenerator = new VoidTransactionGenerator();

            // Assign the values to the void Transaction Request.
            requestVoidTransaction = BuildRequestFromFields(requestVoidTransaction);

            // To make Void Transaction Request and store the response
            var result = VoidTransactionGenerator.VoidTransactionTrans(oAuth, requestVoidTransaction);

            //display the void Transaction Response
            WriteResults(result);
        }