It is useful to autofill the correct payment amount of any particular sales order by clicking on the payment button on the website. Then it will navigate to external payment link with the payment amount.
_.extend(OrderWizardModuleConfirmation.prototype, {
getContext: _.wrap(OrderWizardModuleConfirmation.prototype.getContext, function(fn) {
var profileInfo = ProfileModel.getInstance();
var subsidiary = profile.get('subsidiary');
var disablebutton = false;
if (subsidiary == "2") {
disablebutton = true;
} else {
disablebutton = false;
}
var context = fn.apply(this, _.toArray(arguments).slice(1));
var interrnal_id = this.order_id;
var Paynow = 'External payment link'=ns_salesOrder&extSalesOrderId=' + interrnal_id + 'External payment link';
context.interrnal_id = interrnal_id;
context.Paynow = Paynow;
context.subsidiary = subsidiary
context.disablebutton = disablebutton
return context;
})
});
The sales order Id is stored in a variable and after that it is used in the Payment link which will check for sales order id. If the sales order is there and then it will fetch payable amount in the payment link after clicking on the pay now button.