I’m planning to develop a scan and pay application using Thunkable X with API integration. But once scanning the merchant id, I’m getting a url where I’m unable to send a query using api call since I’m not able to break the link.
And once i click the button it’ll navigate to the ‘PAYTM App’. But unfortunately idk how to break the url details to add those to the API property. As of now I just made this as the web api url in the blocks which I know is a big blunder.
after scanning through ny application, as you can see the url contains all the deatils like merchant name, id, amount and currency.
If I’m manually making a payment, i can collect those label text and pass it through api but after scanning ill get these in a link.
If I try to open this as a link through thunkable, its not prompting the paytm application to open.
Now coming to the idea - once scanned and after entering the amount, it should collect the general details from the url (like the merchant id, name and currency) and the amount I’m typing manually pass that through API and opens paytm application with checkout page by fetching the details already passed from Thunkable app.
It sounds like you need to parse the url and pass parts of it to the API. But to help you with that, I need really specific information. You’re telling me that you need “details like merchant name, id, amount and currency.” It’s still pretty vague.
Because I don’t know if you need “&mc=5499” or “mc=5499” or “5499” etc.
You can use text blocks like find first occurrence to search within a text string which is what your url is. But I can’t show you the blocks without knowing the specific text you need.
Now instead of the scanning qr data, for the time being I used the same qr link given to you and tried inside my code. But unfortunately the data not yet got properly extracted. The above changes are made and done.
You’ve completely changed the getText function that @muneer provided. In his, he checks for the position of the “&” character but in yours, you’re checking for the position of the start text and then subtracting two for some reason. That isn’t going to work in part because if sets the end position before the start position.
Please remix my demo project and if possible make your own minimal project that reproduce the problem and share it here so we can see what went wrong in your project.
I can see the last parameter is shown in your screen so why the others do not show?
I keep updating my code so @tatiang has the latest (I recommend to remix to get the last updated project). I checked in a number of ways to ensure it works properly.