/// <summary> /// Adds Parbad pre-configured services to the specified <see cref="IServiceCollection"/>. /// </summary> public static IParbadBuilder AddParbad(this IServiceCollection services) { var builder = new ParbadBuilder(services); builder.Services.AddOptions(); builder.Services.TryAddTransient <IOnlinePayment, DefaultOnlinePayment>(); builder.Services.TryAddSingleton <IOnlinePaymentAccessor, OnlinePaymentAccessor>(); builder.Services.TryAddTransient <IInvoiceBuilder, DefaultInvoiceBuilder>(); builder.Services.TryAddTransient <IGatewayProvider, GatewayProvider>(); builder.Services.TryAddTransient <AutoIncrementTrackingNumberProvider>(); builder.Services.TryAddTransient <AutoRandomTrackingNumberProvider>(); builder.ConfigureMessages(options => { }); builder.ConfigurePaymentToken(tokenBuilder => tokenBuilder.UseGuidQueryStringPaymentTokenProvider()); return(builder); }