Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jun 6, 2018
1 parent c0d2ee1 commit 63d5c58
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
chargeParams := &stripe.ChargeParams{
Amount: stripe.Int64(2000),
Currency: stripe.String(string(stripe.CurrencyUSD)),
Desc: stripe.String("Charge from Google App Engine"),
Description: stripe.String("Charge from Google App Engine"),
}
chargeParams.SetSource("tok_amex") // obtained with Stripe.js
charge, err := sc.Charges.New(chargeParams)
Expand Down
8 changes: 4 additions & 4 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const (
type OrderItemType string

const (
OrderItemTeypeDiscount OrderItemType = "discount"
OrderItemTeypeShipping OrderItemType = "shipping"
OrderItemTeypeSKU OrderItemType = "sku"
OrderItemTeypeTax OrderItemType = "tax"
OrderItemTypeDiscount OrderItemType = "discount"
OrderItemTypeShipping OrderItemType = "shipping"
OrderItemTypeSKU OrderItemType = "sku"
OrderItemTypeTax OrderItemType = "tax"
)

type OrderParams struct {
Expand Down
8 changes: 4 additions & 4 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ type PlanTier struct {

// PlanTransformUsage represents the bucket billing configuration.
type PlanTransformUsage struct {
DivideBy int64 `json:"bucket_size"`
Round PlanTransformUsageRound `json:"round"`
BucketSize int64 `json:"bucket_size"`
Round PlanTransformUsageRound `json:"round"`
}

// PlanTransformUsageParams represents the bucket billing configuration.
type PlanTransformUsageParams struct {
DivideBy *int64 `form:"bucket_size"`
Round *string `form:"round"`
BucketSize *int64 `form:"bucket_size"`
Round *string `form:"round"`
}

// PlanTierParams configures tiered pricing
Expand Down
4 changes: 2 additions & 2 deletions plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func TestPlanParams_AppendTo(t *testing.T) {
{"tiers[0][up_to]", &PlanParams{Tiers: tiers}, strconv.FormatUint(321, 10)},
{"tiers[1][amount]", &PlanParams{Tiers: tiers}, strconv.FormatUint(123, 10)},
{"tiers[1][up_to]", &PlanParams{Tiers: tiers}, "inf"},
{"transform_usage[bucket_size]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: Int64(123), Round: String("round_up")}}, strconv.FormatUint(123, 10)},
{"transform_usage[round]", &PlanParams{TransformUsage: &PlanTransformUsageParams{DivideBy: Int64(123), Round: String("round_up")}}, "round_up"},
{"transform_usage[bucket_size]", &PlanParams{TransformUsage: &PlanTransformUsageParams{BucketSize: Int64(123), Round: String("round_up")}}, strconv.FormatUint(123, 10)},
{"transform_usage[round]", &PlanParams{TransformUsage: &PlanTransformUsageParams{BucketSize: Int64(123), Round: String("round_up")}}, "round_up"},
{"trial_period_days", &PlanParams{TrialPeriodDays: Int64(123)}, strconv.FormatUint(123, 10)},
{"usage_type", &PlanParams{UsageType: String("metered")}, "metered"},
}
Expand Down
4 changes: 2 additions & 2 deletions recipient.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
type RecipientType string

const (
RecipientTypeIndividual RecipientType = "individual"
RecipientTypeCorp RecipientType = "corporation"
RecipientTypeIndividual RecipientType = "individual"
RecipientTypeCorporation RecipientType = "corporation"
)

// RecipientParams is the set of parameters that can be used when creating or updating recipients.
Expand Down
4 changes: 2 additions & 2 deletions recipienttransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const (
type RecipientTransferType string

const (
RecipientTransferTypeBank RecipientTransferType = "bank_account"
RecipientTransferTypeCard RecipientTransferType = "card"
RecipientTransferTypeBankAccount RecipientTransferType = "bank_account"
RecipientTransferTypeCard RecipientTransferType = "card"
)

// RecipientTransferMethodType represents the type of recipient_transfer
Expand Down
24 changes: 12 additions & 12 deletions stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,18 +495,18 @@ func BoolValue(v *bool) bool {
return false
}

// String returns a pointer to the string value passed in.
func String(v string) *string {
// Float64 returns a pointer to the float64 value passed in.
func Float64(v float64) *float64 {
return &v
}

// StringValue returns the value of the string pointer passed in or
// "" if the pointer is nil.
func StringValue(v *string) string {
// Float64Value returns the value of the float64 pointer passed in or
// 0 if the pointer is nil.
func Float64Value(v *float64) float64 {
if v != nil {
return *v
}
return ""
return 0
}

// Int64 returns a pointer to the int64 value passed in.
Expand All @@ -523,16 +523,16 @@ func Int64Value(v *int64) int64 {
return 0
}

// Float64 returns a pointer to the float64 value passed in.
func Float64(v float64) *float64 {
// String returns a pointer to the string value passed in.
func String(v string) *string {
return &v
}

// Float64Value returns the value of the float64 pointer passed in or
// 0 if the pointer is nil.
func Float64Value(v *float64) float64 {
// StringValue returns the value of the string pointer passed in or
// "" if the pointer is nil.
func StringValue(v *string) string {
if v != nil {
return *v
}
return 0
return ""
}

0 comments on commit 63d5c58

Please sign in to comment.