Refactor/rename the reference transaction enabled checking class.

This commit is contained in:
Narek Zakarian 2025-06-30 16:08:36 +04:00
parent 40a95202ec
commit 0a0d7e9c49
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
10 changed files with 26 additions and 26 deletions

View file

@ -17,7 +17,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentSource;
use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\ApiClient\Helper\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Helper\ReferenceTransactionStatus;
use WooCommerce\PayPalCommerce\Button\Helper\ContextTrait;
use WooCommerce\PayPalCommerce\SavePaymentMethods\Endpoint\CreatePaymentToken;
use WooCommerce\PayPalCommerce\SavePaymentMethods\Endpoint\CreatePaymentTokenForGuest;
@ -70,7 +70,7 @@ class SavePaymentMethodsModule implements ServiceModule, ExtendingModule, Execut
assert( $settings instanceof Settings );
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
assert( $billing_agreements_endpoint instanceof ReferenceTransactionStatus );
$reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled();
if ( $reference_transaction_enabled !== true ) {
$settings->set( 'vault_enabled', false );