paypale/capture.go
2021-04-10 18:09:05 +02:00

24 lines
468 B
Go

package paypal
import (
"context"
"fmt"
)
// GetCapturedPaymentDetails.
// Endpoint: GET /v1/payments/capture/:id
func (c *Client) GetCapturedPaymentDetails(ctx context.Context, id string) (*Capture, error) {
res := &Capture{}
req, err := c.NewRequest(ctx, "GET", fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/capture/", id), nil)
if err != nil {
return res, err
}
if err = c.SendWithAuth(req, res); err != nil {
return res, err
}
return res, nil
}