Esempio n. 1
0
func (c Client) Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) {
	body := &url.Values{}
	params.AppendTo(body)

	refund := &stripe.FeeRefund{}
	err := c.B.Call("POST", fmt.Sprintf("/application_fees/%v/refunds/%v", params.Fee, id), c.Key, body, &params.Params, refund)

	return refund, err
}
Esempio n. 2
0
func (c Client) Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) {
	if params == nil {
		return nil, fmt.Errorf("params cannot be nil, and params.Fee must be set")
	}

	body := &url.Values{}
	params.AppendTo(body)

	refund := &stripe.FeeRefund{}
	err := c.B.Call("GET", fmt.Sprintf("/application_fees/%v/refunds/%v", params.Fee, id), c.Key, body, &params.Params, refund)

	return refund, err
}
Esempio n. 3
0
func (c Client) New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) {
	body := &url.Values{}

	if params.Amount > 0 {
		body.Add("amount", strconv.FormatUint(params.Amount, 10))
	}

	params.AppendTo(body)

	refund := &stripe.FeeRefund{}
	err := c.B.Call("POST", fmt.Sprintf("application_fees/%v/refunds", params.Fee), c.Key, body, &params.Params, refund)

	return refund, err
}