Move payment tokens repository to vaulting package

This commit is contained in:
dinamiko 2021-09-17 17:11:36 +02:00
parent 60dc34e510
commit 2db0162988
11 changed files with 19 additions and 23 deletions

View file

@ -14,7 +14,7 @@ use Dhii\Modular\Module\ModuleInterface;
use Psr\Log\LoggerInterface;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\Subscription\Helper\SubscriptionHelper;
use WooCommerce\PayPalCommerce\Subscription\Repository\PaymentTokenRepository;
use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use Interop\Container\ServiceProviderInterface;
@ -66,7 +66,7 @@ class SubscriptionModule implements ModuleInterface {
add_action(
'woocommerce_subscription_payment_complete',
function ( $subscription ) use ( $container ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
$payment_token_repository = $container->get( 'vaulting.repository.payment-token' );
$logger = $container->get( 'woocommerce.logger.woocommerce' );
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
@ -76,7 +76,7 @@ class SubscriptionModule implements ModuleInterface {
add_filter(
'woocommerce_gateway_description',
function ( $description, $id ) use ( $container ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
$payment_token_repository = $container->get( 'vaulting.repository.payment-token' );
$settings = $container->get( 'wcgateway.settings' );
$subscription_helper = $container->get( 'subscription.helper' );
@ -89,7 +89,7 @@ class SubscriptionModule implements ModuleInterface {
add_filter(
'woocommerce_credit_card_form_fields',
function ( $default_fields, $id ) use ( $container ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
$payment_token_repository = $container->get( 'vaulting.repository.payment-token' );
$settings = $container->get( 'wcgateway.settings' );
$subscription_helper = $container->get( 'subscription.helper' );