Re: Opaya PI (formerly sagepay) Integration woes
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();
}
Re: Opaya PI (formerly sagepay) Integration woes
ok, so digging into the intricacies of javascript forms.... found out that the onsubmit fires before the action, so the call was being made to goto next page and was loading before the post data had returned to place into the session, so was never seen. quite hard to find during debug as when checking if the post page was getting the response, it of course was...
so just added a short time wait to the function
Code:
function checkout(){
setTimeout(() => { document.forms["checkout_payment"].requestSubmit(); }, 1500);
}
Re: Opaya PI (formerly sagepay) Integration woes
Happy to report had this up and running really well for a month now on 2 different sites and both the applepay express checkout button (auto account creaction etc), and the PI form are working well. I'll spend some time to get packaged up and will submit for upload.
Re: Opaya PI (formerly sagepay) Integration woes
Thank you! This will be useful for UK users.
Re: Opaya PI (formerly sagepay) Integration woes
Hello all,
Not sure if anybody using this in UK. Been having problems with Cardstream, and the gateway has recommended Opayo to try. Is it any good? On Cardstream it seems to be fine for months, then I have over a dozen cases of payment going through but no order. I have to push manually. No error logs, am certain its not zencart. That was last year, and maybe 6 months later, the pattern started again now.
So yes just seeing if worth trying Opayo or not, considering never had that trouble with Paypal Payment Pro in all those years. Thanks in advance.
Re: Opaya PI (formerly sagepay) Integration woes
Hi Calljj,
Well done on the Opayo Pi integration.
Have you got a version that we could try out on a test environment.
Would be good to try your version out.
Kind Regards,
Andy