Skip to content

Commit

Permalink
Remove editable bitcoin receiver actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomer-stripe committed Aug 17, 2018
1 parent 55b1f82 commit ca5d762
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
20 changes: 0 additions & 20 deletions bitcoinreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ type BitcoinReceiverListParams struct {
UncapturedFunds *bool `form:"uncaptured_funds"`
}

// BitcoinReceiverParams is the set of parameters that can be used when creating a BitcoinReceiver.
// For more details see https://stripe.com/docs/api/#create_bitcoin_receiver.
type BitcoinReceiverParams struct {
Params `form:"*"`
Amount *int64 `form:"amount"`
Currency *string `form:"currency"`
Description *string `form:"description"`
Email *string `form:"email"`
}

// BitcoinReceiverUpdateParams is the set of parameters that can be used when
// updating a BitcoinReceiver. For more details see
// https://stripe.com/docs/api/#update_bitcoin_receiver.
type BitcoinReceiverUpdateParams struct {
Params `form:"*"`
Description *string `form:"description"`
Email *string `form:"email"`
RefundAddress *string `form:"refund_address"`
}

// BitcoinReceiver is the resource representing a Stripe bitcoin receiver.
// For more details see https://stripe.com/docs/api/#bitcoin_receivers
type BitcoinReceiver struct {
Expand Down
33 changes: 4 additions & 29 deletions bitcoinreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,19 @@ type Client struct {
Key string
}

// New creates a new bitcoin receiver.
func New(params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error) {
return getC().New(params)
}

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

// Get returns the details of a bitcoin receiver.
func Get(id string, params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error) {
return getC().Get(id, params)
func Get(id string) (*stripe.BitcoinReceiver, error) {
return getC().Get(id)
}

// Get returns the details of a bitcoin receiver.
func (c Client) Get(id string, params *stripe.BitcoinReceiverParams) (*stripe.BitcoinReceiver, error) {
func (c Client) Get(id string) (*stripe.BitcoinReceiver, error) {
path := stripe.FormatURLPath("/bitcoin/receivers/%s", id)
bitcoinReceiver := &stripe.BitcoinReceiver{}
err := c.B.Call(http.MethodGet, path, c.Key, params, bitcoinReceiver)
err := c.B.Call(http.MethodGet, path, c.Key, nil, bitcoinReceiver)
return bitcoinReceiver, err
}

// Update updates a bitcoin receiver's properties.
func Update(id string, params *stripe.BitcoinReceiverUpdateParams) (*stripe.BitcoinReceiver, error) {
return getC().Update(id, params)
}

// Update updates a bitcoin receiver's properties.
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.Call(http.MethodPost, path, c.Key, params, receiver)
return receiver, err
}

// List returns a list of bitcoin receivers.
func List(params *stripe.BitcoinReceiverListParams) *Iter {
return getC().List(params)
Expand Down
2 changes: 1 addition & 1 deletion bitcoinreceiver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestBitcoinReceiverGet(t *testing.T) {
receiver, err := Get("btcrcv_123", nil)
receiver, err := Get("btcrcv_123")
assert.Nil(t, err)
assert.NotNil(t, receiver)
}
Expand Down

0 comments on commit ca5d762

Please sign in to comment.