Page 1 of 1
Shell.Explorer.2 problem
Posted: Mon Jun 26, 2023 10:05 pm
by Randal
All,
I've been using the following code for years to access a website for credit card processing. This function displays a window and allows the user to enter credit card information to process a credit card and then returns the result. Now, all of a sudden when this function is called, I get "An error has occurred in the script on this page", Error: syntax error.
I suspect this has something to do with Microsoft updating Edge and ending support for ActiveX. I tried changing the settings in Edge to allow for Internet Explorer Mode with no luck.
Has anyone else seen this problem? What can I use besides ActiveX to get around this issue?
Here is my code.
FUNCTION HPCall( cTransactionSetupID, oDlg )
local oWndHP, oActiveX
local cEvents := ""
LOCAL cHtml := ""
LOCAL oIcon
DEFINE ICON oIcon RESOURCE "MYICON"
DEFINE WINDOW oWndHP ;
FROM 1, 5 TO 40, 75 ;
TITLE "Hosted Payments" ;
STYLE nOr(WS_CAPTION, WS_SYSMENU)
oActiveX = TActiveX():New( oWndHP, "Shell.Explorer.2" )
oWndHP:oClient = oActiveX // To fill the entire window surface
oActiveX:Do( "Navigate", HOSTEDPAYMENTS + "/?TransactionSetupID="+ cTransactionSetupID )
ACTIVATE WINDOW oWndHP ;
ON INIT ( oWndHP:SetIcon( oIcon ) ) ;
VALID ( cHtml := HPCallResults(oActiveX), .t. )
// Disable my app until this window is closed!
IF !empty(oDlg)
oDlg:disable()
ELSE
oWnd:disable()
ENDIF
DO WHILE empty(cHtml)
SysRefresh()
ENDDO
IF !empty(oDlg)
oDlg:enable()
oDlg:SetFocus()
ELSE
oWnd:enable()
oWnd:SetFocus()
ENDIF
RETURN cHtml
Thanks,
Randal
Re: Shell.Explorer.2 problem
Posted: Mon Jun 26, 2023 10:24 pm
by karinha
Try
oActivex:Silent := .T.
Rgards, saludos
Re: Shell.Explorer.2 problem
Posted: Mon Jun 26, 2023 10:40 pm
by karinha
Code: Select all | Expand
// \SAMPLES\CMSOFT1.PRG
#Include "FiveWin.ch"
STATIC oActiveX
FUNCTION CmSoft_Web()
LOCAL oChildWnd, cTitle
cTitle := "FiveWin Brasil"
MsgWait( "CONECTANDO AL FIVEWIN MUNDIAL...", ;
"AGUARDE UM MOMENTO POR FAVOR... ", 2.0 )
// DEFINE WINDOW oChildWnd FROM 0, 0 TO 600, 800 PIXEL TITLE cTitle
DEFINE WINDOW oChildWnd FROM -1, -1 TO -1, -1 PIXEL
oActiveX = TActiveX():New( oChildWnd, "Shell.Explorer.2" )
oActivex:Silent := .T.
oChildWnd:oClient = oActiveX
// oActiveX:Do( "Navigate2", "http://www.fivetechsoft.com" )
//oActiveX:Do( "Navigate2", "https://app.pedidosbcn.com/tienda/tiendadepizzas" )
oActivex:SetFocus()
ACTIVATE WINDOW oChildWnd MAXIMIZED ;
ON INIT( oActiveX:Do( "Navigate2", "https://app.pedidosbcn.com/tienda/tiendadepizzas" ) )
RETURN NIL
// FIN
Regards, saludos.
Re: Shell.Explorer.2 problem
Posted: Mon Jun 26, 2023 10:41 pm
by karinha
// \SAMPLES\CMSOFT1.PRG
#Include "FiveWin.ch"
STATIC oActiveX
FUNCTION CmSoft_Web()
LOCAL oChildWnd, cTitle
cTitle := "FiveWin Brasil"
MsgWait( "CONECTANDO AL FIVEWIN MUNDIAL...", ;
"AGUARDE UM MOMENTO POR FAVOR... ", 2.0 )
// DEFINE WINDOW oChildWnd FROM 0, 0 TO 600, 800 PIXEL TITLE cTitle
DEFINE WINDOW oChildWnd FROM -1, -1 TO -1, -1 PIXEL
oActiveX = TActiveX():New( oChildWnd, "Shell.Explorer.2" )
oActivex:Silent := .T.
oChildWnd:oClient = oActiveX
// oActiveX:Do( "Navigate2", "http://www.fivetechsoft.com" )
//oActiveX:Do( "Navigate2", "https://app.pedidosbcn.com/tienda/tiendadepizzas" )
oActivex:SetFocus()
ACTIVATE WINDOW oChildWnd MAXIMIZED ;
ON INIT( oActiveX:Do( "Navigate2", "https://app.pedidosbcn.com/tienda/tiendadepizzas" ) )
RETURN NIL
// FIN
Regards, saludos.
Re: Shell.Explorer.2 problem
Posted: Mon Jun 26, 2023 11:01 pm
by Randal
oActiveX:Silent := .T.
Thank you for your reply. Adding this line of code causes the error message to not be displayed however, the activex window is blank.
Upon further investigation I believe the problem may be because the vendor recently added a Captcha that the user needs to respond to before proceeding. I would appear that my app is the only one experiencing a problem.
This is the url referenced in the error message.
https://certtransaction.hostedpayments. ... 3ca91c16be
Is there something I need to do with the activex to enable this?
Thanks,
Randal
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 4:20 pm
by Natter
Most likely, the site that you use has stopped running under IE. Try opening it in other browsers. If it opens normally, then install the WebView and work through it.
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 5:24 pm
by Otto
Hello,
What exactly needs to be installed for WebView2?
As far as I know, since Windows 10 version 2004 (May 2020 Update), WebView2 is part of the operating system and is included by default. In such cases, you don't need to install WebView2 separately as it is already present.
What needs to be installed on older systems?
Best regards,
Otto
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 5:30 pm
by karinha
Hello. everything indicates that this provider:
https://certtransaction.hostedpayments.com/
https://stripe.com/br/resources/more/ho ... 0websites.
Also doesn't work:
https://transaction.hostedpayments.com/mobile/
is inoperative or out of order.
Do you have their contact information to find out what happened? Email, phone? It does not open, neither in Internet Explorer nor in Google. Maybe with the WebView...
Regards, saludos.
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 5:41 pm
by karinha
https://certtransaction.elementexpress. ... ardAVSOnly
Code: Select all | Expand
<Response xmlns="https://transaction.elementexpress.com">
<Response>
<ExpressResponseCode>103</ExpressResponseCode>
<ExpressResponseMessage>Invalid Request</ExpressResponseMessage>
</Response>
</Response>
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 5:45 pm
by karinha
Re: Shell.Explorer.2 problem
Posted: Tue Jun 27, 2023 5:57 pm
by Randal
Thank you for all your help and suggestions.
Over the years, Element Payment Systems was bought out by Vantiv which was bought out by Worldpay. I was contacted by developers at Worldpay telling me they are receiving reports from other developers/partners that are having the same problem and are trying to get to the bottom of it.
Although the latest versions of MS Edge have support for IE, I suspect ActiveX is going to be completely obsolete soon if it is not already so upgrading to use Webview or some other technology will be necessary.
Randal
Re: Shell.Explorer.2 problem
Posted: Thu Jun 29, 2023 1:50 pm
by Randal
All,
The developers at Worldpay explained that their website "uses something called ThreatMetrix as an additional security measure for verifying a person is a “person” when initiating a Hosted Payments transaction, and it seems that recently they made a change that implemented some newer javascript functionality that causes issues on older browser versions."
According to them, "a kind of a high level solution would be to look into when the DOM is loaded into the browser that is hosting the window and look for the script tag that grabs the ThreatMatrix Javascript file and remove it from the DOM before it renders the hosted payments page. Ultimately that is where the failure is occurring so it would be wherever you can implement a way to block that from happening."
Does anybody know of a way to do this using oActiveX = TActiveX():New( oWndHP, "Shell.Explorer.2" ) ?
Thanks,
Randal
Re: Shell.Explorer.2 problem
Posted: Thu Jun 29, 2023 4:51 pm
by Antonio Linares
Dear Randal,
You may try it using WebView
Please review FWH\samples\webview.prg and webviewuni.prg