Refactor the service name, variable names to use the new class

This commit is contained in:
Narek Zakarian 2025-06-30 16:40:38 +04:00
parent 0a0d7e9c49
commit 96895aba51
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
8 changed files with 46 additions and 177 deletions

View file

@ -69,10 +69,10 @@ class SavePaymentMethodsModule implements ServiceModule, ExtendingModule, Execut
$settings = $c->get( 'wcgateway.settings' );
assert( $settings instanceof Settings );
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof ReferenceTransactionStatus );
$reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled();
if ( $reference_transaction_enabled !== true ) {
$reference_transaction_status = $c->get( 'api.reference-transaction-status' );
assert( $reference_transaction_status instanceof ReferenceTransactionStatus );
if ( ! $reference_transaction_status->reference_transaction_enabled() ) {
$settings->set( 'vault_enabled', false );
$settings->persist();
}