<?php 

require_once(dirname(__FILE__)."/pages/paystack.php");
require_once(dirname(__FILE__)."/pages/process-paystack.php");

function paystack_gateway_charge($amount, $currency = "NGN"){
	switch ($currency) {
		case 'NGN':
				$charge = 0.015 * $amount; //1.5% + N100 https://support.paystack.com/hc/en-us/articles/360009881920-What-are-Paystack-s-transaction-charges-
				if($amount > 2500) {
					$charge += 100;
				}
				return $charge > 2000 ? 2000 : $charge;
			break;

		case 'USD':
				$charge = 0.039 * $amount; //3.9% flat https://support.paystack.com/hc/en-us/articles/360009973799-Can-I-accept-payments-in-USD-
				return $charge;
			break;
		
		default:
			return 0;
			break;
	}
	
}