本文整理汇总了PHP中event_espresso_require_gateway函数的典型用法代码示例。如果您正苦于以下问题:PHP event_espresso_require_gateway函数的具体用法?PHP event_espresso_require_gateway怎么用?PHP event_espresso_require_gateway使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了event_espresso_require_gateway函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: espresso_process_moneris_hpp
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;
}
示例2: email_after_payment
/**
* 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);
}
示例3: add_action
<?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');
}
示例4: _e
" 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;
示例5: add_action
<?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;
}
示例6: wp_register_script
<?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');
}
示例7: get_option
<?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");
}
示例8: define
<?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');
}
示例9: exit
<?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);
示例10: event_espresso_init_active_gateways
/**
* 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);
}
}
示例11: espresso_display_moneris_hpp
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);
//.........这里部分代码省略.........
示例12: do_action
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';