Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix file upload method]: remove file upload biz content encrypt params #367

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

charsunny
Copy link
Contributor

Sorry,上次提交的时候文件上传&验签确实成功了,但是参数没有解析,又找了好久的文档,发现真实情况是:
本接口为文件上传类接口,与普通OpenAPI接口的入参构造格式不同,如果您没有使用官方SDK发起OpenAPI调用,自行构造HTTP请求时需注意以下事项:

  1. 本接口使用multipart/form-data内容格式上传文本参数与文件,文件字段需传入filename文件名,并带扩展名(例如:Content-Disposition: form-data; name="file_content"; filename="example.png"),否则会提示图片类型为空。
  2. 对于v2版本的协议,本接口的业务请求参数没有封装在biz_content字段中,直接平铺到请求的body中

也就是说,对于业务参数不需要放到biz_content,也不需要加密处理,所以移除了参数加密的代码,详见这个文档:
https://opendocs.alipay.com/mini/510d4a72_alipay.merchant.item.file.upload

@iGoogle-ink
Copy link
Member

好的,希望这次的OK

@iGoogle-ink iGoogle-ink merged commit 295d05c into go-pay:main Nov 16, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants