forked from uncloud/uncloud
Initial stripe playground
This commit is contained in:
parent
c651c4ddaa
commit
4ad737ed90
7 changed files with 124 additions and 3 deletions
|
|
@ -143,10 +143,13 @@ class PaymentMethod(models.Model):
|
|||
description = models.TextField()
|
||||
primary = models.BooleanField(default=True)
|
||||
|
||||
# Only used for "Stripe" source
|
||||
stripe_card_id = models.CharField(max_length=32, blank=True, null=True)
|
||||
|
||||
def charge(self, amount):
|
||||
if amount > 0: # Make sure we don't charge negative amount by errors...
|
||||
if self.source == 'stripe':
|
||||
# TODO: wire to strip, see meooow-payv1/strip_utils.py
|
||||
# TODO: wire to stripe, see meooow-payv1/strip_utils.py
|
||||
payment = Payment(owner=self.owner, source=self.source, amount=amount)
|
||||
payment.save() # TODO: Check return status
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue