function EventInfo( event, aParams, pParams )
DO CASE
CASE event == "StatusTextChange"
CASE event == "ProgressChange"
CASE event == "TitleChange"
CASE event == "DocumentComplete"
* Aqui quizas podrias chequear tu cadena...
CASE event == ...
ENDCASE
return NIL
method PEDIR_CODE () class TApiBBVA
local oDlg, oActiveX, nPos, oApi, cUrl
cUrl := "https://connect.bbva.com/sandboxconnect"
oApi := Self
define dialog oDlg from 100, 100 to 950,1000 title "Navegar" pixel ;
of ::oWnd
activate dialog oDlg on init ;
( oActiveX := oApi:ShowPageWeb( oDlg, ;
cUrl + "?scope=" + ;
"&client_id=" + oApi:cAppID + ;
"&redirect_uri=" + oApi:cRedirect_Uri + ;
"&response_type=code", 0, 0, 825, 950 ) )
return oDlg:nResult = ID_OK
method ShowPageWeb( oParent, cUrl, nT, nL, nH, nW ) class TApiBBVA
local oActiveX, oHttp, oActiveXdo
oActiveX := TActiveX():New( oParent, "Shell.Explorer.2", nT, nL, nW, nH )
oActivex:Silent := .T. // aqui silence... en el script.
oActiveX:bOnEvent := { | event, aParams, pParams | ;
::EventInfo(event, aParams, pParams, oActiveX, oParent ) }
oActiveX:Do( "Navigate2", cUrl )
oActivex:SetFocus()
WHILE oActivex:Busy
SysWait(.2)
ENDDO
oActiveXdo := oActiveX:Document()
oHttp := oActiveX:GetProp( "Document" ) // -> Object Document
if Empty( oHttp )
MsgInfo( "Problemas en el Site...", ;
"Problemas en el Site..." )
RETURN( .F. )
endif
Return oActiveX
method EventInfo( event, aParams, pParams, oActiveX, oDlg ) class TApiBBVA
DO CASE
CASE event == "PropertyChange" .or. ;
event == "StatusTextChange" .or. ;
event == "ProgressChange" .or. ;
event == "TitleChange" .or. ;
event == "BeforeNavigate2" .or. ;
event == "NavigateComplete2" .or. ;
event == "NavigateError" .or. ;
event == "BeforeScriptExecute" .or. ;
event == "DownloadBegin" .or. ;
event == "DownloadComplete" .or. ;
event == "CommandStateChange" .or. ;
event == "FileDownload" .or. ;
event == "SetSecureLockIcon"
CASE event == "DocumentComplete"
if ::TENGO_CODE (oActiveX)
oDlg:End (ID_OK)
endif
otherwise
? 'Evento', event
ENDCASE
return NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: lubin and 93 guests