paypal mobile express checkout - mobile

I am trying to implement mobile express checkout using this guide
I am first making a php call from my web server to call setExpressCheckout with required parameters, and getting back a valid token which I then use to reditect onto paypal using call
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_mobile-express-checkout&useraction=commit&token=EC-2BH4731318131920V
which redirects to PayPal but sandbox is telling me
You have requested an outdated version of PayPal. This error often results from the use of bookmarks.
If I call
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-2BH4731318131920V
this is opening a valid PayPal page asking user to login.
Can any one please tell me where am I wrong or missing any parameters?

I would advise using the standard _cmd=express_checkout and letting PayPal automatically detect the mobile browser and give the appropriate mobile view.

Related

GMail API Node.js quickstart - ERR_CONNECTION_REFUSED

I am trying the GMail API Node.js quickstart on Windows 10.
I do get the expected
.
However when I visit the url I get
for http://localhost/?code=4/xxxxxxxxxxxxxxxxxx&scope=https://www.googleapis.com/auth/gmail.radonly
I get this error after going through 'This app isn't verified'/'Advanced > Go to {Project Name} (unsafe)'. message.
No Proxy active and also tried with AntiVirus disabled.
Any ideas what the problem could be?
Thanks.
The issue you are having is that you are runing a Authorization credentials for a desktop application. Google made a change recently which deprecated the oob redirect. This means that now you need to use localhost or 127.0.0.1 as a redirect endpoint for installed applications.
Resulting them in returning the authorization code back to the browser showing site can not be reached because your not running a web app you are running an installed application.
If you check the url the authorization code you are looking for to add to your code can be found there. just take that code and submit it where it asks for it.
Enter the code from that page here:
There is currently no other option and no way to fix this unless you want to start up a web server in node. basicly its working as intended and Google is in the process of updating all the Javascript samples to reflect that.

Angular, JWTs and 3rd party auth

I'm not posting any code here as I have a design problem. It may also be that I'm trying to do something that makes no sense - if so, let me know.
I have an Angular site that uses JWTs. At present I use Passport.js with a LocalStrategy. I would like to use Twitter login. I can't work out how to handle the communications.
The Passport docs envisage a situation where you go to a route on your server that redirects you to Twitter and Twitter calls back your server after it has finished, and then your server can respond to this second request (I think) with a new page and a cookie.
But I have Angular on the client side, and I can't find any tutorials for handling that. I think I could get Angular to open a window and connect to Twitter, and then I presume twitter could callback my server, but how then does my server find the Angular client to send the JWT?
I had a project that I needed to implement Facebook, Twitter and Local logins. With passport Facebook and Local were easy but with Twitter I just gave up and implemented it without passport.
I just used the Twitter API.
Very helpful was the documentation on Satellizer. It is an angular library for handle the login types in the front end, but it also have a very nice examples how to handle the logins in the different back end languages without using any third party libraries. I actually haven't used it, because I wrote all I needed myself without any third party libraries, but it helped me understand better different login APIs and how to handle them in the backend. You can check the examples here.
Hope this helps you.

Using the Google Users Service with jQuery Mobile

I was wondering what would be a better way to let my jQuery Mobile app "know" the user of the app after completing a registration process.Since the handlers in my Python Google App Engine app expect a username, i decided to store the username in localstorage and then use this as part of any request made to the server.But i don't think this is a good design idea (?).After a lot of search, i have found that jQuery Mobile does not support Google login (Please correct me if am wrong) So i have decided to use the Users Service from the server end.I am confused on how to implement this, since the users service from Google has it's own sign-in form.
Is it possible to use this same service with jQuery? If so, can i change the design of the sign-in form to blend in with the design of my jQuery app?
jQuery Mobile is just a template designer created directly for mobile web applications using a mobile web browser. It does not possess any connections with server side scripting automatically.
You need to create a connection using server side scripting.
Once you login in using the Google Login, your app associates it with the Google account.
jQuery is just a browser scripting. It does not have an automatic connection with the server unless you connect using AJAX to request to a server, but still need to code the server using HTTP protocol (as a tunnel) and server side scripting language like Java, Python, or PHP.
If you just want to get the "username" using a javascript, you may use REST to get the user information after login. You may look for how JSON or XML REST is created (but putting the username on local storage is not a bad option, without the password, however it may get deleted if you clear the root), but knowing that you are already connected with Google Sign in, just as long as you are already logged in with Google, your app should be able to retrieve the Google username.
Udacity also contains a complete course about web development focused on Google App Engine using Python, and how you may use cookies, password encryption, as well as user login. A detailed information about HTTP protocol is also discussed.
https://www.udacity.com/course/cs253
Note that the course I took existed 2 years ago. It may be different now.

Setting up web payment using paypal

I'm working on a project and they have are planning to add a feature web payment. I'm glad to say that our client is a technical person and told me to use the paypal. This is my first time integrating a web payment. I've read some docs in developers.paypal and i'm planning to use the paypal express checkout.
Furthermore I'll be developing this using only client side (Angularjs), is it right decision for me to use paypal express checkout? Will I encounter some security issue here since its client side? The main idea is upon successful payment I have to sync an http request that will trigger that the user has paid.
Sample idea
.success(function(){
$http.post(...)
});
Here it's a complete example that will help you:
http://www.codeproject.com/Articles/576246/A-Shopping-Cart-Application-Built-with-AngularJS

GAE Java Facebook server authentication double call

I am having a weird issue. I created an application on Google App Engine and have a Login with Facebook button on it, for which I am doing server side authentication.
I give the redirect_url, and facebook was calling the URL correctly with no issues. The session parameters that I set were being retrieved on the redirect call and everything was working fine.
Yesterday, I got a domain on godaddy and mapped it to my appspot account using google apps. Now when I click on Facebook login, I am getting two calls on the redirect uri, the first one carries the session varaibles and the session one doesn't. I am not very familiar with domain mapping and followed the steps on Google Apps.
Can anyone help me in the right direction on this.
it's a little out of date, but i documented some GAE to Facebook gotchas here:
http://javagwt.blogspot.com/2010/08/facebook-apps-on-app-engine-without-any.html
It may also help to read about naked domain mapping with godaddy, to make sure you're not getting bounced around. Even though you are mapped to your domain through google apps, you can try to put the redirect URL for facebook as yourappid.appspot.com - the redirect URL you provide, and the one in your facebook app settings must match.
My app, nimbits.com writes to facebook from GAE all of the time - the code is on github under server/facebook
https://github.com/bsautner/com.nimbits/tree/master/nimbits-tds/src/com/nimbits/server
Thanks for the answers bsautner and Michele. I finally figured out the issue. I have google ads on my website. The google ads was trying to parse the URL content and creating a second request for every request that I create. After removing the google ads, I get a single callback with session values retained. It all works now. The final output is this website - www.imagecrashers.com. I will be glad for any suggestions from the gurus here, regarding layout or api calls simplification. Thanks again to all.

Resources