added subscription_id
This commit is contained in:
@@ -124,7 +124,7 @@ class VirtualRaceResultAdmin(admin.ModelAdmin):
|
||||
search_fields = ['race__name','username']
|
||||
|
||||
class PaidPlanAdmin(admin.ModelAdmin):
|
||||
list_display = ('name','shortname','price','paymenttype','paymentprocessor','clubsize')
|
||||
list_display = ('name','shortname','price','paymenttype','paymentprocessor','clubsize','external_id')
|
||||
|
||||
admin.site.unregister(User)
|
||||
admin.site.register(User,UserAdmin)
|
||||
|
||||
@@ -114,6 +114,7 @@ def create_subscription(rower,data):
|
||||
rower.clubsize = plan.clubsize
|
||||
rower.paymenttype = plan.paymenttype
|
||||
rower.rowerplan = plan.shortname
|
||||
rower.subscription_id = result.subscription.id
|
||||
rower.save()
|
||||
return True
|
||||
else:
|
||||
|
||||
@@ -571,7 +571,7 @@ class PaidPlan(models.Model):
|
||||
clubsize = models.IntegerField(default=0)
|
||||
|
||||
def __unicode__(self):
|
||||
return '{name} - {shortname} at {price} EURO ({paymenttype} payment)'.format(
|
||||
return '{name} - {shortname} at {price:.2f} EURO ({paymenttype} payment)'.format(
|
||||
name = self.name,
|
||||
shortname = self.shortname,
|
||||
price = self.price,
|
||||
@@ -623,6 +623,8 @@ class Rower(models.Model):
|
||||
postal_code = models.CharField(default='',blank=True,null=True,max_length=200)
|
||||
|
||||
customer_id = models.CharField(default=None,null=True,blank=True,max_length=200)
|
||||
subscription_id = models.CharField(default=None,null=True,
|
||||
blank=True,max_length=200)
|
||||
|
||||
rowerplan = models.CharField(default='basic',max_length=30,
|
||||
choices=plans)
|
||||
@@ -634,7 +636,7 @@ class Rower(models.Model):
|
||||
paymentprocessor = models.CharField(max_length=50,
|
||||
choices=paymentprocessors,
|
||||
null=True,blank=True,
|
||||
default=None)
|
||||
default='braintree')
|
||||
|
||||
paidplan = models.ForeignKey(PaidPlan,null=True,default=None)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ def setrowerplans():
|
||||
|
||||
if paidplans:
|
||||
r.paidplan = paidplans[0]
|
||||
r.paymenttype = 'paypal'
|
||||
r.paymentprocessor = 'paypal'
|
||||
r.save()
|
||||
else:
|
||||
print 'Could not set plan for ',r
|
||||
|
||||
@@ -241,6 +241,18 @@
|
||||
{% endif %}
|
||||
</button>
|
||||
</td>
|
||||
{% elif rower and rower.rowerplan == 'coach' and rower.clubsize < 100 %}
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button style="width:100%">
|
||||
{% if user|existing_customer %}
|
||||
<a href="/rowers/upgrade">UPGRADE NOW</a>
|
||||
{% else %}
|
||||
<a href="/rowers/billing">BUY NOW</a>
|
||||
{% endif %}
|
||||
</button>
|
||||
</td>
|
||||
{% else %}
|
||||
<td colspan=3>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user