Fix generate-bills, remove debug print in charge method
This commit is contained in:
parent
2f70418f4d
commit
a41184d83d
2 changed files with 1 additions and 5 deletions
|
@ -9,8 +9,6 @@ from datetime import timedelta, date
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from uncloud_pay.models import Bill
|
from uncloud_pay.models import Bill
|
||||||
|
|
||||||
BILL_PAYMENT_DELAY=timedelta(days=10)
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -31,8 +29,7 @@ class Command(BaseCommand):
|
||||||
Bill.generate_for(
|
Bill.generate_for(
|
||||||
year=now.year,
|
year=now.year,
|
||||||
month=now.month,
|
month=now.month,
|
||||||
user=user,
|
user=user)
|
||||||
allowed_delay=BILL_PAYMENT_DELAY)
|
|
||||||
|
|
||||||
# We're done for this round :-)
|
# We're done for this round :-)
|
||||||
print("=> Done.")
|
print("=> Done.")
|
||||||
|
|
|
@ -149,7 +149,6 @@ class PaymentMethod(models.Model):
|
||||||
stripe_customer = StripeCustomer.objects.get(owner=self.owner).stripe_id
|
stripe_customer = StripeCustomer.objects.get(owner=self.owner).stripe_id
|
||||||
stripe_payment = uncloud_pay.stripe.charge_customer(
|
stripe_payment = uncloud_pay.stripe.charge_customer(
|
||||||
amount, stripe_customer, self.stripe_payment_method_id)
|
amount, stripe_customer, self.stripe_payment_method_id)
|
||||||
print(stripe_payment)
|
|
||||||
if 'paid' in stripe_payment and stripe_payment['paid'] == False:
|
if 'paid' in stripe_payment and stripe_payment['paid'] == False:
|
||||||
raise Exception(stripe_payment['error'])
|
raise Exception(stripe_payment['error'])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue