注销申请图片上传(平台收付通)
电商平台服务商调用注销申请接口时,需要先调用本接口上传相关的资料图片,获取图片ID后,再填写到注销申请请求中。 官方文档
js
const { Multipart } = require('wechatpay-axios-plugin')
const { createReadStream } = require('fs')
const { basename } = require('path');
let localFilePath = '/path/to/merchant-certificate-file.jpg'
const stream = createReadStream(localFilePath)
const media = new Multipart()
.append('meta', JSON.stringify({
file_name: basename(localFilePath),
file_digest: 'from upstream or local calculated',
}))
.append('file', stream, basename(localFilePath))
wxpay.v3.ecommerce.account.cancelApplications.media.post(media)
.then(
({
data: {
media_id,
},
}) => ({
media_id,
})
)