Thought i'd carry on down the line of a seperate form to get over the sagepay.js eventlistener submit.

Button click initiates the form, which gets the post info that i want back from opayo, and sends it to a file as below:

Code:
   
<form name="opayo" id="opayo" target="output_frame" onsubmit="return checkout();"  action="/includes/modules/pages/checkout_payment/opayo.php"method="post" > 
    <button id="card-button" type="click" hidden></button></form>
</form>
<iframe name="output_frame" src="" id="output_frame" width="0" height="0">
</iframe>

in the /includes/modules/pages/checkout_payment/opayo.php there is just a line to grab the info and write to session, but the session value isn't being written.
Any ideas to overcome? As soon as session can be grabbed, module will be working as desired.

Code:
///get the post card identifier from opayo
$_SESSION['card-identifier'] =$_POST['card-identifier'];

the onsubmit="return checkout();" simply calls the requestsubmit method to proceed to confirmation page

Code:
 function checkout(){
  document.forms["checkout_payment"].requestSubmit();   
 }