Skip to content

Instantly share code, notes, and snippets.

@webaware
Created July 12, 2018 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webaware/ea1261d9aae60f86bb7d8b7ea7fea589 to your computer and use it in GitHub Desktop.
Save webaware/ea1261d9aae60f86bb7d8b7ea7fea589 to your computer and use it in GitHub Desktop.
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