Skip to content
Permalink
Browse files

Authenticate stripe calls for payment intents

Duh.
  • Loading branch information...
mraerino committed Sep 8, 2019
1 parent 629566d commit e72cbad3df448cfa6cb8f28b2e0e25db91ca26b7
Showing with 2 additions and 3 deletions.
  1. +2 −3 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)

0 comments on commit e72cbad

Please sign in to comment.
You can’t perform that action at this time.