woocommerce-paypal-payments/modules/ppcp-axo/services.php

49 lines
1.2 KiB
PHP
Raw Normal View History

2024-02-06 12:01:38 +00:00
<?php
/**
* The Axo module services.
*
* @package WooCommerce\PayPalCommerce\Axo
*/
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Axo;
2024-02-14 18:17:03 +00:00
use WooCommerce\PayPalCommerce\Axo\Assets\AxoManager;
use WooCommerce\PayPalCommerce\Axo\Gateway\AxoGateway;
2024-02-08 14:37:56 +00:00
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
2024-02-06 12:01:38 +00:00
return array(
2024-02-08 14:37:56 +00:00
'axo.url' => static function ( ContainerInterface $container ): string {
$path = realpath( __FILE__ );
if ( false === $path ) {
return '';
}
return plugins_url(
'/modules/ppcp-axo/',
dirname( $path, 3 ) . '/woocommerce-paypal-payments.php'
);
},
2024-02-14 18:17:03 +00:00
'axo.manager' => static function ( ContainerInterface $container ): AxoManager {
return new AxoManager(
$container->get( 'axo.url' ),
$container->get( 'ppcp.asset-version' ),
$container->get( 'session.handler' ),
$container->get( 'wcgateway.settings' ),
$container->get( 'onboarding.environment' ),
$container->get( 'wcgateway.settings.status' ),
$container->get( 'api.shop.currency' ),
$container->get( 'woocommerce.logger.woocommerce' )
);
},
'axo.gateway' => static function ( ContainerInterface $container ): AxoGateway {
return new AxoGateway(
$container->get( 'wcgateway.settings' )
);
},
2024-02-06 12:01:38 +00:00
);