Jump to content

Howto access UniGUI form as web page


Recommended Posts

Hello forum guys !


I'm using unigui components in a phone application. As a part of the application I need to interact with a bank payment webservice using post protocol.


To close payment process and validate customer order the bank payment solution need an URL as validated return.


Was it possible to access an unigui form as an URL ?


I need to stay in the application worflow because I have to save informations and send an email to the customer when payment is ok.


Thanks a lot for your Help



Link to comment
Share on other sites

  • 5 months later...

This will create a new session which is undesirable I think in this case.

I guess the best approach is to get the current SessionID, forge an URL with it and start external web serivce in UniURLFrame passing URL as a parameter I guess (not mentioned how URL is supposed to be passed). At that point put your app in a waiting state and start UniTimer to check some variable in MainModule of the current session.

Meanwhile in ServerModule.OnHTTPCommand process the incoming requests, iterate over the sessions list and find your session by provided SessionID in URL, and set variable your UniTimer is waiting for.

Link to comment
Share on other sites

You can pass a parameter in the URL, but it will create a new session,

so you have to handle the login, catch the correct user ID if necessary,

and process the request. I assume there is a login.


So first you construct a response url, where you put in a key that you

generate, and you store this key in the db linked to the user, and give

it a timeout datetime, and you pass this url to the shopping cart as

the response url they shall trigger at payment accept.


And in mainModule, beforelogin, you catch the url param with the

key, check it in the db, and if it matches you process the request,

and put up whatever response, logging the user in at the same time,

pulling up whatever order was just accepted. All you need is a key

that you pass and get back again and check, using the url as storage.


You put a timeout on the whole process, like 30-60 seconds,

and in that window you accept the key and process the req,

and if not you don't log the user in, but put up another message.

Link to comment
Share on other sites

Thanks YuriO, zilav, delphidude,

I'll check that URL parameter and possible problem with creating a new session.

I like zilav method to find current session if it is opened.

I'll try, regards.

It all depends on the architecture of your application. If you can restore state using URL parameters on start, then the delphidude's method is preferable since it doesn't keep Uni session open and frees server resources.

Link to comment
Share on other sites

I guess it will nearly always be preferable to stay in the session, as the other

process may halt and thus fail to trigger the new session start.


If you know for sure that you will get a new session start no matter what,

that approach may be more stable as there is less complexity.


The critical thing is the time spent, and I guess up to a minute should be ok with

the current session, but what about let's say half an hour? - that is too much of course,

to keep it alive on a timer, so then a new session is probably better.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...