Fix phpcs

This commit is contained in:
Emili Castells Guasch 2025-04-29 15:42:25 +02:00
parent 116b58bbdb
commit 68785cab77
No known key found for this signature in database
4 changed files with 19 additions and 21 deletions

View file

@ -13,7 +13,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus;
/**
* CardCaptureValidator constructor.
* CardCaptureValidator class.
*/
class CardCaptureValidator {
@ -31,22 +31,21 @@ class CardCaptureValidator {
}
$payment_source = $order->payment_source();
if ( $payment_source ) {
if ( $payment_source->name() !== 'card' ) {
return true;
}
/**
* LiabilityShift determines how to proceed with authentication.
*
* @link https://developer.paypal.com/docs/checkout/advanced/customize/3d-secure/response-parameters/
*/
$liability_shift = $payment_source->properties()->authentication_result->liability_shift ?? '';
if ( in_array( $liability_shift, array( 'POSSIBLE', 'YES' ), true ) ) {
return true;
}
if ( ! $payment_source ) {
return false;
}
return false;
if ( $payment_source->name() !== 'card' ) {
return true;
}
/**
* LiabilityShift determines how to proceed with authentication.
*
* @link https://developer.paypal.com/docs/checkout/advanced/customize/3d-secure/response-parameters/
*/
$liability_shift = $payment_source->properties()->authentication_result->liability_shift ?? '';
return in_array( $liability_shift, array( 'POSSIBLE', 'YES' ), true );
}
}