#219: fix parameter

This commit is contained in:
Yuusuke Miyatake 2021-08-25 00:05:57 +09:00
parent 06067823c6
commit 4ab23e5f78

View File

@ -71,7 +71,7 @@ func (c *Client) VoidAuthorization(ctx context.Context, authID string) (*Authori
// PayPal recommends to reauthorize payment after ~3 days
// Endpoint: POST /v2/payments/authorizations/ID/reauthorize
func (c *Client) ReauthorizeAuthorization(ctx context.Context, authID string, a *Amount) (*Authorization, error) {
buf := bytes.NewBuffer([]byte(`{"amount":{"currency":"` + a.Currency + `","total":"` + a.Total + `"}}`))
buf := bytes.NewBuffer([]byte(`{"amount":{"currency_code":"` + a.Currency + `","total":"` + a.Total + `"}}`))
req, err := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("%s%s", c.APIBase, "/v2/payments/authorizations/"+authID+"/reauthorize"), buf)
auth := &Authorization{}