debits.paypal package

Submodules

debits.paypal.form module

class debits.paypal.form.PayPalForm[source]

Bases: debits.debits_base.processors.BasePaymentProcessor

Base class for processing submit of a PayPal form.

amend_hash_new_purchase(transaction, hash)[source]

Internal.

init_items(transaction)[source]
classmethod ipn_name()[source]

Django view name for PayPal IPN.

classmethod ipn_url()[source]
make_regular(items, transaction, purchase, cart)[source]

Internal.

make_subscription(items, transaction, purchase)[source]

Internal.

subscription_allowed_date(purchase)[source]

See ready_for_subscription().

debits.paypal.models module

class debits.paypal.models.PayPalAPI[source]

Bases: object

PayPal API.

This code only provides a subset of the possible functionality, for something more comprehensive see https://github.com/paypal/PayPal-Python-SDK To login into PayPal we use a Bearer from https://api.paypal.com/v1/oauth2/token with secret from https://developer.paypal.com/developer/applications

cancel_agreement(agreement_id, is_upgrade=False)[source]

Cancels a PayPal recurring payment.

refund(transaction_id, sum=None, currency='USD')[source]

Refunds a PayPal payment.

class debits.paypal.models.PayPalProcessorInfo(id)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

api()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
static offset_date(date, offset)[source]

Used to calculate the next recurring payment date.

debits.paypal.utils module

debits.paypal.views module

class debits.paypal.views.PayPalIPN(**kwargs)[source]

Bases: debits.debits_base.processors.PaymentCallback, django.views.generic.base.View

This class processes all kinds of PayPal IPNs.

All its methods are considered internal.

accept_recurring_canceled(POST, subscription_reference)[source]
accept_recurring_payment(POST, transaction_id)[source]
accept_recurring_signup(POST, transaction_id)[source]
accept_refund(POST, transaction_id)[source]
accept_regular_payment(POST, transaction_id)[source]
accept_subscription_payment(POST, transaction_id)[source]
accept_subscription_signup(POST, transaction_id)[source]
advance_item_date(date, purchase)[source]
auto_refund(transaction, purchase, POST)[source]
dispatch(request, *args, **kwargs)
do_accept_recurring_canceled(POST, subscription_reference)[source]
do_accept_recurring_payment(POST, transaction_id)[source]
do_accept_regular_payment(POST, transaction_id)[source]
do_accept_subscription_payment(POST, transaction_id)[source]
do_accept_subscription_signup(POST, transaction_id)[source]
do_appect_refund(POST, transaction_id)[source]
do_do_accept_regular_payment(POST, transaction_id)[source]
do_do_accept_subscription_or_recurring_payment(transaction, purchase, POST, ref)[source]
do_do_post(POST, request)[source]
do_post(request)[source]
do_subscription_or_recurring_created(transaction, POST, ref)[source]
do_subscription_or_recurring_payment(purchase)[source]
on_transaction_complete(POST, transaction_id)[source]
post(request)[source]
pp_payment_cycles(purchase)[source]
should_auto_refund()[source]
verified_post(POST, request)[source]
debits.paypal.views.parse_date(value)[source]

Internal.

Module contents