Easiest way to implement paypal shopping for e-books - python

I have an existing django website, and I would like to sell some pdf files through it using paypal. The buyer needs to be able to select 1 or more books, get transferred to the paypal site to enter in payment info. Then after a successful payment, the buyer gets redirected back to my website and the books start downloading automatically.
I have looked at the django-paypal and django-merchent apps, but I don't know how to handle the multiple downloads. As far as I know, using these apps, after a successful purchase, the app sends a success signal, but doesn't tell me which books were ordered.
What is the best way to implement this either with the django-paypal app or using some other method? Again, I'm looking for the easiest/quickest solution.
Thanks,

With respect, the question is slightly naive, in that there is typically a separation between the shopping cart, and the payment processing. A payment returns a binary result - it either worked or it didn't. It is up to your application to recall what was being paid for.
The Paypal API returns the success or failure of an identified payment; plus will happily consume a list of items you give it, so that the user is presented with a breakdown of the total amount. But note that you are telling paypal what is being paid for. It is consuming that data, not providing it.
So the answer depends entirely upon your chosen solution (django-paypal or django-merchant or whatever). Read their documentation. Presumably there is some way to inspect the contents of a recently approved transaction. Cycle through the cart and enable a download of each.
Django-paypal, for example, has no interest of what is in the cart. It just fires a signal when a payment is successful, and passes back the transaction identifier. Your application must recall what the transaction was for.
Often it's not as easy as you'd hope.

Related

How to make a Django application send money to its users using PayPal

I have a Django app for online cockfights. Users can bet if their accounts on the site have balance. They do that by first buying a digital product "Online Sabong Cash-In" through PayPal. The money is sent to the website's PayPal business account. I believe, this kind of transaction is called user-to-website transaction, and I've made this work using django-paypal library. I've followed this tutorial for that simple transaction: https://overiq.com/django-paypal-integration-with-django-paypal/ .
Now, I want to give the website the feature where users can cash-out or like withdraw their money if they want. I want to have the website-to-user transaction. How can I do that, please? I've searched on Google a lot and all I see are articles for user-to-website transaction. I've found one way but I don't know how to do it using django-paypal library:https://developer.paypal.com/docs/checkout/integration-features/pay-another-account/.
PayPal has a Payouts API, which you can request access to. However, only certain use cases will be approved.
(There is a way to facilitate user-to-user transactions by setting a payee object for the checkout, but that's not what you're asking in the question)

Get a list of PayPal transactions

I need a program for retrieving the list of transactions on my PayPal account. I tried some Python scripts, e.g. using the requests module for simply logging into PayPal with GET/POST and downloading the HTML from https://www.paypal.com/activities (shows newest transactions), but unfortunately PayPal prevents web scraping (captcha), so I didn't find a solution. There is a "TransactionSearch" API (https://api.paypal.com/v1/reporting/transactions), but the transactions show up with a delay of at least 3 hours (up to 48h) there... Is there a possibility to get a live version (as shown on their website) of my PayPal transactions using the PayPal API?
Unfortunately according to their documentation there isn't a way to get 'live' transactions: https://developer.paypal.com/docs/api/sync/v1/
However it does say up to 3 hours so you may be able to retrieve transactions sooner.
They don't state a reason for why it takes up to 3 hours for executed transactions to appear in the callable request list, however I'd assume PayPal perform security checks before even processing a transaction, let alone making the transaction accessible through an open API.

Django: Shopping site similar to eBay

I need to build a site similar to ebay. I've found some "e-commerce" packages for Django but those are not related to the "C2C" model from eBay.
I've tried these:
https://www.django-shop.org/
http://www.satchmoproject.com/
Do you know any app (package, framework) that can deal with it? Thank you very much!
While this is a frequently asked-for application, it doesn't appear as if anyone has actually implemented it.
It doesn't seem like that hard a project. You would need a Profile app to track the user's reputation, a messaging app (easily available), a Products app (users offer products, users bid on products, at a given time the bidding is closed, etc...).
A weekend for the basics, I think. Rip the Hell out of Satchmo for your transaction handling, and get a real authorization account through Authorize.NET, not some Google Checkout or Paypal thingy. You'd be on the hook for one big fraud risk, though, which is why auction sites are generally for the Big Kids.
Here is a near similar solution for you: Collector City Marketplace

Braintree python transparent redirect with vault option

Braintree's transparent redirect works beautifully, I don't have to pass any credit card info through my servers, and I'd like to keep it this way. My question is what is the preferred method to allow returning customers to use vaulted credit card/billing information? Credit card token is a protected field, so it cannot be submitted by the customer via an option field. Instead, I need to specify credit card token before generating the transaction data field. The problem with this is twofold, 1. handling disabled javascript if I were to attempt some AJAX and 2. forcing a returning user through a separate page so they can choose their credit card/billing info is almost as much hassle as re-entering the info itself.
You're right that using credit card tokens with transparent redirect is slightly difficult to deal with using the current Braintree API.
However if you already have the users credit card information stored in the vault, you can use a server to server request since you won't have to capture any sensitive information. A simple HTML select for the credit card token field would work, and your HTML form would post to your own sever.
To make this solution even more comprehensive, you can have the tr_data field included, if the user wants to enter a new card you can submit the form to Braintree as a TR request.
If you have any more questions or want to work through this code together email Braintree support: support#getbraintree.com
I'm a developer at Braintree and would be happy to help you with any more technical questions.
I am a Python developer and just successfully integrated Django with Braintree.
I used almost the same approach as BenMills's description: using S2S API rather than TR for credit card switching while having the ability to create a new credit card on the same page!
But I think there might be a potential way to solve your problem: General several TR forms in one single page with corresponding tr_data for each credit card under that user, thus you don't have to worry about using AJAX to generate tr_data upon user's choices.

Google Checkout Notification API Python Example

Currently, there are absolutely no code snippets of the Notification API in Python. I am currently at a loss as the documentation, as thorough as it is, seems to be missing important information necessary to actually code a solution for myself.
Currently, I have a single product that I wish to submit to Google Checkout along with a hidden item, which would be the userid of the user currently logged into my site. Upon payment completion, the callback URL will receive the information, and process the user's payment information (serial key, order number, userid) and update the database.
I am using Django.
Gchecky is there, but it doesn't seem to work - and I've attempted multiple times to get a hold of the developer.
Have a look at Chippy's Shop:
http://code.google.com/p/chippysshop/
http://code.google.com/p/chippysshop/source/browse/googlecheckout.py

Categories

Resources