コード例 #1
0
        public override async Task <List <StripeTransaction> > GetCombinedUpdatedAndExistingAsync(IMyConfiguration configuration, TextWriter writer, FileDate lastCacheFileInfo, DateTime from, DateTime to)
        {
            // we have to combine two files:
            // the original cache file and the new transactions file
            await writer.WriteLineAsync(string.Format("Finding Stripe payout transactions from {0:yyyy-MM-dd} to {1:yyyy-MM-dd}", from, to));

            var newStripePayoutTransactions = await Stripe.GetStripePayoutTransactionsAsync(configuration, from, to);

            var originalStripePayoutTransactions = Utils.ReadCacheFile <StripeTransaction>(lastCacheFileInfo.FilePath);

            // copy all the original stripe transactions into a new file, except entries that are
            // from the from date or newer
            var updatedStripePayoutTransactions = originalStripePayoutTransactions.Where(p => p.Created < from).ToList();

            // and add the new transactions to beginning of list
            updatedStripePayoutTransactions.InsertRange(0, newStripePayoutTransactions);

            return(updatedStripePayoutTransactions);
        }
コード例 #2
0
        public override async Task <List <StripeTransaction> > GetListAsync(IMyConfiguration configuration, TextWriter writer, DateTime from, DateTime to)
        {
            await writer.WriteLineAsync(string.Format("Finding Stripe payout transactions from {0:yyyy-MM-dd} to {1:yyyy-MM-dd}", from, to));

            return(await Stripe.GetStripePayoutTransactionsAsync(configuration, from, to));
        }