From e72cbad3df448cfa6cb8f28b2e0e25db91ca26b7 Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Sun, 8 Sep 2019 11:12:07 +0200 Subject: [PATCH] Authenticate stripe calls for payment intents Duh. --- payments/stripe/stripe.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/payments/stripe/stripe.go b/payments/stripe/stripe.go index 933bf55..b721578 100644 --- a/payments/stripe/stripe.go +++ b/payments/stripe/stripe.go @@ -13,7 +13,6 @@ import ( "github.com/sirupsen/logrus" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/client" - "github.com/stripe/stripe-go/paymentintent" ) type stripePaymentProvider struct { @@ -137,7 +136,7 @@ func (s *stripePaymentProvider) chargePaymentIntent(paymentMethodID string, amou )), Confirm: stripe.Bool(true), } - intent, err := paymentintent.New(params) + intent, err := s.client.PaymentIntents.New(params) if err != nil { return "", err } @@ -185,7 +184,7 @@ func (s *stripePaymentProvider) NewConfirmer(ctx context.Context, r *http.Reques } func (s *stripePaymentProvider) confirm(paymentID string) error { - _, err := paymentintent.Confirm(paymentID, nil) + _, err := s.client.PaymentIntents.Confirm(paymentID, nil) if stripeErr, ok := err.(*stripe.Error); ok { return payments.NewPaymentConfirmFailError(stripeErr.Msg)