Code Monkey home page Code Monkey logo

django-paypal's Introduction

Django PayPal

image

Latest PyPI version

Django PayPal is a pluggable application that integrates with PayPal Payments Standard and Payments Pro.

Note that these are now very old payment methods that are increasingly badly supported by PayPal, and django-paypal does not have support for any payment methods using their newer APIs.

See https://django-paypal.readthedocs.org/ for documentation.

django-paypal supports:

  • Django 2.2 and later
  • Python 3.6 and later

Project status

This is an Open Source project that is active but in maintenance mode. The maintainers see their primary responsibilities as:

  • fixing any critical data loss or security bugs.
  • keeping the project up-to-date with new versions of Django (or other dependencies).
  • merging well written patches from the community, and doing so promptly.

Large scale development work and feature additions are not planned by the maintainers.

Some important parts of the code base are not covered by automated tests, and may be broken for some versions of Django or Python. These parts of the code base currently issue warnings, and the maintainers are waiting for tests to be contributed by those who actually need those parts, and docs where appropriate.

Please bear these things in mind if filing an issue. If you discover a bug, unless it is a critical data loss or security bug, the maintainers are unlikely to work for free to fix it, and a new feature, or tests for existing functionality, will only be added by the maintainers if they need it themselves.

That said, if you do have large changes that you want to contribute, including large new features (such as implementing newer PayPal payment methods), they will be gladly accepted if they are implemented well.

Please see CONTRIBUTING.rst for more information about using the issue tracker and pull requests. Please do not open issues for support requests.

Questions and issues

If you have a question about using django-paypal, see the Discussion section. Only use the issues if you are reporting a bug, or describing a new feature that you would like to contribute.

Paid support

Some of the maintainers may be able to provide support on a paid basis for this Open Source project. This includes the following kinds of things:

  • Paying for bug fixes or new features (with the understanding that these changes will become freely available as part of the project and are not 'owned' by the person who paid for them).
  • Debugging or other support for integrating django-paypal into your project.
  • Implementing the integration for you from scratch.

If you are interested in these, you can contact the following developers:

django-paypal's People

Contributors

atul-bhouraskar avatar chripede avatar chrischambers avatar codingjoe avatar dcramer avatar dhontecillas avatar djw avatar fabiocaccamo avatar frankier avatar funkybob avatar jasonculverhouse avatar jonathanroach avatar kevin1024 avatar manikos avatar mthornhill avatar nsurbay avatar ohidurbappy avatar oliverzheng avatar pauloxnet avatar peterlauri avatar pre-commit-ci[bot] avatar rebkwok avatar reginafcompton avatar spookylukey avatar thiagogds avatar thyrst avatar toanant avatar tockrock avatar wolever avatar yuriiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-paypal's Issues

multi-byte character doesn't allowed in item_name.

I used IPN's PayPalPaymentsForm.
I put item_name in multi-byte string.
ex) Japanese.

    paypal_dict = {
        "business": settings.PAYPAL_RECEIVER_EMAIL,
        # "item_name": unicode(name,'utf-8'),
        "item_name": name, # multi-byte string
        # something
    }

    form_plan = PayPalPaymentsForm(initial=paypal_dict)
    # something

Later, I checked in PayPal IPNs table in django databse.
The writing is garbled in item_name column.

unicode(name,'utf-8'), couldn't work.

Could you tell me how to fix name of item_name?
Or I should modify code of django-paypal?

multibyte

Encrypted button Python3.4

Hello,
I can't use the encrypted button, because M2Crypto doesn't work with my Python3 on Ubuntu. I've a other alternative for that ?

PS: Sorry for my english.

IPN seems to work different as expected when trying from mobile device. Django-paypal doesn't implement it?

When user pass standard IPN payment processing workflow via desktop browser, PayPal sends IPN HTTP POST-request to provided notify_url callback (view paypal.standard.views.ipn) as expected.

While trying to pass this scenario using mobile client (Safari browser on iPhone) I faced the problem, that PayPal IPN sends empty GET request to IPN endpoint.

How could I resolve that problem? Is it PayPal specific only, or django-paypal has any workaround?

I need little help from PayPal integration gurus in implementing such support if django-paypal hasn't it yet, so please reply if you can help.

Note for documentation re: upgrading to Django 1.7/1.8 and database upgrade

I was going through my app upgrading to 1.8 from 1.4 (LTS support) and django-paypal 1.2 to 2.1 and freaked out when I got to the django-paypal database upgrade instructions saying I had to do all the migrations before the Django 1.8 upgrade.

I figured out quickly fortunately that I could run:

./manage.py migrate ipn --fake-initial

and it did the job just fine.

Might be worthwhile adding this to the docs.

pytz must be needed?

When I inspect the paypal_ipn table via admin.
pytz module not found error happned.

I think requirement must be add the module.
pip install pytz

doDirectPayment not providing access to error code when throwing PayPalFailure

Is there a suggested way to gain access to the reason a doDirectPayment or createRecurringPaymentsProfile call has failed. Currently a PayPalFailure is raised and swallowed by the PaymentForm.

Perhaps return the nvp_obj itself on success instead of True and raise the error instead of returning False so our app can show a customized error message to the user about why paypal rejected the payment

Getting ImportError: No module named urllib.request

Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(_args, *_options)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/core/management/commands/shell.py", line 70, in handle_noargs
get_models()
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/db/models/loading.py", line 232, in get_models
self._populate()
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/db/models/loading.py", line 78, in _populate
self.load_app(app_name)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
models = import_module('%s.models' % app_name)
File "/home/user/.virtualenvs/sol/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/home/user/codebase/samples/project/paypal/standard/ipn/models.py", line 6, in
from six.moves.urllib.request import urlopen
ImportError: No module named urllib.request

Documentation for issue with upg

The release notes don't state that at some point (looking at the history, I believe it to be v2.0, but I'm upgrading from 1.2 so can't easily tell), settings.PAYPAL_TEST=False was introduced, but also became mandatory for production use, which changed the default behaviour.

This bit me because I tested and everything was fine using the sandbox. I was setting a settings.PRODUCTION=True/False and calling form.render() for the former and form.sandbox() for the latter. This broke.

(like with my previous issue, this may be fine to just close and leave standing as documentation for anyone encountering this problem)

Payment processed, IPN signal not received

I have an issue receiving the IPN signal, despite my payment successfully going through. With the recent version of django-paypal, the signals have been reduced to valid_ipn_received and invalid_ipn_received. I have two connectors to receive both signals and I've placed breakpoints on the methods, but the methods are never hit. Here is what I have so far:

In views.py:

from django.shortcuts import render, render_to_response
from django.http import HttpResponse
from paypal.standard.forms import PayPalPaymentsForm
from paypal.standard.models import ST_PP_COMPLETED
from paypal.standard.ipn.signals import valid_ipn_received, invalid_ipn_received
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.core.urlresolvers import reverse
import pdb

def money_request(request):
    pdb.set_trace()
    # What you want the button to do.
    paypal_dict = {
        "business": settings.PAYPAL_RECEIVER_EMAIL,
        "item_name": "Event Registration",
        "notify_url": "http://localhost:8000/paypal/" + reverse('paypal-ipn'),
        "return_url": "http://localhost:8000/paypal/confirm",
        "cancel_return": "http://localhost:8000/paypal/",

    }

    # Create the instance.
    form = PayPalPaymentsForm(initial=paypal_dict)
    context = {"form": form}
    return render_to_response("paypal_test/payment.html", context)

def show_me_the_money(sender, **kwargs):
    pdb.set_trace()
    ipn_obj = sender
    if ipn_obj.payment_status == ST_PP_COMPLETED:
        # Undertake some action depending upon `ipn_obj`.
        if ipn_obj.custom == "Upgrade all users!":
            Users.objects.update(paid=True)
    else:
        Users.objects.update(paid=False)

@csrf_exempt
def confirm(request):
    return render_to_response("confirm.html")

valid_ipn_received.connect(show_me_the_money)

invalid_ipn_received.connect(show_me_the_money)

I did read on the Paypal's IPN simulator that the simulator would not work for localhost, so I'm wondering if that is the same case for django-paypal, because I did not read this anywhere in the documentation.

Any help would be much appreciated.

Thanks!

RawPostDataException when trying to test IPN

I am using the chrome plugin Postman to try and test the IPN callback on my localhost. When posting to the callback URL I am getting a RawPostDataException error "You cannot access body after reading from request's data stream"

Am I doing something wrong here or is there a better why to test the IPN callback locally? Thanks

django-paypal should use migrations

In #42, I would like to be able to store the billingagreementid (and possibly email) as fields on the PayPalNVP object, rather than having to extract them manually from the response. However, without having migrations available in django-paypal, this is a very dangerous and destructive game to play at.

I would elect for providing South migrations for the time being, for obvious reasons.

AttributeError exception in paypal/standard/ipn/views.py

I just upgraded to django 1.6 and updated django-paypal to 0.1.3, running on CentOS 6.5 with the default python 2.6.6. Then I started getting this exception:
File "django/core/handlers/base.py", line 114, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "django/views/decorators/http.py", line 41, in inner
return func(request, _args, *_kwargs)
File "django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(_args, *_kwargs)
File "paypal/standard/ipn/views.py", line 48, in ipn
del data[date_field]
File "django/http/request.py", line 324, in delitem
self._assert_mutable()
File "django/http/request.py", line 315, in _assert_mutable
raise AttributeError("This QueryDict instance is immutable")

It looks like it was fixed over here:
https://github.com/anvio/django-paypal/commit/887cb1d841a162e99612f8a44e8976dc418fc010
and:
https://github.com/anvio/django-paypal/commit/ec9e4491cc5597f3b9d0e74c6e118aa929bda08e

ImportError No module named defaults

I get an error when trying to follow the instructions in the readme, specifically the part where I add paypal.standard.ipn.urls in my urls.py. When I do that, and try to visit that URL, I get an ImportError ("No module named defaults") with the following trace:

/home/jeremy/positivevibes/positivevibes/positivevibes/urls.py in <module>
    (r'^something/paypal/', include('paypal.standard.ipn.urls')), ...
/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py in include
        urlconf_module = import_module(urlconf_module) ...
/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in import_module
        __import__(name) ...
/usr/local/lib/python2.7/dist-packages/paypal/standard/ipn/urls.py in <module>
from django.conf.urls.defaults import * 

Any help would be appreciated.

Countries translations

The paypal.pro.fields.COUNTRIES choices should be declared using ugettext_lazy() and not ugettext(), otherwise they cannot be used in multilingual projects (since translation happens at import time).

Testing IPN Error Notification Code

While testing my IPN listener with negative testing, I'm getting errors(Make sure that this value is a maximum of 15 characters) on fields reason_code and pending_reason, changing max_length to 40 resolved my issue.

Also, I'm getting error at paypal\standard\models.py", line 289, in set_flag
self.flag_info += info
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 116: ordinal not in range(128)

changing this line to self.flag_info += info.decode('utf-8') resolved my issue

support multiple paypal accounts from one application

I have a need to collect money for multiple clients using a single web site but as far as I can tell, the account information must be in your settings files.

So I plan to convert the settings into a tuple of tuples like settings.databases and have a selector function or parameter.

Any recommendations/suggestions on how to proceed? I am an experienced programmer (C++ and perl mostly) and I have been using paypal API's for years but I am somewhat new to python.

Django-Paypal and IPN. Some questions.

Hi,

I'm new to Django-Paypal and I'm trying to understand how the IPN works. I'm using PayPal Pro.

(r'^some/obscure/name/', include('paypal.standard.ipn.urls')),

If I include the code above in the urls.py the IPN will request the url http://some.com/some/obscure/name/

There is a way that I can specify the url that the IPN will request? In PayPal Pro the if I add

"notify_url": "https://www.example.com" + reverse('paypal-ipn')

to the kw in the view bellow, it will work? If not, how can I specify a notify_url in PayPal Pro?

def checkout_view(request):
    item = {"amt": "10.00", 
               "inv": "555",  
               "custom": "5556"}

    kw = {"item": item,  
              "context": {'test': "Tessste", }, 
              "payment_template": "paypal/payment.html", 
              "confirm_template": "paypal/confirmation.html", 
              "success_url": "/success/"} 

    ppp = PayPalPro(**kw)
    return ppp(request)

Best Regards,

Error Detected with Paypal Encrypted Buttons

I am using django-paypal with Paypal Standard IPN. I generated a comodo certificate, downloaded the private certificate, and uploaded the public one to paypal. Then I set PAYPAL_PRIVATE_CERT, PAYPAL_PUBLIC_CERT, PAYPAL_CERT, PAYPAL_CERT_ID, and PAYPAL_IDENTITY_TOKEN accordingly. The button generates (seemingly) without error, but when I try to buy something in sandbox mode I'm redirected to the Paypal Sandbox page with the error:

Error Message

We were unable to decrypt the certificate id.
We were unable to decrypt the certificate id.```

I tried this with an unencrypted button and there seemed to be a problem sending extra data, namely the redirect URL. Any ideas? Thanks.

Better sandbox support

Hi!

I created the following snippet to solve what I see to be an issue with the way django-paypal handles sandbox testing. https://djangosnippets.org/snippets/3031/

I can see why you might want to keep this out of the core django-paypal code, but if you think this would be useful I'm happy to provide a commit, just let me know!

Thanks

David

Project doesn't work if I test with IPN Simulator

Hello everyone!

I've been using the pluggeable application but if I test with the "Instant Paypment Notification simulator" (https://developer.paypal.com/webapps/developer/applications/ipn_simulator) the project says "Invalid form - no charset passed, can't decode" in the flag field.

I know the IPN Simulator doesn't send the "charset" parameter in the POST, and in the code, the project has a encoding validation so it could be a problem if I want to simulate payments with the IPN Simulator.

Can't get the amount of items bought in resulting payment_was_successful

Here is the object that I receive on my django server (using django-paypal, in the payment_was_successful signal), as you can see the query property has quantity1, but not the object itself:

{'created_at': datetime.datetime(2014, 6, 27, 10, 7, 50, 798488, tzinfo=<UTC>), 
'last_name': u'LASTNAME', 
'shipping_method': u'', 
'query': u'mc_gross=3.00&protection_eligibility=Ineligible&item_number1=&payer_id=Q6E6KSFDPM3U6&tax=0.00&payment_date=03%3A06%3A57+Jun+27%2C+2014+PDT&payment_status=Completed&charset=windows-1252&mc_shipping=0.00&mc_handling=0.00&first_name=FIRSTNAME&mc_fee=0.35&notify_version=3.8&custom=%7B%22user%22%3A%22username%22%2C%22location%22%3A%7B%22x%22%3A202%2C%22y%22%3A223%7D%7D&payer_status=verified&business=email-facilitator%40gmail.com&num_cart_items=1&mc_handling1=0.00&verify_sign=SECRET_CODE&payer_email=email%40gmail.com&mc_shipping1=0.00&tax1=0.00&btn_id1=2965595&txn_id=2KW31663CC752394K&payment_type=instant&last_name=LASTNAME&item_name1=Romanescoins&receiver_email=email-facilitator%40gmail.com&payment_fee=&quantity1=3&receiver_id=CUMWR6T2ARF36&txn_type=cart&mc_gross_1=3.00&mc_currency=EUR&residence_country=FR&test_ipn=1&transaction_subject=%7B%22user%22%3A%22username%22%2C%22location%22%3A%7B%22x%22%3A202%2C%22y%22%3A223%7D%7D&payment_gross=&ipn_track_id=a48170aadb705', 
'outstanding_balance': None, 
'subscr_id': u'', 
'auction_multi_item': None, 
'item_name': u'', 
'case_id': u'', 
'address_name': u'', 
'transaction_entity': u'', 
'from_view': u'', 
'auction_closing_date': None, 
'password': u'', 
'auction_buyer_id': u'', 
'address_country_code': u'', 
'address_city': u'', 
'address_status': u'', 
'auth_exp': u'', 
'payer_email': u'[email protected]', 
'mc_gross': Decimal('3.00'), 
'reattempt': u'', 
'handling_amount': None, 
'reason_code': u'', 
'remaining_settle': None, 
'invoice': u'', 
'address_state': u'', 
'num_cart_items': 1, 
'address_country': u'', 
'payer_business_name': u'', 
'first_name': u'FIRSTNAME', 
'mc_shipping': Decimal('0.00'), 
'flag_info': u'', 
'for_auction': None, 
'profile_status': u'', 
'item_number': u'', 
'business': u'[email protected]', 
'settle_currency': u'', 
'shipping': None, 
'amount': None, 
'currency_code': u'', 
'txn_id': u'2KW31663CC752394K', 
'payment_status': u'Completed', 
'payment_gross': None, 
'retry_at': None, 
'exchange_rate': None, 
'residence_country': u'FR', 
'payer_status': u'verified', 
'address_street': u'', 
'initial_payment_amount': None, 
'auth_amount': None, 
'custom': u'{"user":"username","location":{"x":202,"y":223}}', 
'notify_version': Decimal('3.8'), 
'period_type': u'', 
'settle_amount': None, 
'recurring': u'', 
'pending_reason': u'', 
'username': u'', 
'tax': Decimal('0.00'), 
'memo': u'', 
'payer_id': u'Q6E6KSFDPM3U6', 
'flag': False, 
'mc_handling': Decimal('0.00'), 
'address_zip': u'', 
'mc_fee': Decimal('0.35'), 
'payment_type': u'instant', 
'amount1': None, 
'recurring_payment_id': u'', 
'protection_eligibility': u'Ineligible', 
'receiver_email': u'[email protected]', 
'_state': <django.db.models.base.ModelState object at 0x2248550>, 
'updated_at': datetime.datetime(2014, 6, 27, 10, 7, 50, 798510, tzinfo=<UTC>), 
'time_created': None, 
'mc_currency': u'EUR', 
'option_name1': u'', 
'subscr_date': None, 
'option_name2': u'', 
'txn_type': u'cart', 
'recur_times': None, 
'auth_status': u'', 
'id': 90, 
'rp_invoice_id': u'', 
'payment_cycle': u'', 
'subscr_effective': None, 
'charset': u'windows-1252', 
'parent_txn_id': u'', 
'auth_id': u'', 
'transaction_subject': u'{"user":"username","location":{"x":202,"y":223}}', 
'contact_phone': u'', 
'product_name': u'', 
'test_ipn': True, 
'receiver_id': u'CUMWR6T2ARF36', 
'payment_date': datetime.datetime(2014, 6, 27, 3, 6, 57, tzinfo=<LocalTimezone>), 
'amount_per_cycle': None, 
'period2': u'', 
'period3': u'', 
'period1': u'', 
'verify_sign': u'SECRET_CODE', 
'flag_code': u'', 
'ipaddress': '127.0.0.1', 
'response': u'VERIFIED', 
'product_type': u'', 
'receipt_id': u'', 
'amount3': None, 
'amount2': None, 
'next_payment_date': None, 
'mc_amount3': None, 
'mc_amount2': None, 
'mc_amount1': None, 
'case_creation_date': None, 
'case_type': u'', 
'quantity': None}

http://stackoverflow.com/questions/24323632/paypal-does-not-send-the-number-of-items-in-cart/24324905?noredirect=1#comment37851651_24324905

recurring_payment signal never sent

The recurring_payment signal is never sent because a recurring payment is also a transaction

        if self.is_transaction():
            if self.flag:
                payment_was_flagged.send(sender=self)
            elif self.is_refund():
                payment_was_refunded.send(sender=self)
            elif self.is_reversed():
                payment_was_reversed.send(sender=self)
            else:
                payment_was_successful.send(sender=self)
        # Recurring payment signals:
        # XXX: Should these be merged with subscriptions?
        elif self.is_recurring():
            if self.is_recurring_create():
                recurring_create.send(sender=self)
            elif self.is_recurring_payment():
                recurring_payment.send(sender=self)

I wanted to change elif self.is_recurring(): into if self.is_recurring(): but this comment stopped me:

    def test_recurring_payment_ipn(self):
        """
        The wat the code is written in
        PayPalIPN.send_signals the recurring_payment
        will never be sent because the paypal ipn
        contains a txn_id, if this test failes you
        might break some compatibility
        """

Is there any reason for not sending both signals?

The paypal express checkout function is not working

There are 3 steps for express checkout:

1, setExpressCheckout to set the order info and redirect user to paypal to login
2, getExpressCheckout to ask user's and transactions details.
3, you fire a doExpressCheckout to finish the transaction

I didn't see getExpressCheckout get called anywhere

Encrypted buttons don't work

Trying to get encrypted buttons to work but paypal responds with a strange error each time. The same non encrypted buttons work flawlessly. Tried both sandbox and production paypal endpoint each gives the error.

  Sorry — your last action could not be completed

  If you were making a purchase or sending money, we recommend that you check both your PayPal account and your email for a transaction confirmation after 30 minutes.

  If you came to this page from another website, please return to that site (don't use your browser's Back button) and restart your activity.

  If you came from PayPal's website, click the PayPal logo in the upper-left corner to return to our home page and restart your activity. You might have to log in again.
  We are sorry, we are experiencing temporary difficulties. Please try again later. If this error occurred while making a payment, avoid duplicate payments by checking your Account Overview before resending a payment.

  For some browsers, this problem can be resolved by clearing or deleting cookies.

  Message 4001

Subscribe button not taking price and acting as buy now button

Here's the settings I have:
paypal_dict = {
"business": settings.PAYPAL_RECEIVER_EMAIL,
"no_note": "1",
"item_name": "basic",
"invoice": "1",
"notify_url": request.META['HTTP_HOST'] + 'paypal-ipn',
"return_url": request.META['HTTP_HOST'],
"cancel_return": request.META['HTTP_HOST'],
"a3": "19.99",
"p3": "1",
"t3": "M",
"sra": "1", #reattempt
"src": "1", #recurring
"srt": "52", #52 months

}

Any idea why it's not taking me to a subscription page and why the page has no price, but rather asking me for the price? I entered all the required details of a subscription button, found here: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/

image

Thanks so much!

TemplateDoesNotExist

I tried PDT.

I added
url(r'^money/', 'paypal.standard.pdt.views.pdt', name='return-location'),
in my urks.py.

But, pdt.html has bug.
Did you added base.html?
or must I add base.html myself?

packages/paypal/standard/pdt/templates/pdt/pdt.html, error at line 1
base.html
1 {% extends "base.html" %}

Cannot post to express checkout view

I have a use case where I would like to be able to post data to my checkout (specifically a shopping cart id). Additionally, I would prefer to use a post operation, to prevent any possible xss on my cart page.

Is there a technical reason why the PayPalPro class differentiates between methods? If not, I would like to supply a fix to remove this restriction.

Django-paypal is usable to do recurring payments?

Hi,

I'm evaluating alternatives to process recurring PayPal payments. Django-Paypal seems to be on the spot but as I read the issues I see that some signals are broken.

My question is, this broken signals have implications in the use of Django-Paypal? Some signals that I need are broken, what should be my reaction to these broken signals? Just to validate using the Rest PayPal api?

Best Regards,

Test Mode Disabled on Production Server

I'd like to test my django-paypal using app on my production server in test mode (before launching in non-test mode). On my development server, the test mode works perfectly, as the Buy button takes me to sandbox.paypal.com.

However, when I upload that exact same code (with PAYPAL_TEST = True) to my production server, the button takes me to paypal.com. Are there any other factors that determine which URL django-paypal will use (sandbox or regular), other than PAYPAL_TEST?

Duplicate IPN's

After the payment has been completed I receive 2 POST requests each of which creates a IPN object so for 1 payment i get 2 ion objects... Any ideas on how to fix it?

Django 1.3

Hello,

I see there's no backwards compatibility. Is there a simple way to implement django-paypal into django 1.3 project?

Thanks.

Dacian

PayPalPaymentsForm validation is wrong

I just set up django-paypal, and I frankly can't figure out how it could work with PayPalPaymentsForm. I have tried IPN and PDT payments to no avail.

  • PayPalPaymentsForm validates and integer. This breaks for amounts with cents.
  • PayPalPaymentsForm requires subscription-related fields to be filled, which makes no sense for non-subscription payments.

Here is the full list of errors I get if I follow the example to the letter:

(Hidden field amount) Enter a whole number.
(Hidden field item_number) This field is required.
(Hidden field quantity) This field is required.
(Hidden field a1) This field is required.
(Hidden field p1) This field is required.
(Hidden field t1) This field is required.
(Hidden field a2) This field is required.
(Hidden field p2) This field is required.
(Hidden field t2) This field is required.
(Hidden field a3) This field is required.
(Hidden field p3) This field is required.
(Hidden field t3) This field is required.
(Hidden field src) This field is required.
(Hidden field sra) This field is required.
(Hidden field no_note) This field is required.
(Hidden field modify) This field is required.
(Hidden field lc) This field is required.
(Hidden field page_style) This field is required.
(Hidden field cbt) This field is required.
(Hidden field notify_url) This field is required.
(Hidden field return_url) This field is required.
(Hidden field custom) This field is required.
(Hidden field cmd) Select a valid choice. _xclick is not one of the available choices.

Missing valid_ipn_received signal?

Am I missing something in the docs? Where it says to import valid_ipn_received from paypal.standard.ipn.signals, I see no such function (and Python gripes at me when I try to do the import, so that would confirm that suspicion as well).

I did a search in the repository for this function as well to no avail, though the search does turn up one issue discussing this function and refers to its existence. I'm assuming I'm missing something, so perhaps you could point me in the right direction, and maybe the documentation could be updated if it's just something that needs clarification?

Thanks!

UnicodeDecodeError when receiving flag_info info error

Hi all,

First of all thanks to spookylukey (and also dcramer) for this super library. I have recently discovered that sometimes Paypal is returning some unreadable characters in the 'flag_info' field and an UnicodeDecodeException exception is raised in the following line:
self.flag_info += info
of file: django_paypal-0.1.3-py2.7.egg/paypal/standard/models.py

I guess that a try/catch surrounding the line and managing the unicode variable properly should be enough to fix it.

Best regards from Barcelona,
Álvaro Vélez.

Express checkout endpoints should be accessible as settings

I'm approaching a point in my PayPal implementation where it almost makes sense to create my entire own view, forgoing paypal.pro.views.PayPalPro entirely. However, the endpoints are only set in paypal.pro.views and the logic to choose between them is inside the PayPalPro view.

Ideally, I would like to be able to retrieve settings.PAYPAL_EC_ENDPOINT which would choose the appropriate (sandbox/live) endpoint, as well as PAYPAL_EC_LIVE_ENDPOINT or PAYPAL_EC_SANDBOX_ENDPOINT.

Something like this could be achieved with AppConf, but I don't know that it's worth adding another dependency.

PayPalPro should be a CBV

Perhaps I'm completely off in thinking this, but it seems to me that PayPalPro is a perfect candidate for a CBV. Then using it would be a matter of subclassing, rather than creating a function based view and instantiating PPP. It seems cleaner in my mind.

payment_flagged signal never sent

With the current code the signals are never sent if the transaction is flagged:

At the end of the ipn view:

    if flag is not None:
        #We save errors in the flag field
        ipn_obj.set_flag(flag)
    else:
        # Secrets should only be used over SSL.
        if request.is_secure() and 'secret' in request.GET:
            ipn_obj.verify_secret(form, request.GET['secret'])
        else:
            ipn_obj.verify(item_check_callable)
    ipn_obj.save()

The verify_secret and verify methods both call the send_signals() method.
When the bject is flagged, the flag is set but send_signals() is never called and payment_flagged signal is never sent

I would suggest to resolve this by removing calls to send_signals() in both verify_secret() and verify() and simply call it manually at the end of the ipn view like this:

    if flag is not None:
        #We save errors in the flag field
        ipn_obj.set_flag(flag)
    else:
        # Secrets should only be used over SSL.
        if request.is_secure() and 'secret' in request.GET:
            ipn_obj.verify_secret(form, request.GET['secret'])
        else:
            ipn_obj.verify(item_check_callable)
    ipn_obj.save()
    ipn_obj.send_signals()

PAYPAL_IDENTITY_TOKEN is required?

I don't use PDT.
So, I didn't added 'paypal.standard.pdt', in my settings.py.
But, Django's error says it requires PAYPAL_IDENTITY_TOKEN.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.