The issue is when i add parameters in success url all data come but when i add name it gives error i have tried it and the conclusion i made is if i remove the spaces between letters then it work fine but i want to make it proper workable can you help me with it
success_url: `${YOUR_DOMAIN}/success/${product.email}/${product.quantity}/${product.amount}`,
All i need is to add name in it so this url look like this
success_url: `${YOUR_DOMAIN}/success/${product.name}/${product.email}/${product.quantity}/${product.amount}`,
But it gives this error if i add name
CodePudding user response:
The URL must be encoded. If it is not done automatically, just wrap the URL inside this function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
It replaces i.e. spaces with valid URL characters