Skip to content

Commit

Permalink
Allow to override HTTP transport by custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
zhutik committed Apr 28, 2018
1 parent 1422743 commit 9a87d95
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions adyen.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
// - Credentials instance of API creditials to connect to Adyen API
// - Currency is a default request currency. Request data overrides this setting
// - MerchantAccount is default merchant account to be used. Request data overrides this setting
// - client is http client instance
//
// Currency and MerchantAccount should be used only to store the data and be able to use it later.
// Requests won't be automatically populated with given values
Expand Down Expand Up @@ -117,6 +118,13 @@ func WithTimeout(d time.Duration) func(*Adyen) {
}
}

// WithTransport allows customer HTTP transports to be provider to the Adyen
func WithTransport(transport http.RoundTripper) func(*Adyen) {
return func(a *Adyen) {
a.client.Transport = transport
}
}

// WithCurrency allows for custom currencies to be provided to the Adyen.
func WithCurrency(c string) func(*Adyen) {
return func(a *Adyen) {
Expand Down

0 comments on commit 9a87d95

Please sign in to comment.