Beispiel #1
0
func (c Client) Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) {
	var body *url.Values
	var commonParams *stripe.Params

	if params != nil {
		commonParams = &params.Params
		body = &url.Values{}
		params.AppendTo(body)
	}

	dispute := &stripe.Dispute{}
	err := c.B.Call("GET", "/disputes/"+id, c.Key, body, commonParams, dispute)

	return dispute, err
}
Beispiel #2
0
func (c Client) Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) {
	var body *url.Values
	var commonParams *stripe.Params

	if params != nil {
		commonParams = &params.Params
		body = &url.Values{}

		if params.Evidence != nil {
			params.Evidence.AppendDetails(body)
		}
		params.AppendTo(body)
	}

	dispute := &stripe.Dispute{}
	err := c.B.Call("POST", fmt.Sprintf("/disputes/%v", id), c.Key, body, commonParams, dispute)

	return dispute, err
}