mirror of
https://github.com/plutov/paypal.git
synced 2025-01-22 18:01:04 +01:00
25 lines
543 B
Go
25 lines
543 B
Go
package paypal
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// GetRefund by ID
|
|
// Use it to look up details of a specific refund on direct and captured payments.
|
|
// Endpoint: GET /v2/payments/refund/ID
|
|
func (c *Client) GetRefund(ctx context.Context, refundID string) (*Refund, error) {
|
|
refund := &Refund{}
|
|
|
|
req, err := c.NewRequest(ctx, "GET", fmt.Sprintf("%s%s", c.APIBase, "/v2/payments/refund/"+refundID), nil)
|
|
if err != nil {
|
|
return refund, err
|
|
}
|
|
|
|
if err = c.SendWithAuth(req, refund); err != nil {
|
|
return refund, err
|
|
}
|
|
|
|
return refund, nil
|
|
}
|