/* tslint:disable */
import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { CheckoutConfiguration, CheckoutConfigurationInterface } from './checkout-configuration';

import { StoreCheckoutService } from './services/store-checkout.service';

/**
 * Provider for all Checkout services, plus CheckoutConfiguration
 */
@NgModule({
  imports: [
    HttpClientModule
  ],
  exports: [
    HttpClientModule
  ],
  declarations: [],
  providers: [
    CheckoutConfiguration,
    StoreCheckoutService
  ],
})
export class CheckoutModule {
  static forRoot(customParams: CheckoutConfigurationInterface): ModuleWithProviders<CheckoutModule> {
    return {
      ngModule: CheckoutModule,
      providers: [
        {
          provide: CheckoutConfiguration,
          useValue: {rootUrl: customParams.rootUrl}
        }
      ]
    }
  }
}
