Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add an extra fee for eWAY transactions in Events Manager
<?php
/*
Plugin Name: Events Manager eWAY Extra Fee
Plugin URI: https://gist.github.com/webaware/ea1261d9aae60f86bb7d8b7ea7fea589
Description: Add a fee to booking for eWAY transactions
Version: 1
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
/**
* add a fee to the Events Manager booking price for eWAY
* @param float $price
* @param EM_Booking $booking
* @return float
*/
add_filter('em_eway_amount', function($price, $EM_Booking) {
// define your additional fee
$extra_fee = 2.0;
// add extra fee
$price += $extra_fee;
return $price;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment