Implementing cybersource using Ajax - ajax

I am using cybersource as the payment gateway for my application. The payment information is sent correctly if we post the form without using an Ajax request.
Now we need to implement this by using an Ajax request. I tried passing the information to cybersource but got a javascript error "access denied" when I tried to submit the form using Ajax post request.
When I tried to debug this issue the line "mypostrequest.open("POST", "theUrl", true);" was giving the error.
Is there any reason why a site might block a post request through Ajax and not block a request from the usual form post ?
Thanks in advance.

There should be no difference, from the perspective of the CyberSource server, between a post via AJAX or a normal form submit, so the server would not have a basis for deciding to block a post via AJAX. The "access denied" problem might be due to the fields and values you included in your post. Make sure all required fields are included.

Related

what is the facebook ajax request which get the posts?

I am trying using facebook from Scrapy.
I can log in successfully. However, I can't get the posts on facebook because the posts comes from ajax calls.
I tried using firebug and check the XHR. I got this:
I tried to check the response of all those request but none of them contains the actual data of the posts.
What is the ajax request that get the posts on facebook?
Thanks in advance
Don't use the AJAX calls from your browser. Those are encrypted since Facebook uses HTTPS connections. Focus on using their API to make the calls you need to get the data you want. That's the entire purpose of their Graph API.

How To post Form data to Cross Domain Without Page Refresh

I have tried lot regarding Post form data to Cross domain using Ajax post method. but i received success response. but the Form data is not posted to the requested cross domain instead of shows 404 network error in browser.
can anyone suggest How to Post the Form Data to Cross domain in ASP.NET MVC application?

aweber form submission on backend via ajax

I'm trying to submit an Aweber form from my signup page.
The Aweber submission works perfectly when I submit my page data via POST using the form action and submit button.
But with same values when I used ajax, the Aweber request callback gives an error below
302 Moved Temporarily
Has anybody faced same issue before?
Not the same issue, but do you know where it moved to? When you do a form post back it would just follow the 302. With Ajax it looks like it is just getting the 302 then you need to follow it.

Considering authentication when using Ajax with Spring MVC

I am trying to use ajax in my spring mvc application. When I try a url (post/get) which is secured and needs authentication, the response is the html of login page as it is redirected behind the scenes.
What is the best approach to overcome this issue?
First, I would avoid displaying Ajax links to URLs needing authentication if the user is not authenticated, if possible.
If not always possible, your login page could be returned with a specific HTTP response code, (or any other way to distinguish it from a normal response) and your JavaScript callback could replace the entire body of the current page with the HTML received if this response code is received. Most AJAX libraries come with a way to define a handler to all the AJAX requests. Such a global handler could be used here.
The login page could also be adapted to only return a status code in case of an AJAX request, and the JavaScript code would then redirect to the login page (without using AJAX) if this status code is received.
I may not have explained the issue well. So I did not get the right response. However the response from JB Nizet contained some other points. So thank you.
I could solve the issue after coming back to this issue after some time, so
I posted about this on my blog.
I hope it is useful.

Sending login information via AJAX

Im using jQuery validate plugin and every form has multiple validation levels.
level is by validate plugin
level is:
data is submitted to site
I get a reply
if everything is ok -> JS redirects to url
if there is an error, it shows warnings
Now I wonder, is it safe to send login info via ajax? I know that with addons like firebug, I am also able to get all POST parameters with normal submit. But can somebody else interfere with ajax login request and steal precious data?
is it safe to send login info via ajax
You do use HTTPS, do you? If you do it's as safe as form submit.
Are you issuing requests over HTTPS?
If you mean someone else on the network, then see the earlier comments about HTTPs.
If you mean "can someone inject something into a page and steal the data", the answer is yes. As you've observed, the user can install plugins which could do this; it's also possible that your page could be inadvertently be the target of injection via cross-site scripting or some other flaw.

Resources