tags:

views:

1281

answers:

3

Hello

Would there be any problems calling an HTTPS page (e.g. a credit card authorisation service i.e. WorldPay) from a standard HTTP page via AJAX?

I can't imagine why there would be a problem, the response would be an HTML page which I could then embed in a result pane or such like?

+8  A: 

Yes this would be a Cross domain posting and would be blocked by the browser.

AnthonyWJones
and the reason browsers do this is because if users see https:// in their address bar (along with the lock symbol or whatever depending on browser), they have a different expectation of security and privacy than if it is http://. In fact, if I was at your site and I was asked for credit card verification on a page that was http://, I would leave (even if the form or ajax involved used https). Even Verisign had a page set up this way once, but it is bad form...
larson4
Would it really be blocked though? http://domscripting.com/blog/display/91Not saying it's a good idea - I agree with ferocious - but just need to be prepared!
Duncan
@Duncan: yes, its highly unlikely the hacks suggested in that article would be supported by a site like WorldPay. The only sensible options are a secure server-to-server exchange or a framed form supplied directly from the payment site (ala the VISA verfication thing that is quite common these days).
AnthonyWJones
A: 

Anthony is right, but what you could do is create a local page the AJAX calls and that communicates with the HTTPS service via cURL or something else and returns. That way everything is done locally according to Java script.

Ólafur Waage
Of course, since (in this case) this would involve credit card details being sent across the network in the clear, you absolutely should not do this.
David Dorward
Ofcourse .
Ólafur Waage
A: 

hello im kurt, a php programmer, i have set up our site to https and requesting a file(http) using ajax but the request is unsuccessful? im a newbie can you help me what is the problem or can you identify at least the reasons.

thank you very much

Joseph Kurt
Hi, welcome at Stackoverflow! Please don't post questions as answers :) You can post questions as questions by pressing `Ask Question` button at the right top. Feel free to include links to topics you found in search, but didn't help in answering your own question.
BalusC