Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Upgrade stripe-go version and use StringSlice (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobel-stripe authored and thorsten-stripe committed Apr 18, 2019
1 parent f8be115 commit d8027b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion server/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/labstack/gommon v0.2.8 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.7 // indirect
github.com/stripe/stripe-go v60.5.0+incompatible
github.com/stripe/stripe-go v60.6.0+incompatible
github.com/valyala/fasttemplate v1.0.1 // indirect
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a // indirect
)
2 changes: 2 additions & 0 deletions server/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/stripe/stripe-go v60.5.0+incompatible h1:nxxftMdmgWA4sbtxXPCk+/Fl+20McZZZl3nPr8KOfW0=
github.com/stripe/stripe-go v60.5.0+incompatible/go.mod h1:A1dQZmO/QypXmsL0T8axYZkSN/uA/T/A64pfKdBAMiY=
github.com/stripe/stripe-go v60.6.0+incompatible h1:CbEwrjCA6s5IdX1M1ss3NbadofPy77v+qjp2TQe3Unc=
github.com/stripe/stripe-go v60.6.0+incompatible/go.mod h1:A1dQZmO/QypXmsL0T8axYZkSN/uA/T/A64pfKdBAMiY=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
Expand Down
13 changes: 1 addition & 12 deletions server/go/payments/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func CreateIntent(r *IntentCreationRequest) (*stripe.PaymentIntent, error) {
params := &stripe.PaymentIntentParams{
Amount: stripe.Int64(amount),
Currency: stripe.String(r.Currency),
PaymentMethodTypes: paymentMethodTypes(),
PaymentMethodTypes: stripe.StringSlice(config.PaymentMethods()),
}
pi, err := paymentintent.New(params)
if err != nil {
Expand Down Expand Up @@ -100,14 +100,3 @@ func UpdateShipping(paymentIntent string, r *IntentShippingChangeRequest) (*stri

return pi, nil
}

func paymentMethodTypes() []*string {
types := config.PaymentMethods()

out := make([]*string, len(types))
for i := range types {
out[i] = &types[i]
}

return out
}

0 comments on commit d8027b7

Please sign in to comment.