ShellRox
ShellRox

Reputation: 2602

Paypal Transactions: How to receive and send funds with PayPal API and Django?

i've been wondering to make payment system for my Django website, but with PayPal it seems to be easier for users, i've heard there is special API for python, so it can be used with Django.


So for example, There is user account and my account, i make a receiver function, which listens to the payment gateway and whenever user sends funds to the email, it does a specific commands. Now i also make a sender function, so i can send funds to users, Now if API get's users email whenever they see HTTP Response of Paypal paying window, i want to make a function to send it to specific email.

Also another example with code:

import random
from process import multiprocessing
Users = [ "..." ]
# PayPal:
import SomePayPalApi

def Receiver():
    SomePayPalApi.receive_to = SomePayPalApi.current_user.email
    while True:
        if SomePayPalApi.recieved:
            print SomePaypalApi.recieved.amount
            print SomePaypalApi.received.email
            print SomePaypalApi.Balance
            received = True              
            break

def Sender():
    SomePayPalApi.sendto = random.choice(Users)
    SomePayPalApi.send()


if __name__ == "__main__":
    p1 = Process(target=Receiver)
    p2 = Process(target=Sender)
    p1.start()
    p2.start()

I know it's not as easy as example, but i am looking for two general functions of PayPal, Paying and Receiving, How can i achieve this API on Django? Also if possible, How can i see amount of money received on my account and balance of my account? Can i use PayPal Api documentation for Django? How can paying back be done in Django-Paypal Library?

Upvotes: 2

Views: 1555

Answers (2)

BLang
BLang

Reputation: 990

I am not sure about email, but if you want to access paypal ammounts, this might help. Get amount from django-paypal

Upvotes: 1

zubhav
zubhav

Reputation: 1559

Have you considered using django-paypal as one of your installed apps?

It looks fit for purpose and may provide what you require.

Take a look:

https://github.com/spookylukey/django-paypal https://django-paypal.readthedocs.io/en/stable/overview.html

Upvotes: 1

Related Questions