Add-ipayment-support

To enable Ipayment cc support in OneStepCheckout you need to :

  1. add ipayment references to onestepcheckoutindexindex in app/design/frontend/base/default/layout/onestepcheckout.xml. You can copy the references from app/design/frontend/base/default/layout/ipayment.xml and add them as follows by replacing (serach for to find the right place):

skin_jsonestepcheckout/js/window.js
skin_jsonestepcheckout/js/onestepcheckout.js
onestepcheckout/onestepcheckout.css



with


skin_jsonestepcheckout/js/window.js
skin_jsonestepcheckout/js/onestepcheckout.js

onestepcheckout/onestepcheckout.css




  1. next step is to add ajax event listener to checkout.phtml template to spy on ipayment ajax calls in app/design/frontend/base/default/template/onestepcheckout/checkout.phtml by replacing the following (search for !alreadyplacingorder to find the right place)
/* Submit the form */
$('onestepcheckout-form').submit();

with

if(payment.currentMethod == 'ipayment_cc'){
Ajax.Responders.register({
onComplete: function(event) {
if(event.parameters["payment[method]"]=='ipayment_cc'){
$('onestepcheckout-form').submit();
}
}
});
loaderelement.remove();
submitelement.removeClassName('grey').addClassName('orange');
submitelement.disabled = false;
already_placing_order = false;
payment.save();
Event.stop(e);
} else {
/* Submit the form */
$('onestepcheckout-form').submit();
}