Documentation ¶
Index ¶
- func Create(data *CreateParams) (*xendit.Payout, *xendit.Error)
- func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error)
- func Get(data *GetParams) (*xendit.Payout, *xendit.Error)
- func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Payout, *xendit.Error)
- func Void(data *VoidParams) (*xendit.Payout, *xendit.Error)
- func VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error)
- type Client
- func (c *Client) Create(data *CreateParams) (*xendit.Payout, *xendit.Error)
- func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error)
- func (c *Client) Get(data *GetParams) (*xendit.Payout, *xendit.Error)
- func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Payout, *xendit.Error)
- func (c *Client) Void(data *VoidParams) (*xendit.Payout, *xendit.Error)
- func (c *Client) VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error)
- type CreateParams
- type GetParams
- type VoidParams
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(data *CreateParams) (*xendit.Payout, *xendit.Error)
Create creates new payout
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" createData := payout.CreateParams{ ExternalID: "payout-" + time.Now().String(), Amount: 200000, } resp, err := payout.Create(&createData) if err != nil { log.Fatal(err) } fmt.Printf("created payout: %+v\n", resp)
Output:
func CreateWithContext ¶
func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error)
CreateWithContext creates new payout with context
func Get ¶
func Get(data *GetParams) (*xendit.Payout, *xendit.Error)
Get gets one payout
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" resp, err := payout.Get(&payout.GetParams{ ID: "123", }) if err != nil { log.Fatal(err) } fmt.Printf("retrieved payout: %+v\n", resp)
Output:
func GetWithContext ¶
GetWithContext gets one payout with context
func Void ¶
func Void(data *VoidParams) (*xendit.Payout, *xendit.Error)
Void voids the created payout
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" resp, err := payout.Void(&payout.VoidParams{ ID: "123", }) if err != nil { log.Fatal(err) } fmt.Printf("voided payout: %+v\n", resp)
Output:
func VoidWithContext ¶
func VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error)
VoidWithContext voids the created payout with context
Types ¶
type Client ¶
type Client struct { Opt *xendit.Option APIRequester xendit.APIRequester }
Client is the client used to invoke invoice API.
func (*Client) Create ¶
func (c *Client) Create(data *CreateParams) (*xendit.Payout, *xendit.Error)
Create creates new payout
func (*Client) CreateWithContext ¶
func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error)
CreateWithContext creates new payout with context
func (*Client) GetWithContext ¶
func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Payout, *xendit.Error)
GetWithContext gets one payout with context
func (*Client) Void ¶
func (c *Client) Void(data *VoidParams) (*xendit.Payout, *xendit.Error)
Void voids the created payout
func (*Client) VoidWithContext ¶
func (c *Client) VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error)
VoidWithContext voids the created payout with context
type CreateParams ¶
type CreateParams struct { ExternalID string `json:"external_id" validate:"required"` Amount float64 `json:"amount" validate:"required"` Email string `json:"email" validate:"required"` }
CreateParams contains parameters for Create
type GetParams ¶
type GetParams struct {
ID string `json:"id" validate:"required"`
}
GetParams contains parameters for Get
type VoidParams ¶
type VoidParams struct {
ID string `json:"id" validate:"required"`
}
VoidParams contains parameters for Get
Click to show internal directories.
Click to hide internal directories.