Exemple #1
0
        public void GenerateReportLexicalErrors()
        {
            XMLReport xmlReport = new XMLReport();

            xmlReport.ReportLexicalErrors(ListError);
        }
Exemple #2
0
        public void GenerateReportToken()
        {
            XMLReport xmlReport = new XMLReport();

            xmlReport.ReportToken(ListToken);
        }
Exemple #3
0
        /// <summary>
        /// Executes the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        public void Execute(IJobExecutionContext context)
        {
            // set the encryption protocols that are permissible for external SSL connections
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;

            JobDataMap dataMap = context.JobDetail.JobDataMap;

            int totalTransactions = 0;
            int feesSuccessful    = 0;
            int feesFailed        = 0;

            Rock.Model.FinancialGatewayService fgs      = new Rock.Model.FinancialGatewayService(new Rock.Data.RockContext());
            List <Rock.Model.FinancialGateway> gateways = fgs.Queryable().Where(fg => fg.IsActive && fg.EntityType.Name.Contains("PayFlowPro")).ToList();

            foreach (Rock.Model.FinancialGateway gateway in gateways)
            {
                XMLReport report = new XMLReport();
                report.Gateway = gateway;
                report.URL     = dataMap.GetString("PayPalReportURL");
                report.name    = dataMap.GetString("ReportName");

                DateRange dateRange = Rock.Web.UI.Controls.SlidingDateRangePicker.CalculateDateRangeFromDelimitedValues(dataMap.GetString("DateRange") ?? "-1||");
                DataTable data      = report.RunReport(dateRange.Start ?? DateTime.Now.AddHours(0 - 24), dateRange.End ?? DateTime.Now.Date.AddSeconds(-1));

                foreach (DataRow row in data.Rows)
                {
                    ProcessTransaction(row, gateway);
                }
                dbContext.SaveChanges();

                totalTransactions += data.Rows.Count;
            }


            // Now load all transaction fees
            if (dataMap.GetString("FetchFees").AsBoolean())
            {
                if (dataMap.GetString("PayPalAPIUsername").IsNullOrWhiteSpace() ||
                    dataMap.GetString("PayPalAPIPassword").IsNullOrWhiteSpace() ||
                    dataMap.GetString("PayPalAPISignature").IsNullOrWhiteSpace())
                {
                    throw new Exception("In order to fetch fees, the PayPal API Username, Password, and Signature are required.");
                }

                String             apiUsername  = Encryption.DecryptString(dataMap.GetString("PayPalAPIUsername"));
                String             apiPassword  = Encryption.DecryptString(dataMap.GetString("PayPalAPIPassword"));
                String             apiSignature = Encryption.DecryptString(dataMap.GetString("PayPalAPISignature"));
                List <Transaction> zeroFeeTrans = transactionService.Queryable()
                                                  .Where(tx => tx.Fees == 0 && !tx.IsZeroFee && tx.MerchantTransactionId != "").ToList();
                API paypalAPI = new API();
                paypalAPI.Username  = apiUsername;
                paypalAPI.Password  = apiPassword;
                paypalAPI.Signature = apiSignature;

                foreach (Transaction zeroFeeTran in zeroFeeTrans)
                {
                    Double fee = Convert.ToDouble(paypalAPI.GetTransactionFee(zeroFeeTran));
                    if (fee != 0)
                    {
                        zeroFeeTran.Fees = fee;
                        feesSuccessful++;
                    }
                    else
                    {
                        feesFailed++;
                    }
                }
                dbContext.SaveChanges();
            }

            String message = "Payflow Transactions Retrieved: " + totalTransactions;

            if (dataMap.GetString("FetchFees").AsBoolean())
            {
                message += " - Non-Zero Fee Transactions:" + feesSuccessful;
                message += " - Zero Fee Transactions:" + feesFailed;
            }

            context.Result = message;
        }
Exemple #4
0
        public void GenerateReports()
        {
            XMLReport xmlReport = new XMLReport();

            xmlReport.ReportSyntacticErrors(ListError);
        }
        public void GenerateReports()
        {
            XMLReport xmlReport = new XMLReport();

            xmlReport.ReportSymbolTable(SymbolTable);
        }