services.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The services |
| 5 | * |
| 6 | * @package WooCommerce\PayPalCommerce\WcSubscriptions |
| 7 | */ |
| 8 | declare (strict_types=1); |
| 9 | namespace WooCommerce\PayPalCommerce\WcSubscriptions; |
| 10 | |
| 11 | use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository; |
| 12 | use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface; |
| 13 | use WooCommerce\PayPalCommerce\WcSubscriptions\Endpoint\SubscriptionChangePaymentMethod; |
| 14 | use WooCommerce\PayPalCommerce\WcSubscriptions\Helper\RealTimeAccountUpdaterHelper; |
| 15 | use WooCommerce\PayPalCommerce\WcSubscriptions\Helper\SubscriptionHelper; |
| 16 | return array('wc-subscriptions.helper' => static function (ContainerInterface $container): SubscriptionHelper { |
| 17 | return new SubscriptionHelper(); |
| 18 | }, 'wc-subscriptions.helpers.real-time-account-updater' => static function (ContainerInterface $container): RealTimeAccountUpdaterHelper { |
| 19 | return new RealTimeAccountUpdaterHelper(); |
| 20 | }, 'wc-subscriptions.renewal-handler' => static function (ContainerInterface $container): \WooCommerce\PayPalCommerce\WcSubscriptions\RenewalHandler { |
| 21 | $logger = $container->get('woocommerce.logger.woocommerce'); |
| 22 | $repository = $container->get('vaulting.repository.payment-token'); |
| 23 | $endpoint = $container->get('api.endpoint.order'); |
| 24 | $purchase_unit_factory = $container->get('api.factory.purchase-unit'); |
| 25 | $payer_factory = $container->get('api.factory.payer'); |
| 26 | $environment = $container->get('settings.environment'); |
| 27 | $settings = $container->get('wcgateway.settings'); |
| 28 | $authorized_payments_processor = $container->get('wcgateway.processor.authorized-payments'); |
| 29 | $funding_source_renderer = $container->get('wcgateway.funding-source.renderer'); |
| 30 | return new \WooCommerce\PayPalCommerce\WcSubscriptions\RenewalHandler($logger, $repository, $endpoint, $purchase_unit_factory, $container->get('api.factory.shipping-preference'), $payer_factory, $environment, $settings, $authorized_payments_processor, $funding_source_renderer, $container->get('wc-subscriptions.helpers.real-time-account-updater'), $container->get('wc-subscriptions.helper'), $container->get('api.endpoint.payment-tokens'), $container->get('vaulting.wc-payment-tokens'), $container->get('wcgateway.builder.experience-context')); |
| 31 | }, 'wc-subscriptions.repository.payment-token' => static function (ContainerInterface $container): PaymentTokenRepository { |
| 32 | $factory = $container->get('api.factory.payment-token'); |
| 33 | $endpoint = $container->get('api.endpoint.payment-token'); |
| 34 | return new PaymentTokenRepository($factory, $endpoint); |
| 35 | }, 'wc-subscriptions.endpoint.subscription-change-payment-method' => static function (ContainerInterface $container): SubscriptionChangePaymentMethod { |
| 36 | return new SubscriptionChangePaymentMethod($container->get('button.request-data')); |
| 37 | }); |
| 38 |