I'm looking for an example of creating encrypted forms for paypal from appEngine running python. I've seen a lot of things that are in the neighborhood, but not the right address:
Here's the general info over on PayPal's site for generating the encrypted form. Basically the form data is encrypted and sent over to paypal so that it can't be tampered with.
This great article talks about doing this very thing in django. The trouble is that is relies on M2Crypto and that doesn't run on AppEngine.
There's a library that is based on the previous article but supposed to be hacked to run on app engine. When you poke around class PayPalEncryptedPaymentsForm they are using M2Crypto.
This lead me to try to verify that you can't use M2Crypto on AppEngine.
Turns out during this search I found this article about using PyCrypto instead of M2Crypto. There's a bunch of caveats in the article that aren't in my areas of expertise. I'm hoping that someone out there has made a run at using PyCrypto for PayPal's Encrypted Website Payments and can shed some light with an example.
Thanks.
I can't help with GAE crypto but maybe a different solution could help: Why don't you use express checkout API to negotiate a server2server token used to redirect user on to the PayPal payment process?
Related
All I know about API authentication is just password and bearer token. (and NO AUTH too ;)) And I got this OAuth problem when I was trying to use audiomack API.
https://www.audiomack.com/data-api/docs
This is their API documentation. They say
Rather than manually creating code for OAuth, we recommend instead using one of the pre-built libraries available for your programming language.
And I got piles of python libraries here: https://oauth.net/1/#:~:text=Max%20Countryman%20maintains,Tornado%20Auth%20package
Because I am new to OAuth, and also do not know how to get this consumer key and secret from my audiomack account (newly created for test use), these repos give no meaning to me.
Is there anyone who can help me out? I want to know how to make a proper OAuth step to use this API.
A step-by-step guidance or relevant link will be appreciated. Thanks in advance.
I have a server application written with Django which has a contacts database.
I wish to add a cardav webservice in order to share my contacts on my phone. I have made many search but I am completely lost.
I found some server as Radical, some API which uses files ... but nothing help me.
I need to implement in my server an API which will return to my Android the list of contact from my databases. What output format should I use ?
Thank you.
Your question seems a bit generic nor do you list what resources you looked at and why you are lost.
This presentation is a little old, but shows the fundamentals on how the *DAV protocols work. Building a CardDAV Client is another great starting point.
CardDAV itself is specified in
RFC 6352, and the related RFCs:
WebDAV,
WebDAV ACL,
etc.
What output format should I use ?
CardDAV requests and responses use
WebDAV,
hence XML.
The actual payload is a
vCard v3.
If you are looking for sample code:
The Apple CalendarServer
is a full-fledged CalDAV/CardDAV server written in Python.
Radicale is another one, but you already found that (be more specific why this isn't helping you, Radicale looks like a great starting point to me).
Finally: I don't think Android has CardDAV support builtin. Presumably you are using a sync plugin?
I've searched on google and have taken a look at the facebook site for the apis, but facebook does not have an official SDK for python. I looked at the third party api for python listed on their site that could be used to communicate with facebook. After having visited their official site and github repository there is a small readme file that shows basic usage, it seems to assume that you are already connected to facebook, and the example at the end of that page shows a cookie example.
The short examples seem easy enough but there is no explaination of anything and i dont find any more documentation about anything else.. there does not seem to be any information about all available methods you can use with the api..where do the people who are using this api get the documentation to find the methods available so they are able to do work with this ?
Since i guess people are pretty tired of signing up for yet another service i would like to offer to sign in with their facebook and twitter accounts (although thats a no no for the ad people who would like to have access to the user profile in order to have targeted words/links that generate revenue). Im using django and have taken a look at the django-facebook api as well but the documentation seems to just point to the github repository which doesnt have any documenation, almost just like the other api pointed out above. Basically i dont find any documenation about how to use the apis except from the small examples.
And like always, i appericiate your time answering this, always nice to add an explaination to any code so the answer is a little more usefull, thanks.
My info might be a little bit out of date as I was working at a startup implementing a Python backend on Google AppEngine that interfaced with Facebook, used FQL, AppEngine datastore etc, about a year and half ago.
There are several third party APIs you can use, for instance, https://github.com/jgorset/facepy or https://github.com/pythonforfacebook/facebook-sdk. The reason there is no 'documentation' on the github site is because it implements access to the API that IS documented on Facebook's developer pages https://developers.facebook.com/docs/graph-api/.
But that is in a perfect world. My experience with the Facebook APIs is that they don't always do what is said on the dev pages. You don't get consistent return data, FB Realtime API not/inconsistently notifying for certain connections (music, movies, books, tv). Unfortunately, I think they have many non-documented APIs that are only available to the big app players.
Where I got my real world working info and learned how to access Facebook using Python was right here on stack overflow.
I want to be able to Tweet from my app running on GAE.
Please suggest some Python library or HTTP API for the purpose.
About python-twitter: I think you can use this lib it seems to be compatible with GAE: http://code.google.com/p/python-twitter/source/browse/twitter.py
Also:
Twitter has a very great REST API https://dev.twitter.com/docs/api, You can also to simply use urlfetch and simplejson from appengine.
For authentication Twitter uses OAuth and recommend to understand how it work:
Twitter supports a few authentication methods and with a range of
OAuth authentication styles you may be wondering which method you
should be using. When choosing which authentication method to use you
should understand the way that method will affect your users
experience and the way you write your application.
Twitter share a very great how to https://dev.twitter.com/docs/auth/oauth
You can also see the part of code: http://code.google.com/p/jaikuengine/source/browse/trunk/oauth_client.py from jaikuengine.
This project worked for me: https://github.com/tav/tweetapp/blob/master/standalone/twitter_oauth_handler.py
It's only one file so it's easy to get it started and uses OAuth for authentication with twitter.
I have used twython in the past. I can't remember what made me select it over other libraries but I was using it on GAE and it is kept up-to-date.
You might find the Tweet Engine project of interest. It demonstrates quite simply how to use the Twitter REST API from App Engine.
I want to let users use their google account to login to my website. Exactly the way SO lets me. Can anyone please point in the right direction? I'm assuming the oAuth library is to be used but what I'd really like is a snippet of code I can directly copy paste and get this to work.
It's not OAuth particularly that you need (OAuth is for authorising access for one website to specific private content held on another), but OpenID - which is meant for authentication rather than authorisation. (Some sites, like Twitter, do provide authentication services via OAuth, but that's not what it's primarily for.) I have used python-openid which is fairly straightforward to use, or you can look at django-openid - though it admits to being incomplete, you could get some idea of how to implement OpenID support.
The problem's a little too involved to admit a copy-and-paste solution, but it's not especially hard to do this.
Update: piquadrat's link (in he comment) is definitely worth following.
You may want to check out django-piston which is a mini-framework with oAuth built in. Here's a tutorial on how to set it up.
You might consider using Django-Socialauth, as it supports
Twitter
Gmail
Facebook
Yahoo (essentially openid)
OpenId