Esempio n. 1
0
 /// <remarks/>
 public System.IAsyncResult BeginsendConfirmation(confirmationDTO SaleConf_req, System.AsyncCallback callback,
                                                  object asyncState)
 {
     return(this.BeginInvoke("sendConfirmation", new object[]
     {
         SaleConf_req
     }, callback, asyncState));
 }
Esempio n. 2
0
        public saleConfResponse sendConfirmation(
            [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] confirmationDTO SaleConf_req)
        {
            object[] results = this.Invoke("sendConfirmation", new object[]
            {
                SaleConf_req
            });

            return((saleConfResponse)(results[0]));
        }
Esempio n. 3
0
 /// <remarks/>
 public void sendConfirmationAsync(confirmationDTO SaleConf_req, object userState)
 {
     if ((this.sendConfirmationOperationCompleted == null))
     {
         this.sendConfirmationOperationCompleted =
             new System.Threading.SendOrPostCallback(this.OnsendConfirmationOperationCompleted);
     }
     this.InvokeAsync("sendConfirmation", new object[]
     {
         SaleConf_req
     }, this.sendConfirmationOperationCompleted, userState);
 }
Esempio n. 4
0
 /// <remarks/>
 public void sendConfirmationAsync(confirmationDTO SaleConf_req)
 {
     this.sendConfirmationAsync(SaleConf_req, null);
 }
        public VerifyResult Refund()
        {
            ServicePointManager.ServerCertificateValidationCallback =
                delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); };

            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

            var cpsParameter = new CspParameters {
                Flags = CspProviderFlags.UseMachineKeyStore
            };

            var rsaProvider = new RSACryptoServiceProvider(1024, cpsParameter);

            RSACryptoServiceProvider.UseMachineKeyStore = true;

            rsa.FromXmlString(PrivateKey);
            byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(Mid + Trn + Crn), new
                                           SHA1CryptoServiceProvider());
            var signature = Convert.ToBase64String(signMain);

            RSACryptoServiceProvider cipher = new RSACryptoServiceProvider();

            cipher.FromXmlString(PublicKey);


            //byte[] data = Encoding.UTF8.GetBytes(Amount);
            //byte[] cipherText = cipher.Encrypt(data, false);


            byte[] data       = Encoding.UTF8.GetBytes(Mid);
            byte[] cipherText = cipher.Encrypt(data, false);
            var    enMid      = Convert.ToBase64String(cipherText);

            data       = Encoding.UTF8.GetBytes(Crn);
            cipherText = cipher.Encrypt(data, false);
            var enCrn = Convert.ToBase64String(cipherText);

            data       = Encoding.UTF8.GetBytes(Trn);
            cipherText = cipher.Encrypt(data, false);
            var enTrn = Convert.ToBase64String(cipherText);

            var confParam = new confirmationDTO
            {
                MID       = enMid,
                CRN       = enCrn,
                TRN       = enTrn,
                SIGNATURE = signature
            };

            TransactionReference services = new TransactionReferenceClient();
            var configRequest             = new sendConfirmationRequest(confParam);
            var tokenResponse             = services.sendConfirmation(configRequest);

            var resVerify = new VerifyResult();

            if ([email protected] != null && [email protected]() != "")
            {
                var value = int.Parse([email protected]);
                resVerify.Description = GetDescription(1007, value);
                resVerify.Status      = [email protected];
                if (value == 0 || value == 101)
                {
                    resVerify.Amount           = int.Parse([email protected]);
                    resVerify.RefrenceNumber   = [email protected];
                    resVerify.BankReciptNumber = [email protected];
                }
            }
            return(resVerify);
        }