mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
🎨 Fix Psalm errors
This commit is contained in:
parent
7713956160
commit
ae21627c11
3 changed files with 5 additions and 3 deletions
|
@ -245,7 +245,6 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
);
|
||||
}
|
||||
|
||||
// Check for tokens to determine if this is a 3DS return or initial payment.
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$axo_nonce = wc_clean( wp_unslash( $_POST['axo_nonce'] ?? '' ) );
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
|
|
|
@ -233,8 +233,8 @@ class SettingsModel extends AbstractDataModel {
|
|||
/**
|
||||
* Converts the 3D Secure setting value to the corresponding API enum string.
|
||||
*
|
||||
* @param string|null $three_d_secure The 3D Secure setting ('no-3d-secure', 'only-required-3d-secure', 'always-3d-secure')
|
||||
* @return string The corresponding API enum string ('NO_3D_SECURE', 'SCA_WHEN_REQUIRED', 'SCA_ALWAYS')
|
||||
* @param string|null $three_d_secure The 3D Secure setting ('no-3d-secure', 'only-required-3d-secure', 'always-3d-secure').
|
||||
* @return string The corresponding API enum string ('NO_3D_SECURE', 'SCA_WHEN_REQUIRED', 'SCA_ALWAYS').
|
||||
*/
|
||||
public function get_three_d_secure_enum( string $three_d_secure = null ): string {
|
||||
// If no value is provided, use the current setting.
|
||||
|
|
|
@ -78,12 +78,14 @@ class ReturnUrlEndpoint {
|
|||
* Handles the incoming request.
|
||||
*/
|
||||
public function handle_request(): void {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if ( ! isset( $_GET['token'] ) ) {
|
||||
wc_add_notice( __( 'Payment session expired. Please try placing your order again.', 'woocommerce-paypal-payments' ), 'error' );
|
||||
wp_safe_redirect( wc_get_checkout_url() );
|
||||
exit();
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$token = sanitize_text_field( wp_unslash( $_GET['token'] ) );
|
||||
|
||||
try {
|
||||
|
@ -184,6 +186,7 @@ class ReturnUrlEndpoint {
|
|||
* @param mixed $order The PayPal order.
|
||||
* @return mixed The processed order.
|
||||
* @throws Exception When 3DS completion fails.
|
||||
* @throws RuntimeException When API errors occur that don't match decline patterns.
|
||||
*/
|
||||
private function complete_3ds_verification( $order ) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue