// PatchCreditCard func
// Endpoint: PATCH /v1/vault/credit-cards/credit_card_id
428051
func (c *Client) PatchCreditCard(id string, ccf []CreditCardField) (*CreditCard, error) {
	req, err := c.NewRequest("PATCH", fmt.Sprintf("%s/v1/vault/credit-cards/%s", c.APIBase, id), ccf)
	if err != nil {
		return nil, err
	}

	response := CreditCard{}

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

	return &response, nil
}
1057825
func CreditCard() *CreditCardInfo {
	return &CreditCardInfo{
		Type:   CreditCardType(),
		Number: CreditCardNumber(),
		Exp:    CreditCardExp(),
		Cvv:    CreditCardCvv(),
	}
}
123993
func (idt *IdentityTable) StellarAccountID() *stellar1.AccountID {
	// Return the account ID of the latest link with the network set to stellar.
	if idt.stellar == nil {
		return nil
	}
	link := idt.stellar
	if link.network == string(WalletNetworkStellar) {
		// Something should have already validated link.address as a stellar account ID.
		tmp := stellar1.AccountID(link.address)
		return &tmp
	}
	return nil
}
317737
func (s *Service) CreditCreate(ctx context.Context, o CreditCreateOpts) (*Credit, error) {
	var credit Credit
	return &credit, s.Post(ctx, &credit, fmt.Sprintf("/account/credits"), o)
}
458956
func (w *WalletState) UpdateAccountEntries(mctx libkb.MetaContext, reason string) (err error) {
	defer mctx.TraceTimed(fmt.Sprintf("WalletState.UpdateAccountEntries [%s]", reason), func() error { return err })()

	bundle, err := remote.FetchSecretlessBundle(mctx)
	if err != nil {
		return err
	}

	return w.UpdateAccountEntriesWithBundle(mctx, reason, bundle)
}
442215
func CreditCardType() string {
	n := len(creditCards)
	var vendors []string
	for _, cc := range creditCards {
		vendors = append(vendors, cc.vendor)
	}

	return vendors[r.Intn(n)]
}
872731
func (a *Client) PatchSkusIdentifier(params *PatchSkusIdentifierParams, authInfo runtime.ClientAuthInfoWriter) (*PatchSkusIdentifierOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewPatchSkusIdentifierParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "PatchSkusIdentifier",
		Method:             "PATCH",
		PathPattern:        "/skus/{identifier}",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &PatchSkusIdentifierReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*PatchSkusIdentifierOK), nil
}
182078
func (res *Resource) Patch(storage store.Update) {
	res.HandleFuncC(
		pat.Patch(patID),
		func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
			res.patchHandler(ctx, w, r, storage)
		},
	)

	res.addRoute(patch, patID)
}
166089
func (c *FakeIdentities) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *user.Identity, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(identitiesResource, name, pt, data, subresources...), &user.Identity{})
	if obj == nil {
		return nil, err
	}
	return obj.(*user.Identity), err
}
1350640
func (c *Client) AccountChangeEmail(password string, email string) (*Account, error) {
	params := struct {
		Password string `json:"password"`
		Email    string `json:"email"`
	}{
		Password: password,
		Email:    email,
	}
	var accountRes Account
	return &accountRes, c.Patch(&accountRes, "/account", params)
}
977392
func (s *Store) addCredit(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta, index uint32, change bool) (bool, error) {
	if block == nil {
		// If the outpoint that we should mark as credit already exists
		// within the store, either as unconfirmed or confirmed, then we
		// have nothing left to do and can exit.
		k := canonicalOutPoint(&rec.Hash, index)
		if existsRawUnminedCredit(ns, k) != nil {
			return false, nil
		}
		if existsRawUnspent(ns, k) != nil {
			return false, nil
		}
		v := valueUnminedCredit(btcutil.Amount(rec.MsgTx.TxOut[index].Value), change)
		return true, putRawUnminedCredit(ns, k, v)
	}

	k, v := existsCredit(ns, &rec.Hash, index, &block.Block)
	if v != nil {
		return false, nil
	}

	txOutAmt := btcutil.Amount(rec.MsgTx.TxOut[index].Value)
	log.Debugf("Marking transaction %v output %d (%v) spendable",
		rec.Hash, index, txOutAmt)

	cred := credit{
		outPoint: wire.OutPoint{
			Hash:  rec.Hash,
			Index: index,
		},
		block:   block.Block,
		amount:  txOutAmt,
		change:  change,
		spentBy: indexedIncidence{index: ^uint32(0)},
	}
	v = valueUnspentCredit(&cred)
	err := putRawCredit(ns, k, v)
	if err != nil {
		return false, err
	}

	minedBalance, err := fetchMinedBalance(ns)
	if err != nil {
		return false, err
	}
	err = putMinedBalance(ns, minedBalance+txOutAmt)
	if err != nil {
		return false, err
	}

	return true, putUnspent(ns, &cred.outPoint, &block.Block)
}
314461
func New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) {
	return getC().New(params)
}
654930
func (c *Card) AddMemberID(memberID string) (member []*Member, err error) {
	path := fmt.Sprintf("cards/%s/idMembers", c.ID)
	err = c.client.Post(path, Arguments{"value": memberID}, &member)
	return member, err
}
131857
func (p *Loader) UpdatePayment(ctx context.Context, paymentID stellar1.PaymentID) {
	if p.done {
		return
	}

	p.enqueuePayment(paymentID)
}
575358
func VoidCreditNote(id string, params *stripe.CreditNoteVoidParams) (*stripe.CreditNote, error) {
	return getC().VoidCreditNote(id, params)
}
197931
func (a *Action) DidUnarchiveCard() bool {
	return (a.Type == "updateCard") && a.Data != nil && a.Data.Old != nil && a.Data.Old.Closed
}
550333
func WrapOpID(c context.Context, id int64, caller identity.Identity) (string, error) {
	return opToken.Generate(c, []byte(caller), map[string]string{
		"id": strconv.FormatInt(id, 10),
	}, 0)
}