Пример #1
0
 function info_fields($form_id)
 {
     $payment_mode = give_get_chosen_gateway($form_id);
     if ($this->id === $payment_mode) {
         // Errors
         if (filter_has_var(INPUT_GET, 'payment-error')) {
             printf('<div class="give_error">%s</div>', Pronamic_WP_Pay_Plugin::get_default_error_message());
         }
         // Gateway
         $config_id = give_get_option(sprintf('give_%s_configuration', $this->id));
         $gateway = Pronamic_WP_Pay_Plugin::get_gateway($config_id);
         if ($gateway) {
             $gateway->set_payment_method($this->payment_method);
             echo $gateway->get_input_html();
         }
     }
 }
Пример #2
0
/**
 * Renders the hidden Checkout fields
 *
 * @since 1.0
 *
 * @param int $form_id
 *
 * @return void
 */
function give_checkout_hidden_fields($form_id)
{
    ?>
	<?php 
    if (is_user_logged_in()) {
        ?>
		<input type="hidden" name="give-user-id" value="<?php 
        echo get_current_user_id();
        ?>
" />
	<?php 
    }
    ?>
	<input type="hidden" name="give_action" value="purchase" />
	<input type="hidden" name="give-gateway" value="<?php 
    echo give_get_chosen_gateway($form_id);
    ?>
" />
	<?php 
}
Пример #3
0
/**
 * Purchase Form Required Fields
 *
 * @access      private
 * @since       1.0
 *
 * @param       $form_id
 *
 * @return      array
 */
function give_purchase_form_required_fields($form_id)
{
    $payment_mode = give_get_chosen_gateway($form_id);
    $required_fields = array('give_email' => array('error_id' => 'invalid_email', 'error_message' => esc_html__('Please enter a valid email address.', 'give')), 'give_first' => array('error_id' => 'invalid_first_name', 'error_message' => esc_html__('Please enter your first name.', 'give')));
    $require_address = give_require_billing_address($payment_mode);
    if ($require_address) {
        $required_fields['card_address'] = array('error_id' => 'invalid_card_address', 'error_message' => esc_html__('Please enter your primary billing address.', 'give'));
        $required_fields['card_zip'] = array('error_id' => 'invalid_zip_code', 'error_message' => esc_html__('Please enter your zip / postal code.', 'give'));
        $required_fields['card_city'] = array('error_id' => 'invalid_city', 'error_message' => esc_html__('Please enter your billing city.', 'give'));
        $required_fields['billing_country'] = array('error_id' => 'invalid_country', 'error_message' => esc_html__('Please select your billing country.', 'give'));
        $required_fields['card_state'] = array('error_id' => 'invalid_state', 'error_message' => esc_html__('Please enter billing state / province.', 'give'));
    }
    return apply_filters('give_purchase_form_required_fields', $required_fields, $form_id);
}