Comments (11)
I'm 90% sure that method would have to be added since you're using a custom model. I'll double check later today.
from django-zebra.
Thanks, I really appreciate you getting back to me, i have a deadline to get this billing module completed by this weekend and I'm running into a brick wall. Already spent 4 days with django-stripe-payments just to toss it for lack of docs and move onto this.
from django-zebra.
https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-AUTH_PROFILE_MODULE
Looks like you can just toss it on there- django isn't going to use it internally.
Try something like:
def get_profile(self):
return self
and see if that works...
from django-zebra.
Ok, i added that method to the WUser class and after submitting the charge form again I get this error:
AttributeError at /account/upgrade/
'WUser' object has no attribute 'stripe_customer_id'
from django-zebra.
Should I just add the attributes as they error out or use a mixin? I'm still a new django dev so I'm a little shaky on the best practice here.
Thanks again for your time.
from django-zebra.
Try class WUser(AbstractBaseUser, StripeMixin)
where StripeMixin
is from zebra.mixins import StripeMixin
.
You might also try class WUser(AbstractBaseUser, ZebraMixin)
which is the "kitchen sink".
from django-zebra.
And look through https://github.com/GoodCloud/django-zebra/blob/master/zebra/mixins.py
I don't know why our autodocs didn't pick up all the docstrings but they're there.
from django-zebra.
Ok, I tried both mixins, nothing changed, still complaining about a lack of stripe_customer_id. The StripeMixin says it provides a stripe attribute but it doesn't provide stripe_customer_id which seems to be needed at the profile level.
I went ahead and added it with the following settings to the WUser class:
class WUser(AbstractBaseUser, StripeMixin):
#...
stripe_customer_id = models.PositiveIntegerField(null=True, blank=True)
Now I get this error when trying to post the credit card form:
InvalidRequestError at /account/upgrade/
Could not determine which URL to request: Customer instance has invalid ID: None
from django-zebra.
My bad- That should be WUser(AbstractBaseUser, StripeCustomer)
using from zebra.models import StripeCustomer
https://github.com/GoodCloud/django-zebra/blob/master/zebra/models.py
from django-zebra.
I removed the stripe_customer_id i put in the WUser class and changed to subclass StripeCustomer as you suggest. I still get the same error as before, the "Customer instance has invalid ID: None".
I feel like I'm doing something wrong, maybe I didn't set it up right. Also, this is my first attempt to get Zebra working with a brand new billing system, here's the template contents just in case it helps:
{% extends 'base.html' %}
{% load zebra_tags %}
{% block static_content %}
{{ block.super }}
{% zebra_head_and_stripe_key %}
{% endblock %}
{% block content %}
<div class="body_container_info">
<div class="body">
{% zebra_card_form %}
<div id="checkout_confirm">
</div>
</div>
</div>
</div>
{% endblock %}
from django-zebra.
As I've been digging into this, I started looking at the Stripe Python Library and it looks like it may be easier to implement the library by itself rather than using an abstraction layer like zebra. The two I've tried so far have been extremely uncooperative in my setup which tells me either they are pretty fragile libraries or I'm using some weird edge case environment, what with the custom user model.
I'll leave this issue open for a bit to see if anyone has any thoughts as to how to get it working with my environment, if it's even possible; just to provide an answer to others that may be having or have this issue in the future.
I want to personally thank @leetrout for helping me work through this 👍
from django-zebra.
Related Issues (17)
- Update the version on PyPi HOT 2
- Validate webhooks are actually from stripe HOT 1
- Missing semicolons in javascript HOT 1
- audit_customer_subscription fails when subscription == null HOT 4
- This project is dead HOT 8
- rvnkfjldndchbtctfb
- Upgrade Stripe.js to Ver 2
- Webhooks broken in Django 1.6 HOT 1
- Transfer Webhooks like transfer.paid and transfer.updated
- Order won't submit on Mobile Safari
- zebra not syncing with database on makemigrations?
- Add test coverage HOT 2
- Getting error when initialising django-zebra HOT 2
- Convert docs to sphinx and put on RTFD.org HOT 2
- 'User' object has no attribute 'stripe_id' HOT 7
- need model howto HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-zebra.