cashfree / cashfree-sdk-nodejs

Cashfree SDK for Node js
MIT License
8 stars 20 forks source link

Encode URI components properly #22

Closed manishbhatias closed 4 years ago

manishbhatias commented 4 years ago

The given example for bank validation fails with ERR_UNESCAPED_CHARACTERS if the name field contains a space

Validation.ValidateBankDetails({
    name: "JOHN SMITH",
    phone: "9908712345",
    bankAccount: "026291800001191",
    ifsc: "YESB0000262"
}).then(function(d){
    console.log(d)
});

It seems that the parameters sent via HTTPS to the Cashfree API are not URL-encoded and cause issues if they contain special characters such as space. https://github.com/cashfree/cashfree-sdk-nodejs/blob/master/Payouts/Validation/index.js#L20

RajCashfree commented 4 years ago

Thanks for pointing it out! It should be fixed now.