|
|
|
|
@ -203,19 +203,21 @@ class InvoiceDetailView(APIView): |
|
|
|
|
if pay_count > 1: |
|
|
|
|
invoice.create_child_pays(pay_count) |
|
|
|
|
|
|
|
|
|
if invoice.method == 'Y' and invoice.yandex_pay is None: |
|
|
|
|
yandex_pay = Payment( |
|
|
|
|
order_amount=invoice.price, |
|
|
|
|
shop_amount=0, |
|
|
|
|
customer_number=bill.user.id, |
|
|
|
|
user=bill.user, |
|
|
|
|
cps_email=bill.user.email, |
|
|
|
|
) |
|
|
|
|
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() |
|
|
|
|
invoice.yandex_pay = yandex_pay |
|
|
|
|
if invoice.method == 'Y' and invoice.status == 'P': |
|
|
|
|
if invoice.yandex_pay is None: |
|
|
|
|
yandex_pay = Payment( |
|
|
|
|
order_amount=invoice.price, |
|
|
|
|
shop_amount=0, |
|
|
|
|
customer_number=bill.user.id, |
|
|
|
|
user=bill.user, |
|
|
|
|
cps_email=bill.user.email, |
|
|
|
|
) |
|
|
|
|
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() |
|
|
|
|
invoice.yandex_pay = yandex_pay |
|
|
|
|
|
|
|
|
|
invoice.send_link() |
|
|
|
|
|
|
|
|
|
context = { |
|
|
|
|
|