// Refunds a charge for the full amount.
//
// see https://stripe.com/docs/api#refund_charge
775809
func (self *ChargeClient) Refund(id string) (*Charge, error) {
	values := url.Values{}
	charge := Charge{}
	path := "/v1/charges/" + url.QueryEscape(id) + "/refund"
	err := query("POST", path, values, &charge)
	return &charge, err
}
837985
func (h *Client) rollback(ctx context.Context, req *rls.RollbackReleaseRequest) (*rls.RollbackReleaseResponse, error) {
	c, err := h.connect(ctx)
	if err != nil {
		return nil, err
	}
	defer c.Close()

	rlc := rls.NewReleaseServiceClient(c)
	return rlc.RollbackRelease(ctx, req)
}
587069
func New(params *stripe.RefundParams) (*stripe.Refund, error) {
	return getC().New(params)
}
265340
func (c *Client) GetRefund(refundID string) (*Refund, error) {
	refund := &Refund{}

	req, err := c.NewRequest("GET", fmt.Sprintf("%s%s", c.APIBase, "/v2/payments/refund/"+refundID), nil)
	if err != nil {
		return refund, err
	}

	if err = c.SendWithAuth(req, refund); err != nil {
		return refund, err
	}

	return refund, nil
}
91310
func Amount(milliSat lnwire.MilliSatoshi) func(*Invoice) {
	return func(i *Invoice) {
		i.MilliSat = &milliSat
	}
}
833824
func Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) {
	return getC().Update(id, params)
}
1145625
func (r Product_Item_Price) GetAccountRestrictions() (resp []datatypes.Product_Item_Price_Account_Restriction, err error) {
	err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getAccountRestrictions", nil, &r.Options, &resp)
	return
}
188517
func (q *Query) Limit(amount uint) *Query {
	q.query.Limit(amount)
	return q
}
686501
func (r Account) GetPriceRestrictions() (resp []datatypes.Product_Item_Price_Account_Restriction, err error) {
	err = r.Session.DoRequest("SoftLayer_Account", "getPriceRestrictions", nil, &r.Options, &resp)
	return
}
273193
func (image *Image) GetStripeCount() (stripe_count uint64, err error) {
	if image.image == nil {
		return 0, RbdErrorImageNotOpen
	}

	ret := C.rbd_get_stripe_count(image.image, (*C.uint64_t)(&stripe_count))
	if ret < 0 {
		return 0, RBDError(int(ret))
	}

	return stripe_count, nil
}
123286
func (c Client) New(params *stripe.RefundParams) (*stripe.Refund, error) {
	refund := &stripe.Refund{}
	err := c.B.Call(http.MethodPost, "/v1/refunds", c.Key, params, refund)
	return refund, err
}
224107
async function refund(ctx) {
  let order = ctx.state.order;
  let body = ctx.state.body || ctx.request.body;
  let orderId = body.order || ctx.request.body.order;
  let reason = body.reason || ctx.request.body.reason;
  let amount = body.amount || ctx.request.body.amount;
  if (!orderId && !order || ctx.method !== 'POST') _2.default.error(400);
  if (!ctx.user) _2.default.error(403);
  if (!reason) _2.default.error('Invalid refund reason');
  if (!order) {
    // $Flow
    let orderTmp = await _Order2.default.findById(orderId).where('user', ctx.user._id);
    order = orderTmp;
    if (!order) _2.default.error('Order not found');
    if (order.state !== 400 && order.state !== 500) _2.default.error('Order state error');
  }
  if (!amount) {
    amount = order.payed;
  }
  if (amount > order.payed) _2.default.error('Invalid refund amount');
  await _2.default.run('Refund', {
    ctx, order, reason, amount
  });
  ctx.body = order.data();
}
1236992
func (c Client) New(params *stripe.ChargeParams) (*stripe.Charge, error) {
	charge := &stripe.Charge{}
	err := c.B.Call(http.MethodPost, "/v1/charges", c.Key, params, charge)
	return charge, err
}
1046048
func (r Billing_Item_Cancellation_Request) ValidateBillingItemForCancellation(billingItemId *int) (resp bool, err error) {
	params := []interface{}{
		billingItemId,
	}
	err = r.Session.DoRequest("SoftLayer_Billing_Item_Cancellation_Request", "validateBillingItemForCancellation", params, &r.Options, &resp)
	return
}
580392
func (r Billing_Item_Cancellation_Request) Void(closeRelatedTicketFlag *bool) (resp bool, err error) {
	params := []interface{}{
		closeRelatedTicketFlag,
	}
	err = r.Session.DoRequest("SoftLayer_Billing_Item_Cancellation_Request", "void", params, &r.Options, &resp)
	return
}
286992
func (r Billing_Info) GetCurrency() (resp datatypes.Billing_Currency, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Info", "getCurrency", nil, &r.Options, &resp)
	return
}
813515
func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) {
	path := stripe.FormatURLPath("/v1/refunds/%s", id)
	refund := &stripe.Refund{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, refund)
	return refund, err
}