Skip to content

Commit

Permalink
Authenticate stripe calls for payment intents
Browse files Browse the repository at this point in the history
Duh.
  • Loading branch information
mraerino committed Sep 8, 2019
1 parent 629566d commit e72cbad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions payments/stripe/stripe.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
stripe "github.com/stripe/stripe-go" stripe "github.com/stripe/stripe-go"
"github.com/stripe/stripe-go/client" "github.com/stripe/stripe-go/client"
"github.com/stripe/stripe-go/paymentintent"
) )


type stripePaymentProvider struct { type stripePaymentProvider struct {
Expand Down Expand Up @@ -137,7 +136,7 @@ func (s *stripePaymentProvider) chargePaymentIntent(paymentMethodID string, amou
)), )),
Confirm: stripe.Bool(true), Confirm: stripe.Bool(true),
} }
intent, err := paymentintent.New(params) intent, err := s.client.PaymentIntents.New(params)
if err != nil { if err != nil {
return "", err return "", err
} }
Expand Down Expand Up @@ -185,7 +184,7 @@ func (s *stripePaymentProvider) NewConfirmer(ctx context.Context, r *http.Reques
} }


func (s *stripePaymentProvider) confirm(paymentID string) error { 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 { if stripeErr, ok := err.(*stripe.Error); ok {
return payments.NewPaymentConfirmFailError(stripeErr.Msg) return payments.NewPaymentConfirmFailError(stripeErr.Msg)
Expand Down

0 comments on commit e72cbad

Please sign in to comment.