Beispiel #1
0
        public IEnumerable <StripeEvent> GetAllEvents(string accountId)
        {
            var requestOptions = new StripeRequestOptions()
            {
                StripeConnectAccountId = accountId,
            };

            return(_stripeEventService
                   .List(null, requestOptions)
                   .AsEnumerable());
        }
        // GET: Admin/Events
        public ActionResult Index()
        {
            var eventService = new StripeEventService();
            var events       = eventService.List().Select(e =>
                                                          new EventListViewModel
            {
                Id              = e.Id,
                Created         = e.Created,
                LiveMode        = e.LiveMode,
                PendingWebhooks = e.PendingWebhooks,
                Request         = e.Request,
                Type            = e.Type,
                UserId          = e.UserId
            });

            return(View(events));
        }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            var json = new StreamReader(context.Request.InputStream).ReadToEnd();

            var stripeEvent = StripeEventUtility.ParseEvent(json);

            switch (stripeEvent.Type)
            {
            case StripeEvents.ChargeRefunded:      // all of the types available are listed in StripeEvents
                var stripeCharge = Stripe.Mapper <StripeCharge> .MapFromJson(stripeEvent.Data.Object.ToString());

                break;

            case StripeEvents.CustomerSubscriptionUpdated:      // all of the types available are listed in StripeEvents
                var stripeSubscription = Stripe.Mapper <StripeCharge> .MapFromJson(stripeEvent.Data.Object.ToString());

                break;
            }

            var eventService = new StripeEventService();
            IEnumerable <StripeEvent> response = eventService.List(); // optional StripeEventListOptions
        }