From 57e4cb51eaa69fe5cc23c3f18494fc29cf3129cc Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 29 Jun 2022 14:40:51 +0300 Subject: [PATCH] Fix form fields type was broken after #680 --- modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php index 98e990b3c..81344bb64 100644 --- a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php +++ b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php @@ -449,12 +449,11 @@ class CreateOrderEndpoint implements EndpointInterface { /** * Checks whether the terms input field is checked. * - * @param string $form_values The form values. + * @param array $form_fields The form fields. * @throws \RuntimeException When field is not checked. */ - private function validate_paynow_form( string $form_values ) { - $parsed_values = wp_parse_args( $form_values ); - if ( isset( $parsed_values['terms-field'] ) && ! isset( $parsed_values['terms'] ) ) { + private function validate_paynow_form( array $form_fields ) { + if ( isset( $form_fields['terms-field'] ) && ! isset( $form_fields['terms'] ) ) { throw new \RuntimeException( __( 'Please read and accept the terms and conditions to proceed with your order.', 'woocommerce-paypal-payments' ) );