diff --git a/finance/tasks.py b/finance/tasks.py index b51dcf5..7dca103 100644 --- a/finance/tasks.py +++ b/finance/tasks.py @@ -27,7 +27,9 @@ def periodic_billing(): order_amount=invoice.price, customer_number=user.id, user=user, - cps_email=user.email + cps_email=user.email, + shop_id=settings.YANDEX_MONEY_REBILLING_SHOP_ID, + scid=settings.YANDEX_MONEY_REBILLING_SCID ) invoice.yandex_pay = yandex_pay invoice.save() diff --git a/finance/views.py b/finance/views.py index cfb62fd..ebd8976 100644 --- a/finance/views.py +++ b/finance/views.py @@ -208,7 +208,7 @@ class InvoiceDetailView(APIView): invoice.create_child_pays(pay_count) if invoice.method == 'Y' and invoice.yandex_pay is None: - yandex_pay = Payment.objects.create( + yandex_pay = Payment( order_amount=invoice.price, shop_amount=0, customer_number=bill.user.id, @@ -218,8 +218,7 @@ class InvoiceDetailView(APIView): if pay_count > 1: yandex_pay.shop_id = settings.YANDEX_MONEY_REBILLING_SHOP_ID yandex_pay.scid = settings.YANDEX_MONEY_REBILLING_SCID - yandex_pay.save() - + yandex_pay.save() invoice.yandex_pay = yandex_pay invoice.send_link()