github.com/plutov/paypal/v4@v4.7.1/capture.go (about)

     1  package paypal
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  )
     7  
     8  // GetCapturedPaymentDetails.
     9  // Endpoint: GET /v1/payments/capture/:id
    10  func (c *Client) GetCapturedPaymentDetails(ctx context.Context, id string) (*Capture, error) {
    11  	res := &Capture{}
    12  
    13  	req, err := c.NewRequest(ctx, "GET", fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payments/capture/", id), nil)
    14  	if err != nil {
    15  		return res, err
    16  	}
    17  
    18  	if err = c.SendWithAuth(req, res); err != nil {
    19  		return res, err
    20  	}
    21  
    22  	return res, nil
    23  }