Skip to content

Commit

Permalink
修复特约商户进缺Wechatpay-Serial参数的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
minibear2021 committed Nov 5, 2021
1 parent 9af2f90 commit 35a8ebc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.2.2] - 2021-11-05
### Fixed
- 特约商户进件缺少Wechatpay-Serial的bug

## [1.2.1] - 2021-11-04
### Fixed
- 拼写错误
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="wechatpayv3",
version="1.2.1",
version="1.2.2",
author="minibear",
description="微信支付 API v3 Python SDK(python sdk for wechatpay v3)",
long_description=long_description,
Expand Down
11 changes: 9 additions & 2 deletions wechatpayv3/applyment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,27 @@ def applyment_submit(self, business_code, contact_info, subject_info, business_i
raise Exception('bank_account_info is not assigned.')
if addition_info:
params.update({'addition_info': addition_info})
cipher_data = False
if params.get('contact_info').get('contact_name'):
params['contact_info']['contact_name'] = self._core.encrypt(params['contact_info']['contact_name'])
cipher_data = True
if params.get('contact_info').get('contact_id_number'):
params['contact_info']['contact_id_number'] = self._core.encrypt(params['contact_info']['contact_id_number'])
cipher_data = True
if params.get('contact_info').get('mobile_phone'):
params['contact_info']['mobile_phone'] = self._core.encrypt(params['contact_info']['mobile_phone'])
cipher_data = True
if params.get('contact_info').get('contact_email'):
params['contact_info']['contact_email'] = self._core.encrypt(params['contact_info']['contact_email'])
cipher_data = True
if params.get('bank_account_info').get('account_name'):
params['bank_account_info']['account_name'] = self._core.encrypt(params['bank_account_info']['account_name'])
cipher_data = True
if params.get('bank_account_info').get('account_number'):
params['bank_account_info']['account_number'] = self._core.encrypt(params['bank_account_info']['account_number'])
cipher_data = True
path = '/v3/applyment4sub/applyment'
return self._core.request(path, method=RequestType.POST, data=params)
return self._core.request(path, method=RequestType.POST, data=params, cipher_data=cipher_data)


def applyment_query(self, business_code=None, applyment_id=None):
Expand Down Expand Up @@ -105,7 +112,7 @@ def applyment_settlement_modify(self, sub_mchid, account_type, account_bank, ban
params.update({'bank_name': bank_name})
if bank_branch_id:
params.update({'bank_branch_id': bank_branch_id})
return self._core.request(path, method=RequestType.POST, data=params)
return self._core.request(path, method=RequestType.POST, data=params, cipher_data=True if account_number else False)


def applyment_settlement_query(self, sub_mchid):
Expand Down

0 comments on commit 35a8ebc

Please sign in to comment.