Refactor payment source to handle arbitrary types

This commit is contained in:
Emili Castells Guasch 2023-10-20 12:54:00 +02:00
parent 99d05ca44d
commit 518a1f4e4e
13 changed files with 59 additions and 287 deletions

View file

@ -10,7 +10,9 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\SavePaymentMethods;
use Psr\Log\LoggerInterface;
use WC_Order;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\UserIdToken;
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
@ -90,5 +92,14 @@ class SavePaymentMethodsModule implements ModuleInterface {
return $data;
}
);
add_action(
'woocommerce_paypal_payments_after_order_processor',
function( WC_Order $wc_order, Order $order ) {
// vault payment here ...
},
10,
2
);
}
}