khalti / docs.khalti.com

Khalti Payment Gateway Documentation

Home Page:https://docs.khalti.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client side web SDK error on "#" character on GET request to initiate payment

prajwalbasnet4400 opened this issue · comments

In the client side javascript config
var config = { // replace the publicKey with yours "publicKey": "test_public_key_5", "productIdentity": "{{product.slug}}", "productName": "PRODUCT #1", "productUrl": "http://khalti.com", "paymentPreference": [ "KHALTI", "EBANKING", "MOBILE_BANKING", "CONNECT_IPS", "SCT", ], "eventHandler": { onSuccess (payload) {console.log(payload); }, onError (error) { console.log(error); }, onClose () { console.log('widget is closing'); } } };
Here the productName will cause the payment flow to crash because GET parameters does not get read due to the "#" character right in between. This will throw off an error state like sourceMobile missing.

Can be mitigated by making productName urlsafe