function espresso_display_worldpay($payment_data) { extract($payment_data); include_once 'Worldpay.php'; global $wpdb, $org_options; $myworldpay = new Worldpay(); // initiate an instance of the class echo '<!-- Event Espresso WorldPay Gateway Version ' . $myworldpay->worldpay_gateway_version . '-->'; $worldpay_settings = get_option('event_espresso_worldpay_settings'); $use_sandbox = $worldpay_settings['use_sandbox']; if ($use_sandbox) { $myworldpay->enableTestMode(); } if ($use_sandbox) { // Enable test mode if needed $myworldpay->addField('testMode', '100'); } $myworldpay->addField('instId', $worldpay_settings['worldpay_id']); $myworldpay->addField('cartId', 'wp-' . event_espresso_session_id()); $myworldpay->addField('amount', $event_cost); $myworldpay->addField('MC_id', $attendee_id); $myworldpay->addField('MC_registration_id', $registration_id); $myworldpay->addField('MC_type', 'worldpay'); $myworldpay->addField('currency', $worldpay_settings['currency_format']); if (!empty($worldpay_settings['bypass_payment_page'])) { $myworldpay->submitPayment(); //Enable auto redirect to payment site } else { if (empty($worldpay_settings['button_url'])) { if (file_exists(EVENT_ESPRESSO_GATEWAY_DIR . "/worldpay/worldpay-logo.png")) { $button_url = EVENT_ESPRESSO_GATEWAY_DIR . "/worldpay/worldpay-logo.png"; } else { $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/worldpay/worldpay-logo.png"; } } elseif (file_exists($worldpay_settings['button_url'])) { $button_url = $worldpay_settings['button_url']; } else { //If no other buttons exist, then use the default location $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/worldpay/worldpay-logo.png"; } $myworldpay->submitButton($button_url, 'worldpay'); //Display payment button } if ($use_sandbox) { echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('WorldPay Debug Mode Is Turned On', 'event_espresso') . '</h3>'; $myworldpay->dump_fields(); // for debugging, output a table of all the fields } }
function espresso_display_worldpay($payment_data) { extract($payment_data); include_once 'Worldpay.php'; global $wpdb, $org_options; $myworldpay = new Espresso_Worldpay(); // initiate an instance of the class echo '<!-- Event Espresso WorldPay Gateway Version ' . $myworldpay->worldpay_gateway_version . '-->'; $worldpay_settings = get_option('event_espresso_worldpay_settings'); $use_sandbox = $worldpay_settings['use_sandbox']; if ($use_sandbox) { $myworldpay->enableTestMode(); } if ($use_sandbox) { // Enable test mode if needed $myworldpay->addField('testMode', '100'); } $myworldpay->addField('instId', $worldpay_settings['worldpay_id']); $myworldpay->addField('cartId', 'wp-' . event_espresso_session_id()); $myworldpay->addField('amount', $event_cost); $myworldpay->addField('MC_id', $attendee_id); $myworldpay->addField('MC_registration_id', $registration_id); //$myworldpay->addField('MC_session_id', session_id()); $myworldpay->addField('MC_type', 'worldpay'); $myworldpay->addField('currency', $worldpay_settings['currency_format']); $myworldpay->addField('MC_callback', get_permalink($org_options['return_url'])); if (!empty($worldpay_settings['bypass_payment_page'])) { $myworldpay->submitPayment(); //Enable auto redirect to payment site } else { $button_url = espresso_select_button_for_display($worldpay_settings['button_url'], "worldpay/worldpay-logo.png"); $myworldpay->submitButton($button_url, 'worldpay'); //Display payment button } if ($use_sandbox) { echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('WorldPay Debug Mode Is Turned On', 'event_espresso') . '</h3>'; $myworldpay->dump_fields(); // for debugging, output a table of all the fields } }
function espresso_display_exact($payment_data) { extract($payment_data); // Setup class include_once 'Exact.php'; global $org_options; $myExact = new Espresso_Exact(); // initiate an instance of the class echo '<!--Event Espresso Exact.com Gateway Version ' . $myExact->gateway_version . '-->'; $exact_settings = get_option('event_espresso_exact_settings'); $exact_login_id = empty($exact_settings['exact_login_id']) ? '' : $exact_settings['exact_login_id']; $exact_transaction_key = empty($exact_settings['exact_transaction_key']) ? '' : $exact_settings['exact_transaction_key']; $button_type = empty($exact_settings['button_type']) ? '' : $exact_settings['button_type']; //$button_url = $exact_settings['button_url']; $image_url = empty($exact_settings['image_url']) ? '' : $exact_settings['image_url']; $use_sandbox = $exact_settings['use_sandbox']; $use_testmode = $exact_settings['test_transactions']; if ($use_testmode == true) { // Enable test mode if needed $myExact->enableTestMode(); } if ($use_sandbox) { // Enable test mode if needed $myExact->useTestServer(); } $quantity = isset($quantity) && $quantity > 0 ? $quantity : espresso_count_attendees_for_registration($attendee_id); $myExact->setUserInfo($exact_login_id, $exact_transaction_key); $myExact->addField('x_amount', number_format($event_cost, 2)); $myExact->addField('x_show_form', 'PAYMENT_FORM'); $myExact->addField('x_reference_3', $registration_id . '|exact'); $myExact->addField('x_relay_response', 'TRUE'); if ($exact_settings['force_ssl_return']) { $home = str_replace("http://", "https://", home_url()); } else { $home = home_url(); } $myExact->addField('x_relay_url', $home . '/?type=exact&page_id=' . $org_options['return_url']); $myExact->addField('x_description', stripslashes_deep($event_name) . ' | ' . __('Reg. ID:', 'event_espresso') . ' ' . $attendee_id . ' | ' . __('Name:', 'event_espresso') . ' ' . stripslashes_deep($fname . ' ' . $lname) . ' | ' . __('Total Registrants:', 'event_espresso') . ' ' . $quantity); $myExact->addField('x_logo_url', $image_url); $myExact->addField('x_invoice_num', event_espresso_session_id()); //Post variables $myExact->addField('x_cust_id', $attendee_id); $myExact->addField('x_first_name', $fname); $myExact->addField('x_last_name', $lname); $myExact->addField('x_email', $attendee_email); $myExact->addField('x_address', $address); $myExact->addField('x_city', $city); $myExact->addField('x_state', $state); $myExact->addField('x_zip', $zip); $myExact->addField('x_fp_sequence', $attendee_id); //Enable this function if you want to send payment notification before the person has paid. //This function is copied on the payment processing page //event_espresso_send_payment_notification($attendee_id, $txn_id, $amount_pd); //Decide if you want to auto redirect to your payment website or display a payment button. if (!empty($exact_settings['bypass_payment_page']) && $exact_settings['bypass_payment_page'] == 'Y') { $myExact->submitPayment(); //Enable auto redirect to payment site } else { if (empty($exact_settings['button_url'])) { //$button_url = EVENT_ESPRESSO_GATEWAY_URL . "exact/exact-logo.png"; if (file_exists(EVENT_ESPRESSO_GATEWAY_DIR . "/exact/exact-logo.png")) { $button_url = EVENT_ESPRESSO_GATEWAY_DIR . "/exact/exact-logo.png"; } else { $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/exact/exact-logo.png"; } } elseif (file_exists($exact_settings['button_url'])) { $button_url = $exact_settings['button_url']; } else { //If no other buttons exist, then use the default location $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/exact/exact-logo.png"; } $myExact->submitButton($button_url, 'exact'); //Display payment button } if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; $myExact->dump_fields(); // for debugging, output a table of all the fields } }
function espresso_display_aim($data) { extract($data); global $org_options; ?> <div class="event-display-boxes"> <?php $authnet_aim_settings = get_option('event_espresso_authnet_aim_settings'); $use_sandbox = $authnet_aim_settings['use_sandbox'] || $authnet_aim_settings['test_transactions']; if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; } if ($authnet_aim_settings['force_ssl_return']) { $home = str_replace('http://', 'https://', home_url()); } else { $home = home_url(); } if ($authnet_aim_settings['display_header']) { ?> <h3 class="payment_header"><?php echo $authnet_aim_settings['header']; ?> </h3><?php } ?> <p class="section-title"><?php _e('Billing Information', 'event_espresso'); ?> </p> <form id="aim_payment_form" name="aim_payment_form" method="post" action="<?php echo $home . '/?page_id=' . $org_options['return_url'] . '®istration_id=' . $registration_id; ?> "> <div class = "event_espresso_form_wrapper"> <p> <label for="first_name"><?php _e('First Name', 'event_espresso'); ?> </label> <input name="first_name" type="text" id="aim_first_name" value="<?php echo $fname; ?> " /> </p> <p> <label for="last_name"><?php _e('Last Name', 'event_espresso'); ?> </label> <input name="last_name" type="text" id="aim_last_name" value="<?php echo $lname; ?> " /> </p> <p> <label for="email"><?php _e('Email Address', 'event_espresso'); ?> </label> <input name="email" type="text" id="aim_email" value="<?php echo $attendee_email; ?> " /> </p> <p> <label for="address"><?php _e('Address', 'event_espresso'); ?> </label> <input name="address" type="text" id="aim_address" value="<?php echo $address; ?> " /> </p> <p> <label for="city"><?php _e('City', 'event_espresso'); ?> </label> <input name="city" type="text" id="aim_city" value="<?php echo $city; ?> " /> </p> <p> <label for="state"><?php _e('State', 'event_espresso'); ?> </label> <input name="state" type="text" id="aim_state" value="<?php echo $state; ?> " /> </p> <p> <label for="zip"><?php _e('Zip', 'event_espresso'); ?> </label> <input name="zip" type="text" id="aim_zip" value="<?php echo $zip; ?> " /> </p> <p><strong><?php _e('Credit Card Information', 'event_espresso'); ?> </strong></p> <p> <label for="card_num"><?php _e('Card Number', 'event_espresso'); ?> </label> <input type="text" name="card_num" id="aim_card_num" /> </p> <p> <label for="exp_date"><?php _e('Exp. Date', 'event_espresso'); ?> </label> <input type="text" name="exp_date" id="aim_exp_date" /> </p> <p> <label for="ccv_code"><?php _e('CCV Code', 'event_espresso'); ?> </label> <input type="text" name="ccv_code" id="aim_ccv_code" /> </p> <input name="amount" type="hidden" value="<?php echo number_format($event_cost, 2); ?> " /> <input name="invoice_num" type="hidden" value="<?php echo 'au-' . event_espresso_session_id(); ?> " /> <input name="authnet_aim" type="hidden" value="true" /> <input name="x_cust_id" type="hidden" value="<?php echo $attendee_id; ?> " /> <input name="aim_submit" id="aim_submit" type="submit" value="<?php _e('Complete Purchase', 'event_espresso'); ?> " /> </div> </form> </div> <?php }
function espresso_display_authnet($payment_data) { extract($payment_data); // Setup class include_once 'Authorize.php'; global $org_options, $wpdb; $myAuthorize = new Espresso_Authorize(); // initiate an instance of the class echo '<!--Event Espresso Authorize.net Gateway Version ' . $myAuthorize->gateway_version . '-->'; $authnet_settings = get_option('event_espresso_authnet_settings'); $authnet_login_id = empty($authnet_settings['authnet_login_id']) ? '' : $authnet_settings['authnet_login_id']; $authnet_transaction_key = empty($authnet_settings['authnet_transaction_key']) ? '' : $authnet_settings['authnet_transaction_key']; $image_url = empty($authnet_settings['image_url']) ? '' : $authnet_settings['image_url']; $use_sandbox = $authnet_settings['use_sandbox']; $use_testmode = $authnet_settings['test_transactions']; if ($use_testmode) { // Enable test mode if needed $myAuthorize->enableTestMode(); } if ($use_sandbox) { // Enable test mode if needed $myAuthorize->useTestServer(); } $quantity = !empty($quantity) ? $quantity : espresso_count_attendees_for_registration($attendee_id); $myAuthorize->setUserInfo($authnet_login_id, $authnet_transaction_key); if ($authnet_settings['force_ssl_return']) { $home = str_replace('http:', 'https:', home_url()); } else { $home = home_url(); } $myAuthorize->addField('x_Relay_URL', $home . '/?page_id=' . $org_options['return_url'] . '&r_id=' . $registration_id . '&type=authnet'); $myAuthorize->addField('x_Description', stripslashes_deep($event_name) . ' | ' . __('Reg. ID:', 'event_espresso') . ' ' . $attendee_id . ' | ' . __('Name:', 'event_espresso') . ' ' . stripslashes_deep($fname . ' ' . $lname) . ' | ' . __('Total Registrants:', 'event_espresso') . ' ' . $quantity); $myAuthorize->addField('x_Amount', number_format($event_cost, 2)); $myAuthorize->addField('x_Logo_URL', $image_url); $myAuthorize->addField('x_Invoice_num', 'au-' . event_espresso_session_id()); //Post variables $myAuthorize->addField('x_cust_id', $attendee_id); $myAuthorize->addField('x_first_name', $fname); $myAuthorize->addField('x_last_name', $lname); $myAuthorize->addField('x_Email', $attendee_email); $myAuthorize->addField('x_Address', $address); $myAuthorize->addField('x_City', $city); $myAuthorize->addField('x_State', $state); $myAuthorize->addField('x_Zip', $zip); $sql = "SELECT attendee_session FROM " . EVENTS_ATTENDEE_TABLE . " WHERE id='" . $attendee_id . "'"; $session_id = $wpdb->get_var($sql); $sql = "SELECT a.final_price, a.quantity, ed.event_name, a.price_option, a.fname, a.lname FROM " . EVENTS_ATTENDEE_TABLE . " a JOIN " . EVENTS_DETAIL_TABLE . " ed ON a.event_id=ed.id "; $sql .= " WHERE attendee_session='" . $session_id . "' ORDER BY a.id ASC"; $items = $wpdb->get_results($sql); foreach ($items as $key => $item) { $item_num = $key + 1; $myAuthorize->addLineItem($item_num, strlen($item->event_name) > 30 ? substr_replace($item->event_name, '', 30) : $item->event_name, substr_replace($item->price_option . ' for ' . $item->event_name . '. Attendee: ' . $item->fname . ' ' . $item->lname, '', 255), $item->quantity, $item->final_price, FALSE); } //Enable this function if you want to send payment notification before the person has paid. //This function is copied on the payment processing page //event_espresso_send_payment_notification($attendee_id, $txn_id, $amount_pd); //Decide if you want to auto redirect to your payment website or display a payment button. if (!empty($authnet_settings['bypass_payment_page']) && $authnet_settings['bypass_payment_page'] == 'Y') { $myAuthorize->submitPayment(); //Enable auto redirect to payment site } else { if (empty($authnet_settings['button_url'])) { //$button_url = EVENT_ESPRESSO_GATEWAY_URL . "authnet/authnet-logo.png"; if (file_exists(EVENT_ESPRESSO_GATEWAY_DIR . "/pay-by-credit-card.png")) { $button_url = EVENT_ESPRESSO_GATEWAY_DIR . "/pay-by-credit-card.png"; } else { $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/pay-by-credit-card.png"; } } elseif (file_exists($authnet_settings['button_url'])) { $button_url = $authnet_settings['button_url']; } else { //If no other buttons exist, then use the default location $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/pay-by-credit-card.png"; } $myAuthorize->submitButton($button_url, 'authnet'); //Display payment button } if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; $myAuthorize->dump_fields(); // for debugging, output a table of all the fields } }
function espresso_display_authnet($payment_data) { extract($payment_data); // Setup class include_once 'Authorize.php'; global $org_options; $myAuthorize = new Authorize(); // initiate an instance of the class echo '<!--Event Espresso Authorize.net Gateway Version ' . $myAuthorize->gateway_version . '-->'; $authnet_settings = get_option('event_espresso_authnet_settings'); $authnet_login_id = empty($authnet_settings['authnet_login_id']) ? '' : $authnet_settings['authnet_login_id']; $authnet_transaction_key = empty($authnet_settings['authnet_transaction_key']) ? '' : $authnet_settings['authnet_transaction_key']; $button_type = empty($authnet_settings['button_type']) ? '' : $authnet_settings['button_type']; //$button_url = $authnet_settings['button_url']; $image_url = empty($authnet_settings['image_url']) ? '' : $authnet_settings['image_url']; $use_sandbox = $authnet_settings['use_sandbox']; $use_testmode = $authnet_settings['test_transactions']; if ($use_testmode == true) { // Enable test mode if needed $myAuthorize->enableTestMode(); } if ($use_sandbox) { // Enable test mode if needed $myAuthorize->useTestServer(); } $quantity = !empty($quantity) ? $quantity : espresso_count_attendees_for_registration($attendee_id); $myAuthorize->setUserInfo($authnet_login_id, $authnet_transaction_key); $myAuthorize->addField('x_Relay_URL', home_url() . '/?page_id=' . $org_options['notify_url']); $myAuthorize->addField('x_Description', stripslashes_deep($event_name) . ' | ' . __('Reg. ID:', 'event_espresso') . ' ' . $attendee_id . ' | ' . __('Name:', 'event_espresso') . ' ' . stripslashes_deep($fname . ' ' . $lname) . ' | ' . __('Total Registrants:', 'event_espresso') . ' ' . $quantity); $myAuthorize->addField('x_Amount', number_format($event_cost, 2)); $myAuthorize->addField('x_Logo_URL', $image_url); $myAuthorize->addField('x_Invoice_num', 'au-' . event_espresso_session_id()); //Post variables $myAuthorize->addField('x_cust_id', $attendee_id); $myAuthorize->addField('x_first_name', $fname); $myAuthorize->addField('x_last_name', $lname); $myAuthorize->addField('x_Email', $attendee_email); $myAuthorize->addField('x_Address', $address); $myAuthorize->addField('x_City', $city); $myAuthorize->addField('x_State', $state); $myAuthorize->addField('x_Zip', $zip); //Enable this function if you want to send payment notification before the person has paid. //This function is copied on the payment processing page //event_espresso_send_payment_notification($attendee_id, $txn_id, $amount_pd); //Decide if you want to auto redirect to your payment website or display a payment button. if (!empty($authnet_settings['bypass_payment_page']) && $authnet_settings['bypass_payment_page'] == 'Y') { $myAuthorize->submitPayment(); //Enable auto redirect to payment site } else { if (empty($authnet_settings['button_url'])) { //$button_url = EVENT_ESPRESSO_GATEWAY_URL . "authnet/btn_cc_vmad.gif"; if (file_exists(EVENT_ESPRESSO_GATEWAY_DIR . "/authnet/btn_cc_vmad.gif")) { $button_url = EVENT_ESPRESSO_GATEWAY_DIR . "/authnet/btn_cc_vmad.gif"; } else { $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/authnet/btn_cc_vmad.gif"; } } elseif (file_exists($authnet_settings['button_url'])) { $button_url = $authnet_settings['button_url']; } else { //If no other buttons exist, then use the default location $button_url = EVENT_ESPRESSO_PLUGINFULLURL . "gateways/authnet/btn_cc_vmad.gif"; } $myAuthorize->submitButton($button_url, 'authnet'); //Display payment button } if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; $myAuthorize->dump_fields(); // for debugging, output a table of all the fields } }
function espresso_session_id_sc() { return event_espresso_session_id(); }
function espresso_display_aim($data) { extract($data); global $org_options; ?> <div id="aim-payment-option-dv" class="payment-option-dv"> <a id="aim-payment-option-lnk" class="payment-option-lnk display-the-hidden" rel="aim-payment-option-form" style="cursor:pointer;"> <img alt="Pay using a Credit Card" src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> gateways/pay-by-credit-card.png"> </a> <div id="aim-payment-option-form-dv" class="hide-if-js"> <?php $authnet_aim_settings = get_option('event_espresso_authnet_aim_settings'); $use_sandbox = $authnet_aim_settings['use_sandbox'] || $authnet_aim_settings['test_transactions']; if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; } if ($authnet_aim_settings['force_ssl_return']) { $home = str_replace('http://', 'https://', home_url()); } else { $home = home_url(); } if ($authnet_aim_settings['display_header']) { ?> <h3 class="payment_header"><?php echo $authnet_aim_settings['header']; ?> </h3><?php } ?> <form id="aim_payment_form" name="aim_payment_form" method="post" action="<?php echo $home . '/?page_id=' . $org_options['return_url'] . '&r_id=' . $registration_id; ?> "> <div class = "event_espresso_form_wrapper"> <fieldset id="aim-billing-info-dv"> <h4 class="section-title"><?php _e('Billing Information', 'event_espresso'); ?> </h4> <p> <label for="first_name"><?php _e('First Name', 'event_espresso'); ?> </label> <input name="first_name" type="text" id="aim_first_name" value="<?php echo $fname; ?> " /> </p> <p> <label for="last_name"><?php _e('Last Name', 'event_espresso'); ?> </label> <input name="last_name" type="text" id="aim_last_name" value="<?php echo $lname; ?> " /> </p> <p> <label for="email"><?php _e('Email Address', 'event_espresso'); ?> </label> <input name="email" type="text" id="aim_email" value="<?php echo $attendee_email; ?> " /> </p> <p> <label for="address"><?php _e('Address', 'event_espresso'); ?> </label> <input name="address" type="text" id="aim_address" value="<?php echo $address; ?> " /> </p> <p> <label for="city"><?php _e('City', 'event_espresso'); ?> </label> <input name="city" type="text" id="aim_city" value="<?php echo $city; ?> " /> </p> <p> <label for="state"><?php _e('State', 'event_espresso'); ?> </label> <input name="state" type="text" id="aim_state" value="<?php echo $state; ?> " /> </p> <p> <label for="zip"><?php _e('Zip', 'event_espresso'); ?> </label> <input name="zip" type="text" id="aim_zip" value="<?php echo $zip; ?> " /> </p> </fieldset> <fieldset id="aim-credit-card-info-dv"> <h4 class="section-title"><?php _e('Credit Card Information', 'event_espresso'); ?> </h4> <p> <label for="card_num"><?php _e('Card Number', 'event_espresso'); ?> </label> <input type="text" name="card_num" id="aim_card_num" /> </p> <p> <label for="exp_date"><?php _e('Exp. Date', 'event_espresso'); ?> </label> <input type="text" name="exp_date" id="aim_exp_date" /> </p> <p> <label for="ccv_code"><?php _e('CCV Code', 'event_espresso'); ?> </label> <input type="text" name="ccv_code" id="aim_ccv_code" /> </p> </fieldset> <input name="amount" type="hidden" value="<?php echo number_format($event_cost, 2); ?> " /> <input name="invoice_num" type="hidden" value="<?php echo 'au-' . event_espresso_session_id(); ?> " /> <input name="authnet_aim" type="hidden" value="true" /> <input name="x_cust_id" type="hidden" value="<?php echo $attendee_id; ?> " /> <p class="event_form_submit"> <input name="aim_submit" id="aim_submit" class="submit-payment-btn" type="submit" value="<?php _e('Complete Purchase', 'event_espresso'); ?> " /> </p> </div> </form> <br/> <p class="choose-diff-pay-option-pg"> <a class="hide-the-displayed" rel="aim-payment-option-form" style="cursor:pointer;"><?php _e('Choose a different payment option', 'event_espresso'); ?> </a> </p> </div> </div> <?php }
function espresso_display_aim($data) { extract($data); global $org_options; wp_register_script('aim', EVENT_ESPRESSO_PLUGINFULLURL . 'gateways/aim/aim.js', array('jquery.validate.js'), '1.0', TRUE); wp_enqueue_script('aim'); ?> <div id="aim-payment-option-dv" class="payment-option-dv"> <a id="aim-payment-option-lnk" class="payment-option-lnk display-the-hidden" rel="aim-payment-option-form" style="cursor:pointer;"> <img alt="Pay using a Credit Card" src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> gateways/pay-by-credit-card.png"> </a> <div id="aim-payment-option-form-dv" class="hide-if-js"> <?php $authnet_aim_settings = get_option('event_espresso_authnet_aim_settings'); $use_sandbox = $authnet_aim_settings['use_sandbox'] || $authnet_aim_settings['test_transactions']; if ($use_sandbox) { echo '<p>Test credit card # 4007000000027</p>'; echo '<h3 style="color:#ff0000;" title="Payments will not be processed">' . __('Debug Mode Is Turned On', 'event_espresso') . '</h3>'; } if ($authnet_aim_settings['force_ssl_return']) { $home = str_replace('http://', 'https://', home_url()); } else { $home = home_url(); } if ($authnet_aim_settings['display_header']) { ?> <h3 class="payment_header"><?php echo $authnet_aim_settings['header']; ?> </h3><?php } ?> <form id="aim_payment_form" name="aim_payment_form" method="post" action="<?php echo $home . '/?page_id=' . $org_options['return_url'] . '&r_id=' . $registration_id; ?> "> <div class = "event_espresso_form_wrapper"> <fieldset id="aim-billing-info-dv"> <h4 class="section-title"><?php _e('Billing Information', 'event_espresso'); ?> </h4> <p> <label for="first_name"><?php _e('First Name', 'event_espresso'); ?> </label> <input name="first_name" type="text" id="aim_first_name" value="<?php echo $fname; ?> " class="required"/> </p> <p> <label for="last_name"><?php _e('Last Name', 'event_espresso'); ?> </label> <input name="last_name" type="text" id="aim_last_name" value="<?php echo $lname; ?> " class="required"/> </p> <p> <label for="email"><?php _e('Email Address', 'event_espresso'); ?> </label> <input name="email" type="text" id="aim_email" value="<?php echo $attendee_email; ?> " class="required"/> </p> <p> <label for="address"><?php _e('Address', 'event_espresso'); ?> </label> <input name="address" type="text" id="aim_address" value="<?php echo $address; ?> " class="required" /> </p> <p> <label for="city"><?php _e('City', 'event_espresso'); ?> </label> <input name="city" type="text" id="aim_city" value="<?php echo $city; ?> " class="required" /> </p> <p> <label for="state"><?php _e('State', 'event_espresso'); ?> </label> <input name="state" type="text" id="aim_state" value="<?php echo $state; ?> " class="required" /> </p> <p> <label for="zip"><?php _e('Zip', 'event_espresso'); ?> </label> <input name="zip" type="text" id="aim_zip" value="<?php echo $zip; ?> " class="required" /> </p> </fieldset> <fieldset id="aim-credit-card-info-dv"> <h4 class="section-title"><?php _e('Credit Card Information', 'event_espresso'); ?> </h4> <p> <label for="card_num"><?php _e('Card Number', 'event_espresso'); ?> </label> <input type="text" name="card_num" id="aim_card_num" autocomplete="off" class="required" /> </p> <p> <label for="card-exp"><?php _e('Expiration Month', 'event_espresso'); ?> </label> <select id="aim_card-exp" name ="exp_month" class="med required"> <?php $curr_month = date("m"); for ($i = 1; $i < 13; $i++) { $val = $i; if ($i < 10) { $val = '0' . $i; } $selected = $i == $curr_month ? " selected" : ""; echo "<option value='{$val}'{$selected}>{$val}</option>"; } ?> </select> </p> <p> <label for="exp-year"><?php _e('Expiration Year', 'event_espresso'); ?> </label> <select id="aim_exp_year" name ="exp_year" class="med required"> <?php $curr_year = date("Y"); for ($i = 0; $i < 10; $i++) { $disp_year = $curr_year + $i; $selected = $i == 0 ? " selected" : ""; echo "<option value='{$disp_year}'{$selected}>{$disp_year}</option>"; } ?> </select> </p> <p> <label for="ccv_code"><?php _e('CCV Code', 'event_espresso'); ?> </label> <input type="text" name="ccv_code" id="aim_ccv_code" autocomplete="off" class="small required"/> </p> </fieldset> <input name="amount" type="hidden" value="<?php echo number_format($event_cost, 2); ?> " /> <input name="invoice_num" type="hidden" value="<?php echo 'au-' . event_espresso_session_id(); ?> " /> <input name="authnet_aim" type="hidden" value="true" /> <input name="x_cust_id" type="hidden" value="<?php echo $attendee_id; ?> " /> <input name="aim_submit" id="aim_submit" class="submit-payment-btn allow-leave-page" type="submit" value="<?php _e('Complete Purchase', 'event_espresso'); ?> " /> <div class="clear"></div> </div> </form> <br/> <p class="choose-diff-pay-option-pg"> <a class="hide-the-displayed" rel="aim-payment-option-form" style="cursor:pointer;"><?php _e('Choose a different payment option', 'event_espresso'); ?> </a> </p> </div> </div> <?php }