Skip to content

Commit

Permalink
Update all services (#402)
Browse files Browse the repository at this point in the history
* [reformat][adyen-sdk-automation] automated change

* style(fmt): code formatted

---------

Co-authored-by: AdyenAutomationBot <Adyen Automation [email protected]>
  • Loading branch information
AdyenAutomationBot and AdyenAutomationBot authored Jan 14, 2025
1 parent 6cfe0f0 commit 587ff33
Show file tree
Hide file tree
Showing 11 changed files with 441 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/balanceplatform/model_balance.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 152 additions & 0 deletions src/balanceplatform/model_priority_restriction.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions src/balanceplatform/model_transaction_rule_restrictions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions src/checkout/model_additional_data_common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/checkout/model_payment_refund_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 19 additions & 20 deletions src/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func SendAPIRequest(
return httpResponse, err
}

c.logOnError(httpResponse)
c.logOnError(httpResponse)

if httpResponse.StatusCode >= 300 {
newErr := NewAPIError(body, httpResponse.Status)
Expand Down Expand Up @@ -231,24 +231,24 @@ func (c *Client) CallAPI(request *http.Request) (*http.Response, error) {

// LogOnError log response body when an error occurs
// the type of error being logged depends on the Configuration
func (c *Client) logOnError(httpResponse *http.Response) {
if c.Cfg.Log3XXError {
if httpResponse.StatusCode >= 300 && httpResponse.StatusCode < 400 {
fmt.Println(httpResponse.Body)
}
}

if c.Cfg.Log4XXError {
if httpResponse.StatusCode >= 400 && httpResponse.StatusCode < 500 {
fmt.Println(httpResponse.Body)
}
}

if c.Cfg.Log5XXError {
if httpResponse.StatusCode >= 500 {
fmt.Println(httpResponse.Body)
}
}
func (c *Client) logOnError(httpResponse *http.Response) {
if c.Cfg.Log3XXError {
if httpResponse.StatusCode >= 300 && httpResponse.StatusCode < 400 {
fmt.Println(httpResponse.Body)
}
}

if c.Cfg.Log4XXError {
if httpResponse.StatusCode >= 400 && httpResponse.StatusCode < 500 {
fmt.Println(httpResponse.Body)
}
}

if c.Cfg.Log5XXError {
if httpResponse.StatusCode >= 500 {
fmt.Println(httpResponse.Body)
}
}
}

func maskApiKey(request *http.Request) {
Expand Down Expand Up @@ -884,4 +884,3 @@ func IdempotencyKey(ctx context.Context) (string, bool) {
key, ok := ikey.(string)
return key, ok
}

Loading

0 comments on commit 587ff33

Please sign in to comment.