AJAX form submissions are required when using the Stripe Credit Card field.
To proceed, please go to Settings » General » Advanced and check Enable AJAX form submission.
', 'wpforms-lite' ), [ 'p' => [], 'strong' => [], ] ); $strings['stripe_keys_required'] = wp_kses( __( 'Stripe account connection is required when using the Stripe Credit Card field.
To proceed, please go to WPForms Settings » Payments » Stripe and press Connect with Stripe button.
', 'wpforms-lite' ), [ 'p' => [], 'strong' => [], ] ); $strings['payments_enabled_required'] = wp_kses( __( 'Stripe Payments must be enabled when using the Stripe Credit Card field.
To proceed, please go to Payments » Stripe and check Enable Stripe payments.
', 'wpforms-lite' ), [ 'p' => [], 'strong' => [], ] ); return $strings; } /** * Define additional "Add Field" button attributes. * * @since 1.8.2 * * @param array $attributes Button attributes. * @param array $field Field settings. * @param array $form_data Form data and settings. * * @return array */ public function field_button_attributes( $attributes, $field, $form_data ) { if ( Helpers::get_field_slug() !== $field['type'] ) { return $attributes; } if ( Helpers::has_stripe_field( $form_data ) ) { $attributes['atts']['disabled'] = 'true'; return $attributes; } if ( ! Helpers::has_stripe_keys() ) { $attributes['class'][] = 'warning-modal'; $attributes['class'][] = 'stripe-keys-required'; } return $attributes; } /** * Currently validation happens on the front end. We do not do * generic server-side validation because we do not allow the card * details to POST to the server. * * @since 1.8.2 * * @param int $field_id Field ID. * @param array $field_submit Submitted field value. * @param array $form_data Form data and settings. */ public function validate( $field_id, $field_submit, $form_data ) { } /** * Format field. * * @since 1.8.2 * * @param int $field_id Field ID. * @param array $field_submit Submitted field value. * @param array $form_data Form data and settings. */ public function format( $field_id, $field_submit, $form_data ) { // Define data. $name = ! empty( $form_data['fields'][ $field_id ]['label'] ) ? $form_data['fields'][ $field_id ]['label'] : ''; // Set final field details. wpforms()->get( 'process' )->fields[ $field_id ] = [ 'name' => sanitize_text_field( $name ), 'value' => '', 'id' => absint( $field_id ), 'type' => $this->type, ]; } /** * The field value availability for the entry preview field. * * @since 1.8.2 * * @param bool $is_supported The field availability. * @param string $value The submitted Credit Card detail. * @param array $field Field data. * @param array $form_data Form data. * * @return bool */ public function entry_preview_availability( $is_supported, $value, $field, $form_data ) { return ! empty( $value ) && $value !== '-'; } /** * Maybe display errors before field. * * @since 1.8.2 * * @param array $form_data Form data and settings. * * @return bool */ private function field_display_errors( $form_data ) { // Display warning for non SSL pages. if ( ! is_ssl() ) { echo '