diff --git a/unipay/init.py b/unipay/init.py index ef459ba..59c6eb3 100644 --- a/unipay/init.py +++ b/unipay/init.py @@ -18,7 +18,9 @@ CONF_ENV = { "email": "MAIL", "password": "PASSWORD", "from_mail": "FROM_MAIL", - "account_no": "ACCOUNT_NO" + "account_no": "ACCOUNT_NO", + "bank_name": "BANK_NAME", + "bank_branch": "BANK_BRANCH" }, "wechat": { "mchid": "WXP_MCHID", diff --git a/unipay/providers/transfer.py b/unipay/providers/transfer.py index b409cb1..4f739dd 100644 --- a/unipay/providers/transfer.py +++ b/unipay/providers/transfer.py @@ -65,12 +65,14 @@ class EmailClient: return content class TransferGateway(Gateway): - def __init__(self, from_mail="", pop3server="", email="", password="", account_no=""): + def __init__(self, from_mail="", pop3server="", email="", password="", account_no="", bank_name="", bank_branch=""): self.from_mail = from_mail self.pop3server = pop3server self.email = email self.password = password self.account_no = account_no + self.bank_name = bank_name + self.bank_branch = bank_branch self.running = False async def new_tcode(self, sor): @@ -97,6 +99,8 @@ class TransferGateway(Gateway): } ns = DictObject(**ns) ns.account_no = self.account_no + ns.bank_name = self.bank_name + ns.bank_branch = self.bank_branch env = payload.request._run_ns db = DBPools() dbname = env.get_module_dbname('unipay') diff --git a/wwwroot/transfer_info.ui b/wwwroot/transfer_info.ui index 0cfbf2b..eea98d3 100644 --- a/wwwroot/transfer_info.ui +++ b/wwwroot/transfer_info.ui @@ -27,6 +27,26 @@ "width": "100%" }, "subwidgets": [ +{% if params_kw.bank_name %} + { + "widgettype": "HBox", + "options": {}, + "subwidgets": [ + {"widgettype": "Text", "options": {"text": "收款银行", "cwidth": 8}}, + {"widgettype": "Text", "options": {"text": {{json.dumps(params_kw.bank_name)}}, "cwidth": 16, "cfontsize": 1.1}} + ] + }, +{% endif %} +{% if params_kw.bank_branch %} + { + "widgettype": "HBox", + "options": {}, + "subwidgets": [ + {"widgettype": "Text", "options": {"text": "开户行", "cwidth": 8}}, + {"widgettype": "Text", "options": {"text": {{json.dumps(params_kw.bank_branch)}}, "cwidth": 16, "cfontsize": 1.1}} + ] + }, +{% endif %} { "widgettype": "HBox", "options": {},