<?php
	session_start();

	/**
	 * @author Jan Wehrs (jan.wehrs@billpay.de)
	 * @copyright Copyright 2010 Billpay GmbH
	 * @license commercial 
	 */
	require_once '../../api/ipl_xml_api.php';
	require_once '../../api/php5/ipl_module_config_request.php';
	
	$req = new ipl_module_config_request($_SESSION['api-url-base']);
	$req->set_default_params($_SESSION['mid'], $_SESSION['pid'], $_SESSION['security-key']);
	$req->set_locale("DEU", "EUR", "de");
	
	try {
		$req->send();
	
		if ($req->has_error()) {
			echo "Error occured!<br />";
			echo "Error code: " . $req->get_error_code() . "<br />";
			echo "Merchant msg: " . utf8_decode($req->get_merchant_error_message()) . "<br />";
			echo "Customer msg: " . utf8_decode($req->get_customer_error_message()) . "<br />";
		}
		else {
			echo "Module config request successful<br />";
			echo "Direct debit allowed: " 		. $req->is_direct_debit_allowed()			. "<br />";
			echo "Invoice allowed: " 			. $req->is_invoice_allowed()				. "<br />";
			echo "Invoice business allowed: " 	. $req->is_invoicebusiness_allowed()		. "<br />";
			echo "Limit direct debit: " 		. $req->get_static_limit_direct_debit()		. "<br />";
			echo "Limit invoice: " 				. $req->get_static_limit_invoice()			. "<br />";
			echo "Limit hire purchase: "		. $req->get_static_limit_hire_purchase()	. "<br />";
			echo "Min value direct debit: " 	. $req->get_direct_debit_min_value()		. "<br />";
			echo "Min value invoice: " 			. $req->get_invoice_min_value()				. "<br />";
			echo "Min value hire purchase: "	. $req->get_hire_purchase_min_value()		. "<br />";
			echo "Available terms: " 			. implode(", ", $req->get_terms());
		}
	
		echo "<br /><br />";
		echo "<strong>Request XML:</strong> " . htmlentities($req->get_request_xml());
		echo "<br /><br />";
		echo "<strong>Response XML:</strong> " . htmlentities($req->get_response_xml());
	}
	catch(Exception $e) {
		echo $e->getMessage();
	}
?>

