Hi
I'm having trouble getting the SagePayServer payment and Nop One Page Checkout plugins to work together well. When the sagepay plugin shows its view (in an iframe) and I enter payment details within it, I can then click its "pay now" button for it to submit the initial transaction to sagepay.
It then returns with an OrderGuid, an example as follows:-
<html><head>
<title>Sagepay Server Response page</title>
<script src="/Plugins/Payments.SagePayServer/Scripts/jquery-1.7.1.min.js"></script>
</head>
<body>
<div class="cols cols--white clearfix">
<form id="sagepayPaymentInfoForm" action="/checkout/paymentinfo" method="post" target="_parent">
<p>
Your payment has been made.
</p>
<p id="sagepayPleaseWait">
You will be automatically redirected <span id="sagepaySeconds">3</span> seconds...
</p>
<input type="hidden" id="OrderGuid" name="OrderGuid" value="ed58e495-0463-4426-b2ec-1adbc56efb21">
<input type="hidden" name="nextstep" id="nextstep" value="this form value is required">
<input id="sagepayPostPaymentInfo" type="submit" value="Click to continue" style="display: none;">
</form>
<script type="text/javascript">
var serialisedPaymentinfo;
$(function() {
var checkout = window.parent.Checkout;
var paymentInfo = window.parent.PaymentInfo;
serialisedPaymentinfo = $('#sagepayPaymentInfoForm').serialize();
paymentInfo.save = function() { //Extending PaymentInfo Class
if (checkout.loadWaiting != false) return;
console.log(serialisedPaymentinfo);
checkout.setLoadWaiting('payment-info');
$.ajax({
url: 'http://demosite.co.uk/checkout/OpcSavePaymentInfo/',
data: serialisedPaymentinfo,
type: 'post',
success: paymentInfo.nextStep,
complete: paymentInfo.resetLoadWaiting,
error: checkout.ajaxFailure
});
};
paymentInfo.save();
});
</script>
</div>
</body>
</html>