smartwalle / alipay

支付宝 AliPay SDK for Go, 集成简单,功能完善,持续更新,支持公钥证书和普通公钥进行签名和验签,支持文件上传和接口内容加密。
MIT License
1.87k stars 425 forks source link

请教一下, 自定义上传图片时只能通过AddFile()方法传路径参数的形式去上传文件 不能够直接传文件流吗 #171

Closed xianjieee closed 1 year ago

xianjieee commented 1 year ago

t.Run("", func(t *testing.T) { p := alipay.NewPayload("ant.merchant.expand.indirect.image.upload") p.AddFile("image_content", "8466221.png", "8466221.png") p.AddParam("image_type", "jpg") p.Verify = false

    client, err := alipay.New(aId, g, true)
    if err != nil {
        log.Fatal("New err:", err)
    }

    var result = make(map[string]interface{})

    err = client.Request(p, &result)
    if err != nil {
        log.Fatal("Request err:", err)
    }

    fmt.Println("result:", result)
})
smartwalle commented 1 year ago

目前只支持上传本地文件

smartwalle commented 1 year ago

https://github.com/smartwalle/alipay#%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0