Helcim Logo Support & Tutorials

© Copyright 2006-2018 Helcim Inc.

All Rights Reserved.

Helcim.js » Legacy Helcim.js 1.0 »

PHP Code Sample

This documentation is for the legacy Helcim.js 1.0. New merchants should refer to the Helcim.js version 2 documentation.


<?php

	// CHECK FOR APPROVAL
	if(@$_POST['response'] == 1){

		// APPROVED
		echo 'TRANSACTION APPROVED!';

		// DISPLAY RESPONSE ARRAY
		print_r($_POST);

		// KILL PROCESS
		exit;

	}elseif(@$_POST){

		// DECLINED
		echo 'TRANSACTION DECLINED!';

		// DISPLAY RESPONSE ARRAY
		print_r($_POST);

		// KILL PROCESS
		exit;

	}

?>
<html>
<head>
</head>
<body>

	<!--SCRIPT-->
	<script type="text/javascript" src="https://gateway.helcim.com/js/version1.js"></script>

	<!--FORM-->
	<form name="helcimForm" id="helcimForm" action="your-checkout-page.php" method="POST">

		<!--RESULTS-->
		<div id="helcimResults"></div><br/>

		<!--SETTINGS-->
		<input type="hidden" id="merchantId" value="9999123456">

		<!--CARD-INFORMATION-->
		Credit Card Number: <input type="text" id="cardNumber" value="5454545454545454"><br/>
		Expiry Date: <input type="text" id="expiryDate" value="1019"><br/>
		CVV: <input type="text" id="cvv" value="100"><br/>

		<!--OPTIONAL-AMOUNT-->
		Amount: <input type="text" id="amount" id="amount" value="100.00"><br/>

		<!--OPTIONAL-AVS-->
		Card Holder Name: <input type="text" id="cardholderName" id="cardholderName" value="John Smith"><br/>
		Card Holder Address: <input type="text" id="cardholderAddress" id="cardholderAddress" value="1234 Street"><br/>
		Card Holder Postal Code: <input type="text" id="cardholderPostalCode" id="cardholderPostalCode" value="A1A 1A1"><br/>

		<!--BUTTON-->
		<input type="button" id="buttonProcess" value="Process Payment" onclick="javascript:helcimProcess();">

	</form>

</body>
</html>