Sending optional variables of lang not working in form which is dynamically created by DOM

Hi,

I got some problem with switch the language of the hosted payment page.

I have a dynamically created form post to Moneris in salesforce, code as this below:

 

var params = {
 'hpp_key': hpp_key,
 'ps_store_id': ps_store_id,
 'charge_total': parseFloat(3).toFixed(2),
 'lang':lang,
 'hst': hst,
 'gst': gst,
 'pst': pst,
 //'charge_total': parseFloat(charge_total).toFixed(2),
 'order_id': result.Name,
}
var method = 'POST';
var form = document.createElement('form');
form.action = path;
form.method = method;
form.target = '_blank'
for(const key in params){
if(params.hasOwnProperty(key)){
 const hiddenField = document.createElement('input');
 hiddenField.setAttribute('type', 'hidden');
 hiddenField.setAttribute('name', key);
 hiddenField.setAttribute('value', params[key]);
 form.appendChild(hiddenField);
}

document.body.appendChild(form);
form.submit();

when I press button to run this function, it can not switch to French when i give lang as 'fr-ca' although the form post all input field to "https://esqa.moneris.com/HPPDP/index.php"

all the other attributes are received correctly, but not 'lang' attribute;

Does any body have the same issue?

  • Can you check browser console to make sure the parameter is actually getting passed to us? I just tested this and it displayed in French as expected.
  • In reply to RR_Moneris:

    yes I am sure it pass to Moneris, if I remove the type of all input, it will display all the inputs that are getting passed on browser and I can see that 'lang' is included in them.

  • In reply to newGuyK:

    Are you preloading the session? Or just posting all the fields via the browser? Can you send me a sample of what you are sending so I can test it? If you want you can send that to eProducts@moneris.com. Just include this conversation for context.