xendit/xendit-go

Chaining of config

stanleynguyen opened this issue · 0 comments

Instead of having all config inside constructor's params

func New(secretKey string, xenditURL string, apiRequester *xendit.APIRequester) *API {

We can do chaining like below

// because secretKey is required param
func New(secretKey string) {}

func (c *Client) WithAPIRequester(r *APIRequester) *Client {}

func (c *Client) WithXenditURL(u string) *Client {}