/// <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 VaultSaleByCustomerIdTrans(string token, VaultSaleByCustomerIdRequest vaultSaleByCustomerIdRequest)
        {
            // Header details are available at Authentication header page.
            string methodUrl = ApiEndPointConfiguration.UrlVaultSaleByCustomerId;

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

            //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 if any
            JsonSerializer.AssignError(tempResponse, (PayTraceBasicResponse)payTraceBasicSaleResponse);

            //Return the Desearlized object
            return(payTraceBasicSaleResponse);
        }
Exemplo n.º 2
0
        protected VaultSaleByCustomerIdRequest BuildRequestFromFields(VaultSaleByCustomerIdRequest requestVaultSaleByCustomerId)
        {
            // Build the Vault Sale by customerId fields from the input sources.
            // Customer ID can be obtained from any sources where it is stored previously.
            // Strorage source could be at the PayTrace repository(if used create customer profile earlier) or at the client repository.

            requestVaultSaleByCustomerId.Amount = 0.99;
            //Providing valid existing Customer ID is one of the key for the succssful transaction.
            requestVaultSaleByCustomerId.CustomerId = "customerTest2Demo";

            return(requestVaultSaleByCustomerId);
        }
Exemplo n.º 3
0
        public void BuildTransaction(string oAuth)
        {
            // Vault Sale by Customer Id Request
            VaultSaleByCustomerIdRequest requestVaultSaleByCustomerId = new VaultSaleByCustomerIdRequest();

            // for Vault Sale by Customer Id Transaction Request execuation
            VaultSaleByCustomerIdGenerator vaultSaleByCustomerIdGenerator = new  VaultSaleByCustomerIdGenerator();

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

            // To make Void Transaction Request and store the response
            var result = vaultSaleByCustomerIdGenerator.VaultSaleByCustomerIdTrans(oAuth, requestVaultSaleByCustomerId);

            // To Display the void Transaction Response
            WriteResults(result);
        }