Fix phpcs

This commit is contained in:
Emili Castells Guasch 2024-01-30 11:10:29 +01:00
parent c008e0eaa5
commit 129fba0439

View file

@ -62,13 +62,16 @@ class SavePaymentMethodsModule implements ModuleInterface {
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' ); $billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint ); assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
add_action( 'woocommerce_paypal_payments_gateway_migrate_on_update', function() use($settings, $billing_agreements_endpoint) { add_action(
$reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled(); 'woocommerce_paypal_payments_gateway_migrate_on_update',
if ( $reference_transaction_enabled !== true ) { function() use ( $settings, $billing_agreements_endpoint ) {
$settings->set( 'vault_enabled', false ); $reference_transaction_enabled = $billing_agreements_endpoint->reference_transaction_enabled();
$settings->persist(); if ( $reference_transaction_enabled !== true ) {
$settings->set( 'vault_enabled', false );
$settings->persist();
}
} }
}); );
if ( if (
( ! $settings->has( 'vault_enabled' ) || ! $settings->get( 'vault_enabled' ) ) ( ! $settings->has( 'vault_enabled' ) || ! $settings->get( 'vault_enabled' ) )