2021-07-15 06:51:37 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The compatibility module services.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\PayPalCommerce\Compat
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace WooCommerce\PayPalCommerce\Compat;
|
|
|
|
|
2021-07-27 14:34:36 -05:00
|
|
|
return array(
|
|
|
|
|
2021-07-16 14:00:01 -05:00
|
|
|
'compat.ppec.mock-gateway' => static function( $container ) {
|
2021-07-27 14:34:36 -05:00
|
|
|
$settings = $container->get( 'wcgateway.settings' );
|
|
|
|
$title = $settings->has( 'title' ) ? $settings->get( 'title' ) : __( 'PayPal', 'woocommerce-paypal-payments' );
|
|
|
|
$title = sprintf(
|
|
|
|
/* Translators: placeholder is the gateway name. */
|
|
|
|
__( '%s (Legacy)', 'woocommerce-paypal-payments' ),
|
|
|
|
$title
|
|
|
|
);
|
|
|
|
|
|
|
|
return new PPEC\MockGateway( $title );
|
|
|
|
},
|
|
|
|
|
2021-07-16 14:00:01 -05:00
|
|
|
'compat.ppec.subscriptions-handler' => static function ( $container ) {
|
|
|
|
$ppcp_renewal_handler = $container->get( 'subscription.renewal-handler' );
|
|
|
|
$gateway = $container->get( 'compat.ppec.mock-gateway' );
|
|
|
|
|
|
|
|
return new PPEC\SubscriptionsHandler( $ppcp_renewal_handler, $gateway );
|
|
|
|
},
|
|
|
|
|
2021-07-14 15:06:32 -05:00
|
|
|
'compat.ppec.settings_importer' => static function( $container ) : PPEC\SettingsImporter {
|
|
|
|
$settings = $container->get( 'wcgateway.settings' );
|
|
|
|
|
|
|
|
return new PPEC\SettingsImporter( $settings );
|
|
|
|
},
|
|
|
|
|
2021-07-27 14:34:36 -05:00
|
|
|
);
|