<commit_before><?php

/**
 * Development tools for payments
 *
 * @package payment
 */
class PaymentDevelopmentAdmin extends Controller{

	public function index() {
		$renderer = DebugView::create();
		$renderer->writeHeader();
		$renderer->writeInfo("Installed Omnipay Payment Gateways", Director::absoluteBaseURL());
		$types = $this->PaymentTypes();

		echo "<table style=\"font-size:12px;\" border=1 cellspacing=0>
				<thead>
					<tr>
						<td>Short Name</td>
						<td>Full name</td>
						<td>Purchase</td>
						<td>Authorize</td>
						<td>CompleteAuthorize</td>
						<td>Capture</td>
						<td>Complete Purchase</td>
						<td>Refund</td>
						<td>Void</td>
						<td>Create Card</td>
						<td>Delete Card</td>
						<td>Update Card</td>
					</tr>
				</thead>
			<tbody>";

		foreach ($types as $gateway) {
			echo "<tr>".
					"<td>".$gateway->getShortName()."</td>".
					"<td>".$gateway->getName()."</td>".
					"<td>yes</td>". //purchase is always supported
					"<td>".($gateway->supportsAuthorize() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCompleteAuthorize() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCapture() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCompletePurchase() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsRefund() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsVoid() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCreateCard() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsDeleteCard() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsUpdateCard() ? "yes" : "")."</td>".
			"</tr>";
			if ($this->request->getVar('defaults')) {
				echo "<tr><td colspan=\"11\">";
					var_dump($gateway->getDefaultParameters());
				echo "</td></tr>";
			}
		}
		echo "</tbody></table>";
		$renderer->writeFooter();
	}

	/**
	 * Get all available payment types
	 */
	private function PaymentTypes() {
		$gateways =  Omnipay\Common\GatewayFactory::find();
		$gateways = array_map(function($name) {
			$facebook = new Omnipay\Common\GatewayFactory;
			return $factory->create($name);
		}, $gateways);
		return $gateways;
	}

}<commit_msg>Fixed issue with payment development admin fixes #45<commit_after><?php

/**
 * Development tools for payments
 *
 * @package payment
 */
class PaymentDevelopmentAdmin extends Controller{

	public function index() {
		$renderer = DebugView::create();
		$renderer->writeHeader();
		$renderer->writeInfo("Installed Omnipay Payment Gateways", Director::absoluteBaseURL());
		$types = $this->PaymentTypes();

		echo "<table style=\"font-size:12px;\" border=1 cellspacing=0>
				<thead>
					<tr>
						<td>Short Name</td>
						<td>Full name</td>
						<td>Purchase</td>
						<td>Authorize</td>
						<td>CompleteAuthorize</td>
						<td>Capture</td>
						<td>Complete Purchase</td>
						<td>Refund</td>
						<td>Void</td>
						<td>Create Card</td>
						<td>Delete Card</td>
						<td>Update Card</td>
					</tr>
				</thead>
			<tbody>";

		foreach ($types as $gateway) {
			echo "<tr>".
					"<td>".$gateway->getShortName()."</td>".
					"<td>".$gateway->getName()."</td>".
					"<td>yes</td>". //purchase is always supported
					"<td>".($gateway->supportsAuthorize() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCompleteAuthorize() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCapture() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCompletePurchase() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsRefund() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsVoid() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsCreateCard() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsDeleteCard() ? "yes" : "")."</td>".
					"<td>".($gateway->supportsUpdateCard() ? "yes" : "")."</td>".
			"</tr>";
			if ($this->request->getVar('defaults')) {
				echo "<tr><td colspan=\"11\">";
					var_dump($gateway->getDefaultParameters());
				echo "</td></tr>";
			}
		}
		echo "</tbody></table>";
		$renderer->writeFooter();
	}

	/**
	 * Get all available payment types
	 */
	private function PaymentTypes() {
		$gateways =  Omnipay\Common\GatewayFactory::find();
		$gateways = array_map(function($name) {
			$factory = new Omnipay\Common\GatewayFactory;
			return $factory->create($name);
		}, $gateways);
		return $gateways;
	}

}
{'fraction_non_alphanumeric': 0.2463936714751047, 'fraction_numerical': 0.003257328990228013, 'mean_word_length': 3.3076152304609217, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1198245', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1539, 'n_words': 255}