FundedByMe / django-paypal-adaptive

Paypal Adaptive API support for Django
29 stars 31 forks source link

NoReverseMatch #2

Closed oppianmatt closed 10 years ago

oppianmatt commented 11 years ago

Quite a few NoReverseMatch's when trying to run it. Had to fix models.py to match the urls. So for instance.

urls.py

    url(r'^cancel/pay/(?P<id>\d+)/$', payment_cancel, name="paypal-adaptive-payment-cancel"),
    url(r'^return/pay/(?P<id>\d+)/(?P<secret_uuid>\w+)/$', payment_return, name="paypal-adaptive-payment-return"),
    url(r'^cancel/pre/(?P<id>\d+)/$', preapproval_cancel, name="paypal-adaptive-preapproval-cancel"),
    url(r'^return/pre/(?P<id>\d+)/(?P<secret_uuid>\w+)/$', preapproval_return, name="paypal-adaptive-preapproval-return"),
...
        url(r'^ipn/(?P<id>\d+)/(?P<secret_uuid>\w+)/$', payment_ipn, name="paypal-adaptive-ipn"),

models.py:

ipn_url = request.build_absolute_uri(reverse('paypal-adaptive-ipn',
                                                         kwargs={'payment_id': self.id, 
                                                                 'payment_secret_uuid': self.secret_uuid}))

In urls.py the url has kwargs 'id' and 'secret_uuid' but in models.py its 'payment_id' and 'payment_secret_uuid'.

Also it looks for 'paypal-adaptive-return' but in url.spy it's 'paypal-adaptive-payment-return'

antonagestam commented 10 years ago

Should be fixed.