paypal/payout.go

23 lines
637 B
Go
Raw Normal View History

2016-02-17 05:10:49 +01:00
package paypalsdk
import "fmt"
// CreateSinglePayout submits a payout with an asynchronous API call, which immediately returns the results of a PayPal payment.
2016-02-17 05:10:49 +01:00
// For email payout set RecipientType: "EMAIL" and receiver email into Receiver
// Endpoint: POST /v1/payments/payouts
2016-02-17 05:10:49 +01:00
func (c *Client) CreateSinglePayout(p Payout) (*PayoutResponse, error) {
req, err := c.NewRequest("POST", fmt.Sprintf("%s%s", c.APIBase, "/v1/payments/payouts"), p)
2016-02-17 05:10:49 +01:00
if err != nil {
return &PayoutResponse{}, err
}
response := &PayoutResponse{}
err = c.SendWithAuth(req, response)
if err != nil {
return response, err
}
return response, nil
}