From ef386ff32f79f9eb17e7164ea1bfcddaee828d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E8=88=AA?= Date: Thu, 26 Nov 2020 20:35:49 +0800 Subject: [PATCH] fix param error (#185) fix param error --- billing.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/billing.go b/billing.go index 4c5397d..b0f63f2 100644 --- a/billing.go +++ b/billing.go @@ -1,8 +1,6 @@ package paypal import ( - "bytes" - "encoding/json" "errors" "fmt" "net/http" @@ -66,10 +64,8 @@ func (c *Client) UpdateBillingPlan(planId string, pathValues map[string]map[stri Value: data, }) } - - jsonData, err := json.Marshal(patchData) - buf := bytes.NewBuffer(jsonData) - req, err := c.NewRequest(http.MethodPatch, fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/billing-plans/", planId), buf) + + req, err := c.NewRequest(http.MethodPatch, fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/billing-plans/", planId), patchData) if err != nil { return err }