Documentation ¶
Index ¶
- func CreateFixedVA(data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func CreateFixedVAWithContext(ctx context.Context, data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func GetAvailableBanks() ([]xendit.VirtualAccountBank, *xendit.Error)
- func GetAvailableBanksWithContext(ctx context.Context) ([]xendit.VirtualAccountBank, *xendit.Error)
- func GetFixedVA(data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func GetFixedVAWithContext(ctx context.Context, data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func GetPayment(data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
- func GetPaymentWithContext(ctx context.Context, data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
- func UpdateFixedVA(data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func UpdateFixedVAWithContext(ctx context.Context, data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- type Client
- func (c *Client) CreateFixedVA(data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func (c *Client) CreateFixedVAWithContext(ctx context.Context, data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func (c *Client) GetAvailableBanks() ([]xendit.VirtualAccountBank, *xendit.Error)
- func (c *Client) GetAvailableBanksWithContext(ctx context.Context) ([]xendit.VirtualAccountBank, *xendit.Error)
- func (c *Client) GetFixedVA(data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func (c *Client) GetFixedVAWithContext(ctx context.Context, data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func (c *Client) GetPayment(data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
- func (c *Client) GetPaymentWithContext(ctx context.Context, data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
- func (c *Client) UpdateFixedVA(data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- func (c *Client) UpdateFixedWithContext(ctx context.Context, data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
- type CreateFixedVAParams
- type GetFixedVAParams
- type GetPaymentParams
- type UpdateFixedVAParams
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFixedVA ¶
func CreateFixedVA(data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
CreateFixedVA creates new fixed virtual account
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" data := virtualaccount.CreateFixedVAParams{ ExternalID: "va-example", BankCode: "BRI", Name: "Michael Jackson", } resp, err := virtualaccount.CreateFixedVA(&data) if err != nil { log.Fatal(err) } fmt.Printf("created fixed va: %+v\n", resp)
Output:
func CreateFixedVAWithContext ¶
func CreateFixedVAWithContext(ctx context.Context, data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
CreateFixedVAWithContext creates new fixed virtual account with context
func GetAvailableBanks ¶
func GetAvailableBanks() ([]xendit.VirtualAccountBank, *xendit.Error)
GetAvailableBanks gets available virtual account banks
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" availableBanks, err := virtualaccount.GetAvailableBanks() if err != nil { log.Fatal(err) } fmt.Printf("available va banks: %+v\n", availableBanks)
Output:
func GetAvailableBanksWithContext ¶
GetAvailableBanksWithContext gets available virtual account banks with context
func GetFixedVA ¶
func GetFixedVA(data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
GetFixedVA gets a fixed virtual account
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" data := virtualaccount.GetFixedVAParams{ ID: "va-id", } resp, err := virtualaccount.GetFixedVA(&data) if err != nil { log.Fatal(err) } fmt.Printf("retrieved fixed va: %+v\n", resp)
Output:
func GetFixedVAWithContext ¶
func GetFixedVAWithContext(ctx context.Context, data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
GetFixedVAWithContext gets a fixed virtual account with context
func GetPayment ¶
func GetPayment(data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
GetPayment gets one fixed virtual account payment
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" payment, err := virtualaccount.GetPayment(&virtualaccount.GetPaymentParams{ PaymentID: "va-payment-id", }) if err != nil { log.Fatal(err) } fmt.Printf("retrieved va payment: %+v\n", payment)
Output:
func GetPaymentWithContext ¶
func GetPaymentWithContext(ctx context.Context, data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
GetPaymentWithContext gets one fixed virtual account payment with context
func UpdateFixedVA ¶
func UpdateFixedVA(data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
UpdateFixedVA updates a fixed virtual account
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" expirationDate := time.Now().AddDate(0, 0, 1) updateFixedVAData := virtualaccount.UpdateFixedVAParams{ ID: "va-id", ExpirationDate: &expirationDate, ExpectedAmount: 100000, } resp, err := virtualaccount.UpdateFixedVA(&updateFixedVAData) if err != nil { log.Fatal(err) } fmt.Printf("updated fixed va: %+v\n", resp)
Output:
func UpdateFixedVAWithContext ¶
func UpdateFixedVAWithContext(ctx context.Context, data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
UpdateFixedVAWithContext updates a fixed virtual account with context
Types ¶
type Client ¶
type Client struct { Opt *xendit.Option APIRequester xendit.APIRequester }
Client is the client used to invoke virtual account API.
func (*Client) CreateFixedVA ¶
func (c *Client) CreateFixedVA(data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
CreateFixedVA creates new fixed virtual account
func (*Client) CreateFixedVAWithContext ¶
func (c *Client) CreateFixedVAWithContext(ctx context.Context, data *CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
CreateFixedVAWithContext creates new fixed virtual account with context
func (*Client) GetAvailableBanks ¶
func (c *Client) GetAvailableBanks() ([]xendit.VirtualAccountBank, *xendit.Error)
GetAvailableBanks gets available virtual account banks
func (*Client) GetAvailableBanksWithContext ¶
func (c *Client) GetAvailableBanksWithContext(ctx context.Context) ([]xendit.VirtualAccountBank, *xendit.Error)
GetAvailableBanksWithContext gets available virtual account banks with context
func (*Client) GetFixedVA ¶
func (c *Client) GetFixedVA(data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
GetFixedVA gets one fixed virtual account
func (*Client) GetFixedVAWithContext ¶
func (c *Client) GetFixedVAWithContext(ctx context.Context, data *GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
GetFixedVAWithContext gets one fixed virtual account with context
func (*Client) GetPayment ¶
func (c *Client) GetPayment(data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
GetPayment gets one fixed virtual account payment
func (*Client) GetPaymentWithContext ¶
func (c *Client) GetPaymentWithContext(ctx context.Context, data *GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
GetPaymentWithContext gets one fixed virtual account payment with context
func (*Client) UpdateFixedVA ¶
func (c *Client) UpdateFixedVA(data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
UpdateFixedVA updates one fixed virtual account
func (*Client) UpdateFixedWithContext ¶
func (c *Client) UpdateFixedWithContext(ctx context.Context, data *UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
UpdateFixedWithContext updates one fixed virtual account with context
type CreateFixedVAParams ¶
type CreateFixedVAParams struct { ForUserID string `json:"-"` ExternalID string `json:"external_id" validate:"required"` BankCode string `json:"bank_code" validate:"required"` Name string `json:"name" validate:"required"` VirtualAccountNumber string `json:"virtual_account_number,omitempty"` IsClosed *bool `json:"is_closed,omitempty"` IsSingleUse *bool `json:"is_single_use,omitempty"` ExpirationDate *time.Time `json:"expiration_date,omitempty"` SuggestedAmount float64 `json:"suggested_amount,omitempty"` ExpectedAmount float64 `json:"expected_amount,omitempty"` Description string `json:"description,omitempty"` }
CreateFixedVAParams contains parameters for CreateFixedVA
type GetFixedVAParams ¶
type GetFixedVAParams struct { ForUserID string `json:"-"` ID string `json:"id" validate:"required"` }
GetFixedVAParams contains parameters for GetFixedVA
type GetPaymentParams ¶
type GetPaymentParams struct { ForUserID string `json:"-"` PaymentID string `json:"payment_id" validate:"required"` }
GetPaymentParams contains parameters for GetPayment
type UpdateFixedVAParams ¶
type UpdateFixedVAParams struct { ForUserID string `json:"-"` ID string `json:"-" validate:"required"` IsSingleUse *bool `json:"is_single_use,omitempty"` ExpirationDate *time.Time `json:"expiration_date,omitempty"` SuggestedAmount float64 `json:"suggested_amount,omitempty"` ExpectedAmount float64 `json:"expected_amount,omitempty"` Description string `json:"description,omitempty"` }
UpdateFixedVAParams contains parameters for UpdateFixedVA