Ejemplo n.º 1
0
        static void GetDisputedCharges(StripeDisputeService chargeService, TraceWriter log)
        {
            string lastObjectId = null;
            StripeList <StripeDispute> response = null;

            //var greaterThanCreatedFilter = GetLatestCreatedTime();
            var listOptions = new StripeDisputeListOptions()
            {
                Limit         = 100,
                StartingAfter = lastObjectId
            };

            do
            {
                response = chargeService.List(listOptions);

                foreach (var d in response.Data)
                {
                    var disputes = DisputesResponseToStripeDisputes(d);
                    UpsertStripeDispute(disputes, log);
                    log.Info($"Dispute Updated: {disputes.DisputeId.ToString()}");
                }
                lastObjectId = response.Data.LastOrDefault()?.Id;
                listOptions.StartingAfter = lastObjectId;
                log.Info($"Charge last ObjectId: {lastObjectId}. More responses? {response.HasMore}");
            }while (response.HasMore);
        }
        public StripeDisputeServiceTest()
        {
            this.service = new StripeDisputeService();

            this.updateOptions = new StripeDisputeUpdateOptions()
            {
                Metadata = new Dictionary <string, string>()
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new StripeDisputeListOptions()
            {
                Limit = 1,
            };
        }