2023-10-18 17:03:15 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The PayPalSubscriptions module services.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\PayPalCommerce\PayPalSubscriptions
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace WooCommerce\PayPalCommerce\PayPalSubscriptions;
|
|
|
|
|
|
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'paypal-subscriptions.deactivate-plan-endpoint' => static function ( ContainerInterface $container ): DeactivatePlanEndpoint {
|
|
|
|
return new DeactivatePlanEndpoint(
|
|
|
|
$container->get( 'button.request-data' ),
|
|
|
|
$container->get( 'api.endpoint.billing-plans' )
|
|
|
|
);
|
|
|
|
},
|
|
|
|
'paypal-subscriptions.api-handler' => static function( ContainerInterface $container ): SubscriptionsApiHandler {
|
|
|
|
return new SubscriptionsApiHandler(
|
|
|
|
$container->get( 'api.endpoint.catalog-products' ),
|
|
|
|
$container->get( 'api.factory.product' ),
|
|
|
|
$container->get( 'api.endpoint.billing-plans' ),
|
|
|
|
$container->get( 'api.factory.billing-cycle' ),
|
|
|
|
$container->get( 'api.factory.payment-preferences' ),
|
2024-10-03 10:10:50 +03:00
|
|
|
$container->get( 'api.shop.currency.getter' ),
|
2023-10-18 17:03:15 +02:00
|
|
|
$container->get( 'woocommerce.logger.woocommerce' )
|
|
|
|
);
|
|
|
|
},
|
|
|
|
'paypal-subscriptions.module.url' => static function ( ContainerInterface $container ): string {
|
|
|
|
/**
|
|
|
|
* The path cannot be false.
|
|
|
|
*
|
|
|
|
* @psalm-suppress PossiblyFalseArgument
|
|
|
|
*/
|
|
|
|
return plugins_url(
|
|
|
|
'/modules/ppcp-paypal-subscriptions/',
|
|
|
|
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
|
|
|
);
|
|
|
|
},
|
2024-09-13 15:35:13 +02:00
|
|
|
'paypal-subscriptions.renewal-handler' => static function ( ContainerInterface $container ): RenewalHandler {
|
|
|
|
return new RenewalHandler( $container->get( 'woocommerce.logger.woocommerce' ) );
|
|
|
|
},
|
2024-09-20 12:15:11 +02:00
|
|
|
'paypal-subscriptions.status' => static function ( ContainerInterface $container ): SubscriptionStatus {
|
|
|
|
return new SubscriptionStatus(
|
|
|
|
$container->get( 'api.endpoint.billing-subscriptions' ),
|
|
|
|
$container->get( 'woocommerce.logger.woocommerce' )
|
|
|
|
);
|
|
|
|
},
|
2023-10-18 17:03:15 +02:00
|
|
|
);
|