add module path services

This commit is contained in:
Kirill Braslavsky 2021-03-25 14:26:28 +02:00
parent 54980968c5
commit c3301fe66d

View file

@ -9,7 +9,6 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\WcGateway;
use Dhii\Data\Container\ContainerInterface;
use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext;
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
@ -1877,10 +1876,18 @@ return array(
},
'wcgateway.url' => static function ( $container ): string {
return plugins_url(
'/modules/ppcp-wc-gateway/',
$container->get('wcgateway.relative-path'),
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
);
},
'wcgateway.relative-path' => static function($container): string {
return 'modules/ppcp-wc-gateway/';
},
'wcgateway.absolute-path' => static function($container): string {
return plugin_dir_path(
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php') .
$container->get('wcgateway.relative-path');
},
'wcgateway.endpoint.return-url' => static function ( $container ) : ReturnUrlEndpoint {
$gateway = $container->get( 'wcgateway.paypal-gateway' );
$endpoint = $container->get( 'api.endpoint.order' );