public static ZebbleBillingAppBuilder UseEntityFramework(this ZebbleBillingAppBuilder builder)
        {
            using var serviceScope = builder.App.ApplicationServices.GetService <IServiceScopeFactory>().CreateScope();
            serviceScope.ServiceProvider.GetRequiredService <SubscriptionDbContext>().Database.Migrate();

            return(builder);
        }
Пример #2
0
        public static ZebbleBillingAppBuilder UseAppStore(this ZebbleBillingAppBuilder builder)
        {
            var routes = new RouteBuilder(builder.App);

            var options = builder.App.ApplicationServices.GetService <IOptions <AppStoreOptions> >();

            routes.MapMiddlewarePost(options.Value.HookInterceptorPath, builder => builder.UseMiddleware <AppStoreHookInterceptionMiddleware>());

            builder.App.UseRouter(routes.Build());

            return(builder);
        }
        public static ZebbleBillingAppBuilder UseGooglePlay(this ZebbleBillingAppBuilder builder)
        {
            var routes = new RouteBuilder(builder.App);

            var options = builder.App.ApplicationServices.GetService <IOptions <GooglePlayOptions> >();

            routes.MapMiddlewareGet(options.Value.QueueProcessorPath, builder => builder.UseMiddleware <GooglePlayQueueProcessingMiddleware>());

            builder.App.UseRouter(routes.Build());

            return(builder);
        }
Пример #4
0
        public static ZebbleBillingAppBuilder UseVoucher(this ZebbleBillingAppBuilder builder, Action <ZebbleBillingVoucherAppBuilder> voucherBuilder = null)
        {
            var routes = new RouteBuilder(builder.App);

            var options = builder.App.ApplicationServices.GetService <IOptions <VoucherOptions> >();

            routes.MapMiddlewarePost(options.Value.VoucherApplyPath, builder => builder.UseMiddleware <VoucherApplyingMiddleware>());

            builder.App.UseRouter(routes.Build());

            voucherBuilder?.Invoke(new ZebbleBillingVoucherAppBuilder(builder.App));

            return(builder);
        }
Пример #5
0
        public static ZebbleBillingAppBuilder UseCafeBazaar(this ZebbleBillingAppBuilder builder)
        {
            builder.App.UseCafeBazaarDeveloperApi();

            return(builder);
        }