Simply demo for alipay customs
Python 3.6+ pip3 --cache-dir=.pip install -i https://pypi.douban.com/simple/ -r requirements.txt
- 报关接入流程 https://opendocs.alipay.com/support/01rgj9
- Configuration:
_APP_PRIVATE_KEY = 'MIICXAIBAAKBg**'
_CHARSET = "utf-8"
_PARTNER = "2088**"
_MERCHANT_CUSTOMS_CODE = "3110**"
_MERCHANT_CUSTOMS_NAME = "**"
_CUSTOMS_PLACE = "zongshu"
_SERVER_URL = "https://mapi.alipay.com/gateway.do"
- update payment order fields
param_fields = {
...
"out_request_no": "customs20220520001",
"trade_no": "20220**",
"amount": "0.02",
}
- change to project directory and run
python customs.py