function setup_stripe_form($fields = array()) { global $event_details, $cart_totals; $event_id = $event_details['ID']; $regis_id = $this->erm->get_regis_id(); $post_ID = $this->erm->get_regis_post_id(); $this->epl->load_file('libraries/gateways/stripe/Stripe.php'); $this->ecm->setup_event_details($event_id); $_totals = $this->erm->calculate_cart_totals(); $gateway_info = $this->erm->get_gateway_info(); $test_mode = $gateway_info['_epl_sandbox'] == 10; $secret_key = $gateway_info['_epl_secret_key']; $publishable_key = $gateway_info['_epl_publishable_key']; $data = array(); $data['stripe'] = array("secret_key" => $secret_key, "publishable_key" => $publishable_key); $data['exp_fields'] = array('exp_month' => array('input_type' => 'select', 'class' => 'epl_w70', 'options' => epl_month_dd(true), 'data_attr' => array('stripe' => 'exp-month')), 'exp_year' => array('weight' => 60, 'input_type' => 'select', 'options' => epl_make_array(date_i18n('Y'), date_i18n('Y') + 10), 'class' => 'epl_w70', 'data_attr' => array('stripe' => 'exp-year'))); $data['exp_month'] = $this->epl_util->create_element($data['exp_fields']['exp_month']); $data['exp_year'] = $this->epl_util->create_element($data['exp_fields']['exp_year']); Stripe::setApiKey($data['stripe']['secret_key']); $amount = number_format(epl_get_balance_due(), 2, '.', ''); return $this->epl->load_view('front/registration/regis-stripe-form', $data, true); }
function epl_cc_billing_fields() { global $epl_fields; $epl_fields['epl_cc_billing_fields'] = array('_epl_cc_first_name' => array('weight' => 5, 'input_type' => 'text', 'input_name' => '_epl_cc_first_name', 'label' => epl__('First Name'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'first_name'), 'required' => true), '_epl_cc_last_name' => array('weight' => 10, 'input_type' => 'text', 'input_name' => '_epl_cc_last_name', 'label' => epl__('Last Name'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'last_name'), 'required' => true), '_epl_cc_address' => array('weight' => 15, 'input_type' => 'text', 'input_name' => '_epl_cc_address', 'label' => epl__('Address'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'address'), 'required' => true), '_epl_cc_city' => array('weight' => 20, 'input_type' => 'text', 'input_name' => '_epl_cc_city', 'label' => epl__('City'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'city'), 'required' => true), '_epl_cc_state' => array('weight' => 25, 'input_type' => 'text', 'input_name' => '_epl_cc_state', 'label' => epl__('State'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'state'), 'required' => true), '_epl_cc_zip' => array('weight' => 30, 'input_type' => 'text', 'input_name' => '_epl_cc_zip', 'label' => epl__('Zip'), 'default_value' => epl_get_attendee_form_value('ticket_buyer', 'zip'), 'required' => true), '_epl_cc_country' => array('weight' => 35, 'input_type' => 'select', 'input_name' => '_epl_cc_country', 'label' => epl__('Country'), 'options' => epl_country_codes(), 'default_value' => 'US', 'class' => 'epl_70', 'value' => epl_get_element('_epl_cc_country', $_POST), 'required' => true), '_epl_cc_card_type' => array('weight' => 40, 'input_type' => 'select', 'input_name' => '_epl_cc_card_type', 'label' => epl__('Card Type'), 'options' => array('Visa' => 'Visa', 'MasterCard' => 'Master Card', 'Discover' => 'Discover', 'Amex' => 'Amex'), 'class' => 'epl_70', 'value' => epl_get_element('_epl_cc_exp_month', $_POST), 'required' => true), '_epl_cc_num' => array('weight' => 45, 'input_type' => 'text', 'input_name' => '_epl_cc_num', 'label' => epl__('Card Number'), 'required' => true), '_epl_cc_cvv' => array('weight' => 50, 'input_type' => 'text', 'input_name' => '_epl_cc_cvv', 'label' => epl__('CVV Code'), 'required' => true), '_epl_cc_exp_month' => array('weight' => 55, 'input_type' => 'select', 'input_name' => '_epl_cc_exp_month', 'label' => epl__('Expiration Month'), 'options' => epl_month_dd(), 'class' => 'epl_w70', 'value' => epl_get_element('_epl_cc_exp_month', $_POST), 'required' => true), '_epl_cc_exp_year' => array('weight' => 60, 'input_type' => 'select', 'input_name' => '_epl_cc_exp_year', 'label' => epl__('Expiration Year'), 'options' => epl_make_array(date_i18n('Y'), date_i18n('Y') + 10), 'class' => 'epl_w70', 'value' => epl_get_element('_epl_cc_exp_year', $_POST), 'required' => true)); $epl_fields['epl_cc_billing_fields'] = apply_filters('epl_cc_billing_fields', $epl_fields['epl_cc_billing_fields']); uasort($epl_fields['epl_cc_billing_fields'], 'epl_sort_by_weight'); return $epl_fields; }