Skip to content

Commit

Permalink
Merge pull request #18 from BoltApp/ellenwei/nit-fix
Browse files Browse the repository at this point in the history
Braintree client with access token and passed in httpClient
  • Loading branch information
ellenwei authored Jan 25, 2022
2 parents cc655a5 + fb328dd commit ce0f42b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions braintree.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ func NewWithHttpClient(env Environment, merchantId, publicKey, privateKey string
return &Braintree{credentials: newAPIKey(env, merchantId, publicKey, privateKey), HttpClient: client}
}

// NewWithAccessToken creates a Braintree client with an Access Token and customized http client.
func NewWithAccessTokenAndCustomizedHttpClient(accessToken string, client *http.Client) (*Braintree, error) {
c, err := newAccessToken(accessToken)
if err != nil {
return nil, err
}
return &Braintree{credentials: c, HttpClient: client}, nil
}

// NewWithAccessToken creates a Braintree client with an Access Token.
// Note: When using an access token, webhooks are unsupported and the
// WebhookNotification() function will panic.
Expand Down

0 comments on commit ce0f42b

Please sign in to comment.