|
|
|
|
@ -15,19 +15,19 @@ logger_yandex = logging.getLogger('yandex_money') |
|
|
|
|
def periodic_billing(): |
|
|
|
|
logger_yandex.info("start periodic billing task") |
|
|
|
|
|
|
|
|
|
for invoice in InvoiceRebilling.objects.filter(method='Y').exclude(status='F'): |
|
|
|
|
|
|
|
|
|
user = invoice.bill.user |
|
|
|
|
yandex_pay = Payment.objects.create( |
|
|
|
|
order_amount=invoice.price, |
|
|
|
|
customer_number=user.id, |
|
|
|
|
user=user, |
|
|
|
|
cps_email=user.email |
|
|
|
|
) |
|
|
|
|
invoice.yandex_pay = yandex_pay |
|
|
|
|
invoice.save() |
|
|
|
|
|
|
|
|
|
repeat_card_payment(invoice) |
|
|
|
|
# for invoice in InvoiceRebilling.objects.filter(method='Y').exclude(status='F'): |
|
|
|
|
# |
|
|
|
|
# user = invoice.bill.user |
|
|
|
|
# yandex_pay = Payment.objects.create( |
|
|
|
|
# order_amount=invoice.price, |
|
|
|
|
# customer_number=user.id, |
|
|
|
|
# user=user, |
|
|
|
|
# cps_email=user.email |
|
|
|
|
# ) |
|
|
|
|
# invoice.yandex_pay = yandex_pay |
|
|
|
|
# invoice.save() |
|
|
|
|
# |
|
|
|
|
# repeat_card_payment(invoice) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def repeat_card_payment(invoice): |
|
|
|
|
|