CheckoutCubit constructor

CheckoutCubit({
  1. required dynamic accessKey,
})

Implementation

CheckoutCubit({required accessKey}) : super(ValidateAccessKeyInitial()) {
  try {
    String baseNewsUrl = Constants.BASE_URL_STAGING;
    if (accessKey.startsWith('live_')) {
      baseNewsUrl = Constants.BASE_URL_PRODUCTION;
    }
    getIt.registerLazySingleton<PaymentImpl>(
      () => PaymentImpl(
        paymentHandler: PaymentHandler(dio: Dio(), baseNewsUrl: baseNewsUrl),
      ),
    );
  } catch (_) {}
}