Created
July 12, 2018 23:44
-
-
Save webaware/ea1261d9aae60f86bb7d8b7ea7fea589 to your computer and use it in GitHub Desktop.
Add an extra fee for eWAY transactions in Events Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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