fix param error (#185)

fix param error
This commit is contained in:
方航 2020-11-26 20:35:49 +08:00 committed by GitHub
parent 476102bb76
commit ef386ff32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,6 @@
package paypal package paypal
import ( import (
"bytes"
"encoding/json"
"errors" "errors"
"fmt" "fmt"
"net/http" "net/http"
@ -66,10 +64,8 @@ func (c *Client) UpdateBillingPlan(planId string, pathValues map[string]map[stri
Value: data, Value: data,
}) })
} }
jsonData, err := json.Marshal(patchData) req, err := c.NewRequest(http.MethodPatch, fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/billing-plans/", planId), patchData)
buf := bytes.NewBuffer(jsonData)
req, err := c.NewRequest(http.MethodPatch, fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/billing-plans/", planId), buf)
if err != nil { if err != nil {
return err return err
} }