mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Create configuration fol list of tracking integrations.
This commit is contained in:
parent
bd11a246cc
commit
e4534d64cd
1 changed files with 14 additions and 4 deletions
|
@ -9,15 +9,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\OrderTracking;
|
||||
|
||||
use WC_Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Integration\GermanizedShipmentIntegration;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Integration\ShipmentTrackingIntegration;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Integration\YithShipmentIntegration;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Shipment\ShipmentFactoryInterface;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Shipment\ShipmentFactory;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Assets\OrderEditPageAssets;
|
||||
use WooCommerce\PayPalCommerce\OrderTracking\Endpoint\OrderTrackingEndpoint;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||
|
||||
return array(
|
||||
'order-tracking.assets' => function( ContainerInterface $container ) : OrderEditPageAssets {
|
||||
|
@ -92,4 +91,15 @@ return array(
|
|||
'order-tracking.is-merchant-country-us' => static function ( ContainerInterface $container ): bool {
|
||||
return $container->get( 'api.shop.country' ) === 'US';
|
||||
},
|
||||
'order-tracking.integrations' => static function ( ContainerInterface $container ): array {
|
||||
$shipment_factory = $container->get( 'order-tracking.shipment.factory' );
|
||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||
$endpoint = $container->get( 'order-tracking.endpoint.controller' );
|
||||
|
||||
return array(
|
||||
new GermanizedShipmentIntegration( $shipment_factory, $logger, $endpoint ),
|
||||
new ShipmentTrackingIntegration( $shipment_factory, $logger, $endpoint ),
|
||||
new YithShipmentIntegration( $shipment_factory, $logger, $endpoint ),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue