Merge pull request #223 from Yuusuke8686/fix_#219

Fix Reauthorize authorized payment parameter #219
This commit is contained in:
Alex Pliutau 2021-09-17 08:41:32 +02:00 committed by GitHub
commit ef48df5471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ func (c *Client) VoidAuthorization(ctx context.Context, authID string) (*Authori
// PayPal recommends reauthorizing 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{}