Skip to content

Commit

Permalink
Rename Call2 -> Call, GetIter2 -> GetIter, Query2 -> Query
Browse files Browse the repository at this point in the history
  • Loading branch information
brandur committed Jun 13, 2018
1 parent 7c389d7 commit 7130a47
Show file tree
Hide file tree
Showing 46 changed files with 173 additions and 212 deletions.
14 changes: 7 additions & 7 deletions account/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func New(params *stripe.AccountParams) (*stripe.Account, error) {

func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) {
acct := &stripe.Account{}
err := c.B.Call2("POST", "/accounts", c.Key, params, acct)
err := c.B.Call("POST", "/accounts", c.Key, params, acct)
return acct, err
}

Expand All @@ -29,7 +29,7 @@ func Get() (*stripe.Account, error) {

func (c Client) Get() (*stripe.Account, error) {
account := &stripe.Account{}
err := c.B.Call2("GET", "/account", c.Key, nil, account)
err := c.B.Call("GET", "/account", c.Key, nil, account)
return account, err
}

Expand All @@ -41,7 +41,7 @@ func GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) {
func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/accounts/%s", id)
account := &stripe.Account{}
err := c.B.Call2("GET", path, c.Key, params, account)
err := c.B.Call("GET", path, c.Key, params, account)
return account, err
}

Expand All @@ -53,7 +53,7 @@ func Update(id string, params *stripe.AccountParams) (*stripe.Account, error) {
func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/accounts/%s", id)
acct := &stripe.Account{}
err := c.B.Call2("POST", path, c.Key, params, acct)
err := c.B.Call("POST", path, c.Key, params, acct)
return acct, err
}

Expand All @@ -65,7 +65,7 @@ func Del(id string, params *stripe.AccountParams) (*stripe.Account, error) {
func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/accounts/%s", id)
acct := &stripe.Account{}
err := c.B.Call2("DELETE", path, c.Key, params, acct)
err := c.B.Call("DELETE", path, c.Key, params, acct)
return acct, err
}

Expand All @@ -77,7 +77,7 @@ func Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, err
func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/accounts/%s/reject", id)
acct := &stripe.Account{}
err := c.B.Call2("POST", path, c.Key, params, acct)
err := c.B.Call("POST", path, c.Key, params, acct)
return acct, err
}

Expand All @@ -87,7 +87,7 @@ func List(params *stripe.AccountListParams) *Iter {
}

func (c Client) List(listParams *stripe.AccountListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.AccountList{}
err := c.B.CallRaw("GET", "/accounts", c.Key, b, p, list)

Expand Down
8 changes: 4 additions & 4 deletions applepaydomain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {

func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
domain := &stripe.ApplePayDomain{}
err := c.B.Call2("POST", "/apple_pay/domains", c.Key, params, domain)
err := c.B.Call("POST", "/apple_pay/domains", c.Key, params, domain)
return domain, err
}

Expand All @@ -31,7 +31,7 @@ func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain
func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
path := stripe.FormatURLPath("/apple_pay/domains/%s", id)
domain := &stripe.ApplePayDomain{}
err := c.B.Call2("GET", path, c.Key, params, domain)
err := c.B.Call("GET", path, c.Key, params, domain)
return domain, err
}

Expand All @@ -43,7 +43,7 @@ func Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain
func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
path := stripe.FormatURLPath("/apple_pay/domains/%s", id)
domain := &stripe.ApplePayDomain{}
err := c.B.Call2("DELETE", path, c.Key, params, domain)
err := c.B.Call("DELETE", path, c.Key, params, domain)
return domain, err
}

Expand All @@ -53,7 +53,7 @@ func List(params *stripe.ApplePayDomainListParams) *Iter {
}

func (c Client) List(listParams *stripe.ApplePayDomainListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.ApplePayDomainList{}
err := c.B.CallRaw("GET", "/apple_pay/domains", c.Key, b, p, list)

Expand Down
6 changes: 3 additions & 3 deletions balance/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Get(params *stripe.BalanceParams) (*stripe.Balance, error) {

func (c Client) Get(params *stripe.BalanceParams) (*stripe.Balance, error) {
balance := &stripe.Balance{}
err := c.B.Call2("GET", "/balance", c.Key, params, balance)
err := c.B.Call("GET", "/balance", c.Key, params, balance)
return balance, err
}

Expand All @@ -33,7 +33,7 @@ func GetBalanceTransaction(id string, params *stripe.BalanceTransactionParams) (
func (c Client) GetBalanceTransaction(id string, params *stripe.BalanceTransactionParams) (*stripe.BalanceTransaction, error) {
path := stripe.FormatURLPath("/balance/history/%s", id)
balance := &stripe.BalanceTransaction{}
err := c.B.Call2("GET", path, c.Key, params, balance)
err := c.B.Call("GET", path, c.Key, params, balance)
return balance, err
}

Expand All @@ -44,7 +44,7 @@ func List(params *stripe.BalanceTransactionListParams) *Iter {
}

func (c Client) List(listParams *stripe.BalanceTransactionListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.BalanceTransactionList{}
err := c.B.CallRaw("GET", "/balance/history", c.Key, b, p, list)

Expand Down
8 changes: 4 additions & 4 deletions bankaccount/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (c Client) Get(id string, params *stripe.BankAccountParams) (*stripe.BankAc
}

ba := &stripe.BankAccount{}
err := c.B.Call2("GET", path, c.Key, params, ba)
err := c.B.Call("GET", path, c.Key, params, ba)
return ba, err
}

Expand All @@ -75,7 +75,7 @@ func (c Client) Update(id string, params *stripe.BankAccountParams) (*stripe.Ban
}

ba := &stripe.BankAccount{}
err := c.B.Call2("POST", path, c.Key, params, ba)
err := c.B.Call("POST", path, c.Key, params, ba)
return ba, err
}

Expand All @@ -95,7 +95,7 @@ func (c Client) Del(id string, params *stripe.BankAccountParams) (*stripe.BankAc
}

ba := &stripe.BankAccount{}
err := c.B.Call2("DELETE", path, c.Key, params, ba)
err := c.B.Call("DELETE", path, c.Key, params, ba)
return ba, err
}

Expand All @@ -118,7 +118,7 @@ func (c Client) List(listParams *stripe.BankAccountListParams) *Iter {
outerErr = errors.New("Invalid bank account params: either Customer or Account need to be set")
}

return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.BankAccountList{}

if outerErr != nil {
Expand Down
8 changes: 4 additions & 4 deletions bitcoinreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func New(params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error)

func (c Client) New(params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error) {
receiver := &stripe.BitcoinReceiver{}
err := c.B.Call2("POST", "/bitcoin/receivers", c.Key, params, receiver)
err := c.B.Call("POST", "/bitcoin/receivers", c.Key, params, receiver)
return receiver, err
}

Expand All @@ -36,7 +36,7 @@ func Get(id string, params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiv
func (c Client) Get(id string, params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error) {
path := stripe.FormatURLPath("/bitcoin/receivers/%s", id)
bitcoinReceiver := &stripe.BitcoinReceiver{}
err := c.B.Call2("GET", path, c.Key, params, bitcoinReceiver)
err := c.B.Call("GET", path, c.Key, params, bitcoinReceiver)
return bitcoinReceiver, err
}

Expand All @@ -49,7 +49,7 @@ func Update(id string, params *stripe.BitcoinReceiverUpdateParams) (*stripe.Bitc
func (c Client) Update(id string, params *stripe.BitcoinReceiverUpdateParams) (*stripe.BitcoinReceiver, error) {
path := stripe.FormatURLPath("/bitcoin/receivers/%s", id)
receiver := &stripe.BitcoinReceiver{}
err := c.B.Call2("POST", path, c.Key, params, receiver)
err := c.B.Call("POST", path, c.Key, params, receiver)
return receiver, err
}

Expand All @@ -60,7 +60,7 @@ func List(params *stripe.BitcoinReceiverListParams) *Iter {
}

func (c Client) List(listParams *stripe.BitcoinReceiverListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.BitcoinReceiverList{}
err := c.B.CallRaw("GET", "/bitcoin/receivers", c.Key, b, p, list)

Expand Down
2 changes: 1 addition & 1 deletion bitcointransaction/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func List(params *stripe.BitcoinTransactionListParams) *Iter {
}

func (c Client) List(listParams *stripe.BitcoinTransactionListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
path := stripe.FormatURLPath("/bitcoin/receivers/%s/transactions",
stripe.StringValue(listParams.Receiver))
list := &stripe.BitcoinTransactionList{}
Expand Down
8 changes: 4 additions & 4 deletions card/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c Client) Get(id string, params *stripe.CardParams) (*stripe.Card, error)
}

card := &stripe.Card{}
err := c.B.Call2("GET", path, c.Key, params, card)
err := c.B.Call("GET", path, c.Key, params, card)
return card, err
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func (c Client) Update(id string, params *stripe.CardParams) (*stripe.Card, erro
}

card := &stripe.Card{}
err := c.B.Call2("POST", path, c.Key, params, card)
err := c.B.Call("POST", path, c.Key, params, card)
return card, err
}

Expand All @@ -134,7 +134,7 @@ func (c Client) Del(id string, params *stripe.CardParams) (*stripe.Card, error)
}

card := &stripe.Card{}
err := c.B.Call2("DELETE", path, c.Key, params, card)
err := c.B.Call("DELETE", path, c.Key, params, card)
return card, err
}

Expand Down Expand Up @@ -162,7 +162,7 @@ func (c Client) List(listParams *stripe.CardListParams) *Iter {
outerErr = errors.New("Invalid card params: either account, customer or recipient need to be set")
}

return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.CardList{}

if outerErr != nil {
Expand Down
14 changes: 7 additions & 7 deletions charge/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func New(params *stripe.ChargeParams) (*stripe.Charge, error) {

func (c Client) New(params *stripe.ChargeParams) (*stripe.Charge, error) {
charge := &stripe.Charge{}
err := c.B.Call2("POST", "/charges", c.Key, params, charge)
err := c.B.Call("POST", "/charges", c.Key, params, charge)
return charge, err
}

Expand All @@ -33,7 +33,7 @@ func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) {
func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) {
path := stripe.FormatURLPath("/charges/%s", id)
charge := &stripe.Charge{}
err := c.B.Call2("GET", path, c.Key, params, charge)
err := c.B.Call("GET", path, c.Key, params, charge)
return charge, err
}

Expand All @@ -46,7 +46,7 @@ func Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) {
func (c Client) Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) {
path := stripe.FormatURLPath("/charges/%s", id)
charge := &stripe.Charge{}
err := c.B.Call2("POST", path, c.Key, params, charge)
err := c.B.Call("POST", path, c.Key, params, charge)
return charge, err
}

Expand All @@ -59,7 +59,7 @@ func Capture(id string, params *stripe.CaptureParams) (*stripe.Charge, error) {
func (c Client) Capture(id string, params *stripe.CaptureParams) (*stripe.Charge, error) {
path := stripe.FormatURLPath("/charges/%s/capture", id)
charge := &stripe.Charge{}
err := c.B.Call2("POST", path, c.Key, params, charge)
err := c.B.Call("POST", path, c.Key, params, charge)
return charge, err
}

Expand All @@ -70,7 +70,7 @@ func List(params *stripe.ChargeListParams) *Iter {
}

func (c Client) List(listParams *stripe.ChargeListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.ChargeList{}
err := c.B.CallRaw("GET", "/charges", c.Key, b, p, list)

Expand Down Expand Up @@ -124,7 +124,7 @@ func UpdateDispute(id string, params *stripe.DisputeParams) (*stripe.Dispute, er
func (c Client) UpdateDispute(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) {
path := stripe.FormatURLPath("/charges/%s/dispute", id)
dispute := &stripe.Dispute{}
err := c.B.Call2("POST", path, c.Key, params, dispute)
err := c.B.Call("POST", path, c.Key, params, dispute)

return dispute, err
}
Expand All @@ -137,7 +137,7 @@ func CloseDispute(id string) (*stripe.Dispute, error) {

func (c Client) CloseDispute(id string) (*stripe.Dispute, error) {
dispute := &stripe.Dispute{}
err := c.B.Call2("POST", stripe.FormatURLPath("/charges/%s/dispute/close", id), c.Key, nil, dispute)
err := c.B.Call("POST", stripe.FormatURLPath("/charges/%s/dispute/close", id), c.Key, nil, dispute)
return dispute, err
}

Expand Down
4 changes: 2 additions & 2 deletions countryspec/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Get(country string) (*stripe.CountrySpec, error) {
func (c Client) Get(country string) (*stripe.CountrySpec, error) {
path := stripe.FormatURLPath("/country_specs/%s", country)
countrySpec := &stripe.CountrySpec{}
err := c.B.Call2("GET", path, c.Key, nil, countrySpec)
err := c.B.Call("GET", path, c.Key, nil, countrySpec)
return countrySpec, err
}

Expand All @@ -31,7 +31,7 @@ func List(params *stripe.CountrySpecListParams) *Iter {
}

func (c Client) List(listParams *stripe.CountrySpecListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.CountrySpecList{}
err := c.B.CallRaw("GET", "/country_specs", c.Key, b, p, list)

Expand Down
10 changes: 5 additions & 5 deletions coupon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func New(params *stripe.CouponParams) (*stripe.Coupon, error) {

func (c Client) New(params *stripe.CouponParams) (*stripe.Coupon, error) {
coupon := &stripe.Coupon{}
err := c.B.Call2("POST", "/coupons", c.Key, params, coupon)
err := c.B.Call("POST", "/coupons", c.Key, params, coupon)
return coupon, err
}

Expand All @@ -33,7 +33,7 @@ func Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
path := stripe.FormatURLPath("/coupons/%s", id)
coupon := &stripe.Coupon{}
err := c.B.Call2("GET", path, c.Key, params, coupon)
err := c.B.Call("GET", path, c.Key, params, coupon)
return coupon, err
}

Expand All @@ -46,7 +46,7 @@ func Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
path := stripe.FormatURLPath("/coupons/%s", id)
coupon := &stripe.Coupon{}
err := c.B.Call2("POST", path, c.Key, params, coupon)
err := c.B.Call("POST", path, c.Key, params, coupon)
return coupon, err
}

Expand All @@ -59,7 +59,7 @@ func Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) {
path := stripe.FormatURLPath("/coupons/%s", id)
coupon := &stripe.Coupon{}
err := c.B.Call2("DELETE", path, c.Key, params, coupon)
err := c.B.Call("DELETE", path, c.Key, params, coupon)
return coupon, err
}

Expand All @@ -70,7 +70,7 @@ func List(params *stripe.CouponListParams) *Iter {
}

func (c Client) List(listParams *stripe.CouponListParams) *Iter {
return &Iter{stripe.GetIter2(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) {
list := &stripe.CouponList{}
err := c.B.CallRaw("GET", "/coupons", c.Key, b, p, list)

Expand Down
Loading

0 comments on commit 7130a47

Please sign in to comment.