Example #1
0
        private static void ProcessPayment(HttpRequest request)
        {
            if (!PerfectMoneyAccountDetails.Exists(request["PAYEE_ACCOUNT"]))
            {
                throw new MsgException("PerfectMoney account not exists: " + request["PAYEE_ACCOUNT"]);
            }
            if (!CheckHash(request))
            {
                throw new MsgException("Hashes are different");
            }
            if (!CheckIfNotDoneYet(request))
            {
                throw new MsgException("Prevention against many activities");
            }

            string commandName = request["ITEM_COMMAND"];

            Assembly    assembly = Assembly.GetAssembly(typeof(IIpnHandler));
            var         type     = assembly.GetType(commandName, true, true);
            IIpnHandler command  = Activator.CreateInstance(type) as IIpnHandler;

            command.HandlePerfectMoney(request);
        }
 public PerfectMoneyButtonGenerationStrategy(PerfectMoneyAccountDetails pm)
 {
     account = pm;
 }