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

67 lines
2.6 KiB
PHP
Raw Permalink Normal View History

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;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
2021-09-17 16:54:31 +02:00
return array(
'vaulting.module-url' => static function ( ContainerInterface $container ): string {
return plugins_url(
'/modules/ppcp-vaulting/',
dirname( realpath( __FILE__ ), 3 ) . '/woocommerce-paypal-payments.php'
);
},
'vaulting.repository.payment-token' => static function ( ContainerInterface $container ): PaymentTokenRepository {
$factory = $container->get( 'api.factory.payment-token' );
$endpoint = $container->get( 'api.endpoint.payment-token' );
return new PaymentTokenRepository( $factory, $endpoint );
},
'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' ),
$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' ),
$container->get( 'api.endpoint.payment-token' ),
2022-03-01 15:12:54 +01:00
$container->get( 'woocommerce.logger.woocommerce' )
);
},
'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 {
return new VaultedCreditCardHandler(
2022-08-12 10:56:25 +02:00
$container->get( 'subscription.helper' ),
$container->get( 'vaulting.repository.payment-token' ),
$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 {
return new PaymentTokenFactory();
},
'vaulting.payment-tokens-migration' => function( ContainerInterface $container ): PaymentTokensMigration {
return new PaymentTokensMigration(
$container->get( 'vaulting.payment-token-factory' ),
$container->get( 'vaulting.repository.payment-token' ),
2022-12-15 17:01:56 +01:00
$container->get( 'woocommerce.logger.woocommerce' )
);
},
2021-09-17 16:54:31 +02:00
);