2021-09-16 10:21:31 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The vaulting module services.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\PayPalCommerce\Vaulting
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace WooCommerce\PayPalCommerce\Vaulting;
|
|
|
|
|
2022-11-09 10:11:31 +02:00
|
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
2021-09-22 15:49:24 +02:00
|
|
|
|
2021-09-17 16:54:31 +02:00
|
|
|
return array(
|
2022-04-12 14:59:07 +03:00
|
|
|
'vaulting.module-url' => static function ( ContainerInterface $container ): string {
|
2021-09-22 15:49:24 +02:00
|
|
|
return plugins_url(
|
|
|
|
'/modules/ppcp-vaulting/',
|
2022-01-14 16:35:13 +02:00
|
|
|
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
|
2021-09-22 15:49:24 +02:00
|
|
|
);
|
|
|
|
},
|
2022-04-12 14:59:07 +03:00
|
|
|
'vaulting.repository.payment-token' => static function ( ContainerInterface $container ): PaymentTokenRepository {
|
2021-09-17 17:11:36 +02:00
|
|
|
$factory = $container->get( 'api.factory.payment-token' );
|
|
|
|
$endpoint = $container->get( 'api.endpoint.payment-token' );
|
|
|
|
return new PaymentTokenRepository( $factory, $endpoint );
|
|
|
|
},
|
2022-04-12 14:59:07 +03:00
|
|
|
'vaulting.payment-token-checker' => function( ContainerInterface $container ) : PaymentTokenChecker {
|
2022-03-01 15:12:54 +01:00
|
|
|
return new PaymentTokenChecker(
|
2022-03-01 16:10:46 +01:00
|
|
|
$container->get( 'vaulting.repository.payment-token' ),
|
2022-04-05 09:31:57 +03:00
|
|
|
$container->get( 'api.repository.order' ),
|
2022-03-01 15:12:54 +01:00
|
|
|
$container->get( 'wcgateway.settings' ),
|
|
|
|
$container->get( 'wcgateway.processor.authorized-payments' ),
|
|
|
|
$container->get( 'api.endpoint.payments' ),
|
2023-08-03 12:28:20 +02:00
|
|
|
$container->get( 'api.endpoint.payment-token' ),
|
2022-03-01 15:12:54 +01:00
|
|
|
$container->get( 'woocommerce.logger.woocommerce' )
|
|
|
|
);
|
|
|
|
},
|
2022-04-12 14:59:07 +03:00
|
|
|
'vaulting.customer-approval-listener' => function( ContainerInterface $container ) : CustomerApprovalListener {
|
|
|
|
return new CustomerApprovalListener(
|
|
|
|
$container->get( 'api.endpoint.payment-token' ),
|
|
|
|
$container->get( 'woocommerce.logger.woocommerce' )
|
|
|
|
);
|
|
|
|
},
|
2022-08-12 10:56:25 +02:00
|
|
|
'vaulting.credit-card-handler' => function( ContainerInterface $container ): VaultedCreditCardHandler {
|
2022-08-11 14:22:12 +02:00
|
|
|
return new VaultedCreditCardHandler(
|
2022-08-12 10:56:25 +02:00
|
|
|
$container->get( 'subscription.helper' ),
|
|
|
|
$container->get( 'vaulting.repository.payment-token' ),
|
2022-08-11 14:22:12 +02:00
|
|
|
$container->get( 'api.factory.purchase-unit' ),
|
|
|
|
$container->get( 'api.factory.payer' ),
|
|
|
|
$container->get( 'api.factory.shipping-preference' ),
|
|
|
|
$container->get( 'api.endpoint.order' ),
|
|
|
|
$container->get( 'onboarding.environment' ),
|
|
|
|
$container->get( 'wcgateway.processor.authorized-payments' ),
|
|
|
|
$container->get( 'wcgateway.settings' )
|
|
|
|
);
|
|
|
|
},
|
2023-01-02 14:28:24 +01:00
|
|
|
'vaulting.payment-token-factory' => function( ContainerInterface $container ): PaymentTokenFactory {
|
2023-01-02 12:50:13 +01:00
|
|
|
return new PaymentTokenFactory();
|
2022-12-21 15:10:33 +01:00
|
|
|
},
|
2022-12-05 17:20:11 +01:00
|
|
|
'vaulting.payment-tokens-migration' => function( ContainerInterface $container ): PaymentTokensMigration {
|
|
|
|
return new PaymentTokensMigration(
|
2023-01-02 12:50:13 +01:00
|
|
|
$container->get( 'vaulting.payment-token-factory' ),
|
2023-01-25 12:19:53 +01:00
|
|
|
$container->get( 'vaulting.repository.payment-token' ),
|
2022-12-15 17:01:56 +01:00
|
|
|
$container->get( 'woocommerce.logger.woocommerce' )
|
2022-12-05 17:20:11 +01:00
|
|
|
);
|
|
|
|
},
|
2021-09-17 16:54:31 +02:00
|
|
|
);
|