Skip to content

Commit

Permalink
Add form tag around pop inline script
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimlawal committed Sep 12, 2016
1 parent 9481f93 commit 25d248b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/design/frontend/base/default/template/paystack/pop.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ $params = Mage::helper('paystack_inline')->getFormParams();

// only show popup if parameters were found
if($params):

?>
<form>
<script src="https://js.paystack.co/v1/inline.js"></script>
<script>
//<![CDATA[
(function(PaystackPop){
/* Get a random reference number based on the current time
*
*
* gotten from http://stackoverflow.com/a/2117523/671568
* replaced UUID with REF
*/
Expand All @@ -44,7 +45,7 @@ if($params):
var a = document.createElement('a'), regex = /(?:\?|&amp;|&)+([^=]+)(?:=([^&]*))*/gi;
var params = {}, match, str = []; a.href = url;
while (match = regex.exec(a.search))
if (encodeURIComponent(param) != match[1])
if (encodeURIComponent(param) != match[1])
str.push(match[1] + (match[2] ? "=" + match[2] : ""));
str.push(encodeURIComponent(param) + (value ? "=" + encodeURIComponent(value) : ""));
a.search = str.join("&");
Expand All @@ -70,6 +71,7 @@ if($params):
})(PaystackPop);
//]]>
</script>
<?php
</form>
<?php

endif;
endif;

1 comment on commit 25d248b

@ibrahimlawal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #1

Please sign in to comment.