<?php       
global $conn;
$payment_extensions_qry="select option_value from `ct_settings` where `option_name`='ct_payment_extensions'";
$payment_extensions_runqry=mysqli_query($conn,$payment_extensions_qry);
$result=mysqli_fetch_row($payment_extensions_runqry);
$final_result = unserialize($result[0]);
if(isset($final_result) && $final_result !== false){
	foreach($final_result as $key=>$value){
		$ext_path = $value['include_path'];
		if($ext_path != ''){
			if(is_file(dirname(dirname(__FILE__)).$ext_path)){
				include(dirname(dirname(__FILE__)).$ext_path);
			}
		}
	}
}

function payment_setting($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_setting();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_setting();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_setting();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_setting();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_setting();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_setting();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_setting();
	}
}

function payment_settings_save_js($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_settings_save_js();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_settings_save_js();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_settings_save_js();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_settings_save_js();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_settings_save_js();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_settings_save_js();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_settings_save_js();
	}
}

function payment_currency_check_js($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_aud_currency_check_js();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_ngn_currency_check_js();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_zar_currency_check_js();
	}
}

function payment_validation_js($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_validation_js();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_validation_js();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_validation_js();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_validation_js();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_validation_js();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_validation_js();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_validation_js();
	}
}

function payment_settings_save_ajax($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_settings_save_ajax();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_settings_save_ajax();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_settings_save_ajax();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_settings_save_ajax();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_settings_save_ajax();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_settings_save_ajax();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_settings_save_ajax();
	}
}

function payment_payment_selection($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_payment_selection();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_payment_selection();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_payment_selection();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_payment_selection();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_payment_selection();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_payment_selection();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_payment_selection();
	}
}

function payment_display_cardbox_condition($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_display_cardbox_condition();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_display_cardbox_condition();
	}
}

function payment_partial_deposit_toggle_condition($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_partial_deposit_toggle_condition();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_partial_deposit_toggle_condition();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_partial_deposit_toggle_condition();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_partial_deposit_toggle_condition();
	}
}

function payment_checkout($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_checkout();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_checkout();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_checkout();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_checkout();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_checkout();
	}
}

function payment_process_js($hook_name){
	if($hook_name == 'ct_payway_purchase_status'){
		return payway_process_js();
	}else if($hook_name == 'ct_eway_purchase_status'){
		return eway_process_js();
	}else if($hook_name == 'ct_paystack_purchase_status'){
		return paystack_process_js();
	}else if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_process_js();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_process_js();
	}else if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_process_js();
	}else if($hook_name == 'ct_mollie_purchase_status'){
		return mollie_process_js();
	}
}

function payment_form($hook_name){
	if($hook_name == 'ct_paytm_purchase_status'){
		return paytm_form_check();
	}else if($hook_name == 'ct_payfast_purchase_status'){
		return payfast_form_check();
	}
}

function payment_transation($hook_name){
	if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_payment_transation();
	}elseif($hook_name == 'ct_mollie_purchase_status'){
		return mollie_payment_transation();
												   
									
	}
}

function payment_session_set($hook_name){
	if($hook_name == 'ct_razorpay_purchase_status'){
		return razorpay_payment_session_set();
	}
}