app ->set( PlanRepositoryInterface::class, PlanRepository::class ) ->set( PlanSnapshotRepositoryInterface::class, PlanSnapshotRepository::class ) ->set( SubscriptionRepositoryInterface::class, SubscriptionRepository::class ) ->set( OrderRepositoryInterface::class, OrderRepository::class ); // Register payment gateway implementations $this->app->set( PaymentGatewayFactoryInterface::class, $this->factory ); $this->registerBuiltInPaymentGateways(); $this->registerCurrencyLayer(); } private function registerBuiltInPaymentGateways(): void { $this->factory ->register(Stripe::LOOKUP_KEY, Stripe::class) ->register(PayPal::LOOKUP_KEY, PayPal::class); } private function registerCurrencyLayer(): void { $this->app->set( ExchangeInterface::class, Exchange::class ); $collection = new RateProviderCollection($this->container); $collection ->add(NullRateProvider::LOOKUP_KEY, NullRateProvider::class) ->add(CurrencyApi::LOOKUP_KEY, CurrencyApi::class); $this->app->set( RateProviderCollectionInterface::class, $collection ); } }