download_bill_wechat.py 720 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. import os
  4. import sys
  5. PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
  6. sys.path.insert(0, PROJECT_ROOT)
  7. from script.base import init_env
  8. os.environ["DJANGO_SETTINGS_MODULE"] = "configs.production_local"
  9. init_env(False)
  10. from apps.web.core.models import WechatPayApp
  11. from apps.web.core.payment.wechat import WechatPaymentGateway
  12. bill_date = '2021-01-01'
  13. def download_bill_file():
  14. result = WechatPaymentGateway(
  15. app = WechatPayApp.objects(mchid = '1480791292').first()).download_bill(
  16. bill_date = '20211001')
  17. if __name__ == '__main__':
  18. download_bill_file()