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

	if params != nil {
		commonParams = &params.Params
		body = &stripe.RequestValues{}
		params.AppendTo(body)
	}

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

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

	if params != nil {
		commonParams = &params.Params
		body = &stripe.RequestValues{}

		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
}