Django: Create model before posting to external website
I wonder if it's possible to create a model before posting 开发者_如何学Goto an external website?
I am trying to do the following:
- User clicks on a buy button.
- Post details to Django view. Order model is created.
- Paypal IPN form is posted.
- User get the Paypal login screen, logs in, pays, ...
I could do this with Javascript I guess by first posting to Django and when that is successful post the IPN form but I was wondering if there is a solution that doesn't involve Javascript?
The best way I've seen to do this is how Satchmo does it:
http://www.satchmoproject.com/docs/dev/payment.html#paypal
There has been work to move this out of the core of Satchmo and into its own project here:
https://bitbucket.org/bkroeze/django-bursar
Using the Satchmo Paypal payment module you can test that everything, including IPN is working by using the "fake" payment gateway they provide. Using this type of module you can test before posting it to an external Web site.
精彩评论