Check if terms checkbox is available

This commit is contained in:
dinamiko 2021-11-08 15:09:22 +01:00
parent 984019cb2b
commit 902d6bb0cf

View file

@ -381,7 +381,7 @@ class CreateOrderEndpoint implements EndpointInterface {
*/
private function validate_paynow_form( string $form_values ) {
$parsed_values = wp_parse_args( $form_values );
if ( ! isset( $parsed_values['terms'] ) ) {
if ( isset( $parsed_values['terms-field'] ) && ! isset( $parsed_values['terms'] ) ) {
throw new \RuntimeException(
__( 'Please read and accept the terms and conditions to proceed with your order.', 'woocommerce-paypal-payments' )
);