Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Different payment gateways for different events | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Different payment gateways for different events

Different payment gateways for different events

Posted: September 30, 2013 at 7:13 am

Viewing 1 reply thread


jcooper

September 30, 2013 at 7:13 am

Hi,

We have two different Worldpay accounts which are used for different event locations.

Is there a way of setting this up with event espresso.

-Alex


Josh

September 30, 2013 at 10:01 am

Hi Alex,

There’s a way to make this happen with the PayPal and Stripe gateways along with the Meta key box.

Basically how this works with the PayPal and Stripe gateways is you enter an alternate payment ID in the event’s Event Meta box.

You can modify the WorldPay gateway to do use the same feature. If you look in /gateways/worldpay/worldpay_vars.php you’ll find the line where the WorldPay ID pulls in the WorldPay Installation ID setting (to set the instID field) on line 21:

$myworldpay->addField('instId', $worldpay_settings['worldpay_id']);

Just before line 21 you can add this check:

//Check for an alternate WorldPay account
if (isset($event_meta['worldpay_id']) && !empty($event_meta['worldpay_id']) && filter_var($event_meta['worldpay_id'], FILTER_VALIDATE_EMAIL) != FALSE) {
	//Alternate WorldPay ID - using the worldpay_id meta key field.
	$my_worldpay_id = $event_meta['worldpay_id'];
} else {
	$my_worldpay_id = empty($worldpay_settings['worldpay_id']) ? '' : $worldpay_settings['worldpay_id'];
}

then change the instID field to use your new variable:

$myworldpay->addField('instId', $my_worldpay_id);

What will happen is the default payment account will be used for events where no worldpay_id key is entered. The events that have a valid Worldpay Installation ID entered as the value for the worldpay_id key will use the alternate account.

Hope that helps!

Viewing 1 reply thread

The support post ‘Different payment gateways for different events’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server