mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
codingstandards for subscription module
This commit is contained in:
parent
cfbd3ae428
commit
7af7ace569
11 changed files with 470 additions and 294 deletions
|
@ -1,4 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* The services
|
||||
*
|
||||
* @package Inpsyde\PayPalCommerce\Subscription
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
@ -8,27 +13,27 @@ use Inpsyde\PayPalCommerce\Subscription\Helper\SubscriptionHelper;
|
|||
use Inpsyde\PayPalCommerce\Subscription\Repository\PaymentTokenRepository;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
'subscription.helper' => static function (ContainerInterface $container): SubscriptionHelper {
|
||||
return new SubscriptionHelper();
|
||||
},
|
||||
'subscription.renewal-handler' => static function (ContainerInterface $container): RenewalHandler {
|
||||
$logger = $container->get('woocommerce.logger.woocommerce');
|
||||
$repository = $container->get('subscription.repository.payment-token');
|
||||
$endpoint = $container->get('api.endpoint.order');
|
||||
$purchaseFactory = $container->get('api.factory.purchase-unit');
|
||||
$payerFactory = $container->get('api.factory.payer');
|
||||
return new RenewalHandler(
|
||||
$logger,
|
||||
$repository,
|
||||
$endpoint,
|
||||
$purchaseFactory,
|
||||
$payerFactory
|
||||
);
|
||||
},
|
||||
'subscription.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);
|
||||
},
|
||||
];
|
||||
return array(
|
||||
'subscription.helper' => static function ( ContainerInterface $container ): SubscriptionHelper {
|
||||
return new SubscriptionHelper();
|
||||
},
|
||||
'subscription.renewal-handler' => static function ( ContainerInterface $container ): RenewalHandler {
|
||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||
$repository = $container->get( 'subscription.repository.payment-token' );
|
||||
$endpoint = $container->get( 'api.endpoint.order' );
|
||||
$purchase_unit_factory = $container->get( 'api.factory.purchase-unit' );
|
||||
$payer_factory = $container->get( 'api.factory.payer' );
|
||||
return new RenewalHandler(
|
||||
$logger,
|
||||
$repository,
|
||||
$endpoint,
|
||||
$purchase_unit_factory,
|
||||
$payer_factory
|
||||
);
|
||||
},
|
||||
'subscription.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 );
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue