SecurePay SecureFrame example

I recently had to debug an application that uses SecurePay as an online payment system. Rather than using API integration, the application used SecureFrame, where SecurePay provides the payment page (e.g. via an iframe). I couldn’t find an example in the SecureFrame documentation, so here’s a minimal working example:

<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
$(function() {
  var merchantId = "ABC0001";
  var password = "abc123";
  var txnType = "0";
  var primaryRef = "Test Reference";
  var amount = "100";
  var timestamp = moment.utc().format("YYYYMMDDHHMMSS");
  var fingerprint = CryptoJS.enc.Hex.stringify(
    CryptoJS.SHA1([merchantId, password, txnType, primaryRef, amount, timestamp].join("|"))
<form action="" method="post">
  <input type="hidden" name="bill_name" value="transact">
  <input type="hidden" name="merchant_id">
  <input type="hidden" name="txn_type">
  <input type="hidden" name="primary_ref">
  <input type="hidden" name="amount">
  <input type="hidden" name="fp_timestamp">
  <input type="hidden" name="fingerprint">






Leave a Reply

Your email address will not be published. Required fields are marked *