wechatpay-apiv3 / wechatpay-postman-script

微信支付 APIv3 的调试工具
Apache License 2.0
369 stars 343 forks source link

图片上传API无法直接使用,需要修改postman前置脚本,读取body里的meta数据 #6

Closed yuchenye90 closed 3 years ago

yuchenye90 commented 3 years ago

图片上传API无法直接使用,需要修改postman前置脚本,读取body里的meta数据进行签名。可修改如下

var canonicalUrl = newUrl.getPathWithQuery(); if (method == 'POST' || method == 'PUT' || method == 'PATCH') { var data = pm.request.body.raw; if (canonicalUrl.indexOf('image-upload') >= 0) { var result = JSON.parse(JSON.stringify(pm.request.body.formdata)); data = result[0].value; } }

xy-peng commented 3 years ago

欢迎 pr

sortbylist commented 3 years ago

欢迎 pr

已pr。#8

xy-peng commented 3 years ago

@sortbylist 感谢贡献,已merge。