function espresso_process_moneris_hpp($payment_data) { do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, ''); if (!class_exists('EE_Moneris_HPP')) { event_espresso_require_gateway('moneris_hpp/EE_Moneris_HPP.class.php'); } $EE_Moneris_HPP = new EE_Moneris_HPP(); $EE_Moneris_HPP->ipnLog = FALSE; // TRUE FALSE // if TXN mode = Development, Debug or anything other than Production if ($EE_Moneris_HPP->settings['moneris_hpp_txn_mode'] != 'prod') { $EE_Moneris_HPP->enableTestMode(); } // printr( $_POST, '$_POST <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); // SEE BELOW FOR SAMPLE POST RESPONSE $payment_data['txn_type'] = 'Moneris Hosted Pay Page'; $payment_data['txn_id'] = 0; $payment_data['payment_status'] = 'Incomplete'; $payment_data['txn_details'] = serialize($_REQUEST); // printr( $payment_data, '$payment_data <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); if ($EE_Moneris_HPP->validateIpn()) { // printr( $EE_Moneris_HPP->ipnData, '$EE_Moneris_HPP->ipnData <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); $payment_data['txn_details'] = serialize($EE_Moneris_HPP->ipnData); $payment_data['txn_id'] = $EE_Moneris_HPP->ipnData['bank_transaction_id']; $totals_match = (double) $EE_Moneris_HPP->ipnData['charge_total'] == (double) $payment_data['total_cost'] ? TRUE : FALSE; $txn_approved = (int) $EE_Moneris_HPP->ipnData['response_code'] <= 50 ? TRUE : FALSE; $log_entry = 'response_order_id = ' . $EE_Moneris_HPP->ipnData['response_order_id'] . ', & '; $log_entry .= 'charge_total = ' . $EE_Moneris_HPP->ipnData['charge_total'] . ', & '; $log_entry .= 'total_cost = ' . $payment_data['total_cost'] . ', & '; $log_entry .= 'response_code = ' . $EE_Moneris_HPP->ipnData['response_code']; $EE_Moneris_HPP->moneris_hpp_log($log_entry); if ($totals_match && $txn_approved) { $payment_data['payment_status'] = 'Completed'; $payment_data['txn_id'] = $EE_Moneris_HPP->ipnData['bank_transaction_id']; if ($EE_Moneris_HPP->testMode) { // For this, we'll just email ourselves ALL the data as plain text output. $subject = 'Instant Payment Notification - Gateway Variable Dump'; $body = "An instant payment notification was successfully recieved\n"; $body .= "from " . $EE_Moneris_HPP->ipnData['email'] . " on " . date('Y-m-d'); $body .= " at " . date('g:i A') . "\n\nDetails:\n"; foreach ($EE_Moneris_HPP->ipnData as $key => $value) { $body .= "\n{$key}: {$value}\n"; } wp_mail($payment_data['contact'], $subject, $body); } } else { $subject = 'Instant Payment Notification - Gateway Variable Dump'; $body = "An instant payment notification failed\n"; $body .= "from " . $EE_Moneris_HPP->ipnData['email'] . " on " . date('Y-m-d'); $body .= " at " . date('g:i A') . "\n\nDetails:\n"; foreach ($EE_Moneris_HPP->ipnData as $key => $value) { $body .= "\n{$key}: {$value}\n"; } wp_mail($payment_data['contact'], $subject, $body); } } add_action('action_hook_espresso_email_after_payment', 'espresso_email_after_payment'); return $payment_data; }
/** * E-mail after payment * * @see https://github.com/eventespresso/event-espresso-legacy/blob/3.1.35.P/includes/process-registration/payment_page.php#L407 * * @param array $payment_data */ public static function email_after_payment($payment_data) { event_espresso_require_gateway('process_payments.php'); /* * Load the email.php functions file * * @see https://github.com/eventespresso/event-espresso-legacy/blob/3.1.35.P/espresso.php#L464 */ $filename = EVENT_ESPRESSO_INCLUDES_DIR . 'functions/email.php'; if (is_readable($filename)) { require_once $filename; } // Actions add_action('action_hook_espresso_email_after_payment', 'espresso_email_after_payment'); do_action('action_hook_espresso_email_after_payment', $payment_data); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("usaepay_offsite/payment.php"); // This is for the return from 2Checkout's servers if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'usaepay_offsite') { event_espresso_require_gateway("usaepay_offsite/return.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_usaepay_offsite_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_usaepay_offsite'); }
" class="inline-link" title="<?php _e('Finalize your registration', 'event_espresso'); ?> "><?php _e('click here to finalize your registration', 'event_espresso'); ?> </a> </p> </div> <?php } global $gateway_formal_names; $gateway_formal_names = array(); $active_gateways = get_option('event_espresso_active_gateways', array()); foreach ($active_gateways as $gateway => $path) { event_espresso_require_gateway($gateway . "/init.php"); } $gateway_formal_names = apply_filters('action_hook_espresso_gateway_formal_name', $gateway_formal_names); $data['fname'] = $fname; $data['lname'] = $lname; if (empty($attendee_email)) { $data['attendee_email'] = $email; } else { $data['attendee_email'] = $attendee_email; } $data['address'] = isset($address) && !empty($address) ? $address : ''; $data['city'] = isset($city) && !empty($city) ? $city : ''; $data['state'] = isset($state) && !empty($state) ? $state : ''; $data['zip'] = isset($zip) && !empty($zip) ? $zip : ''; if (empty($event_cost)) { $data['event_cost'] = $total_cost;
<?php // This is for the display gateways add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); add_action('action_hook_espresso_display_onsite_payment_gateway', 'espresso_process_ideal'); event_espresso_require_gateway("ideal/ideal_vars.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_ideal_get_attendee_id'); if (!empty($_GET['transaction_id']) && !empty($_REQUEST['type']) && $_REQUEST['type'] == 'ideal') { event_espresso_require_gateway("ideal/report.php"); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_ideal_report'); } function espresso_transactions_ideal_get_attendee_id($attendee_id) { if (isset($_REQUEST['id'])) { $attendee_id = $_REQUEST['id']; } return $attendee_id; }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("realauth/realauth_vars.php"); // And this is for the return from realauth's server if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'realauth') { event_espresso_require_gateway("realauth/realauthprocesspayment.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_realauth_get_attendee_id'); add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_realauth'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_realauth'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("beanstream/payment.php"); // And this is for the thank you page to process the transaction if (!empty($_REQUEST['beanstream'])) { event_espresso_require_gateway("beanstream/return.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_beanstream_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_beanstream'); }
<?php // This is for the gateway display wp_register_script('megasoft', EVENT_ESPRESSO_PLUGINFULLURL . 'gateways/megasoft/megasoft.js', array('jquery', 'jquery.validate.js'), '1.0', TRUE); add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("megasoft/payment.php"); // This is for the thank you page to process the transaction if (!empty($_REQUEST['megasoft'])) { event_espresso_require_gateway("megasoft/return.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_megasoft_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_megasoft'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("exact/exact_vars.php"); // This is for the return from exact's server if (!empty($_REQUEST['x_reference_3'])) { $temp_array = explode('|', $_REQUEST['x_reference_3']); $_REQUEST['registration_id'] = $temp_array[0]; $_REQUEST['type'] = $temp_array[1]; } if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'exact') { event_espresso_require_gateway("exact/exact_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_exact_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_exact'); }
<?php add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("alipay/index.php");
<?php // This is for the gateway display $invoice_payment_settings = get_option('event_espresso_invoice_payment_settings'); if ($invoice_payment_settings['show'] != 'N') { add_action('action_hook_espresso_display_offline_payment_header', 'espresso_display_offline_payment_header'); add_action('action_hook_espresso_display_offline_payment_footer', 'espresso_display_offline_payment_footer'); event_espresso_require_gateway("invoice/invoice_vars.php"); }
<?php //a few globals define('ESPRESSO_QBSM_DEV_APP_ID', '245799785'); define('ESPRESSO_QBMS_DEV_APP_LOGIN', 'eventespresso.com2.eventespresso.com'); define('ESPRESSO_QBMS_LIVE_APP_ID', '679873720'); define('ESPRESSO_QBMS_LIVE_APP_LOGIN', 'eventespresso.eventespresso.com'); //Display Gateway add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("qbms/qbms_vars.php"); //Process Payment if (!empty($_REQUEST['qbms'])) { event_espresso_require_gateway("qbms/do_transaction.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_qbms_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_qbms'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("aim/aim_vars.php"); // This is for the thank you page to process the transaction if (!empty($_REQUEST['authnet_aim'])) { event_espresso_require_gateway("aim/aim_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_aim_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_aim'); }
<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } //echo '<h3>'. basename( __FILE__ ) . ' LOADED <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway('moneris_hpp/moneris_hpp_vars.php'); // This is for the transaction processing event_espresso_require_gateway('moneris_hpp/moneris_hpp_ipn.php'); // check for moneris response and that response was posted within the last 15 minutes if (isset($_POST['rvar_moneris_hpp']) && $_POST['rvar_moneris_hpp'] <= time() && $_POST['rvar_moneris_hpp'] >= time() - 900) { add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_moneris_hpp_get_attendee_id'); // add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_moneris_hpp'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_moneris_hpp'); } function espresso_moneris_hpp_formal_name($gateway_formal_names) { $gateway_formal_names['moneris_hpp'] = 'Moneris Hosted Pay Page'; return $gateway_formal_names; } add_filter('action_hook_espresso_gateway_formal_name', 'espresso_moneris_hpp_formal_name', 10, 1); function espresso_moneris_hpp_payment_type($gateway_payment_types) { $gateway_payment_types['moneris_hpp'] = 'Moneris Hosted Pay Page / Credit Card'; return $gateway_payment_types; } add_filter('action_hook_espresso_gateway_payment_type', 'espresso_moneris_hpp_payment_type', 10, 1);
<?php // This is for the gateway display add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("usaepay_onsite/usaepay_onsite_vars.php"); // And this is for the thank you page to process the transaction if (!empty($_REQUEST['usaepay_onsite'])) { event_espresso_require_gateway("usaepay_onsite/DoDirectPayment.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_usaepay_onsite_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_usaepay_onsite'); }
<?php // This is for the display gateways add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("paytrace/paytrace_vars.php"); // this is for the thank you page to process the transaction if (!empty($_POST['paytrace'])) { event_espresso_require_gateway("paytrace/do_transaction.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_paytrace_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_paytrace'); }
/** * initialized each active gateway. this is added onto the 'plugins_loaded' hook so taht each active gateway will be called. * before each gateway was included only on pages with important shortcodes (like transaction, or payment) but that wasn't enough power * for some gateways (eg: the google checkout gateway needed to be able to add a hook on init for all page loads, which it coudln't do before) */ function event_espresso_init_active_gateways() { $active_gateways = apply_filters('action_filter_espresso_active_gateways', get_option('event_espresso_active_gateways', array())); foreach ($active_gateways as $gateway => $path) { event_espresso_require_gateway($gateway . "/init.php", false); } }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("authnet/authnet_vars.php"); //This is for the return from authnet's servers if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'authnet') { event_espresso_require_gateway("authnet/authnet_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_authnet_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_authnet'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("firstdata_e4/e4_vars.php"); // This is for the return from firstdata_e4's server if (!empty($_REQUEST['x_reference_3'])) { $temp_array = explode('|', $_REQUEST['x_reference_3']); $_REQUEST['registration_id'] = $temp_array[0]; $_REQUEST['type'] = $temp_array[1]; } if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'firstdata_e4') { event_espresso_require_gateway("firstdata_e4/e4_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_firstdata_e4_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_firstdata_e4'); }
<?php // This is for gateway display add_action('action_hook_espresso_display_offline_payment_header', 'espresso_display_offline_payment_header'); add_action('action_hook_espresso_display_offline_payment_footer', 'espresso_display_offline_payment_footer'); event_espresso_require_gateway("check/check_payment_vars.php"); // This is for the thank you page if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'check') { event_espresso_require_gateway("check/check_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_check_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_check'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("google_checkout/google_checkout_vars.php"); // This is for the transaction processing if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'google_checkout') { event_espresso_require_gateway("google_checkout/google_checkout_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_google_checkout_get_attendee_id'); add_filter('filter_hook_espresso_prepare_payment_data_for_gateways', 'espresso_transactions_google_checkout_prepare_payment_data'); add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_google_checkout_done_payment'); add_action('action_hook_espresso_before_payment_overview', 'espresso_process_google_checkout_done_payment'); add_action('init', 'espresso_google_run_transaction_code_before_shortcode'); } function espresso_google_checkout_formal_name($gateway_formal_names) { $gateway_formal_names['google_checkout'] = 'Google Checkout'; } add_filter('action_hook_espresso_gateway_formal_name', 'espresso_google_checkout_formal_name', 10, 1); function espresso_google_checkout_payment_type($gateway_payment_types) { $gateway_payment_types['google_checkout'] = 'Google Checkout / Credit Card'; } add_filter('action_hook_espresso_gateway_payment_type', 'espresso_google_checkout_payment_type', 10, 1);
<?php // This is for gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("eway/eway_vars.php"); // This is for return from eWay if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'eway') { event_espresso_require_gateway("eway/ewaypaymentprocess.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_eway_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_eway'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("anz/anz_vars.php"); // This is for the transaction processing event_espresso_require_gateway("anz/anz_ipn.php"); if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'anz') { add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_anz_get_attendee_id'); //add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_anz'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_anz'); } function espresso_anz_formal_name($gateway_formal_names) { $gateway_formal_names['anz'] = 'ANZ '; } add_filter('action_hook_espresso_gateway_formal_name', 'espresso_anz_formal_name', 10, 1); function espresso_anz_payment_type($gateway_payment_types) { $gateway_payment_types['anz'] = 'anz / Credit Card'; } add_filter('action_hook_espresso_gateway_payment_type', 'espresso_anz_payment_type', 10, 1);
<?php // This is for the gateway display add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("nab/nab_vars.php"); // This is for the transaction processing if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'nab') { event_espresso_require_gateway("nab/nabpaymentprocess.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_nab_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_nab'); }
<?php // This is for the gateway display add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); event_espresso_require_gateway("psigate/psigate_vars.php"); // This is for the transaction processing event_espresso_require_gateway("psigate/psigate_ipn.php"); if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'psigate') { add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_psigate_get_attendee_id'); //add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_psigate'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_psigate'); } function espresso_psigate_formal_name($gateway_formal_names) { $gateway_formal_names['psigate'] = 'PSiGate'; } add_filter('action_hook_espresso_gateway_formal_name', 'espresso_psigate_formal_name', 10, 1); function espresso_psigate_payment_type($gateway_payment_types) { $gateway_payment_types['psigate'] = 'PSiGate / Credit Card'; } add_filter('action_hook_espresso_gateway_payment_type', 'espresso_psigate_payment_type', 10, 1);
<?php // This is for the gateway display add_action('action_hook_espresso_display_onsite_payment_header', 'espresso_display_onsite_payment_header'); add_action('action_hook_espresso_display_onsite_payment_footer', 'espresso_display_onsite_payment_footer'); event_espresso_require_gateway("eway_rapid3/eway_rapid3_vars.php"); // And this is for the thank you page to process the transaction if (!empty($_REQUEST['eway_rapid3'])) { event_espresso_require_gateway("eway_rapid3/DoDirectPayment.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_eway_rapid3_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_eway_rapid3'); }
function espresso_display_moneris_hpp($payment_data) { global $wpdb, $org_options; extract($payment_data); if (!class_exists('EE_Moneris_HPP')) { event_espresso_require_gateway('moneris_hpp/EE_Moneris_HPP.class.php'); } $EE_Moneris_HPP = new EE_Moneris_HPP(); if ($EE_Moneris_HPP->settings['moneris_hpp_txn_mode'] != 'prod') { $EE_Moneris_HPP->enableTestMode(); } do_action('action_hook_espresso_use_add_on_functions'); // ps_store_id Identifies the configuration for the Hosted Paypage. $EE_Moneris_HPP->addField('ps_store_id', $EE_Moneris_HPP->settings['moneris_hpp_ps_store_id']); // hpp_key This is a security key that corresponds to the ps_store_id. $EE_Moneris_HPP->addField('hpp_key', $EE_Moneris_HPP->settings['moneris_hpp_key']); // the time the transaction was initiated $EE_Moneris_HPP->addField('rvar_moneris_hpp', time()); // lang en-ca = English fr-ca = French // note text This is any special instructions that you or the cardholder might like to store. MAX 50 chars. $EE_Moneris_HPP->addField('lang', $EE_Moneris_HPP->settings['moneris_hpp_lang']); switch ($EE_Moneris_HPP->settings['moneris_hpp_country']) { case 'us': $currency = 'USD'; break; default: $currency = 'CAD'; } $EE_Moneris_HPP->addField('currency_code', $currency); // get attendee_session $SQL = "SELECT attendee_session FROM " . EVENTS_ATTENDEE_TABLE . " WHERE id=%d"; $session_id = $wpdb->get_var($wpdb->prepare($SQL, $attendee_id)); // now get all registrations for that session $SQL = "SELECT a.id, a.registration_id, a.final_price, a.orig_price, a.quantity, a.price_option, a.fname, a.lname, ed.event_name"; $SQL .= " FROM " . EVENTS_ATTENDEE_TABLE . " a "; $SQL .= " JOIN " . EVENTS_DETAIL_TABLE . " ed ON a.event_id=ed.id "; $SQL .= " WHERE attendee_session=%s ORDER BY a.id ASC"; $items = $wpdb->get_results($wpdb->prepare($SQL, $session_id)); //printr( $items, '$items <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); $total = 0; $paid = 0; foreach ($items as $item_num => $item) { $item_num++; // if this the primary attendee if ($item_num == 1) { // cust_id This is an ID field that can be used to identify the client MAX 50 chars. $EE_Moneris_HPP->addField('cust_id', $registration_id); // order_id MUST be unique per transaction MAX 50 chars. // $EE_Moneris_HPP->addField( 'order_id', $registration_id ); // email Customer email address. MAX 50 chars. $EE_Moneris_HPP->addField('email', $attendee_email); } // idn Product Code - SKU (max 10 chars) $EE_Moneris_HPP->addField('id' . $item_num, $item->id); // descriptionn Product Description - (max 15 chars) $EE_Moneris_HPP->addField('description' . $item_num, $item->event_name . '. Attendee: ' . $item->fname . ' ' . $item->lname); // quantityn Quantity of Goods Purchased - (max - 4 digits) $EE_Moneris_HPP->addField('quantity' . $item_num, absint($item->quantity)); // pricen Unit Price - (max - "7"."2" digits, i.e. min 0.00 & max 9999999.99) $EE_Moneris_HPP->addField('price' . $item_num, number_format($item->final_price, 2, '.', '')); // subtotaln Quantity X Price of Product - ( max - "7"."2" digits, i.e. min 0.00 & max 9999999.99) $EE_Moneris_HPP->addField('subtotal' . $item_num, number_format($item->final_price * absint($item->quantity), 2, '.', '')); $total += $item->final_price * absint($item->quantity); $paid += $item->amount_pd; } if ((double) $paid > 0) { // idn Product Code - SKU (max 10 chars) $EE_Moneris_HPP->addField('id' . $item_num, ''); // descriptionn Product Description - (max 15 chars) $EE_Moneris_HPP->addField('description' . $item_num, 'Total paid to date'); // quantityn Quantity of Goods Purchased - (max - 4 digits) $EE_Moneris_HPP->addField('quantity' . $item_num, 1); // pricen Unit Price - (max - "7"."2" digits, i.e. min 0.00 & max 9999999.99) $EE_Moneris_HPP->addField('price' . $item_num, number_format($paid * -1, 2, '.', '')); // subtotaln Quantity X Price of Product - ( max - "7"."2" digits, i.e. min 0.00 & max 9999999.99) $EE_Moneris_HPP->addField('subtotal' . $item_num, number_format($paid * -1, 2, '.', '')); } // gst This is where you would include Goods and Services Tax charged, (min 0.00 & max 9999999.99) // pst This is where you would include Provincial Sales Tax charged, (min 0.00 & max 9999999.99) // hst This is where you would include Harmonized Sales Tax charged, (min 0.00 & max 9999999.99) $total = number_format($total - $paid, 2, '.', ''); if (WP_DEBUG && current_user_can('update_core')) { // $current_user = wp_get_current_user(); // $user_id = $current_user->ID; // $total = $user_id < 3 ? 0.01 : $total; } // charge_total Final purchase Amount - no $, must include 2 decimal places $EE_Moneris_HPP->addField('charge_total', $total); $country = isset($country) ? $country : ''; // bill_first_name text - max 30 chars // bill_last_name text - max 30 chars // bill_company_name text - max 30 chars // bill_address_one text - max 30 chars // bill_city text - max 30 chars // bill_state_or_province text - max 30 chars // bill_postal_code text - max 30 chars // bill_country text - max 30 chars // bill_phone text - max 30 chars // bill_fax text - max 30 chars $EE_Moneris_HPP->addField('bill_first_name', $fname); $EE_Moneris_HPP->addField('bill_last_name', $lname); $EE_Moneris_HPP->addField('bill_address_one', $address); $EE_Moneris_HPP->addField('bill_city', $city); $EE_Moneris_HPP->addField('bill_state_or_province', $state); $EE_Moneris_HPP->addField('bill_country', $country); $EE_Moneris_HPP->addField('bill_postal_code', $zip); // if txn mode is not production (live site) if ($EE_Moneris_HPP->settings['moneris_hpp_txn_mode'] != 'prod') { echo ' <h4 style="color:#ff0000;" title="Payments will not be processed">' . __('Moneris Hosted Pay Page Debug Mode Is Turned On', 'event_espresso') . '</h4> <h5>Credit Card Test Numbers</h5> <ul> <li>MasterCard 5454545454545454</li> <li>Visa 4242424242424242</li> <li>Amex 373599005095005</li> <li>Diners 36462462742008</li> </ul> '; if ($EE_Moneris_HPP->settings['moneris_hpp_txn_mode'] == 'debug') { $EE_Moneris_HPP->dump_fields(); } } if (empty($EE_Moneris_HPP->settings['button_url'])) { $EE_Moneris_HPP->settings['button_url'] = EVENT_ESPRESSO_PLUGINFULLURL . 'gateways/pay-by-credit-card.png'; } $EE_Moneris_HPP->submitButton($EE_Moneris_HPP->settings['button_url'], 'moneris_hpp'); }
<?php // This is for gateway display add_action('action_hook_espresso_display_offline_payment_header', 'espresso_display_offline_payment_header'); add_action('action_hook_espresso_display_offline_payment_footer', 'espresso_display_offline_payment_footer'); event_espresso_require_gateway("purchase_order/po_payment_vars.php"); // This is for the thank you page if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'purchase_order') { event_espresso_require_gateway("purchase_order/po_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_purchase_order_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_purchase_order'); }
<?php add_action('action_hook_espresso_display_offsite_payment_header', 'espresso_display_offsite_payment_header'); add_action('action_hook_espresso_display_offsite_payment_footer', 'espresso_display_offsite_payment_footer'); if (!empty($_REQUEST['MC_type']) && $_REQUEST['MC_type'] == 'worldpay') { event_espresso_require_gateway("worldpay/worldpay_ipn.php"); add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_worldpay_get_attendee_id'); add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_worldpay'); } else { event_espresso_require_gateway("worldpay/worldpay_vars.php"); }
do_action('action_hook_espresso_social_update_api'); do_action('action_hook_espresso_recurring_update_api'); do_action('action_hook_espresso_ticketing_update_api'); do_action('action_hook_espresso_mailchimp_update_api'); //New form builder require_once "includes/form-builder/index.php"; require_once "includes/form-builder/groups/index.php"; //Install/Update Tables when plugin is activated require_once "includes/functions/database_install.php"; register_activation_hook(__FILE__, 'events_data_tables_install'); register_activation_hook(__FILE__, 'espresso_update_active_gateways'); //Premium funtions. If this is a paid version, then we need to include these files. //Premium upgrade options if the piad plugin is not installed require_once "includes/premium_upgrade.php"; //Get the payment settings page event_espresso_require_gateway('payment_gateways.php'); //Email Manager if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/email-manager/index.php')) { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/email-manager/index.php'; } else { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/email-manager.php'; } //Event Registration Subpage - Add/Delete/Edit Venues if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/venue-management/index.php')) { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/venue-management/index.php'; } else { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/venue_management.php'; } //Add/Delete/Edit Locales if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/locale-management/index.php')) { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/locale-management/index.php';