balance

package
v1.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(data *GetParams) (*xendit.Balance, *xendit.Error)

Get gets balance

Example
xendit.Opt.SecretKey = "examplesecretkey"

data := balance.GetParams{
	AccountType: "CASH",
}

resp, err := balance.Get(&data)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("balance: %+v\n", resp)
Output:

func GetWithContext

func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Balance, *xendit.Error)

GetWithContext gets balance with context

Types

type Client

type Client struct {
	Opt          *xendit.Option
	APIRequester xendit.APIRequester
}

Client is the client used to invoke balance API.

func (*Client) Get

func (c *Client) Get(data *GetParams) (*xendit.Balance, *xendit.Error)

Get gets balance

func (*Client) GetWithContext

func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Balance, *xendit.Error)

GetWithContext gets balance with context

type GetParams

type GetParams struct {
	ForUserID   string                        `json:"-"`
	AccountType xendit.BalanceAccountTypeEnum `json:"account_type"`
}

GetParams contains parameters for Get

func (*GetParams) QueryString

func (p *GetParams) QueryString() string

QueryString creates query string from GetParams, ignores nil values

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL