Пример #1
0
        public ApiObject WithdrawCash(ApiObject request)
        {
            var operation = new WithdrawCashOperation(request);
            operation.Execute();

            return operation.Response;
        }
Пример #2
0
        public ApiObject CheckAccountBalance(ApiObject request)
        {
            var operation = new CheckAccountBalanceOperation(request);
            operation.Execute();

            return operation.Response;
        }
Пример #3
0
        public ApiObject CloseSession(ApiObject request)
        {
            var operation = new CloseSessionOperation(request);
            operation.Execute();

            return operation.Response;
        }
Пример #4
0
        public ApiObject AuthorizePin(ApiObject request)
        {
            var operation = new PinAuthorizationOperation(request);
            operation.Execute();

            return operation.Response;
        }
Пример #5
0
        public ApiObject AuthenticateCardNumber(ApiObject request)
        {
            var operation = new CardNumberAuthenticationOperation(request);
            operation.Execute();

            return operation.Response;
        }
Пример #6
0
        public static String Decrypt(String privateKey, String salt, ApiObject request)
        {
            var aes = new AesManaged();
            aes.IV = Encoding.Unicode.GetBytes(salt);
            aes.Key = RSADecrypt(privateKey, request.Key);

            String decrypted = null;

            try
            {
                var decryptor = aes.CreateDecryptor();

                using (MemoryStream msDecrypt = new MemoryStream(request.Data))
                {
                    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
                    {
                        using (StreamReader srDecrypt = new StreamReader(csDecrypt))
                        {

                            // Read the decrypted bytes from the decrypting stream
                            // and place them in a string.
                            decrypted = srDecrypt.ReadToEnd();
                        }
                    }
                }
            }
            catch (Exception ex)
            {

            }
            finally
            {
                aes.Dispose();
            }

            return decrypted;
        }