Пример #1
0
        /* *
         * Permite  realizar  transacciones  de  pago
         * */
        public oneClickPayOutput authorize(string buyOrder, string tbkUser, string username, string amount)
        {
            oneClickPayInput oneClickPayInput = new oneClickPayInput();

            oneClickPayInput.buyOrder          = Convert.ToInt64(buyOrder);
            oneClickPayInput.tbkUser           = tbkUser;
            oneClickPayInput.username          = username;
            oneClickPayInput.amount            = decimal.Parse(amount);
            oneClickPayInput.amountSpecified   = true;
            oneClickPayInput.buyOrderSpecified = true;

            using (OneClickPaymentServiceImplService proxy = new OneClickPaymentServiceImplService())
            {
                /*Define el ENDPOINT del Web Service Webpay*/
                proxy.Url = WSDL;

                Policy myPolicy = new Policy();
                myPolicy.Assertions.Add(new CustomPolicyAssertion(this.config));

                proxy.SetPolicy(myPolicy);
                proxy.Timeout = 60000;
                proxy.UseDefaultCredentials = false;

                oneClickPayOutput oneClickPayOutput = proxy.authorize(oneClickPayInput);
                return(oneClickPayOutput);
            }
        }
Пример #2
0
        /* *
         * Permite finalizar el proceso de inscripción del tarjetahabiente en Oneclick
         * */
        public oneClickFinishInscriptionOutput finishInscription(string token)
        {
            oneClickFinishInscriptionInput oneClickFinishInscriptionInput = new oneClickFinishInscriptionInput();

            oneClickFinishInscriptionInput.token = token;

            using (OneClickPaymentServiceImplService proxy = new OneClickPaymentServiceImplService())
            {
                proxy.Url = WSDL;

                Policy myPolicy = new Policy();
                myPolicy.Assertions.Add(new CustomPolicyAssertion(this.config));

                proxy.SetPolicy(myPolicy);
                proxy.Timeout = 60000;
                proxy.UseDefaultCredentials = false;

                oneClickFinishInscriptionOutput oneClickFinishInscriptionOutput = proxy.finishInscription(oneClickFinishInscriptionInput);
                return(oneClickFinishInscriptionOutput);
            }
        }
Пример #3
0
        /* *
         * Permite eliminar la inscripción de un usuario en Webpay OneClick
         * */
        public bool oneClickremoveUserOutput(string tbkUser, string username)
        {
            oneClickRemoveUserInput oneClickRemoveUserInput = new oneClickRemoveUserInput();

            oneClickRemoveUserInput.tbkUser  = tbkUser;
            oneClickRemoveUserInput.username = username;

            using (OneClickPaymentServiceImplService proxy = new OneClickPaymentServiceImplService())
            {
                /*Define el ENDPOINT del Web Service Webpay*/
                proxy.Url = WSDL;

                Policy myPolicy = new Policy();
                myPolicy.Assertions.Add(new CustomPolicyAssertion(this.config));

                proxy.SetPolicy(myPolicy);
                proxy.Timeout = 60000;
                proxy.UseDefaultCredentials = false;

                return(proxy.removeUser(oneClickRemoveUserInput));
            }
        }
Пример #4
0
        /* *
         * Permite realizar la inscripción del tarjetahabiente e información de su tarjeta de crédito
         * */
        public oneClickInscriptionOutput initInscription(string username, string email, string urlReturn)
        {
            oneClickInscriptionInput oneClickInscriptionInput = new oneClickInscriptionInput();

            oneClickInscriptionInput.username    = username;
            oneClickInscriptionInput.email       = email;
            oneClickInscriptionInput.responseURL = urlReturn;

            using (OneClickPaymentServiceImplService proxy = new OneClickPaymentServiceImplService())
            {
                proxy.Url = WSDL;

                Policy myPolicy = new Policy();
                myPolicy.Assertions.Add(new CustomPolicyAssertion(this.config));

                proxy.SetPolicy(myPolicy);
                proxy.Timeout = 60000;
                proxy.UseDefaultCredentials = false;

                oneClickInscriptionOutput oneClickInscriptionOutput = proxy.initInscription(oneClickInscriptionInput);
                return(oneClickInscriptionOutput);
            }
        }
Пример #5
0
        /* *
         * Permite reversar una transacción de venta autorizada con anterioridad
         * */
        public oneClickReverseOutput reverseTransaction(string buyOrder)
        {
            oneClickReverseInput oneClickReverseInput = new oneClickReverseInput();

            oneClickReverseInput.buyorder          = Int64.Parse(buyOrder);
            oneClickReverseInput.buyorderSpecified = true;

            using (OneClickPaymentServiceImplService proxy = new OneClickPaymentServiceImplService())
            {
                /*Define el ENDPOINT del Web Service Webpay*/
                proxy.Url = WSDL;

                Policy myPolicy = new Policy();
                myPolicy.Assertions.Add(new CustomPolicyAssertion(this.config));

                proxy.SetPolicy(myPolicy);
                proxy.Timeout = 60000;
                proxy.UseDefaultCredentials = false;

                oneClickReverseOutput oneClickReverseOutput = proxy.codeReverseOneClick(oneClickReverseInput);
                return(oneClickReverseOutput);
            }
        }