开发者

django-registration with paypal integration

开发者 https://www.devze.com 2022-12-24 15:50 出处:网络
I\'m trying to figure out how to integrate django-registration with django-paypal.Being a Django n00b, I\'m trying to f开发者_JAVA百科igure out how to implement a flow like this:

I'm trying to figure out how to integrate django-registration with django-paypal. Being a Django n00b, I'm trying to f开发者_JAVA百科igure out how to implement a flow like this:

  1. User signs up using django-registation with 'active' flag set to 0
  2. After registering, send user to PayPal for a subscription
  3. When they come back from PayPal successfully, I want to set 'active' to 1

I've been looking at the django-registration documentation and don't quite understand how to use different backends or implement a flow the way I want.

Any tips on how to accomplish this would be greatly appreciated. django-paypal won't be a problem for me as I've done PayPal integration before (in PHP for a self-published book about CakePHP).


To have registration not send an email you pass send_email=False to the RegistrationManager.create_inactive_user call in your view to register a user. After you create the user, you probably want to create a landing page with the paypal buttons for payment. Instruct the user to click a payment button to pay. Generally I send the user.id in the custom field for the payment button.

Then, in django-paypal, use the IPN signal handlers to activate the user based on the user.id in the custom field of the IPN query. You might want to send a modified registration email at this point, welcoming the user to your site and telling them you have received payment and have activated their account, but those are details for you to define.

0

精彩评论

暂无评论...
验证码 换一张
取 消