Skip to content

Commit e20fa67

Browse files
paul-nicolaslaouji
andauthored
fix(stripe): Increase Stripe client timeout to Stripe default value (#482)
Co-authored-by: Crimson Thompson <crimson@formance.com>
1 parent c18c002 commit e20fa67

File tree

1 file changed

+5
-2
lines changed
  • internal/connectors/plugins/public/stripe/client

1 file changed

+5
-2
lines changed

internal/connectors/plugins/public/stripe/client/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package client
22

33
import (
44
"context"
5+
"time"
56

67
"github.com/formancehq/payments/internal/connectors/httpwrapper"
78
"github.com/formancehq/payments/internal/connectors/metrics"
8-
"github.com/formancehq/payments/internal/models"
99
errorsutils "github.com/formancehq/payments/internal/utils/errors"
1010
"github.com/stripe/stripe-go/v79"
1111
"github.com/stripe/stripe-go/v79/account"
@@ -17,6 +17,9 @@ import (
1717
"github.com/stripe/stripe-go/v79/transferreversal"
1818
)
1919

20+
// https://github.com/stripe/stripe-go/blob/master/stripe.go#L1478
21+
const StripeDefaultTimeout = 80 * time.Second
22+
2023
//go:generate mockgen -source client.go -destination client_generated.go -package client . Client
2124
type Client interface {
2225
GetAccounts(ctx context.Context, timeline Timeline, pageSize int64) ([]*stripe.Account, Timeline, bool, error)
@@ -40,7 +43,7 @@ type client struct {
4043

4144
func New(name string, backend stripe.Backend, apiKey string) Client {
4245
if backend == nil {
43-
backends := stripe.NewBackends(metrics.NewHTTPClient(name, models.DefaultConnectorClientTimeout))
46+
backends := stripe.NewBackends(metrics.NewHTTPClient(name, StripeDefaultTimeout))
4447
backend = backends.API
4548
}
4649

0 commit comments

Comments
 (0)