From d8027b7b08e65a87674cd4bb65b931821a19def7 Mon Sep 17 00:00:00 2001 From: sobel-stripe Date: Thu, 18 Apr 2019 13:55:42 -0400 Subject: [PATCH] Upgrade stripe-go version and use StringSlice (#66) https://github.com/stripe/stripe-go/blob/master/CHANGELOG.md#6060---2019-04-18 --- server/go/go.mod | 2 +- server/go/go.sum | 2 ++ server/go/payments/payments.go | 13 +------------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/server/go/go.mod b/server/go/go.mod index 7033fc32..b7b6694f 100644 --- a/server/go/go.mod +++ b/server/go/go.mod @@ -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 ) diff --git a/server/go/go.sum b/server/go/go.sum index 3c250f7c..d684f822 100644 --- a/server/go/go.sum +++ b/server/go/go.sum @@ -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= diff --git a/server/go/payments/payments.go b/server/go/payments/payments.go index 744bd028..c720dae4 100644 --- a/server/go/payments/payments.go +++ b/server/go/payments/payments.go @@ -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 { @@ -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 -}