diff --git a/src/balanceplatform/api_account_holders.go b/src/balanceplatform/api_account_holders.go index 117218351..d8041a357 100644 --- a/src/balanceplatform/api_account_holders.go +++ b/src/balanceplatform/api_account_holders.go @@ -10,26 +10,26 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AccountHoldersApi AccountHoldersApi service type AccountHoldersApi common.Service -type CreateAccountHolderConfig struct { - ctx context.Context +type AccountHoldersApiCreateAccountHolderConfig struct { + ctx context.Context accountHolderInfo *AccountHolderInfo } -func (r CreateAccountHolderConfig) AccountHolderInfo(accountHolderInfo AccountHolderInfo) CreateAccountHolderConfig { +func (r AccountHoldersApiCreateAccountHolderConfig) AccountHolderInfo(accountHolderInfo AccountHolderInfo) AccountHoldersApiCreateAccountHolderConfig { r.accountHolderInfo = &accountHolderInfo return r } + /* CreateAccountHolder Create an account holder @@ -38,34 +38,90 @@ Creates an account holder linked to a [legal entity](https://docs.adyen.com/api- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreateAccountHolderConfig + @return AccountHoldersApiCreateAccountHolderConfig */ -func (a *AccountHoldersApi) CreateAccountHolderConfig(ctx context.Context) CreateAccountHolderConfig { - return CreateAccountHolderConfig{ +func (a *AccountHoldersApi) CreateAccountHolderConfig(ctx context.Context) AccountHoldersApiCreateAccountHolderConfig { + return AccountHoldersApiCreateAccountHolderConfig{ ctx: ctx, } } /* Create an account holder -Creates an account holder linked to a [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities). - * @param req AccountHolderInfo - reference of AccountHolderInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Creates an account holder linked to a [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities). + * @param req AccountHolderInfo - reference of AccountHolderInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AccountHolder */ -func (a *AccountHoldersApi) CreateAccountHolder(r CreateAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { - res := &AccountHolder{} +func (a *AccountHoldersApi) CreateAccountHolder(r AccountHoldersApiCreateAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &AccountHolder{} path := "/accountHolders" - httpRes, err := a.Client.MakeHTTPPostRequest(r.accountHolderInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.accountHolderInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetAccountHolderConfig struct { + +type AccountHoldersApiGetAccountHolderConfig struct { ctx context.Context - id string + id string } + /* GetAccountHolder Get an account holder @@ -73,12 +129,12 @@ Returns an account holder. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the account holder. - @return GetAccountHolderConfig + @return AccountHoldersApiGetAccountHolderConfig */ -func (a *AccountHoldersApi) GetAccountHolderConfig(ctx context.Context, id string) GetAccountHolderConfig { - return GetAccountHolderConfig{ +func (a *AccountHoldersApi) GetAccountHolderConfig(ctx context.Context, id string) AccountHoldersApiGetAccountHolderConfig { + return AccountHoldersApiGetAccountHolderConfig{ ctx: ctx, - id: id, + id: id, } } @@ -86,52 +142,108 @@ func (a *AccountHoldersApi) GetAccountHolderConfig(ctx context.Context, id strin Get an account holder Returns an account holder. * @param id The unique identifier of the account holder. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AccountHolder */ -func (a *AccountHoldersApi) GetAccountHolder(r GetAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { - res := &AccountHolder{} +func (a *AccountHoldersApi) GetAccountHolder(r AccountHoldersApiGetAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &AccountHolder{} path := "/accountHolders/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetAllBalanceAccountsOfAccountHolderConfig struct { - ctx context.Context - id string + +type AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig struct { + ctx context.Context + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. -func (r GetAllBalanceAccountsOfAccountHolderConfig) Offset(offset int32) GetAllBalanceAccountsOfAccountHolderConfig { +func (r AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig) Offset(offset int32) AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig { r.offset = &offset return r } // The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r GetAllBalanceAccountsOfAccountHolderConfig) Limit(limit int32) GetAllBalanceAccountsOfAccountHolderConfig { +func (r AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig) Limit(limit int32) AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig { r.limit = &limit return r } + /* GetAllBalanceAccountsOfAccountHolder Get all balance accounts of an account holder -Returns a paginated list of the balance accounts associated with an account holder. To fetch multiple pages, use the query parameters. +Returns a paginated list of the balance accounts associated with an account holder. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 balance accounts and skip the first 10, use `/accountHolders/{id}/balanceAccounts?limit=5&offset=10`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the account holder. - @return GetAllBalanceAccountsOfAccountHolderConfig + @return AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig */ -func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolderConfig(ctx context.Context, id string) GetAllBalanceAccountsOfAccountHolderConfig { - return GetAllBalanceAccountsOfAccountHolderConfig{ +func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolderConfig(ctx context.Context, id string) AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig { + return AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig{ ctx: ctx, - id: id, + id: id, } } @@ -139,36 +251,91 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolderConfig(ctx conte Get all balance accounts of an account holder Returns a paginated list of the balance accounts associated with an account holder. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 balance accounts and skip the first 10, use `/accountHolders/{id}/balanceAccounts?limit=5&offset=10`. * @param id The unique identifier of the account holder. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaginatedBalanceAccountsResponse */ -func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(r GetAllBalanceAccountsOfAccountHolderConfig) (PaginatedBalanceAccountsResponse, *_nethttp.Response, error) { - res := &PaginatedBalanceAccountsResponse{} +func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(r AccountHoldersApiGetAllBalanceAccountsOfAccountHolderConfig) (PaginatedBalanceAccountsResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaginatedBalanceAccountsResponse{} path := "/accountHolders/{id}/balanceAccounts" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryString := url.Values{} - if r.offset != nil { - common.ParameterAddToQuery(queryString, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryString, "limit", r.limit, "") - } - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path+"?"+queryString.Encode(), r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type UpdateAccountHolderConfig struct { - ctx context.Context - id string + +type AccountHoldersApiUpdateAccountHolderConfig struct { + ctx context.Context + id string accountHolder *AccountHolder } -func (r UpdateAccountHolderConfig) AccountHolder(accountHolder AccountHolder) UpdateAccountHolderConfig { +func (r AccountHoldersApiUpdateAccountHolderConfig) AccountHolder(accountHolder AccountHolder) AccountHoldersApiUpdateAccountHolderConfig { r.accountHolder = &accountHolder return r } + /* UpdateAccountHolder Update an account holder @@ -176,12 +343,12 @@ Updates an account holder. When updating an account holder resource, if a parame @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the account holder. - @return UpdateAccountHolderConfig + @return AccountHoldersApiUpdateAccountHolderConfig */ -func (a *AccountHoldersApi) UpdateAccountHolderConfig(ctx context.Context, id string) UpdateAccountHolderConfig { - return UpdateAccountHolderConfig{ +func (a *AccountHoldersApi) UpdateAccountHolderConfig(ctx context.Context, id string) AccountHoldersApiUpdateAccountHolderConfig { + return AccountHoldersApiUpdateAccountHolderConfig{ ctx: ctx, - id: id, + id: id, } } @@ -189,15 +356,70 @@ func (a *AccountHoldersApi) UpdateAccountHolderConfig(ctx context.Context, id st Update an account holder Updates an account holder. When updating an account holder resource, if a parameter is not provided in the request, it is left unchanged. * @param id The unique identifier of the account holder. - * @param req AccountHolder - reference of AccountHolder). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req AccountHolder - reference of AccountHolder). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AccountHolder */ -func (a *AccountHoldersApi) UpdateAccountHolder(r UpdateAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { - res := &AccountHolder{} +func (a *AccountHoldersApi) UpdateAccountHolder(r AccountHoldersApiUpdateAccountHolderConfig) (AccountHolder, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &AccountHolder{} path := "/accountHolders/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPPatchRequest(r.accountHolder, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.accountHolder, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index 1c2b4e48d..37ccfd168 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -10,36 +10,36 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // BalanceAccountsApi BalanceAccountsApi service type BalanceAccountsApi common.Service -type CreateBalanceAccountConfig struct { - ctx context.Context +type BalanceAccountsApiCreateBalanceAccountConfig struct { + ctx context.Context balanceAccountInfo *BalanceAccountInfo } -func (r CreateBalanceAccountConfig) BalanceAccountInfo(balanceAccountInfo BalanceAccountInfo) CreateBalanceAccountConfig { +func (r BalanceAccountsApiCreateBalanceAccountConfig) BalanceAccountInfo(balanceAccountInfo BalanceAccountInfo) BalanceAccountsApiCreateBalanceAccountConfig { r.balanceAccountInfo = &balanceAccountInfo return r } + /* CreateBalanceAccount Create a balance account Creates a balance account that holds the funds of the associated account holder. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreateBalanceAccountConfig + @return BalanceAccountsApiCreateBalanceAccountConfig */ -func (a *BalanceAccountsApi) CreateBalanceAccountConfig(ctx context.Context) CreateBalanceAccountConfig { - return CreateBalanceAccountConfig{ +func (a *BalanceAccountsApi) CreateBalanceAccountConfig(ctx context.Context) BalanceAccountsApiCreateBalanceAccountConfig { + return BalanceAccountsApiCreateBalanceAccountConfig{ ctx: ctx, } } @@ -47,29 +47,85 @@ func (a *BalanceAccountsApi) CreateBalanceAccountConfig(ctx context.Context) Cre /* Create a balance account Creates a balance account that holds the funds of the associated account holder. - * @param req BalanceAccountInfo - reference of BalanceAccountInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req BalanceAccountInfo - reference of BalanceAccountInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BalanceAccount */ -func (a *BalanceAccountsApi) CreateBalanceAccount(r CreateBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { - res := &BalanceAccount{} +func (a *BalanceAccountsApi) CreateBalanceAccount(r BalanceAccountsApiCreateBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &BalanceAccount{} path := "/balanceAccounts" - httpRes, err := a.Client.MakeHTTPPostRequest(r.balanceAccountInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err -} - -type CreateSweepConfig struct { - ctx context.Context - balanceAccountId string + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.balanceAccountInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiCreateSweepConfig struct { + ctx context.Context + balanceAccountId string sweepConfigurationV2 *SweepConfigurationV2 } -func (r CreateSweepConfig) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) CreateSweepConfig { +func (r BalanceAccountsApiCreateSweepConfig) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) BalanceAccountsApiCreateSweepConfig { r.sweepConfigurationV2 = &sweepConfigurationV2 return r } + /* CreateSweep Create a sweep @@ -79,11 +135,11 @@ A sweep pulls in or pushes out funds based on a defined schedule, amount, curren @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param balanceAccountId The unique identifier of the balance account. - @return CreateSweepConfig + @return BalanceAccountsApiCreateSweepConfig */ -func (a *BalanceAccountsApi) CreateSweepConfig(ctx context.Context, balanceAccountId string) CreateSweepConfig { - return CreateSweepConfig{ - ctx: ctx, +func (a *BalanceAccountsApi) CreateSweepConfig(ctx context.Context, balanceAccountId string) BalanceAccountsApiCreateSweepConfig { + return BalanceAccountsApiCreateSweepConfig{ + ctx: ctx, balanceAccountId: balanceAccountId, } } @@ -92,25 +148,81 @@ func (a *BalanceAccountsApi) CreateSweepConfig(ctx context.Context, balanceAccou Create a sweep Creates a sweep that results in moving funds from or to a balance account. A sweep pulls in or pushes out funds based on a defined schedule, amount, currency, and a source or a destination. * @param balanceAccountId The unique identifier of the balance account. - * @param req SweepConfigurationV2 - reference of SweepConfigurationV2). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req SweepConfigurationV2 - reference of SweepConfigurationV2). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SweepConfigurationV2 */ -func (a *BalanceAccountsApi) CreateSweep(r CreateSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { - res := &SweepConfigurationV2{} +func (a *BalanceAccountsApi) CreateSweep(r BalanceAccountsApiCreateSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - httpRes, err := a.Client.MakeHTTPPostRequest(r.sweepConfigurationV2, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err -} - -type DeleteSweepConfig struct { - ctx context.Context + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.sweepConfigurationV2, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiDeleteSweepConfig struct { + ctx context.Context balanceAccountId string - sweepId string + sweepId string } + /* DeleteSweep Delete a sweep @@ -119,13 +231,13 @@ Deletes a sweep for a balance account. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param balanceAccountId The unique identifier of the balance account. @param sweepId The unique identifier of the sweep. - @return DeleteSweepConfig + @return BalanceAccountsApiDeleteSweepConfig */ -func (a *BalanceAccountsApi) DeleteSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) DeleteSweepConfig { - return DeleteSweepConfig{ - ctx: ctx, +func (a *BalanceAccountsApi) DeleteSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) BalanceAccountsApiDeleteSweepConfig { + return BalanceAccountsApiDeleteSweepConfig{ + ctx: ctx, balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -134,52 +246,107 @@ Delete a sweep Deletes a sweep for a balance account. * @param balanceAccountId The unique identifier of the balance account. * @param sweepId The unique identifier of the sweep. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ -func (a *BalanceAccountsApi) DeleteSweep(r DeleteSweepConfig) (*_nethttp.Response, error) { - var res interface{} +func (a *BalanceAccountsApi) DeleteSweep(r BalanceAccountsApiDeleteSweepConfig) (*_nethttp.Response, error) { + var serviceError common.RestServiceError + var res interface{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - httpRes, err := a.Client.MakeHTTPDeleteRequest(res, a.BasePath()+path, r.ctx) - return httpRes, err -} - -type GetAllPaymentInstrumentsForBalanceAccountConfig struct { - ctx context.Context - id string + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err +} + + +type BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig struct { + ctx context.Context + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. -func (r GetAllPaymentInstrumentsForBalanceAccountConfig) Offset(offset int32) GetAllPaymentInstrumentsForBalanceAccountConfig { +func (r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig) Offset(offset int32) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig { r.offset = &offset return r } // The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r GetAllPaymentInstrumentsForBalanceAccountConfig) Limit(limit int32) GetAllPaymentInstrumentsForBalanceAccountConfig { +func (r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig) Limit(limit int32) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig { r.limit = &limit return r } + /* GetAllPaymentInstrumentsForBalanceAccount Get all payment instruments for a balance account -Returns a paginated list of the payment instruments associated with a balance account. +Returns a paginated list of the payment instruments associated with a balance account. To fetch multiple pages, use the query parameters.For example, to limit the page to 3 payment instruments and to skip the first 6, use `/balanceAccounts/{id}/paymentInstruments?limit=3&offset=6`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the balance account. - @return GetAllPaymentInstrumentsForBalanceAccountConfig + @return BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig */ -func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccountConfig(ctx context.Context, id string) GetAllPaymentInstrumentsForBalanceAccountConfig { - return GetAllPaymentInstrumentsForBalanceAccountConfig{ +func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccountConfig(ctx context.Context, id string) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig { + return BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig{ ctx: ctx, - id: id, + id: id, } } @@ -187,44 +354,99 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccountConfig(ctx Get all payment instruments for a balance account Returns a paginated list of the payment instruments associated with a balance account. To fetch multiple pages, use the query parameters.For example, to limit the page to 3 payment instruments and to skip the first 6, use `/balanceAccounts/{id}/paymentInstruments?limit=3&offset=6`. * @param id The unique identifier of the balance account. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaginatedPaymentInstrumentsResponse */ -func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(r GetAllPaymentInstrumentsForBalanceAccountConfig) (PaginatedPaymentInstrumentsResponse, *_nethttp.Response, error) { - res := &PaginatedPaymentInstrumentsResponse{} +func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountConfig) (PaginatedPaymentInstrumentsResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaginatedPaymentInstrumentsResponse{} path := "/balanceAccounts/{id}/paymentInstruments" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryString := url.Values{} - if r.offset != nil { - common.ParameterAddToQuery(queryString, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryString, "limit", r.limit, "") - } - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path+"?"+queryString.Encode(), r.ctx) - return *res, httpRes, err -} - -type GetAllSweepsForBalanceAccountConfig struct { - ctx context.Context + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiGetAllSweepsForBalanceAccountConfig struct { + ctx context.Context balanceAccountId string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The number of items that you want to skip. -func (r GetAllSweepsForBalanceAccountConfig) Offset(offset int32) GetAllSweepsForBalanceAccountConfig { +func (r BalanceAccountsApiGetAllSweepsForBalanceAccountConfig) Offset(offset int32) BalanceAccountsApiGetAllSweepsForBalanceAccountConfig { r.offset = &offset return r } // The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r GetAllSweepsForBalanceAccountConfig) Limit(limit int32) GetAllSweepsForBalanceAccountConfig { +func (r BalanceAccountsApiGetAllSweepsForBalanceAccountConfig) Limit(limit int32) BalanceAccountsApiGetAllSweepsForBalanceAccountConfig { r.limit = &limit return r } + /* GetAllSweepsForBalanceAccount Get all sweeps for a balance account @@ -234,11 +456,11 @@ To fetch multiple pages, use the query parameters. For example, to limit the pag @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param balanceAccountId The unique identifier of the balance account. - @return GetAllSweepsForBalanceAccountConfig + @return BalanceAccountsApiGetAllSweepsForBalanceAccountConfig */ -func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccountConfig(ctx context.Context, balanceAccountId string) GetAllSweepsForBalanceAccountConfig { - return GetAllSweepsForBalanceAccountConfig{ - ctx: ctx, +func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccountConfig(ctx context.Context, balanceAccountId string) BalanceAccountsApiGetAllSweepsForBalanceAccountConfig { + return BalanceAccountsApiGetAllSweepsForBalanceAccountConfig{ + ctx: ctx, balanceAccountId: balanceAccountId, } } @@ -247,30 +469,85 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccountConfig(ctx context.Con Get all sweeps for a balance account Returns a list of the sweeps configured for a balance account. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 sweeps and to skip the first 10, use `/balanceAccounts/{balanceAccountId}/sweeps?limit=5&offset=10`. * @param balanceAccountId The unique identifier of the balance account. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BalanceSweepConfigurationsResponse */ -func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(r GetAllSweepsForBalanceAccountConfig) (BalanceSweepConfigurationsResponse, *_nethttp.Response, error) { - res := &BalanceSweepConfigurationsResponse{} +func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(r BalanceAccountsApiGetAllSweepsForBalanceAccountConfig) (BalanceSweepConfigurationsResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &BalanceSweepConfigurationsResponse{} path := "/balanceAccounts/{balanceAccountId}/sweeps" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - queryString := url.Values{} - if r.offset != nil { - common.ParameterAddToQuery(queryString, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryString, "limit", r.limit, "") - } - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path+"?"+queryString.Encode(), r.ctx) - return *res, httpRes, err -} - -type GetBalanceAccountConfig struct { + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiGetBalanceAccountConfig struct { ctx context.Context - id string + id string } + /* GetBalanceAccount Get a balance account @@ -278,12 +555,12 @@ Returns a balance account and its balances for the default currency and other cu @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the balance account. - @return GetBalanceAccountConfig + @return BalanceAccountsApiGetBalanceAccountConfig */ -func (a *BalanceAccountsApi) GetBalanceAccountConfig(ctx context.Context, id string) GetBalanceAccountConfig { - return GetBalanceAccountConfig{ +func (a *BalanceAccountsApi) GetBalanceAccountConfig(ctx context.Context, id string) BalanceAccountsApiGetBalanceAccountConfig { + return BalanceAccountsApiGetBalanceAccountConfig{ ctx: ctx, - id: id, + id: id, } } @@ -291,24 +568,80 @@ func (a *BalanceAccountsApi) GetBalanceAccountConfig(ctx context.Context, id str Get a balance account Returns a balance account and its balances for the default currency and other currencies with a non-zero balance. * @param id The unique identifier of the balance account. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BalanceAccount */ -func (a *BalanceAccountsApi) GetBalanceAccount(r GetBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { - res := &BalanceAccount{} +func (a *BalanceAccountsApi) GetBalanceAccount(r BalanceAccountsApiGetBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &BalanceAccount{} path := "/balanceAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err -} - -type GetSweepConfig struct { - ctx context.Context + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiGetSweepConfig struct { + ctx context.Context balanceAccountId string - sweepId string + sweepId string } + /* GetSweep Get a sweep @@ -317,13 +650,13 @@ Returns a sweep. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param balanceAccountId The unique identifier of the balance account. @param sweepId The unique identifier of the sweep. - @return GetSweepConfig + @return BalanceAccountsApiGetSweepConfig */ -func (a *BalanceAccountsApi) GetSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) GetSweepConfig { - return GetSweepConfig{ - ctx: ctx, +func (a *BalanceAccountsApi) GetSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) BalanceAccountsApiGetSweepConfig { + return BalanceAccountsApiGetSweepConfig{ + ctx: ctx, balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -332,30 +665,86 @@ Get a sweep Returns a sweep. * @param balanceAccountId The unique identifier of the balance account. * @param sweepId The unique identifier of the sweep. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SweepConfigurationV2 */ -func (a *BalanceAccountsApi) GetSweep(r GetSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { - res := &SweepConfigurationV2{} +func (a *BalanceAccountsApi) GetSweep(r BalanceAccountsApiGetSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err -} - -type UpdateBalanceAccountConfig struct { - ctx context.Context - id string + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiUpdateBalanceAccountConfig struct { + ctx context.Context + id string balanceAccountUpdateRequest *BalanceAccountUpdateRequest } -func (r UpdateBalanceAccountConfig) BalanceAccountUpdateRequest(balanceAccountUpdateRequest BalanceAccountUpdateRequest) UpdateBalanceAccountConfig { +func (r BalanceAccountsApiUpdateBalanceAccountConfig) BalanceAccountUpdateRequest(balanceAccountUpdateRequest BalanceAccountUpdateRequest) BalanceAccountsApiUpdateBalanceAccountConfig { r.balanceAccountUpdateRequest = &balanceAccountUpdateRequest return r } + /* UpdateBalanceAccount Update a balance account @@ -363,12 +752,12 @@ Updates a balance account. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the balance account. - @return UpdateBalanceAccountConfig + @return BalanceAccountsApiUpdateBalanceAccountConfig */ -func (a *BalanceAccountsApi) UpdateBalanceAccountConfig(ctx context.Context, id string) UpdateBalanceAccountConfig { - return UpdateBalanceAccountConfig{ +func (a *BalanceAccountsApi) UpdateBalanceAccountConfig(ctx context.Context, id string) BalanceAccountsApiUpdateBalanceAccountConfig { + return BalanceAccountsApiUpdateBalanceAccountConfig{ ctx: ctx, - id: id, + id: id, } } @@ -376,31 +765,87 @@ func (a *BalanceAccountsApi) UpdateBalanceAccountConfig(ctx context.Context, id Update a balance account Updates a balance account. * @param id The unique identifier of the balance account. - * @param req BalanceAccountUpdateRequest - reference of BalanceAccountUpdateRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req BalanceAccountUpdateRequest - reference of BalanceAccountUpdateRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BalanceAccount */ -func (a *BalanceAccountsApi) UpdateBalanceAccount(r UpdateBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { - res := &BalanceAccount{} +func (a *BalanceAccountsApi) UpdateBalanceAccount(r BalanceAccountsApiUpdateBalanceAccountConfig) (BalanceAccount, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &BalanceAccount{} path := "/balanceAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPPatchRequest(r.balanceAccountUpdateRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err -} - -type UpdateSweepConfig struct { - ctx context.Context - balanceAccountId string - sweepId string + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.balanceAccountUpdateRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type BalanceAccountsApiUpdateSweepConfig struct { + ctx context.Context + balanceAccountId string + sweepId string sweepConfigurationV2 *SweepConfigurationV2 } -func (r UpdateSweepConfig) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) UpdateSweepConfig { +func (r BalanceAccountsApiUpdateSweepConfig) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) BalanceAccountsApiUpdateSweepConfig { r.sweepConfigurationV2 = &sweepConfigurationV2 return r } + /* UpdateSweep Update a sweep @@ -409,13 +854,13 @@ Updates a sweep. When updating a sweep resource, note that if a request paramete @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param balanceAccountId The unique identifier of the balance account. @param sweepId The unique identifier of the sweep. - @return UpdateSweepConfig + @return BalanceAccountsApiUpdateSweepConfig */ -func (a *BalanceAccountsApi) UpdateSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) UpdateSweepConfig { - return UpdateSweepConfig{ - ctx: ctx, +func (a *BalanceAccountsApi) UpdateSweepConfig(ctx context.Context, balanceAccountId string, sweepId string) BalanceAccountsApiUpdateSweepConfig { + return BalanceAccountsApiUpdateSweepConfig{ + ctx: ctx, balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -424,16 +869,71 @@ Update a sweep Updates a sweep. When updating a sweep resource, note that if a request parameter is not provided, the parameter is left unchanged. * @param balanceAccountId The unique identifier of the balance account. * @param sweepId The unique identifier of the sweep. - * @param req SweepConfigurationV2 - reference of SweepConfigurationV2). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req SweepConfigurationV2 - reference of SweepConfigurationV2). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SweepConfigurationV2 */ -func (a *BalanceAccountsApi) UpdateSweep(r UpdateSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { - res := &SweepConfigurationV2{} +func (a *BalanceAccountsApi) UpdateSweep(r BalanceAccountsApiUpdateSweepConfig) (SweepConfigurationV2, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - httpRes, err := a.Client.MakeHTTPPatchRequest(r.sweepConfigurationV2, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.sweepConfigurationV2, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_bank_account_validation.go b/src/balanceplatform/api_bank_account_validation.go index 6fec770d9..0d96ff8bc 100644 --- a/src/balanceplatform/api_bank_account_validation.go +++ b/src/balanceplatform/api_bank_account_validation.go @@ -10,34 +10,36 @@ package balanceplatform import ( "context" - _nethttp "net/http" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // BankAccountValidationApi BankAccountValidationApi service type BankAccountValidationApi common.Service -type ValidateBankAccountIdentificationConfig struct { - ctx context.Context +type BankAccountValidationApiValidateBankAccountIdentificationConfig struct { + ctx context.Context bankAccountIdentificationValidationRequest *BankAccountIdentificationValidationRequest } -func (r ValidateBankAccountIdentificationConfig) BankAccountIdentificationValidationRequest(bankAccountIdentificationValidationRequest BankAccountIdentificationValidationRequest) ValidateBankAccountIdentificationConfig { +func (r BankAccountValidationApiValidateBankAccountIdentificationConfig) BankAccountIdentificationValidationRequest(bankAccountIdentificationValidationRequest BankAccountIdentificationValidationRequest) BankAccountValidationApiValidateBankAccountIdentificationConfig { r.bankAccountIdentificationValidationRequest = &bankAccountIdentificationValidationRequest return r } + /* ValidateBankAccountIdentification Validate a bank account Validates bank account identification details. You can use this endpoint to validate bank account details before you [make a transfer](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) or [create a transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ValidateBankAccountIdentificationConfig + @return BankAccountValidationApiValidateBankAccountIdentificationConfig */ -func (a *BankAccountValidationApi) ValidateBankAccountIdentificationConfig(ctx context.Context) ValidateBankAccountIdentificationConfig { - return ValidateBankAccountIdentificationConfig{ +func (a *BankAccountValidationApi) ValidateBankAccountIdentificationConfig(ctx context.Context) BankAccountValidationApiValidateBankAccountIdentificationConfig { + return BankAccountValidationApiValidateBankAccountIdentificationConfig{ ctx: ctx, } } @@ -45,14 +47,61 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentificationConfig(ctx c /* Validate a bank account Validates bank account identification details. You can use this endpoint to validate bank account details before you [make a transfer](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) or [create a transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). - * @param req BankAccountIdentificationValidationRequest - reference of BankAccountIdentificationValidationRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req BankAccountIdentificationValidationRequest - reference of BankAccountIdentificationValidationRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]interface{} */ -func (a *BankAccountValidationApi) ValidateBankAccountIdentification(r ValidateBankAccountIdentificationConfig) (map[string]interface{}, *_nethttp.Response, error) { - res := &map[string]interface{}{} +func (a *BankAccountValidationApi) ValidateBankAccountIdentification(r BankAccountValidationApiValidateBankAccountIdentificationConfig) (map[string]interface{}, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &map[string]interface{}{} path := "/validateBankAccountIdentification" - httpRes, err := a.Client.MakeHTTPPostRequest(r.bankAccountIdentificationValidationRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.bankAccountIdentificationValidationRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_grant_accounts.go b/src/balanceplatform/api_grant_accounts.go index 298b63057..dcd8a1c06 100644 --- a/src/balanceplatform/api_grant_accounts.go +++ b/src/balanceplatform/api_grant_accounts.go @@ -10,21 +10,21 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GrantAccountsApi GrantAccountsApi service type GrantAccountsApi common.Service -type GetGrantAccountConfig struct { +type GrantAccountsApiGetGrantAccountConfig struct { ctx context.Context - id string + id string } + /* GetGrantAccount Get a grant account @@ -32,12 +32,12 @@ Returns the details of the [grant account](https://docs.adyen.com/marketplaces-a @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the grant account. - @return GetGrantAccountConfig + @return GrantAccountsApiGetGrantAccountConfig */ -func (a *GrantAccountsApi) GetGrantAccountConfig(ctx context.Context, id string) GetGrantAccountConfig { - return GetGrantAccountConfig{ +func (a *GrantAccountsApi) GetGrantAccountConfig(ctx context.Context, id string) GrantAccountsApiGetGrantAccountConfig { + return GrantAccountsApiGetGrantAccountConfig{ ctx: ctx, - id: id, + id: id, } } @@ -45,14 +45,69 @@ func (a *GrantAccountsApi) GetGrantAccountConfig(ctx context.Context, id string) Get a grant account Returns the details of the [grant account](https://docs.adyen.com/marketplaces-and-platforms/capital#grant-account). * @param id The unique identifier of the grant account. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CapitalGrantAccount */ -func (a *GrantAccountsApi) GetGrantAccount(r GetGrantAccountConfig) (CapitalGrantAccount, *_nethttp.Response, error) { - res := &CapitalGrantAccount{} +func (a *GrantAccountsApi) GetGrantAccount(r GrantAccountsApiGetGrantAccountConfig) (CapitalGrantAccount, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &CapitalGrantAccount{} path := "/grantAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_grant_offers.go b/src/balanceplatform/api_grant_offers.go index 131ec9aad..5a6c14c32 100644 --- a/src/balanceplatform/api_grant_offers.go +++ b/src/balanceplatform/api_grant_offers.go @@ -10,37 +10,37 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GrantOffersApi GrantOffersApi service type GrantOffersApi common.Service -type GetAllAvailableGrantOffersConfig struct { - ctx context.Context +type GrantOffersApiGetAllAvailableGrantOffersConfig struct { + ctx context.Context accountHolderId *string } // The unique identifier of the grant account. -func (r GetAllAvailableGrantOffersConfig) AccountHolderId(accountHolderId string) GetAllAvailableGrantOffersConfig { +func (r GrantOffersApiGetAllAvailableGrantOffersConfig) AccountHolderId(accountHolderId string) GrantOffersApiGetAllAvailableGrantOffersConfig { r.accountHolderId = &accountHolderId return r } + /* GetAllAvailableGrantOffers Get all available grant offers Returns a list of all [grant offers](https://docs.adyen.com/marketplaces-and-platforms/capital#grant-offers) available for `accountHolderId` specified as a query parameter. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GetAllAvailableGrantOffersConfig + @return GrantOffersApiGetAllAvailableGrantOffersConfig */ -func (a *GrantOffersApi) GetAllAvailableGrantOffersConfig(ctx context.Context) GetAllAvailableGrantOffersConfig { - return GetAllAvailableGrantOffersConfig{ +func (a *GrantOffersApi) GetAllAvailableGrantOffersConfig(ctx context.Context) GrantOffersApiGetAllAvailableGrantOffersConfig { + return GrantOffersApiGetAllAvailableGrantOffersConfig{ ctx: ctx, } } @@ -48,26 +48,81 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffersConfig(ctx context.Context) G /* Get all available grant offers Returns a list of all [grant offers](https://docs.adyen.com/marketplaces-and-platforms/capital#grant-offers) available for `accountHolderId` specified as a query parameter. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GrantOffers */ -func (a *GrantOffersApi) GetAllAvailableGrantOffers(r GetAllAvailableGrantOffersConfig) (GrantOffers, *_nethttp.Response, error) { - res := &GrantOffers{} +func (a *GrantOffersApi) GetAllAvailableGrantOffers(r GrantOffersApiGetAllAvailableGrantOffersConfig) (GrantOffers, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &GrantOffers{} path := "/grantOffers" - queryString := url.Values{} - if r.accountHolderId != nil { - common.ParameterAddToQuery(queryString, "accountHolderId", r.accountHolderId, "") - } - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path+"?"+queryString.Encode(), r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.accountHolderId != nil { + common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetGrantOfferConfig struct { - ctx context.Context + +type GrantOffersApiGetGrantOfferConfig struct { + ctx context.Context grantOfferId string } + /* GetGrantOffer Get a grant offer @@ -75,11 +130,11 @@ Returns the details of a single grant offer. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param grantOfferId The unique identifier of the grant offer. - @return GetGrantOfferConfig + @return GrantOffersApiGetGrantOfferConfig */ -func (a *GrantOffersApi) GetGrantOfferConfig(ctx context.Context, grantOfferId string) GetGrantOfferConfig { - return GetGrantOfferConfig{ - ctx: ctx, +func (a *GrantOffersApi) GetGrantOfferConfig(ctx context.Context, grantOfferId string) GrantOffersApiGetGrantOfferConfig { + return GrantOffersApiGetGrantOfferConfig{ + ctx: ctx, grantOfferId: grantOfferId, } } @@ -88,14 +143,69 @@ func (a *GrantOffersApi) GetGrantOfferConfig(ctx context.Context, grantOfferId s Get a grant offer Returns the details of a single grant offer. * @param grantOfferId The unique identifier of the grant offer. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GrantOffer */ -func (a *GrantOffersApi) GetGrantOffer(r GetGrantOfferConfig) (GrantOffer, *_nethttp.Response, error) { - res := &GrantOffer{} +func (a *GrantOffersApi) GetGrantOffer(r GrantOffersApiGetGrantOfferConfig) (GrantOffer, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &GrantOffer{} path := "/grantOffers/{grantOfferId}" - path = strings.Replace(path, "{"+"grantOfferId"+"}", url.PathEscape(common.ParameterValueToString(r.grantOfferId, "grantOfferId")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"grantOfferId"+"}", url.PathEscape(common.ParameterValueToString(r.grantOfferId, "grantOfferId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_payment_instrument_groups.go b/src/balanceplatform/api_payment_instrument_groups.go index 0aab18721..daee2ef21 100644 --- a/src/balanceplatform/api_payment_instrument_groups.go +++ b/src/balanceplatform/api_payment_instrument_groups.go @@ -10,36 +10,36 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PaymentInstrumentGroupsApi PaymentInstrumentGroupsApi service type PaymentInstrumentGroupsApi common.Service -type CreatePaymentInstrumentGroupConfig struct { - ctx context.Context +type PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig struct { + ctx context.Context paymentInstrumentGroupInfo *PaymentInstrumentGroupInfo } -func (r CreatePaymentInstrumentGroupConfig) PaymentInstrumentGroupInfo(paymentInstrumentGroupInfo PaymentInstrumentGroupInfo) CreatePaymentInstrumentGroupConfig { +func (r PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig) PaymentInstrumentGroupInfo(paymentInstrumentGroupInfo PaymentInstrumentGroupInfo) PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig { r.paymentInstrumentGroupInfo = &paymentInstrumentGroupInfo return r } + /* CreatePaymentInstrumentGroup Create a payment instrument group Creates a payment instrument group to associate and group payment instrument resources together. You can apply a transaction rule to a payment instrument group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreatePaymentInstrumentGroupConfig + @return PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig */ -func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroupConfig(ctx context.Context) CreatePaymentInstrumentGroupConfig { - return CreatePaymentInstrumentGroupConfig{ +func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroupConfig(ctx context.Context) PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig { + return PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig{ ctx: ctx, } } @@ -47,23 +47,79 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroupConfig(ctx cont /* Create a payment instrument group Creates a payment instrument group to associate and group payment instrument resources together. You can apply a transaction rule to a payment instrument group. - * @param req PaymentInstrumentGroupInfo - reference of PaymentInstrumentGroupInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req PaymentInstrumentGroupInfo - reference of PaymentInstrumentGroupInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentInstrumentGroup */ -func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(r CreatePaymentInstrumentGroupConfig) (PaymentInstrumentGroup, *_nethttp.Response, error) { - res := &PaymentInstrumentGroup{} +func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(r PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupConfig) (PaymentInstrumentGroup, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaymentInstrumentGroup{} path := "/paymentInstrumentGroups" - httpRes, err := a.Client.MakeHTTPPostRequest(r.paymentInstrumentGroupInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentInstrumentGroupInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetAllTransactionRulesForPaymentInstrumentGroupConfig struct { + +type PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupConfig struct { ctx context.Context - id string + id string } + /* GetAllTransactionRulesForPaymentInstrumentGroup Get all transaction rules for a payment instrument group @@ -71,12 +127,12 @@ Returns a list of all the transaction rules associated with a payment instrument @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument group. - @return GetAllTransactionRulesForPaymentInstrumentGroupConfig + @return PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupConfig */ -func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentGroupConfig(ctx context.Context, id string) GetAllTransactionRulesForPaymentInstrumentGroupConfig { - return GetAllTransactionRulesForPaymentInstrumentGroupConfig{ +func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentGroupConfig(ctx context.Context, id string) PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupConfig { + return PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupConfig{ ctx: ctx, - id: id, + id: id, } } @@ -84,23 +140,79 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG Get all transaction rules for a payment instrument group Returns a list of all the transaction rules associated with a payment instrument group. * @param id The unique identifier of the payment instrument group. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRulesResponse */ -func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentGroup(r GetAllTransactionRulesForPaymentInstrumentGroupConfig) (TransactionRulesResponse, *_nethttp.Response, error) { - res := &TransactionRulesResponse{} +func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentGroup(r PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupConfig) (TransactionRulesResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRulesResponse{} path := "/paymentInstrumentGroups/{id}/transactionRules" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetPaymentInstrumentGroupConfig struct { + +type PaymentInstrumentGroupsApiGetPaymentInstrumentGroupConfig struct { ctx context.Context - id string + id string } + /* GetPaymentInstrumentGroup Get a payment instrument group @@ -108,12 +220,12 @@ Returns the details of a payment instrument group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument group. - @return GetPaymentInstrumentGroupConfig + @return PaymentInstrumentGroupsApiGetPaymentInstrumentGroupConfig */ -func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroupConfig(ctx context.Context, id string) GetPaymentInstrumentGroupConfig { - return GetPaymentInstrumentGroupConfig{ +func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroupConfig(ctx context.Context, id string) PaymentInstrumentGroupsApiGetPaymentInstrumentGroupConfig { + return PaymentInstrumentGroupsApiGetPaymentInstrumentGroupConfig{ ctx: ctx, - id: id, + id: id, } } @@ -121,14 +233,69 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroupConfig(ctx context Get a payment instrument group Returns the details of a payment instrument group. * @param id The unique identifier of the payment instrument group. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentInstrumentGroup */ -func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(r GetPaymentInstrumentGroupConfig) (PaymentInstrumentGroup, *_nethttp.Response, error) { - res := &PaymentInstrumentGroup{} +func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(r PaymentInstrumentGroupsApiGetPaymentInstrumentGroupConfig) (PaymentInstrumentGroup, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaymentInstrumentGroup{} path := "/paymentInstrumentGroups/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_payment_instruments.go b/src/balanceplatform/api_payment_instruments.go index 42b4235b2..f5d3a4037 100644 --- a/src/balanceplatform/api_payment_instruments.go +++ b/src/balanceplatform/api_payment_instruments.go @@ -10,26 +10,26 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PaymentInstrumentsApi PaymentInstrumentsApi service type PaymentInstrumentsApi common.Service -type CreatePaymentInstrumentConfig struct { - ctx context.Context +type PaymentInstrumentsApiCreatePaymentInstrumentConfig struct { + ctx context.Context paymentInstrumentInfo *PaymentInstrumentInfo } -func (r CreatePaymentInstrumentConfig) PaymentInstrumentInfo(paymentInstrumentInfo PaymentInstrumentInfo) CreatePaymentInstrumentConfig { +func (r PaymentInstrumentsApiCreatePaymentInstrumentConfig) PaymentInstrumentInfo(paymentInstrumentInfo PaymentInstrumentInfo) PaymentInstrumentsApiCreatePaymentInstrumentConfig { r.paymentInstrumentInfo = &paymentInstrumentInfo return r } + /* CreatePaymentInstrument Create a payment instrument @@ -38,10 +38,10 @@ Creates a payment instrument to issue a physical card, a virtual card, or a busi For more information, refer to [Issue cards](https://docs.adyen.com/issuing/create-cards) or [Issue business accounts](https://docs.adyen.com/marketplaces-and-platforms/business-accounts). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreatePaymentInstrumentConfig + @return PaymentInstrumentsApiCreatePaymentInstrumentConfig */ -func (a *PaymentInstrumentsApi) CreatePaymentInstrumentConfig(ctx context.Context) CreatePaymentInstrumentConfig { - return CreatePaymentInstrumentConfig{ +func (a *PaymentInstrumentsApi) CreatePaymentInstrumentConfig(ctx context.Context) PaymentInstrumentsApiCreatePaymentInstrumentConfig { + return PaymentInstrumentsApiCreatePaymentInstrumentConfig{ ctx: ctx, } } @@ -49,23 +49,79 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrumentConfig(ctx context.Contex /* Create a payment instrument Creates a payment instrument to issue a physical card, a virtual card, or a business account to your user. For more information, refer to [Issue cards](https://docs.adyen.com/issuing/create-cards) or [Issue business accounts](https://docs.adyen.com/marketplaces-and-platforms/business-accounts). - * @param req PaymentInstrumentInfo - reference of PaymentInstrumentInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req PaymentInstrumentInfo - reference of PaymentInstrumentInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentInstrument */ -func (a *PaymentInstrumentsApi) CreatePaymentInstrument(r CreatePaymentInstrumentConfig) (PaymentInstrument, *_nethttp.Response, error) { - res := &PaymentInstrument{} +func (a *PaymentInstrumentsApi) CreatePaymentInstrument(r PaymentInstrumentsApiCreatePaymentInstrumentConfig) (PaymentInstrument, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaymentInstrument{} path := "/paymentInstruments" - httpRes, err := a.Client.MakeHTTPPostRequest(r.paymentInstrumentInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentInstrumentInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetAllTransactionRulesForPaymentInstrumentConfig struct { + +type PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentConfig struct { ctx context.Context - id string + id string } + /* GetAllTransactionRulesForPaymentInstrument Get all transaction rules for a payment instrument @@ -73,12 +129,12 @@ Returns a list of transaction rules associated with a payment instrument. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument. - @return GetAllTransactionRulesForPaymentInstrumentConfig + @return PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentConfig */ -func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrumentConfig(ctx context.Context, id string) GetAllTransactionRulesForPaymentInstrumentConfig { - return GetAllTransactionRulesForPaymentInstrumentConfig{ +func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrumentConfig(ctx context.Context, id string) PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentConfig { + return PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -86,23 +142,79 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrumentConfig Get all transaction rules for a payment instrument Returns a list of transaction rules associated with a payment instrument. * @param id The unique identifier of the payment instrument. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRulesResponse */ -func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(r GetAllTransactionRulesForPaymentInstrumentConfig) (TransactionRulesResponse, *_nethttp.Response, error) { - res := &TransactionRulesResponse{} +func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(r PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentConfig) (TransactionRulesResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRulesResponse{} path := "/paymentInstruments/{id}/transactionRules" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetPanOfPaymentInstrumentConfig struct { + +type PaymentInstrumentsApiGetPanOfPaymentInstrumentConfig struct { ctx context.Context - id string + id string } + /* GetPanOfPaymentInstrument Get the PAN of a payment instrument @@ -114,12 +226,12 @@ To make this request, your API credential must have the following [role](https:/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument. - @return GetPanOfPaymentInstrumentConfig + @return PaymentInstrumentsApiGetPanOfPaymentInstrumentConfig */ -func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrumentConfig(ctx context.Context, id string) GetPanOfPaymentInstrumentConfig { - return GetPanOfPaymentInstrumentConfig{ +func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrumentConfig(ctx context.Context, id string) PaymentInstrumentsApiGetPanOfPaymentInstrumentConfig { + return PaymentInstrumentsApiGetPanOfPaymentInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -127,23 +239,79 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrumentConfig(ctx context.Cont Get the PAN of a payment instrument Returns the primary account number (PAN) of a payment instrument. To make this request, your API credential must have the following [role](https://docs.adyen.com/issuing/manage-access/api-credentials-web-service#api-permissions): * Balance Platform BCL PCI role * @param id The unique identifier of the payment instrument. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentInstrumentRevealInfo */ -func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(r GetPanOfPaymentInstrumentConfig) (PaymentInstrumentRevealInfo, *_nethttp.Response, error) { - res := &PaymentInstrumentRevealInfo{} +func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(r PaymentInstrumentsApiGetPanOfPaymentInstrumentConfig) (PaymentInstrumentRevealInfo, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaymentInstrumentRevealInfo{} path := "/paymentInstruments/{id}/reveal" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetPaymentInstrumentConfig struct { + +type PaymentInstrumentsApiGetPaymentInstrumentConfig struct { ctx context.Context - id string + id string } + /* GetPaymentInstrument Get a payment instrument @@ -151,12 +319,12 @@ Returns the details of a payment instrument. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument. - @return GetPaymentInstrumentConfig + @return PaymentInstrumentsApiGetPaymentInstrumentConfig */ -func (a *PaymentInstrumentsApi) GetPaymentInstrumentConfig(ctx context.Context, id string) GetPaymentInstrumentConfig { - return GetPaymentInstrumentConfig{ +func (a *PaymentInstrumentsApi) GetPaymentInstrumentConfig(ctx context.Context, id string) PaymentInstrumentsApiGetPaymentInstrumentConfig { + return PaymentInstrumentsApiGetPaymentInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -164,29 +332,85 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrumentConfig(ctx context.Context, Get a payment instrument Returns the details of a payment instrument. * @param id The unique identifier of the payment instrument. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentInstrument */ -func (a *PaymentInstrumentsApi) GetPaymentInstrument(r GetPaymentInstrumentConfig) (PaymentInstrument, *_nethttp.Response, error) { - res := &PaymentInstrument{} +func (a *PaymentInstrumentsApi) GetPaymentInstrument(r PaymentInstrumentsApiGetPaymentInstrumentConfig) (PaymentInstrument, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaymentInstrument{} path := "/paymentInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type UpdatePaymentInstrumentConfig struct { - ctx context.Context - id string + +type PaymentInstrumentsApiUpdatePaymentInstrumentConfig struct { + ctx context.Context + id string paymentInstrumentUpdateRequest *PaymentInstrumentUpdateRequest } -func (r UpdatePaymentInstrumentConfig) PaymentInstrumentUpdateRequest(paymentInstrumentUpdateRequest PaymentInstrumentUpdateRequest) UpdatePaymentInstrumentConfig { +func (r PaymentInstrumentsApiUpdatePaymentInstrumentConfig) PaymentInstrumentUpdateRequest(paymentInstrumentUpdateRequest PaymentInstrumentUpdateRequest) PaymentInstrumentsApiUpdatePaymentInstrumentConfig { r.paymentInstrumentUpdateRequest = &paymentInstrumentUpdateRequest return r } + /* UpdatePaymentInstrument Update a payment instrument @@ -194,12 +418,12 @@ Updates a payment instrument. Once a payment instrument is already active, you c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the payment instrument. - @return UpdatePaymentInstrumentConfig + @return PaymentInstrumentsApiUpdatePaymentInstrumentConfig */ -func (a *PaymentInstrumentsApi) UpdatePaymentInstrumentConfig(ctx context.Context, id string) UpdatePaymentInstrumentConfig { - return UpdatePaymentInstrumentConfig{ +func (a *PaymentInstrumentsApi) UpdatePaymentInstrumentConfig(ctx context.Context, id string) PaymentInstrumentsApiUpdatePaymentInstrumentConfig { + return PaymentInstrumentsApiUpdatePaymentInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -207,15 +431,70 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrumentConfig(ctx context.Contex Update a payment instrument Updates a payment instrument. Once a payment instrument is already active, you can only update its status. However, for cards created with **inactive** status, you can still update the balance account associated with the card. * @param id The unique identifier of the payment instrument. - * @param req PaymentInstrumentUpdateRequest - reference of PaymentInstrumentUpdateRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req PaymentInstrumentUpdateRequest - reference of PaymentInstrumentUpdateRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return UpdatePaymentInstrument */ -func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(r UpdatePaymentInstrumentConfig) (UpdatePaymentInstrument, *_nethttp.Response, error) { - res := &UpdatePaymentInstrument{} +func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(r PaymentInstrumentsApiUpdatePaymentInstrumentConfig) (UpdatePaymentInstrument, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &UpdatePaymentInstrument{} path := "/paymentInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPPatchRequest(r.paymentInstrumentUpdateRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentInstrumentUpdateRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_platform.go b/src/balanceplatform/api_platform.go index a13609068..53a0f8267 100644 --- a/src/balanceplatform/api_platform.go +++ b/src/balanceplatform/api_platform.go @@ -10,50 +10,50 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PlatformApi PlatformApi service type PlatformApi common.Service -type GetAllAccountHoldersUnderBalancePlatformConfig struct { - ctx context.Context - id string +type PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig struct { + ctx context.Context + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. -func (r GetAllAccountHoldersUnderBalancePlatformConfig) Offset(offset int32) GetAllAccountHoldersUnderBalancePlatformConfig { +func (r PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig) Offset(offset int32) PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig { r.offset = &offset return r } // The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r GetAllAccountHoldersUnderBalancePlatformConfig) Limit(limit int32) GetAllAccountHoldersUnderBalancePlatformConfig { +func (r PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig) Limit(limit int32) PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig { r.limit = &limit return r } + /* GetAllAccountHoldersUnderBalancePlatform Get all account holders under a balance platform -Returns a paginated list of all the account holders that belong to the balance platform. To fetch multiple pages, use the query parameters. +Returns a paginated list of all the account holders that belong to the balance platform. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 account holders and to skip the first 20, use `/balancePlatforms/{id}/accountHolders?limit=5&offset=20`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the balance platform. - @return GetAllAccountHoldersUnderBalancePlatformConfig + @return PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig */ -func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatformConfig(ctx context.Context, id string) GetAllAccountHoldersUnderBalancePlatformConfig { - return GetAllAccountHoldersUnderBalancePlatformConfig{ +func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatformConfig(ctx context.Context, id string) PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig { + return PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig{ ctx: ctx, - id: id, + id: id, } } @@ -61,30 +61,85 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatformConfig(ctx context Get all account holders under a balance platform Returns a paginated list of all the account holders that belong to the balance platform. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 account holders and to skip the first 20, use `/balancePlatforms/{id}/accountHolders?limit=5&offset=20`. * @param id The unique identifier of the balance platform. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaginatedAccountHoldersResponse */ -func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(r GetAllAccountHoldersUnderBalancePlatformConfig) (PaginatedAccountHoldersResponse, *_nethttp.Response, error) { - res := &PaginatedAccountHoldersResponse{} +func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(r PlatformApiGetAllAccountHoldersUnderBalancePlatformConfig) (PaginatedAccountHoldersResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &PaginatedAccountHoldersResponse{} path := "/balancePlatforms/{id}/accountHolders" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryString := url.Values{} - if r.offset != nil { - common.ParameterAddToQuery(queryString, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryString, "limit", r.limit, "") - } - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path+"?"+queryString.Encode(), r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetBalancePlatformConfig struct { + +type PlatformApiGetBalancePlatformConfig struct { ctx context.Context - id string + id string } + /* GetBalancePlatform Get a balance platform @@ -92,12 +147,12 @@ Returns a balance platform. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the balance platform. - @return GetBalancePlatformConfig + @return PlatformApiGetBalancePlatformConfig */ -func (a *PlatformApi) GetBalancePlatformConfig(ctx context.Context, id string) GetBalancePlatformConfig { - return GetBalancePlatformConfig{ +func (a *PlatformApi) GetBalancePlatformConfig(ctx context.Context, id string) PlatformApiGetBalancePlatformConfig { + return PlatformApiGetBalancePlatformConfig{ ctx: ctx, - id: id, + id: id, } } @@ -105,14 +160,69 @@ func (a *PlatformApi) GetBalancePlatformConfig(ctx context.Context, id string) G Get a balance platform Returns a balance platform. * @param id The unique identifier of the balance platform. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BalancePlatform */ -func (a *PlatformApi) GetBalancePlatform(r GetBalancePlatformConfig) (BalancePlatform, *_nethttp.Response, error) { - res := &BalancePlatform{} +func (a *PlatformApi) GetBalancePlatform(r PlatformApiGetBalancePlatformConfig) (BalancePlatform, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &BalancePlatform{} path := "/balancePlatforms/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_transaction_rules.go b/src/balanceplatform/api_transaction_rules.go index 806c688da..5ae0b37f7 100644 --- a/src/balanceplatform/api_transaction_rules.go +++ b/src/balanceplatform/api_transaction_rules.go @@ -10,36 +10,36 @@ package balanceplatform import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TransactionRulesApi TransactionRulesApi service type TransactionRulesApi common.Service -type CreateTransactionRuleConfig struct { - ctx context.Context +type TransactionRulesApiCreateTransactionRuleConfig struct { + ctx context.Context transactionRuleInfo *TransactionRuleInfo } -func (r CreateTransactionRuleConfig) TransactionRuleInfo(transactionRuleInfo TransactionRuleInfo) CreateTransactionRuleConfig { +func (r TransactionRulesApiCreateTransactionRuleConfig) TransactionRuleInfo(transactionRuleInfo TransactionRuleInfo) TransactionRulesApiCreateTransactionRuleConfig { r.transactionRuleInfo = &transactionRuleInfo return r } + /* CreateTransactionRule Create a transaction rule Creates a [transaction rule](https://docs.adyen.com/issuing/transaction-rules). When your user makes a transaction with their Adyen-issued card, the transaction is allowed or declined based on the conditions and outcome defined in the transaction rule. You can apply the transaction rule to several cards, such as all the cards in your platform, or to a specific card. For use cases, see [examples](https://docs.adyen.com/issuing/transaction-rules/examples). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreateTransactionRuleConfig + @return TransactionRulesApiCreateTransactionRuleConfig */ -func (a *TransactionRulesApi) CreateTransactionRuleConfig(ctx context.Context) CreateTransactionRuleConfig { - return CreateTransactionRuleConfig{ +func (a *TransactionRulesApi) CreateTransactionRuleConfig(ctx context.Context) TransactionRulesApiCreateTransactionRuleConfig { + return TransactionRulesApiCreateTransactionRuleConfig{ ctx: ctx, } } @@ -47,23 +47,79 @@ func (a *TransactionRulesApi) CreateTransactionRuleConfig(ctx context.Context) C /* Create a transaction rule Creates a [transaction rule](https://docs.adyen.com/issuing/transaction-rules). When your user makes a transaction with their Adyen-issued card, the transaction is allowed or declined based on the conditions and outcome defined in the transaction rule. You can apply the transaction rule to several cards, such as all the cards in your platform, or to a specific card. For use cases, see [examples](https://docs.adyen.com/issuing/transaction-rules/examples). - * @param req TransactionRuleInfo - reference of TransactionRuleInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req TransactionRuleInfo - reference of TransactionRuleInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRule */ -func (a *TransactionRulesApi) CreateTransactionRule(r CreateTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { - res := &TransactionRule{} +func (a *TransactionRulesApi) CreateTransactionRule(r TransactionRulesApiCreateTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRule{} path := "/transactionRules" - httpRes, err := a.Client.MakeHTTPPostRequest(r.transactionRuleInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.transactionRuleInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type DeleteTransactionRuleConfig struct { - ctx context.Context + +type TransactionRulesApiDeleteTransactionRuleConfig struct { + ctx context.Context transactionRuleId string } + /* DeleteTransactionRule Delete a transaction rule @@ -71,11 +127,11 @@ Deletes a transaction rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param transactionRuleId The unique identifier of the transaction rule. - @return DeleteTransactionRuleConfig + @return TransactionRulesApiDeleteTransactionRuleConfig */ -func (a *TransactionRulesApi) DeleteTransactionRuleConfig(ctx context.Context, transactionRuleId string) DeleteTransactionRuleConfig { - return DeleteTransactionRuleConfig{ - ctx: ctx, +func (a *TransactionRulesApi) DeleteTransactionRuleConfig(ctx context.Context, transactionRuleId string) TransactionRulesApiDeleteTransactionRuleConfig { + return TransactionRulesApiDeleteTransactionRuleConfig{ + ctx: ctx, transactionRuleId: transactionRuleId, } } @@ -84,23 +140,79 @@ func (a *TransactionRulesApi) DeleteTransactionRuleConfig(ctx context.Context, t Delete a transaction rule Deletes a transaction rule. * @param transactionRuleId The unique identifier of the transaction rule. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRule */ -func (a *TransactionRulesApi) DeleteTransactionRule(r DeleteTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { - res := &TransactionRule{} +func (a *TransactionRulesApi) DeleteTransactionRule(r TransactionRulesApiDeleteTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRule{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - httpRes, err := a.Client.MakeHTTPDeleteRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type GetTransactionRuleConfig struct { - ctx context.Context + +type TransactionRulesApiGetTransactionRuleConfig struct { + ctx context.Context transactionRuleId string } + /* GetTransactionRule Get a transaction rule @@ -108,11 +220,11 @@ Returns the details of a transaction rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param transactionRuleId The unique identifier of the transaction rule. - @return GetTransactionRuleConfig + @return TransactionRulesApiGetTransactionRuleConfig */ -func (a *TransactionRulesApi) GetTransactionRuleConfig(ctx context.Context, transactionRuleId string) GetTransactionRuleConfig { - return GetTransactionRuleConfig{ - ctx: ctx, +func (a *TransactionRulesApi) GetTransactionRuleConfig(ctx context.Context, transactionRuleId string) TransactionRulesApiGetTransactionRuleConfig { + return TransactionRulesApiGetTransactionRuleConfig{ + ctx: ctx, transactionRuleId: transactionRuleId, } } @@ -121,33 +233,89 @@ func (a *TransactionRulesApi) GetTransactionRuleConfig(ctx context.Context, tran Get a transaction rule Returns the details of a transaction rule. * @param transactionRuleId The unique identifier of the transaction rule. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRuleResponse */ -func (a *TransactionRulesApi) GetTransactionRule(r GetTransactionRuleConfig) (TransactionRuleResponse, *_nethttp.Response, error) { - res := &TransactionRuleResponse{} +func (a *TransactionRulesApi) GetTransactionRule(r TransactionRulesApiGetTransactionRuleConfig) (TransactionRuleResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRuleResponse{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - httpRes, err := a.Client.MakeHTTPGetRequest(res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type UpdateTransactionRuleConfig struct { - ctx context.Context - transactionRuleId string + +type TransactionRulesApiUpdateTransactionRuleConfig struct { + ctx context.Context + transactionRuleId string transactionRuleInfo *TransactionRuleInfo } -func (r UpdateTransactionRuleConfig) TransactionRuleInfo(transactionRuleInfo TransactionRuleInfo) UpdateTransactionRuleConfig { +func (r TransactionRulesApiUpdateTransactionRuleConfig) TransactionRuleInfo(transactionRuleInfo TransactionRuleInfo) TransactionRulesApiUpdateTransactionRuleConfig { r.transactionRuleInfo = &transactionRuleInfo return r } + /* UpdateTransactionRule Update a transaction rule -Updates a transaction rule. +Updates a transaction rule. * To update only the status of a transaction rule, send only the `status` parameter. All other parameters not provided in the request are left unchanged. @@ -155,11 +323,11 @@ Updates a transaction rule. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param transactionRuleId The unique identifier of the transaction rule. - @return UpdateTransactionRuleConfig + @return TransactionRulesApiUpdateTransactionRuleConfig */ -func (a *TransactionRulesApi) UpdateTransactionRuleConfig(ctx context.Context, transactionRuleId string) UpdateTransactionRuleConfig { - return UpdateTransactionRuleConfig{ - ctx: ctx, +func (a *TransactionRulesApi) UpdateTransactionRuleConfig(ctx context.Context, transactionRuleId string) TransactionRulesApiUpdateTransactionRuleConfig { + return TransactionRulesApiUpdateTransactionRuleConfig{ + ctx: ctx, transactionRuleId: transactionRuleId, } } @@ -168,15 +336,70 @@ func (a *TransactionRulesApi) UpdateTransactionRuleConfig(ctx context.Context, t Update a transaction rule Updates a transaction rule. * To update only the status of a transaction rule, send only the `status` parameter. All other parameters not provided in the request are left unchanged. * When updating any other parameter, you need to send all existing resource parameters. If you omit a parameter in the request, that parameter is removed from the resource. * @param transactionRuleId The unique identifier of the transaction rule. - * @param req TransactionRuleInfo - reference of TransactionRuleInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req TransactionRuleInfo - reference of TransactionRuleInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransactionRule */ -func (a *TransactionRulesApi) UpdateTransactionRule(r UpdateTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { - res := &TransactionRule{} +func (a *TransactionRulesApi) UpdateTransactionRule(r TransactionRulesApiUpdateTransactionRuleConfig) (TransactionRule, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionRule{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - httpRes, err := a.Client.MakeHTTPPatchRequest(r.transactionRuleInfo, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.transactionRuleInfo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/balanceplatform/client.go b/src/balanceplatform/client.go index ca3b8d0b4..2ef7664e9 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -38,8 +38,7 @@ type APIClient struct { TransactionRulesApi *TransactionRulesApi } -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. +// NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} c.common.Client = client diff --git a/src/balanceplatform/docs/AccountHolder.md b/src/balanceplatform/docs/AccountHolder.md index 52a1b5159..b4941d424 100644 --- a/src/balanceplatform/docs/AccountHolder.md +++ b/src/balanceplatform/docs/AccountHolder.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **Description** | Pointer to **string** | Your description for the account holder, maximum 300 characters. | [optional] **Id** | **string** | The unique identifier of the account holder. | [readonly] **LegalEntityId** | **string** | The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. | +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **PrimaryBalanceAccount** | Pointer to **string** | The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. | [optional] **Reference** | Pointer to **string** | Your reference for the account holder, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. | [optional] @@ -175,6 +176,31 @@ and a boolean to check if the value has been set. SetLegalEntityId sets LegalEntityId field to given value. +### GetMetadata + +`func (o *AccountHolder) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *AccountHolder) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *AccountHolder) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *AccountHolder) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetPrimaryBalanceAccount `func (o *AccountHolder) GetPrimaryBalanceAccount() string` diff --git a/src/balanceplatform/docs/AccountHolderCapability.md b/src/balanceplatform/docs/AccountHolderCapability.md index 15ab21db3..cedf71725 100644 --- a/src/balanceplatform/docs/AccountHolderCapability.md +++ b/src/balanceplatform/docs/AccountHolderCapability.md @@ -6,12 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Allowed** | Pointer to **bool** | Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. | [optional] [readonly] **AllowedLevel** | Pointer to **string** | The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. | [optional] [readonly] -**AllowedSettings** | Pointer to [**JSONObject**](JSONObject.md) | | [optional] +**AllowedSettings** | Pointer to [**CapabilitySettings**](CapabilitySettings.md) | | [optional] **Enabled** | Pointer to **bool** | Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. | [optional] **Problems** | Pointer to **[]map[string]interface{}** | Contains verification errors and the actions that you can take to resolve them. | [optional] [readonly] **Requested** | Pointer to **bool** | Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. | [optional] **RequestedLevel** | Pointer to **string** | The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. | [optional] -**RequestedSettings** | Pointer to [**JSONObject**](JSONObject.md) | | [optional] +**RequestedSettings** | Pointer to [**CapabilitySettings**](CapabilitySettings.md) | | [optional] **TransferInstruments** | Pointer to [**[]AccountSupportingEntityCapability**](AccountSupportingEntityCapability.md) | Contains the status of the transfer instruments associated with this capability. | [optional] **VerificationStatus** | Pointer to **string** | The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. | [optional] [readonly] @@ -86,20 +86,20 @@ HasAllowedLevel returns a boolean if a field has been set. ### GetAllowedSettings -`func (o *AccountHolderCapability) GetAllowedSettings() JSONObject` +`func (o *AccountHolderCapability) GetAllowedSettings() CapabilitySettings` GetAllowedSettings returns the AllowedSettings field if non-nil, zero value otherwise. ### GetAllowedSettingsOk -`func (o *AccountHolderCapability) GetAllowedSettingsOk() (*JSONObject, bool)` +`func (o *AccountHolderCapability) GetAllowedSettingsOk() (*CapabilitySettings, bool)` GetAllowedSettingsOk returns a tuple with the AllowedSettings field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAllowedSettings -`func (o *AccountHolderCapability) SetAllowedSettings(v JSONObject)` +`func (o *AccountHolderCapability) SetAllowedSettings(v CapabilitySettings)` SetAllowedSettings sets AllowedSettings field to given value. @@ -211,20 +211,20 @@ HasRequestedLevel returns a boolean if a field has been set. ### GetRequestedSettings -`func (o *AccountHolderCapability) GetRequestedSettings() JSONObject` +`func (o *AccountHolderCapability) GetRequestedSettings() CapabilitySettings` GetRequestedSettings returns the RequestedSettings field if non-nil, zero value otherwise. ### GetRequestedSettingsOk -`func (o *AccountHolderCapability) GetRequestedSettingsOk() (*JSONObject, bool)` +`func (o *AccountHolderCapability) GetRequestedSettingsOk() (*CapabilitySettings, bool)` GetRequestedSettingsOk returns a tuple with the RequestedSettings field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRequestedSettings -`func (o *AccountHolderCapability) SetRequestedSettings(v JSONObject)` +`func (o *AccountHolderCapability) SetRequestedSettings(v CapabilitySettings)` SetRequestedSettings sets RequestedSettings field to given value. diff --git a/src/balanceplatform/docs/AccountHolderInfo.md b/src/balanceplatform/docs/AccountHolderInfo.md index b22b9dc2f..3c7eeff5e 100644 --- a/src/balanceplatform/docs/AccountHolderInfo.md +++ b/src/balanceplatform/docs/AccountHolderInfo.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **ContactDetails** | Pointer to [**ContactDetails**](ContactDetails.md) | | [optional] **Description** | Pointer to **string** | Your description for the account holder, maximum 300 characters. | [optional] **LegalEntityId** | **string** | The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. | +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **Reference** | Pointer to **string** | Your reference for the account holder, maximum 150 characters. | [optional] **TimeZone** | Pointer to **string** | The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] @@ -151,6 +152,31 @@ and a boolean to check if the value has been set. SetLegalEntityId sets LegalEntityId field to given value. +### GetMetadata + +`func (o *AccountHolderInfo) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *AccountHolderInfo) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *AccountHolderInfo) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *AccountHolderInfo) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetReference `func (o *AccountHolderInfo) GetReference() string` diff --git a/src/balanceplatform/docs/BalanceAccount.md b/src/balanceplatform/docs/BalanceAccount.md index 6c3492d80..548ab8d39 100644 --- a/src/balanceplatform/docs/BalanceAccount.md +++ b/src/balanceplatform/docs/BalanceAccount.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **DefaultCurrencyCode** | Pointer to **string** | The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. | [optional] **Description** | Pointer to **string** | A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. | [optional] **Id** | **string** | The unique identifier of the balance account. | +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **Reference** | Pointer to **string** | Your reference for the balance account, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the balance account, set to **active** by default. | [optional] **TimeZone** | Pointer to **string** | The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] @@ -147,6 +148,31 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. +### GetMetadata + +`func (o *BalanceAccount) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *BalanceAccount) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *BalanceAccount) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *BalanceAccount) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetReference `func (o *BalanceAccount) GetReference() string` diff --git a/src/balanceplatform/docs/BalanceAccountBase.md b/src/balanceplatform/docs/BalanceAccountBase.md index c37ac99dc..38196b48f 100644 --- a/src/balanceplatform/docs/BalanceAccountBase.md +++ b/src/balanceplatform/docs/BalanceAccountBase.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **DefaultCurrencyCode** | Pointer to **string** | The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. | [optional] **Description** | Pointer to **string** | A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. | [optional] **Id** | **string** | The unique identifier of the balance account. | +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **Reference** | Pointer to **string** | Your reference for the balance account, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the balance account, set to **active** by default. | [optional] **TimeZone** | Pointer to **string** | The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] @@ -121,6 +122,31 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. +### GetMetadata + +`func (o *BalanceAccountBase) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *BalanceAccountBase) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *BalanceAccountBase) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *BalanceAccountBase) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetReference `func (o *BalanceAccountBase) GetReference() string` diff --git a/src/balanceplatform/docs/BalanceAccountInfo.md b/src/balanceplatform/docs/BalanceAccountInfo.md index e85db9e7b..4921716ec 100644 --- a/src/balanceplatform/docs/BalanceAccountInfo.md +++ b/src/balanceplatform/docs/BalanceAccountInfo.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **AccountHolderId** | **string** | The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. | **DefaultCurrencyCode** | Pointer to **string** | The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. | [optional] **Description** | Pointer to **string** | A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. | [optional] +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **Reference** | Pointer to **string** | Your reference for the balance account, maximum 150 characters. | [optional] **TimeZone** | Pointer to **string** | The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] @@ -99,6 +100,31 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### GetMetadata + +`func (o *BalanceAccountInfo) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *BalanceAccountInfo) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *BalanceAccountInfo) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *BalanceAccountInfo) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetReference `func (o *BalanceAccountInfo) GetReference() string` diff --git a/src/balanceplatform/docs/BalanceAccountUpdateRequest.md b/src/balanceplatform/docs/BalanceAccountUpdateRequest.md index 580e57e76..52bc72572 100644 --- a/src/balanceplatform/docs/BalanceAccountUpdateRequest.md +++ b/src/balanceplatform/docs/BalanceAccountUpdateRequest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **AccountHolderId** | Pointer to **string** | The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. | [optional] **DefaultCurrencyCode** | Pointer to **string** | The default currency code of this balance account, in three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) format. The default value is **EUR**. | [optional] **Description** | Pointer to **string** | A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. | [optional] +**Metadata** | Pointer to **map[string]string** | A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. | [optional] **Reference** | Pointer to **string** | Your reference to the balance account, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **inactive**, **closed**, **suspended**. | [optional] **TimeZone** | Pointer to **string** | The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] @@ -105,6 +106,31 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### GetMetadata + +`func (o *BalanceAccountUpdateRequest) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *BalanceAccountUpdateRequest) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *BalanceAccountUpdateRequest) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *BalanceAccountUpdateRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + ### GetReference `func (o *BalanceAccountUpdateRequest) GetReference() string` diff --git a/src/balanceplatform/docs/CapabilitySettings.md b/src/balanceplatform/docs/CapabilitySettings.md new file mode 100644 index 000000000..d2e63a33a --- /dev/null +++ b/src/balanceplatform/docs/CapabilitySettings.md @@ -0,0 +1,160 @@ +# CapabilitySettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AmountPerIndustry** | Pointer to [**map[string]Amount**](Amount.md) | | [optional] +**AuthorizedCardUsers** | Pointer to **bool** | | [optional] +**FundingSource** | Pointer to **[]string** | | [optional] +**Interval** | Pointer to **string** | | [optional] +**MaxAmount** | Pointer to [**Amount**](Amount.md) | | [optional] + +## Methods + +### NewCapabilitySettings + +`func NewCapabilitySettings() *CapabilitySettings` + +NewCapabilitySettings instantiates a new CapabilitySettings object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapabilitySettingsWithDefaults + +`func NewCapabilitySettingsWithDefaults() *CapabilitySettings` + +NewCapabilitySettingsWithDefaults instantiates a new CapabilitySettings object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmountPerIndustry + +`func (o *CapabilitySettings) GetAmountPerIndustry() map[string]Amount` + +GetAmountPerIndustry returns the AmountPerIndustry field if non-nil, zero value otherwise. + +### GetAmountPerIndustryOk + +`func (o *CapabilitySettings) GetAmountPerIndustryOk() (*map[string]Amount, bool)` + +GetAmountPerIndustryOk returns a tuple with the AmountPerIndustry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountPerIndustry + +`func (o *CapabilitySettings) SetAmountPerIndustry(v map[string]Amount)` + +SetAmountPerIndustry sets AmountPerIndustry field to given value. + +### HasAmountPerIndustry + +`func (o *CapabilitySettings) HasAmountPerIndustry() bool` + +HasAmountPerIndustry returns a boolean if a field has been set. + +### GetAuthorizedCardUsers + +`func (o *CapabilitySettings) GetAuthorizedCardUsers() bool` + +GetAuthorizedCardUsers returns the AuthorizedCardUsers field if non-nil, zero value otherwise. + +### GetAuthorizedCardUsersOk + +`func (o *CapabilitySettings) GetAuthorizedCardUsersOk() (*bool, bool)` + +GetAuthorizedCardUsersOk returns a tuple with the AuthorizedCardUsers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthorizedCardUsers + +`func (o *CapabilitySettings) SetAuthorizedCardUsers(v bool)` + +SetAuthorizedCardUsers sets AuthorizedCardUsers field to given value. + +### HasAuthorizedCardUsers + +`func (o *CapabilitySettings) HasAuthorizedCardUsers() bool` + +HasAuthorizedCardUsers returns a boolean if a field has been set. + +### GetFundingSource + +`func (o *CapabilitySettings) GetFundingSource() []string` + +GetFundingSource returns the FundingSource field if non-nil, zero value otherwise. + +### GetFundingSourceOk + +`func (o *CapabilitySettings) GetFundingSourceOk() (*[]string, bool)` + +GetFundingSourceOk returns a tuple with the FundingSource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFundingSource + +`func (o *CapabilitySettings) SetFundingSource(v []string)` + +SetFundingSource sets FundingSource field to given value. + +### HasFundingSource + +`func (o *CapabilitySettings) HasFundingSource() bool` + +HasFundingSource returns a boolean if a field has been set. + +### GetInterval + +`func (o *CapabilitySettings) GetInterval() string` + +GetInterval returns the Interval field if non-nil, zero value otherwise. + +### GetIntervalOk + +`func (o *CapabilitySettings) GetIntervalOk() (*string, bool)` + +GetIntervalOk returns a tuple with the Interval field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInterval + +`func (o *CapabilitySettings) SetInterval(v string)` + +SetInterval sets Interval field to given value. + +### HasInterval + +`func (o *CapabilitySettings) HasInterval() bool` + +HasInterval returns a boolean if a field has been set. + +### GetMaxAmount + +`func (o *CapabilitySettings) GetMaxAmount() Amount` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *CapabilitySettings) GetMaxAmountOk() (*Amount, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *CapabilitySettings) SetMaxAmount(v Amount)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *CapabilitySettings) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/balanceplatform/docs/CronSweepSchedule.md b/src/balanceplatform/docs/CronSweepSchedule.md index bfd378521..050a090c4 100644 --- a/src/balanceplatform/docs/CronSweepSchedule.md +++ b/src/balanceplatform/docs/CronSweepSchedule.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CronExpression** | **string** | A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. | -**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. | [optional] +**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. | [optional] ## Methods diff --git a/src/balanceplatform/docs/DeliveryAddress.md b/src/balanceplatform/docs/DeliveryAddress.md new file mode 100644 index 000000000..fc321b7af --- /dev/null +++ b/src/balanceplatform/docs/DeliveryAddress.md @@ -0,0 +1,207 @@ +# DeliveryAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**City** | Pointer to **string** | The name of the city. | [optional] +**Country** | **string** | The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. | +**Line1** | Pointer to **string** | First line of the address. | [optional] +**Line2** | Pointer to **string** | Second line of the address. | [optional] +**Line3** | Pointer to **string** | Third line of the address. | [optional] +**PostalCode** | Pointer to **string** | The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. | [optional] +**StateOrProvince** | Pointer to **string** | The two-letterISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. | [optional] + +## Methods + +### NewDeliveryAddress + +`func NewDeliveryAddress(country string, ) *DeliveryAddress` + +NewDeliveryAddress instantiates a new DeliveryAddress object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeliveryAddressWithDefaults + +`func NewDeliveryAddressWithDefaults() *DeliveryAddress` + +NewDeliveryAddressWithDefaults instantiates a new DeliveryAddress object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCity + +`func (o *DeliveryAddress) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *DeliveryAddress) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *DeliveryAddress) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *DeliveryAddress) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### GetCountry + +`func (o *DeliveryAddress) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *DeliveryAddress) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *DeliveryAddress) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetLine1 + +`func (o *DeliveryAddress) GetLine1() string` + +GetLine1 returns the Line1 field if non-nil, zero value otherwise. + +### GetLine1Ok + +`func (o *DeliveryAddress) GetLine1Ok() (*string, bool)` + +GetLine1Ok returns a tuple with the Line1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLine1 + +`func (o *DeliveryAddress) SetLine1(v string)` + +SetLine1 sets Line1 field to given value. + +### HasLine1 + +`func (o *DeliveryAddress) HasLine1() bool` + +HasLine1 returns a boolean if a field has been set. + +### GetLine2 + +`func (o *DeliveryAddress) GetLine2() string` + +GetLine2 returns the Line2 field if non-nil, zero value otherwise. + +### GetLine2Ok + +`func (o *DeliveryAddress) GetLine2Ok() (*string, bool)` + +GetLine2Ok returns a tuple with the Line2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLine2 + +`func (o *DeliveryAddress) SetLine2(v string)` + +SetLine2 sets Line2 field to given value. + +### HasLine2 + +`func (o *DeliveryAddress) HasLine2() bool` + +HasLine2 returns a boolean if a field has been set. + +### GetLine3 + +`func (o *DeliveryAddress) GetLine3() string` + +GetLine3 returns the Line3 field if non-nil, zero value otherwise. + +### GetLine3Ok + +`func (o *DeliveryAddress) GetLine3Ok() (*string, bool)` + +GetLine3Ok returns a tuple with the Line3 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLine3 + +`func (o *DeliveryAddress) SetLine3(v string)` + +SetLine3 sets Line3 field to given value. + +### HasLine3 + +`func (o *DeliveryAddress) HasLine3() bool` + +HasLine3 returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *DeliveryAddress) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *DeliveryAddress) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *DeliveryAddress) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *DeliveryAddress) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + +### GetStateOrProvince + +`func (o *DeliveryAddress) GetStateOrProvince() string` + +GetStateOrProvince returns the StateOrProvince field if non-nil, zero value otherwise. + +### GetStateOrProvinceOk + +`func (o *DeliveryAddress) GetStateOrProvinceOk() (*string, bool)` + +GetStateOrProvinceOk returns a tuple with the StateOrProvince field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateOrProvince + +`func (o *DeliveryAddress) SetStateOrProvince(v string)` + +SetStateOrProvince sets StateOrProvince field to given value. + +### HasStateOrProvince + +`func (o *DeliveryAddress) HasStateOrProvince() bool` + +HasStateOrProvince returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/balanceplatform/docs/DeliveryContact.md b/src/balanceplatform/docs/DeliveryContact.md index 66db65c42..b6ee51e3f 100644 --- a/src/balanceplatform/docs/DeliveryContact.md +++ b/src/balanceplatform/docs/DeliveryContact.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Address** | [**Address2**](Address2.md) | | +**Address** | [**DeliveryAddress**](DeliveryAddress.md) | | **Email** | Pointer to **string** | The email address of the contact. | [optional] **FullPhoneNumber** | Pointer to **string** | The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" | [optional] **Name** | [**Name**](Name.md) | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewDeliveryContact -`func NewDeliveryContact(address Address2, name Name, ) *DeliveryContact` +`func NewDeliveryContact(address DeliveryAddress, name Name, ) *DeliveryContact` NewDeliveryContact instantiates a new DeliveryContact object This constructor will assign default values to properties that have it defined, @@ -32,20 +32,20 @@ but it doesn't guarantee that properties required by API are set ### GetAddress -`func (o *DeliveryContact) GetAddress() Address2` +`func (o *DeliveryContact) GetAddress() DeliveryAddress` GetAddress returns the Address field if non-nil, zero value otherwise. ### GetAddressOk -`func (o *DeliveryContact) GetAddressOk() (*Address2, bool)` +`func (o *DeliveryContact) GetAddressOk() (*DeliveryAddress, bool)` GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAddress -`func (o *DeliveryContact) SetAddress(v Address2)` +`func (o *DeliveryContact) SetAddress(v DeliveryAddress)` SetAddress sets Address field to given value. diff --git a/src/balanceplatform/docs/PaymentInstrument.md b/src/balanceplatform/docs/PaymentInstrument.md index d7d5117e8..8f4de0bce 100644 --- a/src/balanceplatform/docs/PaymentInstrument.md +++ b/src/balanceplatform/docs/PaymentInstrument.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **PaymentInstrumentGroupId** | Pointer to **string** | The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. | [optional] **Reference** | Pointer to **string** | Your reference for the payment instrument, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. | [optional] -**StatusReason** | Pointer to **string** | The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] +**StatusReason** | Pointer to **string** | The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] **Type** | **string** | Type of payment instrument. Possible value: **card**, **bankAccount**. | ## Methods diff --git a/src/balanceplatform/docs/PaymentInstrumentInfo.md b/src/balanceplatform/docs/PaymentInstrumentInfo.md index fb81baf78..38dc4344f 100644 --- a/src/balanceplatform/docs/PaymentInstrumentInfo.md +++ b/src/balanceplatform/docs/PaymentInstrumentInfo.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **PaymentInstrumentGroupId** | Pointer to **string** | The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. | [optional] **Reference** | Pointer to **string** | Your reference for the payment instrument, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. | [optional] -**StatusReason** | Pointer to **string** | The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] +**StatusReason** | Pointer to **string** | The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] **Type** | **string** | Type of payment instrument. Possible value: **card**, **bankAccount**. | ## Methods diff --git a/src/balanceplatform/docs/SweepConfigurationV2Schedule.md b/src/balanceplatform/docs/SweepConfigurationV2Schedule.md index f82b5f202..121ef87f8 100644 --- a/src/balanceplatform/docs/SweepConfigurationV2Schedule.md +++ b/src/balanceplatform/docs/SweepConfigurationV2Schedule.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CronExpression** | **string** | A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. | -**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. | [optional] +**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. | [optional] ## Methods diff --git a/src/balanceplatform/docs/SweepSchedule.md b/src/balanceplatform/docs/SweepSchedule.md index 85be1077f..839355449 100644 --- a/src/balanceplatform/docs/SweepSchedule.md +++ b/src/balanceplatform/docs/SweepSchedule.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. | [optional] +**Type** | Pointer to **string** | The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. | [optional] ## Methods diff --git a/src/balanceplatform/docs/UpdatePaymentInstrument.md b/src/balanceplatform/docs/UpdatePaymentInstrument.md index 03e6e16d4..1ace981bc 100644 --- a/src/balanceplatform/docs/UpdatePaymentInstrument.md +++ b/src/balanceplatform/docs/UpdatePaymentInstrument.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **Reference** | Pointer to **string** | Your reference for the payment instrument, maximum 150 characters. | [optional] **Status** | Pointer to **string** | The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. | [optional] **StatusComment** | Pointer to **string** | Comment for the status of the payment instrument. Required if `statusReason` is **other**. | [optional] -**StatusReason** | Pointer to **string** | The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] +**StatusReason** | Pointer to **string** | The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. | [optional] **Type** | **string** | Type of payment instrument. Possible value: **card**, **bankAccount**. | ## Methods diff --git a/src/balanceplatform/model_account_holder.go b/src/balanceplatform/model_account_holder.go index b8681e810..3bf7e865b 100644 --- a/src/balanceplatform/model_account_holder.go +++ b/src/balanceplatform/model_account_holder.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountHolder type satisfies the MappedNullable interface at compile time @@ -22,14 +21,16 @@ type AccountHolder struct { // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. BalancePlatform *string `json:"balancePlatform,omitempty"` // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. - Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // Your description for the account holder, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the account holder. Id string `json:"id"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. LegalEntityId string `json:"legalEntityId"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. PrimaryBalanceAccount *string `json:"primaryBalanceAccount,omitempty"` // Your reference for the account holder, maximum 150 characters. @@ -237,6 +238,38 @@ func (o *AccountHolder) SetLegalEntityId(v string) { o.LegalEntityId = v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *AccountHolder) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *AccountHolder) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *AccountHolder) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetPrimaryBalanceAccount returns the PrimaryBalanceAccount field value if set, zero value otherwise. func (o *AccountHolder) GetPrimaryBalanceAccount() string { if o == nil || common.IsNil(o.PrimaryBalanceAccount) { @@ -398,7 +431,7 @@ func (o *AccountHolder) SetVerificationDeadlines(v []VerificationDeadline) { } func (o AccountHolder) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,8 +452,11 @@ func (o AccountHolder) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } - // skip: id is readOnly + toSerialize["id"] = o.Id toSerialize["legalEntityId"] = o.LegalEntityId + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.PrimaryBalanceAccount) { toSerialize["primaryBalanceAccount"] = o.PrimaryBalanceAccount } @@ -433,7 +469,9 @@ func (o AccountHolder) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.TimeZone) { toSerialize["timeZone"] = o.TimeZone } - // skip: verificationDeadlines is readOnly + if !common.IsNil(o.VerificationDeadlines) { + toSerialize["verificationDeadlines"] = o.VerificationDeadlines + } return toSerialize, nil } @@ -473,12 +511,14 @@ func (v *NullableAccountHolder) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountHolder) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_account_holder_capability.go b/src/balanceplatform/model_account_holder_capability.go index 0f3b144e3..fc3fa0a85 100644 --- a/src/balanceplatform/model_account_holder_capability.go +++ b/src/balanceplatform/model_account_holder_capability.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountHolderCapability type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type AccountHolderCapability struct { // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. Allowed *bool `json:"allowed,omitempty"` // The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. - AllowedLevel *string `json:"allowedLevel,omitempty"` - AllowedSettings *JSONObject `json:"allowedSettings,omitempty"` + AllowedLevel *string `json:"allowedLevel,omitempty"` + AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` // Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. Enabled *bool `json:"enabled,omitempty"` // Contains verification errors and the actions that you can take to resolve them. @@ -31,11 +30,11 @@ type AccountHolderCapability struct { // Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. - RequestedLevel *string `json:"requestedLevel,omitempty"` - RequestedSettings *JSONObject `json:"requestedSettings,omitempty"` - // Contains the status of the transfer instruments associated with this capability. + RequestedLevel *string `json:"requestedLevel,omitempty"` + RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` + // Contains the status of the transfer instruments associated with this capability. TransferInstruments []AccountSupportingEntityCapability `json:"transferInstruments,omitempty"` - // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -121,9 +120,9 @@ func (o *AccountHolderCapability) SetAllowedLevel(v string) { } // GetAllowedSettings returns the AllowedSettings field value if set, zero value otherwise. -func (o *AccountHolderCapability) GetAllowedSettings() JSONObject { +func (o *AccountHolderCapability) GetAllowedSettings() CapabilitySettings { if o == nil || common.IsNil(o.AllowedSettings) { - var ret JSONObject + var ret CapabilitySettings return ret } return *o.AllowedSettings @@ -131,7 +130,7 @@ func (o *AccountHolderCapability) GetAllowedSettings() JSONObject { // GetAllowedSettingsOk returns a tuple with the AllowedSettings field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AccountHolderCapability) GetAllowedSettingsOk() (*JSONObject, bool) { +func (o *AccountHolderCapability) GetAllowedSettingsOk() (*CapabilitySettings, bool) { if o == nil || common.IsNil(o.AllowedSettings) { return nil, false } @@ -147,8 +146,8 @@ func (o *AccountHolderCapability) HasAllowedSettings() bool { return false } -// SetAllowedSettings gets a reference to the given JSONObject and assigns it to the AllowedSettings field. -func (o *AccountHolderCapability) SetAllowedSettings(v JSONObject) { +// SetAllowedSettings gets a reference to the given CapabilitySettings and assigns it to the AllowedSettings field. +func (o *AccountHolderCapability) SetAllowedSettings(v CapabilitySettings) { o.AllowedSettings = &v } @@ -281,9 +280,9 @@ func (o *AccountHolderCapability) SetRequestedLevel(v string) { } // GetRequestedSettings returns the RequestedSettings field value if set, zero value otherwise. -func (o *AccountHolderCapability) GetRequestedSettings() JSONObject { +func (o *AccountHolderCapability) GetRequestedSettings() CapabilitySettings { if o == nil || common.IsNil(o.RequestedSettings) { - var ret JSONObject + var ret CapabilitySettings return ret } return *o.RequestedSettings @@ -291,7 +290,7 @@ func (o *AccountHolderCapability) GetRequestedSettings() JSONObject { // GetRequestedSettingsOk returns a tuple with the RequestedSettings field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AccountHolderCapability) GetRequestedSettingsOk() (*JSONObject, bool) { +func (o *AccountHolderCapability) GetRequestedSettingsOk() (*CapabilitySettings, bool) { if o == nil || common.IsNil(o.RequestedSettings) { return nil, false } @@ -307,8 +306,8 @@ func (o *AccountHolderCapability) HasRequestedSettings() bool { return false } -// SetRequestedSettings gets a reference to the given JSONObject and assigns it to the RequestedSettings field. -func (o *AccountHolderCapability) SetRequestedSettings(v JSONObject) { +// SetRequestedSettings gets a reference to the given CapabilitySettings and assigns it to the RequestedSettings field. +func (o *AccountHolderCapability) SetRequestedSettings(v CapabilitySettings) { o.RequestedSettings = &v } @@ -377,7 +376,7 @@ func (o *AccountHolderCapability) SetVerificationStatus(v string) { } func (o AccountHolderCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -386,15 +385,21 @@ func (o AccountHolderCapability) MarshalJSON() ([]byte, error) { func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: allowed is readOnly - // skip: allowedLevel is readOnly + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.AllowedLevel) { + toSerialize["allowedLevel"] = o.AllowedLevel + } if !common.IsNil(o.AllowedSettings) { toSerialize["allowedSettings"] = o.AllowedSettings } if !common.IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } - // skip: problems is readOnly + if !common.IsNil(o.Problems) { + toSerialize["problems"] = o.Problems + } if !common.IsNil(o.Requested) { toSerialize["requested"] = o.Requested } @@ -407,7 +412,9 @@ func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.TransferInstruments) { toSerialize["transferInstruments"] = o.TransferInstruments } - // skip: verificationStatus is readOnly + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } return toSerialize, nil } @@ -447,30 +454,32 @@ func (v *NullableAccountHolderCapability) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountHolderCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *AccountHolderCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } func (o *AccountHolderCapability) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_account_holder_info.go b/src/balanceplatform/model_account_holder_info.go index edd5b14c3..ca5e22a2b 100644 --- a/src/balanceplatform/model_account_holder_info.go +++ b/src/balanceplatform/model_account_holder_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountHolderInfo type satisfies the MappedNullable interface at compile time @@ -22,12 +21,14 @@ type AccountHolderInfo struct { // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. BalancePlatform *string `json:"balancePlatform,omitempty"` // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. - Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // Your description for the account holder, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. LegalEntityId string `json:"legalEntityId"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // Your reference for the account holder, maximum 150 characters. Reference *string `json:"reference,omitempty"` // The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). @@ -204,6 +205,38 @@ func (o *AccountHolderInfo) SetLegalEntityId(v string) { o.LegalEntityId = v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *AccountHolderInfo) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderInfo) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *AccountHolderInfo) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *AccountHolderInfo) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *AccountHolderInfo) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -269,7 +302,7 @@ func (o *AccountHolderInfo) SetTimeZone(v string) { } func (o AccountHolderInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -291,6 +324,9 @@ func (o AccountHolderInfo) ToMap() (map[string]interface{}, error) { toSerialize["description"] = o.Description } toSerialize["legalEntityId"] = o.LegalEntityId + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } @@ -335,3 +371,6 @@ func (v *NullableAccountHolderInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_account_supporting_entity_capability.go b/src/balanceplatform/model_account_supporting_entity_capability.go index e92480a0b..7147ae963 100644 --- a/src/balanceplatform/model_account_supporting_entity_capability.go +++ b/src/balanceplatform/model_account_supporting_entity_capability.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountSupportingEntityCapability type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type AccountSupportingEntityCapability struct { Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel *string `json:"requestedLevel,omitempty"` - // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -277,7 +276,7 @@ func (o *AccountSupportingEntityCapability) SetVerificationStatus(v string) { } func (o AccountSupportingEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -286,19 +285,27 @@ func (o AccountSupportingEntityCapability) MarshalJSON() ([]byte, error) { func (o AccountSupportingEntityCapability) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: allowed is readOnly - // skip: allowedLevel is readOnly + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.AllowedLevel) { + toSerialize["allowedLevel"] = o.AllowedLevel + } if !common.IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } - // skip: id is readOnly + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } if !common.IsNil(o.Requested) { toSerialize["requested"] = o.Requested } if !common.IsNil(o.RequestedLevel) { toSerialize["requestedLevel"] = o.RequestedLevel } - // skip: verificationStatus is readOnly + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } return toSerialize, nil } @@ -338,30 +345,32 @@ func (v *NullableAccountSupportingEntityCapability) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *AccountSupportingEntityCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *AccountSupportingEntityCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } func (o *AccountSupportingEntityCapability) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_active_network_tokens_restriction.go b/src/balanceplatform/model_active_network_tokens_restriction.go index 37bbba03b..51de60164 100644 --- a/src/balanceplatform/model_active_network_tokens_restriction.go +++ b/src/balanceplatform/model_active_network_tokens_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ActiveNetworkTokensRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *ActiveNetworkTokensRestriction) SetValue(v int32) { } func (o ActiveNetworkTokensRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableActiveNetworkTokensRestriction) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_additional_bank_identification.go b/src/balanceplatform/model_additional_bank_identification.go index e65fd0121..74f412420 100644 --- a/src/balanceplatform/model_additional_bank_identification.go +++ b/src/balanceplatform/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_address.go b/src/balanceplatform/model_address.go index 64e40632a..56a3a7447 100644 --- a/src/balanceplatform/model_address.go +++ b/src/balanceplatform/model_address.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_amount.go b/src/balanceplatform/model_amount.go index dbc59fc34..d36ecae2e 100644 --- a/src/balanceplatform/model_amount.go +++ b/src/balanceplatform/model_amount.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_au_local_account_identification.go b/src/balanceplatform/model_au_local_account_identification.go index 43917df52..abe14a20e 100644 --- a/src/balanceplatform/model_au_local_account_identification.go +++ b/src/balanceplatform/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_authentication.go b/src/balanceplatform/model_authentication.go index 45cf76a63..b431ac9c3 100644 --- a/src/balanceplatform/model_authentication.go +++ b/src/balanceplatform/model_authentication.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Authentication type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type Authentication struct { Email *string `json:"email,omitempty"` // The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** Password *string `json:"password,omitempty"` - Phone *Phone `json:"phone,omitempty"` + Phone *Phone `json:"phone,omitempty"` } // NewAuthentication instantiates a new Authentication object @@ -140,7 +139,7 @@ func (o *Authentication) SetPhone(v Phone) { } func (o Authentication) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableAuthentication) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance.go b/src/balanceplatform/model_balance.go index c40815d30..2210de6c6 100644 --- a/src/balanceplatform/model_balance.go +++ b/src/balanceplatform/model_balance.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Balance type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *Balance) SetReserved(v int64) { } func (o Balance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableBalance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_account.go b/src/balanceplatform/model_balance_account.go index ce1b5b7d3..c480259cf 100644 --- a/src/balanceplatform/model_balance_account.go +++ b/src/balanceplatform/model_balance_account.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalanceAccount type satisfies the MappedNullable interface at compile time @@ -29,9 +28,11 @@ type BalanceAccount struct { Description *string `json:"description,omitempty"` // The unique identifier of the balance account. Id string `json:"id"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the balance account, set to **active** by default. + // The status of the balance account, set to **active** by default. Status *string `json:"status,omitempty"` // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). TimeZone *string `json:"timeZone,omitempty"` @@ -200,6 +201,38 @@ func (o *BalanceAccount) SetId(v string) { o.Id = v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *BalanceAccount) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *BalanceAccount) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *BalanceAccount) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *BalanceAccount) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -297,7 +330,7 @@ func (o *BalanceAccount) SetTimeZone(v string) { } func (o BalanceAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -317,6 +350,9 @@ func (o BalanceAccount) ToMap() (map[string]interface{}, error) { toSerialize["description"] = o.Description } toSerialize["id"] = o.Id + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } @@ -365,12 +401,14 @@ func (v *NullableBalanceAccount) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccount) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_account_base.go b/src/balanceplatform/model_balance_account_base.go index b07896336..ba1d295d2 100644 --- a/src/balanceplatform/model_balance_account_base.go +++ b/src/balanceplatform/model_balance_account_base.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalanceAccountBase type satisfies the MappedNullable interface at compile time @@ -27,9 +26,11 @@ type BalanceAccountBase struct { Description *string `json:"description,omitempty"` // The unique identifier of the balance account. Id string `json:"id"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the balance account, set to **active** by default. + // The status of the balance account, set to **active** by default. Status *string `json:"status,omitempty"` // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). TimeZone *string `json:"timeZone,omitempty"` @@ -166,6 +167,38 @@ func (o *BalanceAccountBase) SetId(v string) { o.Id = v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *BalanceAccountBase) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccountBase) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *BalanceAccountBase) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *BalanceAccountBase) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *BalanceAccountBase) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -263,7 +296,7 @@ func (o *BalanceAccountBase) SetTimeZone(v string) { } func (o BalanceAccountBase) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -280,6 +313,9 @@ func (o BalanceAccountBase) ToMap() (map[string]interface{}, error) { toSerialize["description"] = o.Description } toSerialize["id"] = o.Id + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } @@ -328,12 +364,14 @@ func (v *NullableBalanceAccountBase) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccountBase) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_account_info.go b/src/balanceplatform/model_balance_account_info.go index 65ba10e70..8de6104d0 100644 --- a/src/balanceplatform/model_balance_account_info.go +++ b/src/balanceplatform/model_balance_account_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalanceAccountInfo type satisfies the MappedNullable interface at compile time @@ -25,6 +24,8 @@ type BalanceAccountInfo struct { DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). @@ -137,6 +138,38 @@ func (o *BalanceAccountInfo) SetDescription(v string) { o.Description = &v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *BalanceAccountInfo) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccountInfo) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *BalanceAccountInfo) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *BalanceAccountInfo) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *BalanceAccountInfo) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -202,7 +235,7 @@ func (o *BalanceAccountInfo) SetTimeZone(v string) { } func (o BalanceAccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -218,6 +251,9 @@ func (o BalanceAccountInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } @@ -262,3 +298,6 @@ func (v *NullableBalanceAccountInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_account_update_request.go b/src/balanceplatform/model_balance_account_update_request.go index 03f707660..6464138f4 100644 --- a/src/balanceplatform/model_balance_account_update_request.go +++ b/src/balanceplatform/model_balance_account_update_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalanceAccountUpdateRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +24,8 @@ type BalanceAccountUpdateRequest struct { DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` + // A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` // Your reference to the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` // The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **inactive**, **closed**, **suspended**. @@ -146,6 +147,38 @@ func (o *BalanceAccountUpdateRequest) SetDescription(v string) { o.Description = &v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *BalanceAccountUpdateRequest) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccountUpdateRequest) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *BalanceAccountUpdateRequest) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *BalanceAccountUpdateRequest) SetMetadata(v map[string]string) { + o.Metadata = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *BalanceAccountUpdateRequest) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -243,7 +276,7 @@ func (o *BalanceAccountUpdateRequest) SetTimeZone(v string) { } func (o BalanceAccountUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -261,6 +294,9 @@ func (o BalanceAccountUpdateRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } @@ -309,12 +345,14 @@ func (v *NullableBalanceAccountUpdateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccountUpdateRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_platform.go b/src/balanceplatform/model_balance_platform.go index ec767e377..3f949b491 100644 --- a/src/balanceplatform/model_balance_platform.go +++ b/src/balanceplatform/model_balance_platform.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalancePlatform type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *BalancePlatform) SetStatus(v string) { } func (o BalancePlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableBalancePlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_sweep_configurations_response.go b/src/balanceplatform/model_balance_sweep_configurations_response.go index 01a93b934..3e2680443 100644 --- a/src/balanceplatform/model_balance_sweep_configurations_response.go +++ b/src/balanceplatform/model_balance_sweep_configurations_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BalanceSweepConfigurationsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *BalanceSweepConfigurationsResponse) SetSweeps(v []SweepConfigurationV2) } func (o BalanceSweepConfigurationsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableBalanceSweepConfigurationsResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bank_account_identification_validation_request.go b/src/balanceplatform/model_bank_account_identification_validation_request.go index 0b08e51e4..a6abf9d08 100644 --- a/src/balanceplatform/model_bank_account_identification_validation_request.go +++ b/src/balanceplatform/model_bank_account_identification_validation_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccountIdentificationValidationRequest type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *BankAccountIdentificationValidationRequest) SetAccountIdentification(v } func (o BankAccountIdentificationValidationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableBankAccountIdentificationValidationRequest) UnmarshalJSON(src [ v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go b/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go index 5a8e240c4..ea9f9d264 100644 --- a/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go +++ b/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go @@ -10,23 +10,24 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // BankAccountIdentificationValidationRequestAccountIdentification - Bank account identification. type BankAccountIdentificationValidationRequestAccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountIdentificationValidationRequestAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountIdentificationValidationRequestAccountIdentification @@ -113,6 +114,7 @@ func USLocalAccountIdentificationAsBankAccountIdentificationValidationRequestAcc } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountIdentificationValidationRequestAccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -123,7 +125,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -136,7 +138,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -149,7 +151,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -162,7 +164,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -175,7 +177,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -188,7 +190,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -201,7 +203,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -214,7 +216,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -227,7 +229,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -240,7 +242,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -253,7 +255,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -266,7 +268,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -350,7 +352,7 @@ func (src BankAccountIdentificationValidationRequestAccountIdentification) Marsh } // Get the actual instance -func (obj *BankAccountIdentificationValidationRequestAccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountIdentificationValidationRequestAccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -441,3 +443,5 @@ func (v *NullableBankAccountIdentificationValidationRequestAccountIdentification v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_brand_variants_restriction.go b/src/balanceplatform/model_brand_variants_restriction.go index 81225256f..dc0a6ea63 100644 --- a/src/balanceplatform/model_brand_variants_restriction.go +++ b/src/balanceplatform/model_brand_variants_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BrandVariantsRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &BrandVariantsRestriction{} type BrandVariantsRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. + // List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *BrandVariantsRestriction) SetValue(v []string) { } func (o BrandVariantsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableBrandVariantsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bulk_address.go b/src/balanceplatform/model_bulk_address.go index 16b61bf2e..abd149a81 100644 --- a/src/balanceplatform/model_bulk_address.go +++ b/src/balanceplatform/model_bulk_address.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BulkAddress type satisfies the MappedNullable interface at compile time @@ -338,7 +337,7 @@ func (o *BulkAddress) SetStreet(v string) { } func (o BulkAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -410,3 +409,6 @@ func (v *NullableBulkAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_ca_local_account_identification.go b/src/balanceplatform/model_ca_local_account_identification.go index b9e166e4d..eab135085 100644 --- a/src/balanceplatform/model_ca_local_account_identification.go +++ b/src/balanceplatform/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_capability_settings.go b/src/balanceplatform/model_capability_settings.go new file mode 100644 index 000000000..565c6b695 --- /dev/null +++ b/src/balanceplatform/model_capability_settings.go @@ -0,0 +1,283 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the CapabilitySettings type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CapabilitySettings{} + +// CapabilitySettings struct for CapabilitySettings +type CapabilitySettings struct { + // + AmountPerIndustry *map[string]Amount `json:"amountPerIndustry,omitempty"` + // + AuthorizedCardUsers *bool `json:"authorizedCardUsers,omitempty"` + // + FundingSource []string `json:"fundingSource,omitempty"` + // + Interval *string `json:"interval,omitempty"` + MaxAmount *Amount `json:"maxAmount,omitempty"` +} + +// NewCapabilitySettings instantiates a new CapabilitySettings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapabilitySettings() *CapabilitySettings { + this := CapabilitySettings{} + return &this +} + +// NewCapabilitySettingsWithDefaults instantiates a new CapabilitySettings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapabilitySettingsWithDefaults() *CapabilitySettings { + this := CapabilitySettings{} + return &this +} + +// GetAmountPerIndustry returns the AmountPerIndustry field value if set, zero value otherwise. +func (o *CapabilitySettings) GetAmountPerIndustry() map[string]Amount { + if o == nil || common.IsNil(o.AmountPerIndustry) { + var ret map[string]Amount + return ret + } + return *o.AmountPerIndustry +} + +// GetAmountPerIndustryOk returns a tuple with the AmountPerIndustry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetAmountPerIndustryOk() (*map[string]Amount, bool) { + if o == nil || common.IsNil(o.AmountPerIndustry) { + return nil, false + } + return o.AmountPerIndustry, true +} + +// HasAmountPerIndustry returns a boolean if a field has been set. +func (o *CapabilitySettings) HasAmountPerIndustry() bool { + if o != nil && !common.IsNil(o.AmountPerIndustry) { + return true + } + + return false +} + +// SetAmountPerIndustry gets a reference to the given map[string]Amount and assigns it to the AmountPerIndustry field. +func (o *CapabilitySettings) SetAmountPerIndustry(v map[string]Amount) { + o.AmountPerIndustry = &v +} + +// GetAuthorizedCardUsers returns the AuthorizedCardUsers field value if set, zero value otherwise. +func (o *CapabilitySettings) GetAuthorizedCardUsers() bool { + if o == nil || common.IsNil(o.AuthorizedCardUsers) { + var ret bool + return ret + } + return *o.AuthorizedCardUsers +} + +// GetAuthorizedCardUsersOk returns a tuple with the AuthorizedCardUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetAuthorizedCardUsersOk() (*bool, bool) { + if o == nil || common.IsNil(o.AuthorizedCardUsers) { + return nil, false + } + return o.AuthorizedCardUsers, true +} + +// HasAuthorizedCardUsers returns a boolean if a field has been set. +func (o *CapabilitySettings) HasAuthorizedCardUsers() bool { + if o != nil && !common.IsNil(o.AuthorizedCardUsers) { + return true + } + + return false +} + +// SetAuthorizedCardUsers gets a reference to the given bool and assigns it to the AuthorizedCardUsers field. +func (o *CapabilitySettings) SetAuthorizedCardUsers(v bool) { + o.AuthorizedCardUsers = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *CapabilitySettings) GetFundingSource() []string { + if o == nil || common.IsNil(o.FundingSource) { + var ret []string + return ret + } + return o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetFundingSourceOk() ([]string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *CapabilitySettings) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given []string and assigns it to the FundingSource field. +func (o *CapabilitySettings) SetFundingSource(v []string) { + o.FundingSource = v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *CapabilitySettings) GetInterval() string { + if o == nil || common.IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetIntervalOk() (*string, bool) { + if o == nil || common.IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *CapabilitySettings) HasInterval() bool { + if o != nil && !common.IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *CapabilitySettings) SetInterval(v string) { + o.Interval = &v +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise. +func (o *CapabilitySettings) GetMaxAmount() Amount { + if o == nil || common.IsNil(o.MaxAmount) { + var ret Amount + return ret + } + return *o.MaxAmount +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetMaxAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.MaxAmount) { + return nil, false + } + return o.MaxAmount, true +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *CapabilitySettings) HasMaxAmount() bool { + if o != nil && !common.IsNil(o.MaxAmount) { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given Amount and assigns it to the MaxAmount field. +func (o *CapabilitySettings) SetMaxAmount(v Amount) { + o.MaxAmount = &v +} + +func (o CapabilitySettings) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapabilitySettings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AmountPerIndustry) { + toSerialize["amountPerIndustry"] = o.AmountPerIndustry + } + if !common.IsNil(o.AuthorizedCardUsers) { + toSerialize["authorizedCardUsers"] = o.AuthorizedCardUsers + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + if !common.IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !common.IsNil(o.MaxAmount) { + toSerialize["maxAmount"] = o.MaxAmount + } + return toSerialize, nil +} + +type NullableCapabilitySettings struct { + value *CapabilitySettings + isSet bool +} + +func (v NullableCapabilitySettings) Get() *CapabilitySettings { + return v.value +} + +func (v *NullableCapabilitySettings) Set(val *CapabilitySettings) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilitySettings) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilitySettings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilitySettings(val *CapabilitySettings) *NullableCapabilitySettings { + return &NullableCapabilitySettings{value: val, isSet: true} +} + +func (v NullableCapabilitySettings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilitySettings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CapabilitySettings) isValidInterval() bool { + var allowedEnumValues = []string{ "daily", "monthly", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetInterval() == allowed { + return true + } + } + return false +} + diff --git a/src/balanceplatform/model_capital_balance.go b/src/balanceplatform/model_capital_balance.go index c6023cc6d..32a39f373 100644 --- a/src/balanceplatform/model_capital_balance.go +++ b/src/balanceplatform/model_capital_balance.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapitalBalance type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *CapitalBalance) SetTotal(v int64) { } func (o CapitalBalance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableCapitalBalance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_capital_grant_account.go b/src/balanceplatform/model_capital_grant_account.go index 9417f3c6c..8744b0539 100644 --- a/src/balanceplatform/model_capital_grant_account.go +++ b/src/balanceplatform/model_capital_grant_account.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapitalGrantAccount type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *CapitalGrantAccount) SetLimits(v []GrantLimit) { } func (o CapitalGrantAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableCapitalGrantAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_card.go b/src/balanceplatform/model_card.go index 72754d237..6cccea173 100644 --- a/src/balanceplatform/model_card.go +++ b/src/balanceplatform/model_card.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -27,12 +26,12 @@ type Card struct { // The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. BrandVariant string `json:"brandVariant"` // The name of the cardholder. Maximum length: 26 characters. - CardholderName string `json:"cardholderName"` - Configuration *CardConfiguration `json:"configuration,omitempty"` + CardholderName string `json:"cardholderName"` + Configuration *CardConfiguration `json:"configuration,omitempty"` // The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. - Cvc *string `json:"cvc,omitempty"` + Cvc *string `json:"cvc,omitempty"` DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` - Expiration *Expiry `json:"expiration,omitempty"` + Expiration *Expiry `json:"expiration,omitempty"` // The form factor of the card. Possible values: **virtual**, **physical**. FormFactor string `json:"formFactor"` // Last last four digits of the card number. @@ -408,7 +407,7 @@ func (o *Card) SetNumber(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -442,7 +441,7 @@ func (o Card) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.LastFour) { toSerialize["lastFour"] = o.LastFour } - // skip: number is readOnly + toSerialize["number"] = o.Number return toSerialize, nil } @@ -482,12 +481,14 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Card) isValidFormFactor() bool { - var allowedEnumValues = []string{"physical", "unknown", "virtual"} - for _, allowed := range allowedEnumValues { - if o.GetFormFactor() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "physical", "unknown", "virtual" } + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_card_configuration.go b/src/balanceplatform/model_card_configuration.go index 49262af48..c383c993a 100644 --- a/src/balanceplatform/model_card_configuration.go +++ b/src/balanceplatform/model_card_configuration.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardConfiguration type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type CardConfiguration struct { // Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. Activation *string `json:"activation,omitempty"` // Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. - ActivationUrl *string `json:"activationUrl,omitempty"` - BulkAddress *BulkAddress `json:"bulkAddress,omitempty"` + ActivationUrl *string `json:"activationUrl,omitempty"` + BulkAddress *BulkAddress `json:"bulkAddress,omitempty"` // The ID of the card image. This is the image that will be printed on the full front of the card. CardImageId *string `json:"cardImageId,omitempty"` // Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. @@ -34,7 +33,7 @@ type CardConfiguration struct { ConfigurationProfileId string `json:"configurationProfileId"` // The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. Currency *string `json:"currency,omitempty"` - // Overrides the envelope design ID defined in the `configurationProfileId`. + // Overrides the envelope design ID defined in the `configurationProfileId`. Envelope *string `json:"envelope,omitempty"` // Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. Insert *string `json:"insert,omitempty"` @@ -507,7 +506,7 @@ func (o *CardConfiguration) SetShipmentMethod(v string) { } func (o CardConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -594,3 +593,6 @@ func (v *NullableCardConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_card_info.go b/src/balanceplatform/model_card_info.go index f9eba5713..41a4312fe 100644 --- a/src/balanceplatform/model_card_info.go +++ b/src/balanceplatform/model_card_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardInfo type satisfies the MappedNullable interface at compile time @@ -25,9 +24,9 @@ type CardInfo struct { // The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. BrandVariant string `json:"brandVariant"` // The name of the cardholder. Maximum length: 26 characters. - CardholderName string `json:"cardholderName"` - Configuration *CardConfiguration `json:"configuration,omitempty"` - DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` + CardholderName string `json:"cardholderName"` + Configuration *CardConfiguration `json:"configuration,omitempty"` + DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` // The form factor of the card. Possible values: **virtual**, **physical**. FormFactor string `json:"formFactor"` } @@ -246,7 +245,7 @@ func (o *CardInfo) SetFormFactor(v string) { } func (o CardInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -307,12 +306,14 @@ func (v *NullableCardInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CardInfo) isValidFormFactor() bool { - var allowedEnumValues = []string{"physical", "unknown", "virtual"} - for _, allowed := range allowedEnumValues { - if o.GetFormFactor() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "physical", "unknown", "virtual" } + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_contact_details.go b/src/balanceplatform/model_contact_details.go index 647d57da1..8a0c71915 100644 --- a/src/balanceplatform/model_contact_details.go +++ b/src/balanceplatform/model_contact_details.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ContactDetails type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type ContactDetails struct { Address Address `json:"address"` // The email address of the account holder. Email string `json:"email"` - Phone Phone `json:"phone"` + Phone Phone `json:"phone"` // The URL of the account holder's website. WebAddress *string `json:"webAddress,omitempty"` } @@ -152,7 +151,7 @@ func (o *ContactDetails) SetWebAddress(v string) { } func (o ContactDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -205,3 +204,6 @@ func (v *NullableContactDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_countries_restriction.go b/src/balanceplatform/model_countries_restriction.go index c48fc3fa4..4d599e6bc 100644 --- a/src/balanceplatform/model_countries_restriction.go +++ b/src/balanceplatform/model_countries_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CountriesRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *CountriesRestriction) SetValue(v []string) { } func (o CountriesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableCountriesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_cron_sweep_schedule.go b/src/balanceplatform/model_cron_sweep_schedule.go index f953b1869..fec319078 100644 --- a/src/balanceplatform/model_cron_sweep_schedule.go +++ b/src/balanceplatform/model_cron_sweep_schedule.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CronSweepSchedule type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &CronSweepSchedule{} type CronSweepSchedule struct { // A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. CronExpression string `json:"cronExpression"` - // The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + // The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. Type *string `json:"type,omitempty"` } @@ -100,7 +99,7 @@ func (o *CronSweepSchedule) SetType(v string) { } func (o CronSweepSchedule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableCronSweepSchedule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CronSweepSchedule) isValidType() bool { - var allowedEnumValues = []string{"daily", "weekly", "monthly", "balance", "cron"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "weekly", "monthly", "balance", "cron" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_cz_local_account_identification.go b/src/balanceplatform/model_cz_local_account_identification.go index 282cf17c6..9393b2a06 100644 --- a/src/balanceplatform/model_cz_local_account_identification.go +++ b/src/balanceplatform/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_day_of_week_restriction.go b/src/balanceplatform/model_day_of_week_restriction.go index 68674f0a9..f412b396c 100644 --- a/src/balanceplatform/model_day_of_week_restriction.go +++ b/src/balanceplatform/model_day_of_week_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DayOfWeekRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &DayOfWeekRestriction{} type DayOfWeekRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. + // List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *DayOfWeekRestriction) SetValue(v []string) { } func (o DayOfWeekRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableDayOfWeekRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_delivery_address.go b/src/balanceplatform/model_delivery_address.go new file mode 100644 index 000000000..cb8a312f8 --- /dev/null +++ b/src/balanceplatform/model_delivery_address.go @@ -0,0 +1,340 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the DeliveryAddress type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &DeliveryAddress{} + +// DeliveryAddress struct for DeliveryAddress +type DeliveryAddress struct { + // The name of the city. + City *string `json:"city,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + Country string `json:"country"` + // First line of the address. + Line1 *string `json:"line1,omitempty"` + // Second line of the address. + Line2 *string `json:"line2,omitempty"` + // Third line of the address. + Line3 *string `json:"line3,omitempty"` + // The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + PostalCode *string `json:"postalCode,omitempty"` + // The two-letterISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` +} + +// NewDeliveryAddress instantiates a new DeliveryAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeliveryAddress(country string) *DeliveryAddress { + this := DeliveryAddress{} + this.Country = country + return &this +} + +// NewDeliveryAddressWithDefaults instantiates a new DeliveryAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeliveryAddressWithDefaults() *DeliveryAddress { + this := DeliveryAddress{} + return &this +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *DeliveryAddress) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *DeliveryAddress) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *DeliveryAddress) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value +func (o *DeliveryAddress) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *DeliveryAddress) SetCountry(v string) { + o.Country = v +} + +// GetLine1 returns the Line1 field value if set, zero value otherwise. +func (o *DeliveryAddress) GetLine1() string { + if o == nil || common.IsNil(o.Line1) { + var ret string + return ret + } + return *o.Line1 +} + +// GetLine1Ok returns a tuple with the Line1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetLine1Ok() (*string, bool) { + if o == nil || common.IsNil(o.Line1) { + return nil, false + } + return o.Line1, true +} + +// HasLine1 returns a boolean if a field has been set. +func (o *DeliveryAddress) HasLine1() bool { + if o != nil && !common.IsNil(o.Line1) { + return true + } + + return false +} + +// SetLine1 gets a reference to the given string and assigns it to the Line1 field. +func (o *DeliveryAddress) SetLine1(v string) { + o.Line1 = &v +} + +// GetLine2 returns the Line2 field value if set, zero value otherwise. +func (o *DeliveryAddress) GetLine2() string { + if o == nil || common.IsNil(o.Line2) { + var ret string + return ret + } + return *o.Line2 +} + +// GetLine2Ok returns a tuple with the Line2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetLine2Ok() (*string, bool) { + if o == nil || common.IsNil(o.Line2) { + return nil, false + } + return o.Line2, true +} + +// HasLine2 returns a boolean if a field has been set. +func (o *DeliveryAddress) HasLine2() bool { + if o != nil && !common.IsNil(o.Line2) { + return true + } + + return false +} + +// SetLine2 gets a reference to the given string and assigns it to the Line2 field. +func (o *DeliveryAddress) SetLine2(v string) { + o.Line2 = &v +} + +// GetLine3 returns the Line3 field value if set, zero value otherwise. +func (o *DeliveryAddress) GetLine3() string { + if o == nil || common.IsNil(o.Line3) { + var ret string + return ret + } + return *o.Line3 +} + +// GetLine3Ok returns a tuple with the Line3 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetLine3Ok() (*string, bool) { + if o == nil || common.IsNil(o.Line3) { + return nil, false + } + return o.Line3, true +} + +// HasLine3 returns a boolean if a field has been set. +func (o *DeliveryAddress) HasLine3() bool { + if o != nil && !common.IsNil(o.Line3) { + return true + } + + return false +} + +// SetLine3 gets a reference to the given string and assigns it to the Line3 field. +func (o *DeliveryAddress) SetLine3(v string) { + o.Line3 = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *DeliveryAddress) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *DeliveryAddress) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *DeliveryAddress) SetPostalCode(v string) { + o.PostalCode = &v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *DeliveryAddress) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *DeliveryAddress) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *DeliveryAddress) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +func (o DeliveryAddress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeliveryAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + toSerialize["country"] = o.Country + if !common.IsNil(o.Line1) { + toSerialize["line1"] = o.Line1 + } + if !common.IsNil(o.Line2) { + toSerialize["line2"] = o.Line2 + } + if !common.IsNil(o.Line3) { + toSerialize["line3"] = o.Line3 + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + return toSerialize, nil +} + +type NullableDeliveryAddress struct { + value *DeliveryAddress + isSet bool +} + +func (v NullableDeliveryAddress) Get() *DeliveryAddress { + return v.value +} + +func (v *NullableDeliveryAddress) Set(val *DeliveryAddress) { + v.value = val + v.isSet = true +} + +func (v NullableDeliveryAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableDeliveryAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeliveryAddress(val *DeliveryAddress) *NullableDeliveryAddress { + return &NullableDeliveryAddress{value: val, isSet: true} +} + +func (v NullableDeliveryAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeliveryAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/balanceplatform/model_delivery_contact.go b/src/balanceplatform/model_delivery_contact.go index 74eb42dd4..f1c1a8342 100644 --- a/src/balanceplatform/model_delivery_contact.go +++ b/src/balanceplatform/model_delivery_contact.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DeliveryContact type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &DeliveryContact{} // DeliveryContact struct for DeliveryContact type DeliveryContact struct { - Address Address2 `json:"address"` + Address DeliveryAddress `json:"address"` // The email address of the contact. Email *string `json:"email,omitempty"` // The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" - FullPhoneNumber *string `json:"fullPhoneNumber,omitempty"` - Name Name `json:"name"` - PhoneNumber *PhoneNumber `json:"phoneNumber,omitempty"` + FullPhoneNumber *string `json:"fullPhoneNumber,omitempty"` + Name Name `json:"name"` + PhoneNumber *PhoneNumber `json:"phoneNumber,omitempty"` // The URL of the contact's website. WebAddress *string `json:"webAddress,omitempty"` } @@ -34,7 +33,7 @@ type DeliveryContact struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeliveryContact(address Address2, name Name) *DeliveryContact { +func NewDeliveryContact(address DeliveryAddress, name Name) *DeliveryContact { this := DeliveryContact{} this.Address = address this.Name = name @@ -50,9 +49,9 @@ func NewDeliveryContactWithDefaults() *DeliveryContact { } // GetAddress returns the Address field value -func (o *DeliveryContact) GetAddress() Address2 { +func (o *DeliveryContact) GetAddress() DeliveryAddress { if o == nil { - var ret Address2 + var ret DeliveryAddress return ret } @@ -61,7 +60,7 @@ func (o *DeliveryContact) GetAddress() Address2 { // GetAddressOk returns a tuple with the Address field value // and a boolean to check if the value has been set. -func (o *DeliveryContact) GetAddressOk() (*Address2, bool) { +func (o *DeliveryContact) GetAddressOk() (*DeliveryAddress, bool) { if o == nil { return nil, false } @@ -69,7 +68,7 @@ func (o *DeliveryContact) GetAddressOk() (*Address2, bool) { } // SetAddress sets field value -func (o *DeliveryContact) SetAddress(v Address2) { +func (o *DeliveryContact) SetAddress(v DeliveryAddress) { o.Address = v } @@ -226,7 +225,7 @@ func (o *DeliveryContact) SetWebAddress(v string) { } func (o DeliveryContact) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -287,3 +286,6 @@ func (v *NullableDeliveryContact) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_different_currencies_restriction.go b/src/balanceplatform/model_different_currencies_restriction.go index 759558121..34406bcf8 100644 --- a/src/balanceplatform/model_different_currencies_restriction.go +++ b/src/balanceplatform/model_different_currencies_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DifferentCurrenciesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &DifferentCurrenciesRestriction{} type DifferentCurrenciesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. + // Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. Value *bool `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *DifferentCurrenciesRestriction) SetValue(v bool) { } func (o DifferentCurrenciesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableDifferentCurrenciesRestriction) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_duration.go b/src/balanceplatform/model_duration.go index 34d07ce17..8d06827b4 100644 --- a/src/balanceplatform/model_duration.go +++ b/src/balanceplatform/model_duration.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Duration type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Duration) SetValue(v int32) { } func (o Duration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableDuration) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Duration) isValidUnit() bool { - var allowedEnumValues = []string{"days", "hours", "minutes", "months", "weeks"} - for _, allowed := range allowedEnumValues { - if o.GetUnit() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "days", "hours", "minutes", "months", "weeks" } + for _, allowed := range allowedEnumValues { + if o.GetUnit() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_entry_modes_restriction.go b/src/balanceplatform/model_entry_modes_restriction.go index ebdb7073d..d052dfff5 100644 --- a/src/balanceplatform/model_entry_modes_restriction.go +++ b/src/balanceplatform/model_entry_modes_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the EntryModesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &EntryModesRestriction{} type EntryModesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of point-of-sale entry modes. Possible values: **barcode**, **chip**, **cof**, **contactless**, **magstripe**, **manual**, **ocr**, **server**. + // List of point-of-sale entry modes. Possible values: **barcode**, **chip**, **cof**, **contactless**, **magstripe**, **manual**, **ocr**, **server**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *EntryModesRestriction) SetValue(v []string) { } func (o EntryModesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableEntryModesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_expiry.go b/src/balanceplatform/model_expiry.go index 04ecfe926..4c9bb5cbe 100644 --- a/src/balanceplatform/model_expiry.go +++ b/src/balanceplatform/model_expiry.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Expiry type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Expiry) SetYear(v string) { } func (o Expiry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableExpiry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_fee.go b/src/balanceplatform/model_fee.go index fcdaec650..da4f92c77 100644 --- a/src/balanceplatform/model_fee.go +++ b/src/balanceplatform/model_fee.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Fee type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *Fee) SetAmount(v Amount) { } func (o Fee) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableFee) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_grant_limit.go b/src/balanceplatform/model_grant_limit.go index 811a7626d..59f6fbb17 100644 --- a/src/balanceplatform/model_grant_limit.go +++ b/src/balanceplatform/model_grant_limit.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GrantLimit type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *GrantLimit) SetAmount(v Amount) { } func (o GrantLimit) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableGrantLimit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_grant_offer.go b/src/balanceplatform/model_grant_offer.go index 343163b77..45e6d478e 100644 --- a/src/balanceplatform/model_grant_offer.go +++ b/src/balanceplatform/model_grant_offer.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GrantOffer type satisfies the MappedNullable interface at compile time @@ -20,16 +19,16 @@ var _ common.MappedNullable = &GrantOffer{} // GrantOffer struct for GrantOffer type GrantOffer struct { // The identifier of the account holder to which the grant is offered. - AccountHolderId string `json:"accountHolderId"` - Amount *Amount `json:"amount,omitempty"` + AccountHolderId string `json:"accountHolderId"` + Amount *Amount `json:"amount,omitempty"` // The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. - ContractType *string `json:"contractType,omitempty"` - ExpiresAt map[string]interface{} `json:"expiresAt,omitempty"` - Fee *Fee `json:"fee,omitempty"` + ContractType *string `json:"contractType,omitempty"` + ExpiresAt map[string]interface{} `json:"expiresAt,omitempty"` + Fee *Fee `json:"fee,omitempty"` // The unique identifier of the grant offer. - Id *string `json:"id,omitempty"` - Repayment *Repayment `json:"repayment,omitempty"` - StartsAt map[string]interface{} `json:"startsAt,omitempty"` + Id *string `json:"id,omitempty"` + Repayment *Repayment `json:"repayment,omitempty"` + StartsAt map[string]interface{} `json:"startsAt,omitempty"` } // NewGrantOffer instantiates a new GrantOffer object @@ -299,7 +298,7 @@ func (o *GrantOffer) SetStartsAt(v map[string]interface{}) { } func (o GrantOffer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -369,12 +368,14 @@ func (v *NullableGrantOffer) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GrantOffer) isValidContractType() bool { - var allowedEnumValues = []string{"cashAdvance", "loan"} - for _, allowed := range allowedEnumValues { - if o.GetContractType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "cashAdvance", "loan" } + for _, allowed := range allowedEnumValues { + if o.GetContractType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_grant_offers.go b/src/balanceplatform/model_grant_offers.go index e83b16b30..e4103ea00 100644 --- a/src/balanceplatform/model_grant_offers.go +++ b/src/balanceplatform/model_grant_offers.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GrantOffers type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GrantOffers) SetGrantOffers(v []GrantOffer) { } func (o GrantOffers) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGrantOffers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_hu_local_account_identification.go b/src/balanceplatform/model_hu_local_account_identification.go index 551cdffcc..3c6088ac5 100644 --- a/src/balanceplatform/model_hu_local_account_identification.go +++ b/src/balanceplatform/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_iban_account_identification.go b/src/balanceplatform/model_iban_account_identification.go index f9ffa90a4..480545ed6 100644 --- a/src/balanceplatform/model_iban_account_identification.go +++ b/src/balanceplatform/model_iban_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_international_transaction_restriction.go b/src/balanceplatform/model_international_transaction_restriction.go index 07d7059bb..827b00267 100644 --- a/src/balanceplatform/model_international_transaction_restriction.go +++ b/src/balanceplatform/model_international_transaction_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InternationalTransactionRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &InternationalTransactionRestriction{} type InternationalTransactionRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. + // Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. Value *bool `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *InternationalTransactionRestriction) SetValue(v bool) { } func (o InternationalTransactionRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableInternationalTransactionRestriction) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_invalid_field.go b/src/balanceplatform/model_invalid_field.go index b846184e8..7014637de 100644 --- a/src/balanceplatform/model_invalid_field.go +++ b/src/balanceplatform/model_invalid_field.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_json_object.go b/src/balanceplatform/model_json_object.go index 65f46849b..94e946030 100644 --- a/src/balanceplatform/model_json_object.go +++ b/src/balanceplatform/model_json_object.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONObject type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &JSONObject{} // JSONObject struct for JSONObject type JSONObject struct { - Paths []JSONPath `json:"paths,omitempty"` - RootPath *JSONPath `json:"rootPath,omitempty"` + Paths []JSONPath `json:"paths,omitempty"` + RootPath *JSONPath `json:"rootPath,omitempty"` } // NewJSONObject instantiates a new JSONObject object @@ -105,7 +104,7 @@ func (o *JSONObject) SetRootPath(v JSONPath) { } func (o JSONObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableJSONObject) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_json_path.go b/src/balanceplatform/model_json_path.go index 1d01e4b60..39f9572e1 100644 --- a/src/balanceplatform/model_json_path.go +++ b/src/balanceplatform/model_json_path.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONPath type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *JSONPath) SetContent(v []string) { } func (o JSONPath) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableJSONPath) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_matching_transactions_restriction.go b/src/balanceplatform/model_matching_transactions_restriction.go index 62a29e0d3..1dff55402 100644 --- a/src/balanceplatform/model_matching_transactions_restriction.go +++ b/src/balanceplatform/model_matching_transactions_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MatchingTransactionsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MatchingTransactionsRestriction) SetValue(v int32) { } func (o MatchingTransactionsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMatchingTransactionsRestriction) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_mccs_restriction.go b/src/balanceplatform/model_mccs_restriction.go index acd9439a9..08665f5cb 100644 --- a/src/balanceplatform/model_mccs_restriction.go +++ b/src/balanceplatform/model_mccs_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MccsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MccsRestriction) SetValue(v []string) { } func (o MccsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMccsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchant_acquirer_pair.go b/src/balanceplatform/model_merchant_acquirer_pair.go index 2d62e68db..ffb4acf6c 100644 --- a/src/balanceplatform/model_merchant_acquirer_pair.go +++ b/src/balanceplatform/model_merchant_acquirer_pair.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantAcquirerPair type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *MerchantAcquirerPair) SetMerchantId(v string) { } func (o MerchantAcquirerPair) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableMerchantAcquirerPair) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchant_names_restriction.go b/src/balanceplatform/model_merchant_names_restriction.go index a85a78623..21c695429 100644 --- a/src/balanceplatform/model_merchant_names_restriction.go +++ b/src/balanceplatform/model_merchant_names_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantNamesRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &MerchantNamesRestriction{} // MerchantNamesRestriction struct for MerchantNamesRestriction type MerchantNamesRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value []StringMatch `json:"value,omitempty"` + Operation string `json:"operation"` + Value []StringMatch `json:"value,omitempty"` } // NewMerchantNamesRestriction instantiates a new MerchantNamesRestriction object @@ -99,7 +98,7 @@ func (o *MerchantNamesRestriction) SetValue(v []StringMatch) { } func (o MerchantNamesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableMerchantNamesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchants_restriction.go b/src/balanceplatform/model_merchants_restriction.go index 7a91031c9..a2024e578 100644 --- a/src/balanceplatform/model_merchants_restriction.go +++ b/src/balanceplatform/model_merchants_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MerchantsRestriction) SetValue(v []MerchantAcquirerPair) { } func (o MerchantsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMerchantsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_name.go b/src/balanceplatform/model_name.go index afbb24daa..056d60f3c 100644 --- a/src/balanceplatform/model_name.go +++ b/src/balanceplatform/model_name.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_no_local_account_identification.go b/src/balanceplatform/model_no_local_account_identification.go index 18ee14759..ac2606ee5 100644 --- a/src/balanceplatform/model_no_local_account_identification.go +++ b/src/balanceplatform/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_number_and_bic_account_identification.go b/src/balanceplatform/model_number_and_bic_account_identification.go index bbfd01189..fe63509d7 100644 --- a/src/balanceplatform/model_number_and_bic_account_identification.go +++ b/src/balanceplatform/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_paginated_account_holders_response.go b/src/balanceplatform/model_paginated_account_holders_response.go index 060c6ca72..5832a073b 100644 --- a/src/balanceplatform/model_paginated_account_holders_response.go +++ b/src/balanceplatform/model_paginated_account_holders_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaginatedAccountHoldersResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedAccountHoldersResponse) SetHasPrevious(v bool) { } func (o PaginatedAccountHoldersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedAccountHoldersResponse) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_paginated_balance_accounts_response.go b/src/balanceplatform/model_paginated_balance_accounts_response.go index 93f14a278..30608de7d 100644 --- a/src/balanceplatform/model_paginated_balance_accounts_response.go +++ b/src/balanceplatform/model_paginated_balance_accounts_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaginatedBalanceAccountsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedBalanceAccountsResponse) SetHasPrevious(v bool) { } func (o PaginatedBalanceAccountsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedBalanceAccountsResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_paginated_payment_instruments_response.go b/src/balanceplatform/model_paginated_payment_instruments_response.go index 6b3590d4e..3669c3bee 100644 --- a/src/balanceplatform/model_paginated_payment_instruments_response.go +++ b/src/balanceplatform/model_paginated_payment_instruments_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaginatedPaymentInstrumentsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedPaymentInstrumentsResponse) SetPaymentInstruments(v []PaymentI } func (o PaginatedPaymentInstrumentsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedPaymentInstrumentsResponse) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument.go b/src/balanceplatform/model_payment_instrument.go index b33e34dc5..3d374fdf2 100644 --- a/src/balanceplatform/model_payment_instrument.go +++ b/src/balanceplatform/model_payment_instrument.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &PaymentInstrument{} // PaymentInstrument struct for PaymentInstrument type PaymentInstrument struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` - Card *Card `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` + Card *Card `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the payment instrument. @@ -33,11 +32,11 @@ type PaymentInstrument struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` - // The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -383,7 +382,7 @@ func (o *PaymentInstrument) SetType(v string) { } func (o PaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,30 +455,32 @@ func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrument) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrument) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *PaymentInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_payment_instrument_bank_account.go b/src/balanceplatform/model_payment_instrument_bank_account.go index b7bc991ed..89caa9910 100644 --- a/src/balanceplatform/model_payment_instrument_bank_account.go +++ b/src/balanceplatform/model_payment_instrument_bank_account.go @@ -10,12 +10,13 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // PaymentInstrumentBankAccount - Contains the business account details. Returned when you create a payment instrument with `type` **bankAccount**. type PaymentInstrumentBankAccount struct { - IbanAccountIdentification *IbanAccountIdentification + IbanAccountIdentification *IbanAccountIdentification USLocalAccountIdentification *USLocalAccountIdentification } @@ -33,6 +34,7 @@ func USLocalAccountIdentificationAsPaymentInstrumentBankAccount(v *USLocalAccoun } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { var err error @@ -43,7 +45,7 @@ func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -56,7 +58,7 @@ func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -90,7 +92,7 @@ func (src PaymentInstrumentBankAccount) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *PaymentInstrumentBankAccount) GetActualInstance() interface{} { +func (obj *PaymentInstrumentBankAccount) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -141,3 +143,5 @@ func (v *NullablePaymentInstrumentBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_payment_instrument_group.go b/src/balanceplatform/model_payment_instrument_group.go index 30064caab..03d77f6b6 100644 --- a/src/balanceplatform/model_payment_instrument_group.go +++ b/src/balanceplatform/model_payment_instrument_group.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrumentGroup type satisfies the MappedNullable interface at compile time @@ -229,7 +228,7 @@ func (o *PaymentInstrumentGroup) SetTxVariant(v string) { } func (o PaymentInstrumentGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -290,3 +289,6 @@ func (v *NullablePaymentInstrumentGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_group_info.go b/src/balanceplatform/model_payment_instrument_group_info.go index 7cbd60abb..9b67e8f90 100644 --- a/src/balanceplatform/model_payment_instrument_group_info.go +++ b/src/balanceplatform/model_payment_instrument_group_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrumentGroupInfo type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *PaymentInstrumentGroupInfo) SetTxVariant(v string) { } func (o PaymentInstrumentGroupInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullablePaymentInstrumentGroupInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_info.go b/src/balanceplatform/model_payment_instrument_info.go index eb6154c41..2dc7a7325 100644 --- a/src/balanceplatform/model_payment_instrument_info.go +++ b/src/balanceplatform/model_payment_instrument_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrumentInfo type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &PaymentInstrumentInfo{} // PaymentInstrumentInfo struct for PaymentInstrumentInfo type PaymentInstrumentInfo struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - Card *CardInfo `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + Card *CardInfo `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. @@ -30,11 +29,11 @@ type PaymentInstrumentInfo struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` - // The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -323,7 +322,7 @@ func (o *PaymentInstrumentInfo) SetType(v string) { } func (o PaymentInstrumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -392,30 +391,32 @@ func (v *NullablePaymentInstrumentInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrumentInfo) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentInfo) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentInfo) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_payment_instrument_reveal_info.go b/src/balanceplatform/model_payment_instrument_reveal_info.go index c778f00c3..18c95971f 100644 --- a/src/balanceplatform/model_payment_instrument_reveal_info.go +++ b/src/balanceplatform/model_payment_instrument_reveal_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrumentRevealInfo type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &PaymentInstrumentRevealInfo{} // PaymentInstrumentRevealInfo struct for PaymentInstrumentRevealInfo type PaymentInstrumentRevealInfo struct { // The CVC2 value of the card. - Cvc string `json:"cvc"` + Cvc string `json:"cvc"` Expiration Expiry `json:"expiration"` // The primary account number (PAN) of the card. Pan string `json:"pan"` @@ -119,7 +118,7 @@ func (o *PaymentInstrumentRevealInfo) SetPan(v string) { } func (o PaymentInstrumentRevealInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -169,3 +168,6 @@ func (v *NullablePaymentInstrumentRevealInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_update_request.go b/src/balanceplatform/model_payment_instrument_update_request.go index f7357aa73..6753e4931 100644 --- a/src/balanceplatform/model_payment_instrument_update_request.go +++ b/src/balanceplatform/model_payment_instrument_update_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrumentUpdateRequest type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &PaymentInstrumentUpdateRequest{} // PaymentInstrumentUpdateRequest struct for PaymentInstrumentUpdateRequest type PaymentInstrumentUpdateRequest struct { // The unique identifier of the balance account associated with this payment instrument. >You can only change the balance account ID if the payment instrument has **inactive** status. - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - Card *CardInfo `json:"card,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + Card *CardInfo `json:"card,omitempty"` + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // Comment for the status of the payment instrument. Required if `statusReason` is **other**. StatusComment *string `json:"statusComment,omitempty"` @@ -208,7 +207,7 @@ func (o *PaymentInstrumentUpdateRequest) SetStatusReason(v string) { } func (o PaymentInstrumentUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,21 +270,23 @@ func (v *NullablePaymentInstrumentUpdateRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrumentUpdateRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentUpdateRequest) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_phone.go b/src/balanceplatform/model_phone.go index c53eca893..b87a36785 100644 --- a/src/balanceplatform/model_phone.go +++ b/src/balanceplatform/model_phone.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &Phone{} type Phone struct { // The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. Number string `json:"number"` - // Type of phone number. Possible values: **Landline**, **Mobile**. + // Type of phone number. Possible values: **Landline**, **Mobile**. Type string `json:"type"` } @@ -93,7 +92,7 @@ func (o *Phone) SetType(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -143,12 +142,14 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Phone) isValidType() bool { - var allowedEnumValues = []string{"landline", "mobile"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "landline", "mobile" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_phone_number.go b/src/balanceplatform/model_phone_number.go index 4fa136900..2285bee15 100644 --- a/src/balanceplatform/model_phone_number.go +++ b/src/balanceplatform/model_phone_number.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PhoneNumber type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PhoneNumber) SetPhoneType(v string) { } func (o PhoneNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PhoneNumber) isValidPhoneType() bool { - var allowedEnumValues = []string{"Fax", "Landline", "Mobile", "SIP"} - for _, allowed := range allowedEnumValues { - if o.GetPhoneType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Fax", "Landline", "Mobile", "SIP" } + for _, allowed := range allowedEnumValues { + if o.GetPhoneType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_pl_local_account_identification.go b/src/balanceplatform/model_pl_local_account_identification.go index 73291f8a2..382d67861 100644 --- a/src/balanceplatform/model_pl_local_account_identification.go +++ b/src/balanceplatform/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_processing_types_restriction.go b/src/balanceplatform/model_processing_types_restriction.go index 3f8ed3828..6c4f2a37c 100644 --- a/src/balanceplatform/model_processing_types_restriction.go +++ b/src/balanceplatform/model_processing_types_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ProcessingTypesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &ProcessingTypesRestriction{} type ProcessingTypesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of processing types. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **recurring**, **token**. + // List of processing types. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **recurring**, **token**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *ProcessingTypesRestriction) SetValue(v []string) { } func (o ProcessingTypesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableProcessingTypesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_repayment.go b/src/balanceplatform/model_repayment.go index 6270439c9..10967d4a1 100644 --- a/src/balanceplatform/model_repayment.go +++ b/src/balanceplatform/model_repayment.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Repayment type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &Repayment{} // Repayment struct for Repayment type Repayment struct { // The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - BasisPoints int32 `json:"basisPoints"` - Term *RepaymentTerm `json:"term,omitempty"` - Threshold *ThresholdRepayment `json:"threshold,omitempty"` + BasisPoints int32 `json:"basisPoints"` + Term *RepaymentTerm `json:"term,omitempty"` + Threshold *ThresholdRepayment `json:"threshold,omitempty"` } // NewRepayment instantiates a new Repayment object @@ -132,7 +131,7 @@ func (o *Repayment) SetThreshold(v ThresholdRepayment) { } func (o Repayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -186,3 +185,6 @@ func (v *NullableRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_repayment_term.go b/src/balanceplatform/model_repayment_term.go index 129ca2f2d..d0dcd09f6 100644 --- a/src/balanceplatform/model_repayment_term.go +++ b/src/balanceplatform/model_repayment_term.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RepaymentTerm type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *RepaymentTerm) SetMaximumDays(v int32) { } func (o RepaymentTerm) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableRepaymentTerm) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_rest_service_error.go b/src/balanceplatform/model_rest_service_error.go index f217f18ae..ce22a9e8a 100644 --- a/src/balanceplatform/model_rest_service_error.go +++ b/src/balanceplatform/model_rest_service_error.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidField `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - Response *JSONObject `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response *JSONObject `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -309,7 +308,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -373,3 +372,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_se_local_account_identification.go b/src/balanceplatform/model_se_local_account_identification.go index 1fc1c7416..a7c7c1cce 100644 --- a/src/balanceplatform/model_se_local_account_identification.go +++ b/src/balanceplatform/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sg_local_account_identification.go b/src/balanceplatform/model_sg_local_account_identification.go index 5551e0b6a..1d4c73f59 100644 --- a/src/balanceplatform/model_sg_local_account_identification.go +++ b/src/balanceplatform/model_sg_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *SGLocalAccountIdentification) SetType(v string) { } func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,12 +183,14 @@ func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SGLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"sgLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_string_match.go b/src/balanceplatform/model_string_match.go index df66e737c..b9b39dd08 100644 --- a/src/balanceplatform/model_string_match.go +++ b/src/balanceplatform/model_string_match.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StringMatch type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *StringMatch) SetValue(v string) { } func (o StringMatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableStringMatch) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StringMatch) isValidOperation() bool { - var allowedEnumValues = []string{"contains", "endsWith", "isEqualTo", "startsWith"} - for _, allowed := range allowedEnumValues { - if o.GetOperation() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "contains", "endsWith", "isEqualTo", "startsWith" } + for _, allowed := range allowedEnumValues { + if o.GetOperation() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sweep_configuration_v2.go b/src/balanceplatform/model_sweep_configuration_v2.go index 5b13237c2..6aa92fe81 100644 --- a/src/balanceplatform/model_sweep_configuration_v2.go +++ b/src/balanceplatform/model_sweep_configuration_v2.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SweepConfigurationV2 type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &SweepConfigurationV2{} // SweepConfigurationV2 struct for SweepConfigurationV2 type SweepConfigurationV2 struct { // The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. - Category *string `json:"category,omitempty"` + Category *string `json:"category,omitempty"` Counterparty SweepCounterparty `json:"counterparty"` // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). Currency string `json:"currency"` @@ -31,12 +30,12 @@ type SweepConfigurationV2 struct { // The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). Priorities []string `json:"priorities,omitempty"` // The reason for disabling the sweep. - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` Schedule SweepConfigurationV2Schedule `json:"schedule"` - // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. - Status *string `json:"status,omitempty"` - SweepAmount *Amount `json:"sweepAmount,omitempty"` - TargetAmount *Amount `json:"targetAmount,omitempty"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` TriggerAmount *Amount `json:"triggerAmount,omitempty"` // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. Type *string `json:"type,omitempty"` @@ -452,7 +451,7 @@ func (o *SweepConfigurationV2) SetType(v string) { } func (o SweepConfigurationV2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -469,11 +468,13 @@ func (o SweepConfigurationV2) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } - // skip: id is readOnly + toSerialize["id"] = o.Id if !common.IsNil(o.Priorities) { toSerialize["priorities"] = o.Priorities } - // skip: reason is readOnly + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } toSerialize["schedule"] = o.Schedule if !common.IsNil(o.Status) { toSerialize["status"] = o.Status @@ -529,39 +530,41 @@ func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SweepConfigurationV2) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidType() bool { - var allowedEnumValues = []string{"pull", "push"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "pull", "push" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sweep_configuration_v2_schedule.go b/src/balanceplatform/model_sweep_configuration_v2_schedule.go index f0f339990..2dbd623bd 100644 --- a/src/balanceplatform/model_sweep_configuration_v2_schedule.go +++ b/src/balanceplatform/model_sweep_configuration_v2_schedule.go @@ -10,13 +10,14 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // SweepConfigurationV2Schedule - The schedule when the `triggerAmount` is evaluated. If the balance meets the threshold, funds are pushed out of or pulled in to the balance account. type SweepConfigurationV2Schedule struct { CronSweepSchedule *CronSweepSchedule - SweepSchedule *SweepSchedule + SweepSchedule *SweepSchedule } // CronSweepScheduleAsSweepConfigurationV2Schedule is a convenience function that returns CronSweepSchedule wrapped in SweepConfigurationV2Schedule @@ -33,6 +34,7 @@ func SweepScheduleAsSweepConfigurationV2Schedule(v *SweepSchedule) SweepConfigur } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *SweepConfigurationV2Schedule) UnmarshalJSON(data []byte) error { var err error @@ -43,7 +45,7 @@ func (dst *SweepConfigurationV2Schedule) UnmarshalJSON(data []byte) error { jsonCronSweepSchedule, _ := json.Marshal(dst.CronSweepSchedule) if string(jsonCronSweepSchedule) == "{}" || !dst.CronSweepSchedule.isValidType() { // empty struct dst.CronSweepSchedule = nil - } else { + } else { match++ } } else { @@ -56,7 +58,7 @@ func (dst *SweepConfigurationV2Schedule) UnmarshalJSON(data []byte) error { jsonSweepSchedule, _ := json.Marshal(dst.SweepSchedule) if string(jsonSweepSchedule) == "{}" || !dst.SweepSchedule.isValidType() { // empty struct dst.SweepSchedule = nil - } else { + } else { match++ } } else { @@ -90,7 +92,7 @@ func (src SweepConfigurationV2Schedule) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *SweepConfigurationV2Schedule) GetActualInstance() interface{} { +func (obj *SweepConfigurationV2Schedule) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -141,3 +143,5 @@ func (v *NullableSweepConfigurationV2Schedule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_sweep_counterparty.go b/src/balanceplatform/model_sweep_counterparty.go index 5a14175f8..f463c6d74 100644 --- a/src/balanceplatform/model_sweep_counterparty.go +++ b/src/balanceplatform/model_sweep_counterparty.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SweepCounterparty type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *SweepCounterparty) SetTransferInstrumentId(v string) { } func (o SweepCounterparty) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableSweepCounterparty) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_sweep_schedule.go b/src/balanceplatform/model_sweep_schedule.go index d2f4ecaa4..5ce126221 100644 --- a/src/balanceplatform/model_sweep_schedule.go +++ b/src/balanceplatform/model_sweep_schedule.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SweepSchedule type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &SweepSchedule{} // SweepSchedule struct for SweepSchedule type SweepSchedule struct { - // The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + // The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. Type *string `json:"type,omitempty"` } @@ -73,7 +72,7 @@ func (o *SweepSchedule) SetType(v string) { } func (o SweepSchedule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableSweepSchedule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SweepSchedule) isValidType() bool { - var allowedEnumValues = []string{"daily", "weekly", "monthly", "balance", "cron"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "weekly", "monthly", "balance", "cron" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_threshold_repayment.go b/src/balanceplatform/model_threshold_repayment.go index 64424508d..33bd79563 100644 --- a/src/balanceplatform/model_threshold_repayment.go +++ b/src/balanceplatform/model_threshold_repayment.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThresholdRepayment type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *ThresholdRepayment) SetAmount(v Amount) { } func (o ThresholdRepayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableThresholdRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_time_of_day.go b/src/balanceplatform/model_time_of_day.go index 588b8c6eb..9a26c8e52 100644 --- a/src/balanceplatform/model_time_of_day.go +++ b/src/balanceplatform/model_time_of_day.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TimeOfDay type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &TimeOfDay{} // TimeOfDay struct for TimeOfDay type TimeOfDay struct { - // The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + // The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. EndTime *string `json:"endTime,omitempty"` - // The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + // The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. StartTime *string `json:"startTime,omitempty"` } @@ -107,7 +106,7 @@ func (o *TimeOfDay) SetStartTime(v string) { } func (o TimeOfDay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTimeOfDay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_time_of_day_restriction.go b/src/balanceplatform/model_time_of_day_restriction.go index 59820e796..4d9dbfc17 100644 --- a/src/balanceplatform/model_time_of_day_restriction.go +++ b/src/balanceplatform/model_time_of_day_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TimeOfDayRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &TimeOfDayRestriction{} // TimeOfDayRestriction struct for TimeOfDayRestriction type TimeOfDayRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value *TimeOfDay `json:"value,omitempty"` + Operation string `json:"operation"` + Value *TimeOfDay `json:"value,omitempty"` } // NewTimeOfDayRestriction instantiates a new TimeOfDayRestriction object @@ -99,7 +98,7 @@ func (o *TimeOfDayRestriction) SetValue(v TimeOfDay) { } func (o TimeOfDayRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableTimeOfDayRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_total_amount_restriction.go b/src/balanceplatform/model_total_amount_restriction.go index 15b00ad71..51b31bc34 100644 --- a/src/balanceplatform/model_total_amount_restriction.go +++ b/src/balanceplatform/model_total_amount_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TotalAmountRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &TotalAmountRestriction{} // TotalAmountRestriction struct for TotalAmountRestriction type TotalAmountRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value *Amount `json:"value,omitempty"` + Operation string `json:"operation"` + Value *Amount `json:"value,omitempty"` } // NewTotalAmountRestriction instantiates a new TotalAmountRestriction object @@ -99,7 +98,7 @@ func (o *TotalAmountRestriction) SetValue(v Amount) { } func (o TotalAmountRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableTotalAmountRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule.go b/src/balanceplatform/model_transaction_rule.go index 837168d66..a4f9d9547 100644 --- a/src/balanceplatform/model_transaction_rule.go +++ b/src/balanceplatform/model_transaction_rule.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRule type satisfies the MappedNullable interface at compile time @@ -24,25 +23,25 @@ type TransactionRule struct { // Your description for the transaction rule, maximum 300 characters. Description string `json:"description"` // The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. - EndDate *string `json:"endDate,omitempty"` + EndDate *string `json:"endDate,omitempty"` EntityKey TransactionRuleEntityKey `json:"entityKey"` // The unique identifier of the transaction rule. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Interval TransactionRuleInterval `json:"interval"` // The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` // Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. - RequestType *string `json:"requestType,omitempty"` + RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. Score *int32 `json:"score,omitempty"` - // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. StartDate *string `json:"startDate,omitempty"` // The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. Status *string `json:"status,omitempty"` - // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. Type string `json:"type"` } @@ -470,7 +469,7 @@ func (o *TransactionRule) SetType(v string) { } func (o TransactionRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -548,39 +547,41 @@ func (v *NullableTransactionRule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRule) isValidOutcomeType() bool { - var allowedEnumValues = []string{"hardBlock", "scoreBased"} - for _, allowed := range allowedEnumValues { - if o.GetOutcomeType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "hardBlock", "scoreBased" } + for _, allowed := range allowedEnumValues { + if o.GetOutcomeType() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidRequestType() bool { - var allowedEnumValues = []string{"authentication", "authorization", "tokenization"} - for _, allowed := range allowedEnumValues { - if o.GetRequestType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "authentication", "authorization", "tokenization" } + for _, allowed := range allowedEnumValues { + if o.GetRequestType() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidType() bool { - var allowedEnumValues = []string{"allowList", "blockList", "maxUsage", "velocity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allowList", "blockList", "maxUsage", "velocity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_entity_key.go b/src/balanceplatform/model_transaction_rule_entity_key.go index d9a86b42d..64cd3bf0d 100644 --- a/src/balanceplatform/model_transaction_rule_entity_key.go +++ b/src/balanceplatform/model_transaction_rule_entity_key.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRuleEntityKey type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TransactionRuleEntityKey) SetEntityType(v string) { } func (o TransactionRuleEntityKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTransactionRuleEntityKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule_info.go b/src/balanceplatform/model_transaction_rule_info.go index 7f8f46e6c..8ce700270 100644 --- a/src/balanceplatform/model_transaction_rule_info.go +++ b/src/balanceplatform/model_transaction_rule_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRuleInfo type satisfies the MappedNullable interface at compile time @@ -24,23 +23,23 @@ type TransactionRuleInfo struct { // Your description for the transaction rule, maximum 300 characters. Description string `json:"description"` // The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. - EndDate *string `json:"endDate,omitempty"` + EndDate *string `json:"endDate,omitempty"` EntityKey TransactionRuleEntityKey `json:"entityKey"` - Interval TransactionRuleInterval `json:"interval"` + Interval TransactionRuleInterval `json:"interval"` // The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` // Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. - RequestType *string `json:"requestType,omitempty"` + RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. Score *int32 `json:"score,omitempty"` - // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. StartDate *string `json:"startDate,omitempty"` // The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. Status *string `json:"status,omitempty"` - // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. Type string `json:"type"` } @@ -436,7 +435,7 @@ func (o *TransactionRuleInfo) SetType(v string) { } func (o TransactionRuleInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -511,39 +510,41 @@ func (v *NullableTransactionRuleInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRuleInfo) isValidOutcomeType() bool { - var allowedEnumValues = []string{"hardBlock", "scoreBased"} - for _, allowed := range allowedEnumValues { - if o.GetOutcomeType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "hardBlock", "scoreBased" } + for _, allowed := range allowedEnumValues { + if o.GetOutcomeType() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidRequestType() bool { - var allowedEnumValues = []string{"authentication", "authorization", "tokenization"} - for _, allowed := range allowedEnumValues { - if o.GetRequestType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "authentication", "authorization", "tokenization" } + for _, allowed := range allowedEnumValues { + if o.GetRequestType() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidType() bool { - var allowedEnumValues = []string{"allowList", "blockList", "maxUsage", "velocity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allowList", "blockList", "maxUsage", "velocity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_interval.go b/src/balanceplatform/model_transaction_rule_interval.go index af504216c..55348f808 100644 --- a/src/balanceplatform/model_transaction_rule_interval.go +++ b/src/balanceplatform/model_transaction_rule_interval.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRuleInterval type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type TransactionRuleInterval struct { // The day of month, used when the `duration.unit` is **months**. If not provided, by default, this is set to **1**, the first day of the month. DayOfMonth *int32 `json:"dayOfMonth,omitempty"` // The day of week, used when the `duration.unit` is **weeks**. If not provided, by default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, **wednesday**, **thursday**, **friday**. - DayOfWeek *string `json:"dayOfWeek,omitempty"` - Duration *Duration `json:"duration,omitempty"` + DayOfWeek *string `json:"dayOfWeek,omitempty"` + Duration *Duration `json:"duration,omitempty"` // The time of day, in **hh:mm:ss** format, used when the `duration.unit` is **hours**. If not provided, by default, this is set to **00:00:00**. TimeOfDay *string `json:"timeOfDay,omitempty"` // The [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, **Europe/Amsterdam**. By default, this is set to **UTC**. @@ -235,7 +234,7 @@ func (o *TransactionRuleInterval) SetType(v string) { } func (o TransactionRuleInterval) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,21 +298,23 @@ func (v *NullableTransactionRuleInterval) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRuleInterval) isValidDayOfWeek() bool { - var allowedEnumValues = []string{"friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday"} - for _, allowed := range allowedEnumValues { - if o.GetDayOfWeek() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" } + for _, allowed := range allowedEnumValues { + if o.GetDayOfWeek() == allowed { + return true + } + } + return false } func (o *TransactionRuleInterval) isValidType() bool { - var allowedEnumValues = []string{"daily", "lifetime", "monthly", "perTransaction", "rolling", "sliding", "weekly"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "lifetime", "monthly", "perTransaction", "rolling", "sliding", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_response.go b/src/balanceplatform/model_transaction_rule_response.go index 0035da882..f35e54c65 100644 --- a/src/balanceplatform/model_transaction_rule_response.go +++ b/src/balanceplatform/model_transaction_rule_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRuleResponse type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *TransactionRuleResponse) SetTransactionRule(v TransactionRule) { } func (o TransactionRuleResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableTransactionRuleResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule_restrictions.go b/src/balanceplatform/model_transaction_rule_restrictions.go index 547a712a8..f241328b1 100644 --- a/src/balanceplatform/model_transaction_rule_restrictions.go +++ b/src/balanceplatform/model_transaction_rule_restrictions.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRuleRestrictions type satisfies the MappedNullable interface at compile time @@ -19,20 +18,20 @@ var _ common.MappedNullable = &TransactionRuleRestrictions{} // TransactionRuleRestrictions struct for TransactionRuleRestrictions type TransactionRuleRestrictions struct { - ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` - BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` - Countries *CountriesRestriction `json:"countries,omitempty"` - DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` - DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` - EntryModes *EntryModesRestriction `json:"entryModes,omitempty"` + ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` + BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` + Countries *CountriesRestriction `json:"countries,omitempty"` + DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` + DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` + EntryModes *EntryModesRestriction `json:"entryModes,omitempty"` InternationalTransaction *InternationalTransactionRestriction `json:"internationalTransaction,omitempty"` - MatchingTransactions *MatchingTransactionsRestriction `json:"matchingTransactions,omitempty"` - Mccs *MccsRestriction `json:"mccs,omitempty"` - MerchantNames *MerchantNamesRestriction `json:"merchantNames,omitempty"` - Merchants *MerchantsRestriction `json:"merchants,omitempty"` - ProcessingTypes *ProcessingTypesRestriction `json:"processingTypes,omitempty"` - TimeOfDay *TimeOfDayRestriction `json:"timeOfDay,omitempty"` - TotalAmount *TotalAmountRestriction `json:"totalAmount,omitempty"` + MatchingTransactions *MatchingTransactionsRestriction `json:"matchingTransactions,omitempty"` + Mccs *MccsRestriction `json:"mccs,omitempty"` + MerchantNames *MerchantNamesRestriction `json:"merchantNames,omitempty"` + Merchants *MerchantsRestriction `json:"merchants,omitempty"` + ProcessingTypes *ProcessingTypesRestriction `json:"processingTypes,omitempty"` + TimeOfDay *TimeOfDayRestriction `json:"timeOfDay,omitempty"` + TotalAmount *TotalAmountRestriction `json:"totalAmount,omitempty"` } // NewTransactionRuleRestrictions instantiates a new TransactionRuleRestrictions object @@ -501,7 +500,7 @@ func (o *TransactionRuleRestrictions) SetTotalAmount(v TotalAmountRestriction) { } func (o TransactionRuleRestrictions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -590,3 +589,6 @@ func (v *NullableTransactionRuleRestrictions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rules_response.go b/src/balanceplatform/model_transaction_rules_response.go index f287440af..9850a6bc6 100644 --- a/src/balanceplatform/model_transaction_rules_response.go +++ b/src/balanceplatform/model_transaction_rules_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionRulesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TransactionRulesResponse) SetTransactionRules(v []TransactionRule) { } func (o TransactionRulesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTransactionRulesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_uk_local_account_identification.go b/src/balanceplatform/model_uk_local_account_identification.go index 102a216ec..3467225df 100644 --- a/src/balanceplatform/model_uk_local_account_identification.go +++ b/src/balanceplatform/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_update_payment_instrument.go b/src/balanceplatform/model_update_payment_instrument.go index 8b2c0a79c..919f29969 100644 --- a/src/balanceplatform/model_update_payment_instrument.go +++ b/src/balanceplatform/model_update_payment_instrument.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdatePaymentInstrument type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &UpdatePaymentInstrument{} // UpdatePaymentInstrument struct for UpdatePaymentInstrument type UpdatePaymentInstrument struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` - Card *Card `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` + Card *Card `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the payment instrument. @@ -33,13 +32,13 @@ type UpdatePaymentInstrument struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // Comment for the status of the payment instrument. Required if `statusReason` is **other**. StatusComment *string `json:"statusComment,omitempty"` - // The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -417,7 +416,7 @@ func (o *UpdatePaymentInstrument) SetType(v string) { } func (o UpdatePaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,30 +492,32 @@ func (v *NullableUpdatePaymentInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdatePaymentInstrument) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *UpdatePaymentInstrument) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *UpdatePaymentInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_us_local_account_identification.go b/src/balanceplatform/model_us_local_account_identification.go index 60991a561..6e00244fa 100644 --- a/src/balanceplatform/model_us_local_account_identification.go +++ b/src/balanceplatform/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_verification_deadline.go b/src/balanceplatform/model_verification_deadline.go index a9b332baa..a60faf225 100644 --- a/src/balanceplatform/model_verification_deadline.go +++ b/src/balanceplatform/model_verification_deadline.go @@ -10,9 +10,8 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VerificationDeadline type satisfies the MappedNullable interface at compile time @@ -94,7 +93,7 @@ func (o *VerificationDeadline) SetExpiresAt(v time.Time) { } func (o VerificationDeadline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -103,8 +102,8 @@ func (o VerificationDeadline) MarshalJSON() ([]byte, error) { func (o VerificationDeadline) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: capabilities is readOnly - // skip: expiresAt is readOnly + toSerialize["capabilities"] = o.Capabilities + toSerialize["expiresAt"] = o.ExpiresAt return toSerialize, nil } @@ -143,3 +142,6 @@ func (v *NullableVerificationDeadline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/api_general.go b/src/binlookup/api_general.go index 2b2bbbbd0..398bfc5af 100644 --- a/src/binlookup/api_general.go +++ b/src/binlookup/api_general.go @@ -10,17 +10,17 @@ package binlookup import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GeneralApi GeneralApi service type GeneralApi common.Service type GeneralApiGet3dsAvailabilityConfig struct { - ctx context.Context + ctx context.Context threeDSAvailabilityRequest *ThreeDSAvailabilityRequest } @@ -29,6 +29,7 @@ func (r GeneralApiGet3dsAvailabilityConfig) ThreeDSAvailabilityRequest(threeDSAv return r } + /* Get3dsAvailability Check if 3D Secure is available @@ -48,32 +49,75 @@ func (a *GeneralApi) Get3dsAvailabilityConfig(ctx context.Context) GeneralApiGet /* Check if 3D Secure is available Verifies whether 3D Secure is available for the specified BIN or card brand. For 3D Secure 2, this endpoint also returns device fingerprinting keys. For more information, refer to [3D Secure 2](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). - * @param req ThreeDSAvailabilityRequest - reference of ThreeDSAvailabilityRequest). + * @param req ThreeDSAvailabilityRequest - reference of ThreeDSAvailabilityRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ThreeDSAvailabilityResponse */ func (a *GeneralApi) Get3dsAvailability(r GeneralApiGet3dsAvailabilityConfig) (ThreeDSAvailabilityResponse, *_nethttp.Response, error) { - res := &ThreeDSAvailabilityResponse{} + var serviceError common.RestServiceError + res := &ThreeDSAvailabilityResponse{} path := "/get3dsAvailability" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.threeDSAvailabilityRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.threeDSAvailabilityRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiGetCostEstimateConfig struct { - ctx context.Context + ctx context.Context costEstimateRequest *CostEstimateRequest } @@ -82,6 +126,7 @@ func (r GeneralApiGetCostEstimateConfig) CostEstimateRequest(costEstimateRequest return r } + /* GetCostEstimate Get a fees cost estimate @@ -105,26 +150,69 @@ func (a *GeneralApi) GetCostEstimateConfig(ctx context.Context) GeneralApiGetCos /* Get a fees cost estimate >This API is available only for merchants operating in Australia, the EU, and the UK. Use the Adyen Cost Estimation API to pre-calculate interchange and scheme fee costs. Knowing these costs prior actual payment authorisation gives you an opportunity to charge those costs to the cardholder, if necessary. To retrieve this information, make the call to the `/getCostEstimate` endpoint. The response to this call contains the amount of the interchange and scheme fees charged by the network for this transaction, and also which surcharging policy is possible (based on current regulations). > Since not all information is known in advance (for example, if the cardholder will successfully authenticate via 3D Secure or if you also plan to provide additional Level 2/3 data), the returned amounts are based on a set of assumption criteria you define in the `assumptions` parameter. - * @param req CostEstimateRequest - reference of CostEstimateRequest). + * @param req CostEstimateRequest - reference of CostEstimateRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CostEstimateResponse */ func (a *GeneralApi) GetCostEstimate(r GeneralApiGetCostEstimateConfig) (CostEstimateResponse, *_nethttp.Response, error) { - res := &CostEstimateResponse{} + var serviceError common.RestServiceError + res := &CostEstimateResponse{} path := "/getCostEstimate" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.costEstimateRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.costEstimateRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/binlookup/model_amount.go b/src/binlookup/model_amount.go index db4f54144..7e4b7d4c3 100644 --- a/src/binlookup/model_amount.go +++ b/src/binlookup/model_amount.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_bin_detail.go b/src/binlookup/model_bin_detail.go index 6ae668526..a8735bcf6 100644 --- a/src/binlookup/model_bin_detail.go +++ b/src/binlookup/model_bin_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BinDetail type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BinDetail) SetIssuerCountry(v string) { } func (o BinDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBinDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_card_bin.go b/src/binlookup/model_card_bin.go index e0d0a1354..71b7df5de 100644 --- a/src/binlookup/model_card_bin.go +++ b/src/binlookup/model_card_bin.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardBin type satisfies the MappedNullable interface at compile time @@ -413,7 +412,7 @@ func (o *CardBin) SetSummary(v string) { } func (o CardBin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,3 +492,6 @@ func (v *NullableCardBin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_cost_estimate_assumptions.go b/src/binlookup/model_cost_estimate_assumptions.go index d9af7886c..64f599920 100644 --- a/src/binlookup/model_cost_estimate_assumptions.go +++ b/src/binlookup/model_cost_estimate_assumptions.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CostEstimateAssumptions type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CostEstimateAssumptions) SetInstallments(v int32) { } func (o CostEstimateAssumptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCostEstimateAssumptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_cost_estimate_request.go b/src/binlookup/model_cost_estimate_request.go index 6a194db49..9e2edb045 100644 --- a/src/binlookup/model_cost_estimate_request.go +++ b/src/binlookup/model_cost_estimate_request.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CostEstimateRequest type satisfies the MappedNullable interface at compile time @@ -19,16 +18,16 @@ var _ common.MappedNullable = &CostEstimateRequest{} // CostEstimateRequest struct for CostEstimateRequest type CostEstimateRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` Assumptions *CostEstimateAssumptions `json:"assumptions,omitempty"` // The card number (4-19 characters) for PCI compliant use cases. Do not use any separators. > Either the `cardNumber` or `encryptedCardNumber` field must be provided in a payment request. CardNumber *string `json:"cardNumber,omitempty"` // Encrypted data that stores card information for non PCI-compliant use cases. The encrypted data must be created with the Checkout Card Component or Secured Fields Component, and must contain the `encryptedCardNumber` field. > Either the `cardNumber` or `encryptedCardNumber` field must be provided in a payment request. EncryptedCardNumber *string `json:"encryptedCardNumber,omitempty"` // The merchant account identifier you want to process the (transaction) request with. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` MerchantDetails *MerchantDetails `json:"merchantDetails,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` + Recurring *Recurring `json:"recurring,omitempty"` // The `recurringDetailReference` you want to use for this cost estimate. The value `LATEST` can be used to select the most recently stored recurring detail. SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the card holder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. @@ -361,7 +360,7 @@ func (o *CostEstimateRequest) SetShopperReference(v string) { } func (o CostEstimateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -435,12 +434,14 @@ func (v *NullableCostEstimateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CostEstimateRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/binlookup/model_cost_estimate_response.go b/src/binlookup/model_cost_estimate_response.go index 6e9d0b110..247ec2401 100644 --- a/src/binlookup/model_cost_estimate_response.go +++ b/src/binlookup/model_cost_estimate_response.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CostEstimateResponse type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &CostEstimateResponse{} // CostEstimateResponse struct for CostEstimateResponse type CostEstimateResponse struct { - CardBin *CardBin `json:"cardBin,omitempty"` - CostEstimateAmount *Amount `json:"costEstimateAmount,omitempty"` + CardBin *CardBin `json:"cardBin,omitempty"` + CostEstimateAmount *Amount `json:"costEstimateAmount,omitempty"` // Adyen's 16-character reference associated with the request. CostEstimateReference *string `json:"costEstimateReference,omitempty"` // The result of the cost estimation. @@ -207,7 +206,7 @@ func (o *CostEstimateResponse) SetSurchargeType(v string) { } func (o CostEstimateResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -269,3 +268,6 @@ func (v *NullableCostEstimateResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_ds_public_key_detail.go b/src/binlookup/model_ds_public_key_detail.go index 53c7e090b..124c90f09 100644 --- a/src/binlookup/model_ds_public_key_detail.go +++ b/src/binlookup/model_ds_public_key_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DSPublicKeyDetail type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *DSPublicKeyDetail) SetPublicKey(v string) { } func (o DSPublicKeyDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableDSPublicKeyDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_merchant_details.go b/src/binlookup/model_merchant_details.go index 559d82cd7..a59f6906b 100644 --- a/src/binlookup/model_merchant_details.go +++ b/src/binlookup/model_merchant_details.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantDetails type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDetails) SetMcc(v string) { } func (o MerchantDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_recurring.go b/src/binlookup/model_recurring.go index eca0a03bc..7da6a4b98 100644 --- a/src/binlookup/model_recurring.go +++ b/src/binlookup/model_recurring.go @@ -10,9 +10,8 @@ package binlookup import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/binlookup/model_service_error.go b/src/binlookup/model_service_error.go index c044f30c1..6dcbafa9b 100644 --- a/src/binlookup/model_service_error.go +++ b/src/binlookup/model_service_error.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds2_card_range_detail.go b/src/binlookup/model_three_ds2_card_range_detail.go index 3fbd85710..b5f32106a 100644 --- a/src/binlookup/model_three_ds2_card_range_detail.go +++ b/src/binlookup/model_three_ds2_card_range_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2CardRangeDetail type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ThreeDS2CardRangeDetail) SetThreeDSMethodURL(v string) { } func (o ThreeDS2CardRangeDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableThreeDS2CardRangeDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds_availability_request.go b/src/binlookup/model_three_ds_availability_request.go index ca6c65abe..d50a6a8ca 100644 --- a/src/binlookup/model_three_ds_availability_request.go +++ b/src/binlookup/model_three_ds_availability_request.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSAvailabilityRequest type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *ThreeDSAvailabilityRequest) SetShopperReference(v string) { } func (o ThreeDSAvailabilityRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableThreeDSAvailabilityRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds_availability_response.go b/src/binlookup/model_three_ds_availability_response.go index 7de54a41b..d5821608b 100644 --- a/src/binlookup/model_three_ds_availability_response.go +++ b/src/binlookup/model_three_ds_availability_response.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSAvailabilityResponse type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *ThreeDSAvailabilityResponse) SetThreeDS2supported(v bool) { } func (o ThreeDSAvailabilityResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableThreeDSAvailabilityResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/api_classic_checkout_sdk.go b/src/checkout/api_classic_checkout_sdk.go index 2d336426f..170f965d3 100644 --- a/src/checkout/api_classic_checkout_sdk.go +++ b/src/checkout/api_classic_checkout_sdk.go @@ -10,18 +10,18 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ClassicCheckoutSDKApi ClassicCheckoutSDKApi service type ClassicCheckoutSDKApi common.Service type ClassicCheckoutSDKApiPaymentSessionConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string paymentSetupRequest *PaymentSetupRequest } @@ -36,6 +36,7 @@ func (r ClassicCheckoutSDKApiPaymentSessionConfig) PaymentSetupRequest(paymentSe return r } + /* PaymentSession Create a payment session @@ -57,36 +58,79 @@ func (a *ClassicCheckoutSDKApi) PaymentSessionConfig(ctx context.Context) Classi /* Create a payment session Provides the data object that can be used to start the Checkout SDK. To set up the payment, pass its amount, currency, and other required parameters. We use this to optimise the payment flow and perform better risk assessment of the transaction. For more information, refer to [How it works](https://docs.adyen.com/online-payments#howitworks). - * @param req PaymentSetupRequest - reference of PaymentSetupRequest). + * @param req PaymentSetupRequest - reference of PaymentSetupRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentSetupResponse */ func (a *ClassicCheckoutSDKApi) PaymentSession(r ClassicCheckoutSDKApiPaymentSessionConfig) (PaymentSetupResponse, *_nethttp.Response, error) { - res := &PaymentSetupResponse{} + var serviceError common.RestServiceError + res := &PaymentSetupResponse{} path := "/paymentSession" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentSetupRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentSetupRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ClassicCheckoutSDKApiVerifyPaymentResultConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string paymentVerificationRequest *PaymentVerificationRequest } @@ -101,6 +145,7 @@ func (r ClassicCheckoutSDKApiVerifyPaymentResultConfig) PaymentVerificationReque return r } + /* VerifyPaymentResult Verify a payment result @@ -122,29 +167,72 @@ func (a *ClassicCheckoutSDKApi) VerifyPaymentResultConfig(ctx context.Context) C /* Verify a payment result Verifies the payment result using the payload returned from the Checkout SDK. For more information, refer to [How it works](https://docs.adyen.com/online-payments#howitworks). - * @param req PaymentVerificationRequest - reference of PaymentVerificationRequest). + * @param req PaymentVerificationRequest - reference of PaymentVerificationRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentVerificationResponse */ func (a *ClassicCheckoutSDKApi) VerifyPaymentResult(r ClassicCheckoutSDKApiVerifyPaymentResultConfig) (PaymentVerificationResponse, *_nethttp.Response, error) { - res := &PaymentVerificationResponse{} + var serviceError common.RestServiceError + res := &PaymentVerificationResponse{} path := "/payments/result" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentVerificationRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentVerificationRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/checkout/api_modifications.go b/src/checkout/api_modifications.go index 9423ede8a..594e9d8d4 100644 --- a/src/checkout/api_modifications.go +++ b/src/checkout/api_modifications.go @@ -10,19 +10,18 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ModificationsApi ModificationsApi service type ModificationsApi common.Service type ModificationsApiCancelAuthorisedPaymentConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string createStandalonePaymentCancelRequest *CreateStandalonePaymentCancelRequest } @@ -37,6 +36,7 @@ func (r ModificationsApiCancelAuthorisedPaymentConfig) CreateStandalonePaymentCa return r } + /* CancelAuthorisedPayment Cancel an authorised payment @@ -60,37 +60,81 @@ func (a *ModificationsApi) CancelAuthorisedPaymentConfig(ctx context.Context) Mo /* Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - * @param req CreateStandalonePaymentCancelRequest - reference of CreateStandalonePaymentCancelRequest). + * @param req CreateStandalonePaymentCancelRequest - reference of CreateStandalonePaymentCancelRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StandalonePaymentCancelResource */ func (a *ModificationsApi) CancelAuthorisedPayment(r ModificationsApiCancelAuthorisedPaymentConfig) (StandalonePaymentCancelResource, *_nethttp.Response, error) { - res := &StandalonePaymentCancelResource{} + var serviceError common.RestServiceError + res := &StandalonePaymentCancelResource{} path := "/cancels" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createStandalonePaymentCancelRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createStandalonePaymentCancelRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig struct { - ctx context.Context - paymentPspReference string - idempotencyKey *string + ctx context.Context + paymentPspReference string + idempotencyKey *string createPaymentCancelRequest *CreatePaymentCancelRequest } @@ -105,6 +149,7 @@ func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig) CreatePayme return r } + /* CancelAuthorisedPaymentByPspReference Cancel an authorised payment @@ -117,12 +162,12 @@ If you want to cancel a payment but are not sure whether it has been captured, u For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. @return ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig */ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReferenceConfig(ctx context.Context, paymentPspReference string) ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig { return ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig{ - ctx: ctx, + ctx: ctx, paymentPspReference: paymentPspReference, } } @@ -130,39 +175,83 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReferenceConfig(ctx conte /* Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/paymentPspReference/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - * @param req CreatePaymentCancelRequest - reference of CreatePaymentCancelRequest). + * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + * @param req CreatePaymentCancelRequest - reference of CreatePaymentCancelRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentCancelResource */ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(r ModificationsApiCancelAuthorisedPaymentByPspReferenceConfig) (PaymentCancelResource, *_nethttp.Response, error) { - res := &PaymentCancelResource{} + var serviceError common.RestServiceError + res := &PaymentCancelResource{} path := "/payments/{paymentPspReference}/cancels" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentCancelRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentCancelRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiCaptureAuthorisedPaymentConfig struct { - ctx context.Context - paymentPspReference string - idempotencyKey *string + ctx context.Context + paymentPspReference string + idempotencyKey *string createPaymentCaptureRequest *CreatePaymentCaptureRequest } @@ -177,12 +266,13 @@ func (r ModificationsApiCaptureAuthorisedPaymentConfig) CreatePaymentCaptureRequ return r } + /* CaptureAuthorisedPayment Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). -You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. +You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. @@ -194,7 +284,7 @@ For more information, refer to [Capture](https://docs.adyen.com/online-payments/ */ func (a *ModificationsApi) CaptureAuthorisedPaymentConfig(ctx context.Context, paymentPspReference string) ModificationsApiCaptureAuthorisedPaymentConfig { return ModificationsApiCaptureAuthorisedPaymentConfig{ - ctx: ctx, + ctx: ctx, paymentPspReference: paymentPspReference, } } @@ -203,38 +293,82 @@ func (a *ModificationsApi) CaptureAuthorisedPaymentConfig(ctx context.Context, p Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - * @param req CreatePaymentCaptureRequest - reference of CreatePaymentCaptureRequest). + * @param req CreatePaymentCaptureRequest - reference of CreatePaymentCaptureRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentCaptureResource */ func (a *ModificationsApi) CaptureAuthorisedPayment(r ModificationsApiCaptureAuthorisedPaymentConfig) (PaymentCaptureResource, *_nethttp.Response, error) { - res := &PaymentCaptureResource{} + var serviceError common.RestServiceError + res := &PaymentCaptureResource{} path := "/payments/{paymentPspReference}/captures" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentCaptureRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentCaptureRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiRefundCapturedPaymentConfig struct { - ctx context.Context - paymentPspReference string - idempotencyKey *string + ctx context.Context + paymentPspReference string + idempotencyKey *string createPaymentRefundRequest *CreatePaymentRefundRequest } @@ -249,6 +383,7 @@ func (r ModificationsApiRefundCapturedPaymentConfig) CreatePaymentRefundRequest( return r } + /* RefundCapturedPayment Refund a captured payment @@ -256,7 +391,7 @@ Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/# You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. -> Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). +> Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. @@ -268,7 +403,7 @@ For more information, refer to [Refund](https://docs.adyen.com/online-payments/r */ func (a *ModificationsApi) RefundCapturedPaymentConfig(ctx context.Context, paymentPspReference string) ModificationsApiRefundCapturedPaymentConfig { return ModificationsApiRefundCapturedPaymentConfig{ - ctx: ctx, + ctx: ctx, paymentPspReference: paymentPspReference, } } @@ -277,38 +412,82 @@ func (a *ModificationsApi) RefundCapturedPaymentConfig(ctx context.Context, paym Refund a captured payment Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - * @param req CreatePaymentRefundRequest - reference of CreatePaymentRefundRequest). + * @param req CreatePaymentRefundRequest - reference of CreatePaymentRefundRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentRefundResource */ func (a *ModificationsApi) RefundCapturedPayment(r ModificationsApiRefundCapturedPaymentConfig) (PaymentRefundResource, *_nethttp.Response, error) { - res := &PaymentRefundResource{} + var serviceError common.RestServiceError + res := &PaymentRefundResource{} path := "/payments/{paymentPspReference}/refunds" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentRefundRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentRefundRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiRefundOrCancelPaymentConfig struct { - ctx context.Context - paymentPspReference string - idempotencyKey *string + ctx context.Context + paymentPspReference string + idempotencyKey *string createPaymentReversalRequest *CreatePaymentReversalRequest } @@ -323,6 +502,7 @@ func (r ModificationsApiRefundOrCancelPaymentConfig) CreatePaymentReversalReques return r } + /* RefundOrCancelPayment Refund or cancel a payment @@ -334,12 +514,12 @@ The reversed amount is always the full payment amount. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. @return ModificationsApiRefundOrCancelPaymentConfig */ func (a *ModificationsApi) RefundOrCancelPaymentConfig(ctx context.Context, paymentPspReference string) ModificationsApiRefundOrCancelPaymentConfig { return ModificationsApiRefundOrCancelPaymentConfig{ - ctx: ctx, + ctx: ctx, paymentPspReference: paymentPspReference, } } @@ -347,39 +527,83 @@ func (a *ModificationsApi) RefundOrCancelPaymentConfig(ctx context.Context, paym /* Refund or cancel a payment [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). - * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - * @param req CreatePaymentReversalRequest - reference of CreatePaymentReversalRequest). + * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + * @param req CreatePaymentReversalRequest - reference of CreatePaymentReversalRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentReversalResource */ func (a *ModificationsApi) RefundOrCancelPayment(r ModificationsApiRefundOrCancelPaymentConfig) (PaymentReversalResource, *_nethttp.Response, error) { - res := &PaymentReversalResource{} + var serviceError common.RestServiceError + res := &PaymentReversalResource{} path := "/payments/{paymentPspReference}/reversals" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentReversalRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentReversalRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiUpdateAuthorisedAmountConfig struct { - ctx context.Context - paymentPspReference string - idempotencyKey *string + ctx context.Context + paymentPspReference string + idempotencyKey *string createPaymentAmountUpdateRequest *CreatePaymentAmountUpdateRequest } @@ -394,6 +618,7 @@ func (r ModificationsApiUpdateAuthorisedAmountConfig) CreatePaymentAmountUpdateR return r } + /* UpdateAuthorisedAmount Update an authorised amount @@ -411,7 +636,7 @@ For more information, refer to [Authorisation adjustment](https://docs.adyen.com */ func (a *ModificationsApi) UpdateAuthorisedAmountConfig(ctx context.Context, paymentPspReference string) ModificationsApiUpdateAuthorisedAmountConfig { return ModificationsApiUpdateAuthorisedAmountConfig{ - ctx: ctx, + ctx: ctx, paymentPspReference: paymentPspReference, } } @@ -420,30 +645,74 @@ func (a *ModificationsApi) UpdateAuthorisedAmountConfig(ctx context.Context, pay Update an authorised amount Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). * @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - * @param req CreatePaymentAmountUpdateRequest - reference of CreatePaymentAmountUpdateRequest). + * @param req CreatePaymentAmountUpdateRequest - reference of CreatePaymentAmountUpdateRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentAmountUpdateResource */ func (a *ModificationsApi) UpdateAuthorisedAmount(r ModificationsApiUpdateAuthorisedAmountConfig) (PaymentAmountUpdateResource, *_nethttp.Response, error) { - res := &PaymentAmountUpdateResource{} + var serviceError common.RestServiceError + res := &PaymentAmountUpdateResource{} path := "/payments/{paymentPspReference}/amountUpdates" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentAmountUpdateRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentAmountUpdateRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index 42ca295b9..be60ab37f 100644 --- a/src/checkout/api_orders.go +++ b/src/checkout/api_orders.go @@ -10,18 +10,18 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // OrdersApi OrdersApi service type OrdersApi common.Service type OrdersApiCancelOrderConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string checkoutCancelOrderRequest *CheckoutCancelOrderRequest } @@ -36,6 +36,7 @@ func (r OrdersApiCancelOrderConfig) CheckoutCancelOrderRequest(checkoutCancelOrd return r } + /* CancelOrder Cancel an order @@ -53,36 +54,79 @@ func (a *OrdersApi) CancelOrderConfig(ctx context.Context) OrdersApiCancelOrderC /* Cancel an order Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. - * @param req CheckoutCancelOrderRequest - reference of CheckoutCancelOrderRequest). + * @param req CheckoutCancelOrderRequest - reference of CheckoutCancelOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CheckoutCancelOrderResponse */ func (a *OrdersApi) CancelOrder(r OrdersApiCancelOrderConfig) (CheckoutCancelOrderResponse, *_nethttp.Response, error) { - res := &CheckoutCancelOrderResponse{} + var serviceError common.RestServiceError + res := &CheckoutCancelOrderResponse{} path := "/orders/cancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.checkoutCancelOrderRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutCancelOrderRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type OrdersApiGetBalanceOfGiftCardConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string checkoutBalanceCheckRequest *CheckoutBalanceCheckRequest } @@ -97,6 +141,7 @@ func (r OrdersApiGetBalanceOfGiftCardConfig) CheckoutBalanceCheckRequest(checkou return r } + /* GetBalanceOfGiftCard Get the balance of a gift card @@ -114,36 +159,79 @@ func (a *OrdersApi) GetBalanceOfGiftCardConfig(ctx context.Context) OrdersApiGet /* Get the balance of a gift card Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. - * @param req CheckoutBalanceCheckRequest - reference of CheckoutBalanceCheckRequest). + * @param req CheckoutBalanceCheckRequest - reference of CheckoutBalanceCheckRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CheckoutBalanceCheckResponse */ func (a *OrdersApi) GetBalanceOfGiftCard(r OrdersApiGetBalanceOfGiftCardConfig) (CheckoutBalanceCheckResponse, *_nethttp.Response, error) { - res := &CheckoutBalanceCheckResponse{} + var serviceError common.RestServiceError + res := &CheckoutBalanceCheckResponse{} path := "/paymentMethods/balance" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.checkoutBalanceCheckRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutBalanceCheckRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type OrdersApiOrdersConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string checkoutCreateOrderRequest *CheckoutCreateOrderRequest } @@ -158,6 +246,7 @@ func (r OrdersApiOrdersConfig) CheckoutCreateOrderRequest(checkoutCreateOrderReq return r } + /* Orders Create an order @@ -175,29 +264,72 @@ func (a *OrdersApi) OrdersConfig(ctx context.Context) OrdersApiOrdersConfig { /* Create an order Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. - * @param req CheckoutCreateOrderRequest - reference of CheckoutCreateOrderRequest). + * @param req CheckoutCreateOrderRequest - reference of CheckoutCreateOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CheckoutCreateOrderResponse */ func (a *OrdersApi) Orders(r OrdersApiOrdersConfig) (CheckoutCreateOrderResponse, *_nethttp.Response, error) { - res := &CheckoutCreateOrderResponse{} + var serviceError common.RestServiceError + res := &CheckoutCreateOrderResponse{} path := "/orders" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.checkoutCreateOrderRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutCreateOrderRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index 74a8ca3f3..cde08c77b 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -10,21 +10,21 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PaymentLinksApi PaymentLinksApi service type PaymentLinksApi common.Service type PaymentLinksApiGetPaymentLinkConfig struct { - ctx context.Context + ctx context.Context linkId string } + /* GetPaymentLink Get a payment link @@ -36,7 +36,7 @@ Retrieves the payment link details using the payment link `id`. */ func (a *PaymentLinksApi) GetPaymentLinkConfig(ctx context.Context, linkId string) PaymentLinksApiGetPaymentLinkConfig { return PaymentLinksApiGetPaymentLinkConfig{ - ctx: ctx, + ctx: ctx, linkId: linkId, } } @@ -50,28 +50,71 @@ Retrieves the payment link details using the payment link `id`. */ func (a *PaymentLinksApi) GetPaymentLink(r PaymentLinksApiGetPaymentLinkConfig) (PaymentLinkResponse, *_nethttp.Response, error) { - res := &PaymentLinkResponse{} + var serviceError common.RestServiceError + res := &PaymentLinkResponse{} path := "/paymentLinks/{linkId}" - path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentLinksApiPaymentLinksConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string createPaymentLinkRequest *CreatePaymentLinkRequest } @@ -86,6 +129,7 @@ func (r PaymentLinksApiPaymentLinksConfig) CreatePaymentLinkRequest(createPaymen return r } + /* PaymentLinks Create a payment link @@ -105,36 +149,80 @@ func (a *PaymentLinksApi) PaymentLinksConfig(ctx context.Context) PaymentLinksAp /* Create a payment link Creates a payment link to our hosted payment form where shoppers can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). - * @param req CreatePaymentLinkRequest - reference of CreatePaymentLinkRequest). + * @param req CreatePaymentLinkRequest - reference of CreatePaymentLinkRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentLinkResponse */ func (a *PaymentLinksApi) PaymentLinks(r PaymentLinksApiPaymentLinksConfig) (PaymentLinkResponse, *_nethttp.Response, error) { - res := &PaymentLinkResponse{} + var serviceError common.RestServiceError + res := &PaymentLinkResponse{} path := "/paymentLinks" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createPaymentLinkRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPaymentLinkRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentLinksApiUpdatePaymentLinkConfig struct { - ctx context.Context - linkId string + ctx context.Context + linkId string updatePaymentLinkRequest *UpdatePaymentLinkRequest } @@ -143,6 +231,7 @@ func (r PaymentLinksApiUpdatePaymentLinkConfig) UpdatePaymentLinkRequest(updateP return r } + /* UpdatePaymentLink Update the status of a payment link @@ -154,7 +243,7 @@ Updates the status of a payment link. Use this endpoint to [force the expiry of */ func (a *PaymentLinksApi) UpdatePaymentLinkConfig(ctx context.Context, linkId string) PaymentLinksApiUpdatePaymentLinkConfig { return PaymentLinksApiUpdatePaymentLinkConfig{ - ctx: ctx, + ctx: ctx, linkId: linkId, } } @@ -163,27 +252,70 @@ func (a *PaymentLinksApi) UpdatePaymentLinkConfig(ctx context.Context, linkId st Update the status of a payment link Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). * @param linkId Unique identifier of the payment link. - * @param req UpdatePaymentLinkRequest - reference of UpdatePaymentLinkRequest). + * @param req UpdatePaymentLinkRequest - reference of UpdatePaymentLinkRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentLinkResponse */ func (a *PaymentLinksApi) UpdatePaymentLink(r PaymentLinksApiUpdatePaymentLinkConfig) (PaymentLinkResponse, *_nethttp.Response, error) { - res := &PaymentLinkResponse{} + var serviceError common.RestServiceError + res := &PaymentLinkResponse{} path := "/paymentLinks/{linkId}" - path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updatePaymentLinkRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updatePaymentLinkRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index 28496c408..eb4b6aafb 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -10,18 +10,18 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PaymentsApi PaymentsApi service type PaymentsApi common.Service type PaymentsApiCardDetailsConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string cardDetailsRequest *CardDetailsRequest } @@ -36,6 +36,7 @@ func (r PaymentsApiCardDetailsConfig) CardDetailsRequest(cardDetailsRequest Card return r } + /* CardDetails Get the list of brands on the card @@ -56,38 +57,41 @@ func (a *PaymentsApi) CardDetailsConfig(ctx context.Context) PaymentsApiCardDeta /* Get the list of brands on the card -Send a request with at least the first 6 digits of the card number to get a response with an array of brands on the card. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. - * @param req CardDetailsRequest - reference of CardDetailsRequest). +Send a request with at least the first 6 digits of the card number to get a response with an array of brands on the card. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. + * @param req CardDetailsRequest - reference of CardDetailsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CardDetailsResponse */ func (a *PaymentsApi) CardDetails(r PaymentsApiCardDetailsConfig) (CardDetailsResponse, *_nethttp.Response, error) { - res := &CardDetailsResponse{} + var serviceError common.RestServiceError + res := &CardDetailsResponse{} path := "/cardDetails" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.cardDetailsRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.cardDetailsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + return *res, httpRes, err } + type PaymentsApiDonationsConfig struct { - ctx context.Context - idempotencyKey *string - paymentDonationRequest *PaymentDonationRequest + ctx context.Context + idempotencyKey *string + checkoutDonationPaymentRequest *CheckoutDonationPaymentRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -96,11 +100,12 @@ func (r PaymentsApiDonationsConfig) IdempotencyKey(idempotencyKey string) Paymen return r } -func (r PaymentsApiDonationsConfig) PaymentDonationRequest(paymentDonationRequest PaymentDonationRequest) PaymentsApiDonationsConfig { - r.paymentDonationRequest = &paymentDonationRequest +func (r PaymentsApiDonationsConfig) CheckoutDonationPaymentRequest(checkoutDonationPaymentRequest CheckoutDonationPaymentRequest) PaymentsApiDonationsConfig { + r.checkoutDonationPaymentRequest = &checkoutDonationPaymentRequest return r } + /* Donations Start a transaction for donations @@ -120,36 +125,79 @@ func (a *PaymentsApi) DonationsConfig(ctx context.Context) PaymentsApiDonationsC /* Start a transaction for donations Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - * @param req PaymentDonationRequest - reference of PaymentDonationRequest). + * @param req CheckoutDonationPaymentRequest - reference of CheckoutDonationPaymentRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return DonationResponse */ func (a *PaymentsApi) Donations(r PaymentsApiDonationsConfig) (DonationResponse, *_nethttp.Response, error) { - res := &DonationResponse{} + var serviceError common.RestServiceError + res := &DonationResponse{} path := "/donations" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentDonationRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutDonationPaymentRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentsApiPaymentMethodsConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string paymentMethodsRequest *PaymentMethodsRequest } @@ -164,6 +212,7 @@ func (r PaymentsApiPaymentMethodsConfig) PaymentMethodsRequest(paymentMethodsReq return r } + /* PaymentMethods Get a list of available payment methods @@ -183,37 +232,80 @@ func (a *PaymentsApi) PaymentMethodsConfig(ctx context.Context) PaymentsApiPayme /* Get a list of available payment methods Queries the available payment methods for a transaction based on the transaction context (like amount, country, and currency). Besides giving back a list of the available payment methods, the response also returns which input details you need to collect from the shopper (to be submitted to `/payments`). Although we highly recommend using this endpoint to ensure you are always offering the most up-to-date list of payment methods, its usage is optional. You can, for example, also cache the `/paymentMethods` response and update it once a week. - * @param req PaymentMethodsRequest - reference of PaymentMethodsRequest). + * @param req PaymentMethodsRequest - reference of PaymentMethodsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentMethodsResponse */ func (a *PaymentsApi) PaymentMethods(r PaymentsApiPaymentMethodsConfig) (PaymentMethodsResponse, *_nethttp.Response, error) { - res := &PaymentMethodsResponse{} + var serviceError common.RestServiceError + res := &PaymentMethodsResponse{} path := "/paymentMethods" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentMethodsRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentMethodsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentsApiPaymentsConfig struct { - ctx context.Context + ctx context.Context idempotencyKey *string - paymentRequest *PaymentRequest + checkoutPaymentRequest *CheckoutPaymentRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -222,18 +314,19 @@ func (r PaymentsApiPaymentsConfig) IdempotencyKey(idempotencyKey string) Payment return r } -func (r PaymentsApiPaymentsConfig) PaymentRequest(paymentRequest PaymentRequest) PaymentsApiPaymentsConfig { - r.paymentRequest = &paymentRequest +func (r PaymentsApiPaymentsConfig) CheckoutPaymentRequest(checkoutPaymentRequest CheckoutPaymentRequest) PaymentsApiPaymentsConfig { + r.checkoutPaymentRequest = &checkoutPaymentRequest return r } + /* Payments Start a transaction -Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). +Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): -* For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. -* For a redirect or additional action, the response contains an `action` object. +* For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. +* For a redirect or additional action, the response contains an `action` object. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentsApiPaymentsConfig @@ -246,36 +339,79 @@ func (a *PaymentsApi) PaymentsConfig(ctx context.Context) PaymentsApiPaymentsCon /* Start a transaction -Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. - * @param req PaymentRequest - reference of PaymentRequest). +Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. + * @param req CheckoutPaymentRequest - reference of CheckoutPaymentRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentResponse */ func (a *PaymentsApi) Payments(r PaymentsApiPaymentsConfig) (PaymentResponse, *_nethttp.Response, error) { - res := &PaymentResponse{} + var serviceError common.RestServiceError + res := &PaymentResponse{} path := "/payments" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutPaymentRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentsApiPaymentsDetailsConfig struct { - ctx context.Context + ctx context.Context idempotencyKey *string detailsRequest *DetailsRequest } @@ -291,6 +427,7 @@ func (r PaymentsApiPaymentsDetailsConfig) DetailsRequest(detailsRequest DetailsR return r } + /* PaymentsDetails Submit details for a payment @@ -309,37 +446,80 @@ func (a *PaymentsApi) PaymentsDetailsConfig(ctx context.Context) PaymentsApiPaym /* Submit details for a payment -Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. - * @param req DetailsRequest - reference of DetailsRequest). +Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. + * @param req DetailsRequest - reference of DetailsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentDetailsResponse */ func (a *PaymentsApi) PaymentsDetails(r PaymentsApiPaymentsDetailsConfig) (PaymentDetailsResponse, *_nethttp.Response, error) { - res := &PaymentDetailsResponse{} + var serviceError common.RestServiceError + res := &PaymentDetailsResponse{} path := "/payments/details" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.detailsRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.detailsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentsApiSessionsConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string createCheckoutSessionRequest *CreateCheckoutSessionRequest } @@ -354,6 +534,7 @@ func (r PaymentsApiSessionsConfig) CreateCheckoutSessionRequest(createCheckoutSe return r } + /* Sessions Create a payment session @@ -375,29 +556,32 @@ func (a *PaymentsApi) SessionsConfig(ctx context.Context) PaymentsApiSessionsCon /* Create a payment session Creates a payment session for [Web Drop-in](https://docs.adyen.com/online-payments/web-drop-in) and [Web Components](https://docs.adyen.com/online-payments/web-components) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. - * @param req CreateCheckoutSessionRequest - reference of CreateCheckoutSessionRequest). + * @param req CreateCheckoutSessionRequest - reference of CreateCheckoutSessionRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateCheckoutSessionResponse */ func (a *PaymentsApi) Sessions(r PaymentsApiSessionsConfig) (CreateCheckoutSessionResponse, *_nethttp.Response, error) { - res := &CreateCheckoutSessionResponse{} + var serviceError common.RestServiceError + res := &CreateCheckoutSessionResponse{} path := "/sessions" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createCheckoutSessionRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createCheckoutSessionRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + return *res, httpRes, err } + diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index 11487ccf9..606bb5453 100644 --- a/src/checkout/api_recurring.go +++ b/src/checkout/api_recurring.go @@ -10,21 +10,20 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // RecurringApi RecurringApi service type RecurringApi common.Service type RecurringApiDeleteTokenForStoredPaymentDetailsConfig struct { - ctx context.Context - recurringId string + ctx context.Context + recurringId string shopperReference *string - merchantAccount *string + merchantAccount *string } // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -39,6 +38,7 @@ func (r RecurringApiDeleteTokenForStoredPaymentDetailsConfig) MerchantAccount(me return r } + /* DeleteTokenForStoredPaymentDetails Delete a token for stored payment details @@ -50,7 +50,7 @@ Deletes the token identified in the path. The token can no longer be used with p */ func (a *RecurringApi) DeleteTokenForStoredPaymentDetailsConfig(ctx context.Context, recurringId string) RecurringApiDeleteTokenForStoredPaymentDetailsConfig { return RecurringApiDeleteTokenForStoredPaymentDetailsConfig{ - ctx: ctx, + ctx: ctx, recurringId: recurringId, } } @@ -64,35 +64,38 @@ Deletes the token identified in the path. The token can no longer be used with p */ func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(r RecurringApiDeleteTokenForStoredPaymentDetailsConfig) (StoredPaymentMethodResource, *_nethttp.Response, error) { - res := &StoredPaymentMethodResource{} + var serviceError common.RestServiceError + res := &StoredPaymentMethodResource{} path := "/storedPaymentMethods/{recurringId}" - path = strings.Replace(path, "{"+"recurringId"+"}", url.PathEscape(common.ParameterValueToString(r.recurringId, "recurringId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.shopperReference != nil { - common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") - } - if r.merchantAccount != nil { - common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"recurringId"+"}", url.PathEscape(common.ParameterValueToString(r.recurringId, "recurringId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.shopperReference != nil { + common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") + } + if r.merchantAccount != nil { + common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + return *res, httpRes, err } + type RecurringApiGetTokensForStoredPaymentDetailsConfig struct { - ctx context.Context + ctx context.Context shopperReference *string - merchantAccount *string + merchantAccount *string } // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -107,6 +110,7 @@ func (r RecurringApiGetTokensForStoredPaymentDetailsConfig) MerchantAccount(merc return r } + /* GetTokensForStoredPaymentDetails Get tokens for stored payment details @@ -125,32 +129,35 @@ func (a *RecurringApi) GetTokensForStoredPaymentDetailsConfig(ctx context.Contex /* Get tokens for stored payment details -Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. +Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ListStoredPaymentMethodsResponse */ func (a *RecurringApi) GetTokensForStoredPaymentDetails(r RecurringApiGetTokensForStoredPaymentDetailsConfig) (ListStoredPaymentMethodsResponse, *_nethttp.Response, error) { - res := &ListStoredPaymentMethodsResponse{} + var serviceError common.RestServiceError + res := &ListStoredPaymentMethodsResponse{} path := "/storedPaymentMethods" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.shopperReference != nil { - common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") - } - if r.merchantAccount != nil { - common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.shopperReference != nil { + common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") + } + if r.merchantAccount != nil { + common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + return *res, httpRes, err } + diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index 36d0a28b5..412680167 100644 --- a/src/checkout/api_utility.go +++ b/src/checkout/api_utility.go @@ -10,18 +10,18 @@ package checkout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // UtilityApi UtilityApi service type UtilityApi common.Service type UtilityApiGetApplePaySessionConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string createApplePaySessionRequest *CreateApplePaySessionRequest } @@ -36,6 +36,7 @@ func (r UtilityApiGetApplePaySessionConfig) CreateApplePaySessionRequest(createA return r } + /* GetApplePaySession Get an Apple Pay session @@ -55,36 +56,39 @@ func (a *UtilityApi) GetApplePaySessionConfig(ctx context.Context) UtilityApiGet /* Get an Apple Pay session You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - * @param req CreateApplePaySessionRequest - reference of CreateApplePaySessionRequest). + * @param req CreateApplePaySessionRequest - reference of CreateApplePaySessionRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApplePaySessionResponse */ func (a *UtilityApi) GetApplePaySession(r UtilityApiGetApplePaySessionConfig) (ApplePaySessionResponse, *_nethttp.Response, error) { - res := &ApplePaySessionResponse{} + var serviceError common.RestServiceError + res := &ApplePaySessionResponse{} path := "/applePay/sessions" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createApplePaySessionRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createApplePaySessionRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + return *res, httpRes, err } + type UtilityApiOriginKeysConfig struct { - ctx context.Context - idempotencyKey *string + ctx context.Context + idempotencyKey *string checkoutUtilityRequest *CheckoutUtilityRequest } @@ -99,11 +103,12 @@ func (r UtilityApiOriginKeysConfig) CheckoutUtilityRequest(checkoutUtilityReques return r } + /* OriginKeys Create originKey values for domains -This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. -> If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. +This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. +> If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return UtilityApiOriginKeysConfig @@ -118,30 +123,73 @@ func (a *UtilityApi) OriginKeysConfig(ctx context.Context) UtilityApiOriginKeysC /* Create originKey values for domains -This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. - * @param req CheckoutUtilityRequest - reference of CheckoutUtilityRequest). +This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. + * @param req CheckoutUtilityRequest - reference of CheckoutUtilityRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CheckoutUtilityResponse */ func (a *UtilityApi) OriginKeys(r UtilityApiOriginKeysConfig) (CheckoutUtilityResponse, *_nethttp.Response, error) { - res := &CheckoutUtilityResponse{} + var serviceError common.RestServiceError + res := &CheckoutUtilityResponse{} path := "/originKeys" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.checkoutUtilityRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.checkoutUtilityRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/checkout/docs/AccountInfo2.md b/src/checkout/docs/AccountInfo2.md new file mode 100644 index 000000000..1990aebab --- /dev/null +++ b/src/checkout/docs/AccountInfo2.md @@ -0,0 +1,524 @@ +# AccountInfo2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountAgeIndicator** | Pointer to **string** | Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days | [optional] +**AccountChangeDate** | Pointer to **time.Time** | Date when the shopper's account was last changed. | [optional] +**AccountChangeIndicator** | Pointer to **string** | Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days | [optional] +**AccountCreationDate** | Pointer to **time.Time** | Date when the shopper's account was created. | [optional] +**AccountType** | Pointer to **string** | Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit | [optional] +**AddCardAttemptsDay** | Pointer to **int32** | Number of attempts the shopper tried to add a card to their account in the last day. | [optional] +**DeliveryAddressUsageDate** | Pointer to **time.Time** | Date the selected delivery address was first used. | [optional] +**DeliveryAddressUsageIndicator** | Pointer to **string** | Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days | [optional] +**HomePhone** | Pointer to **string** | Shopper's home phone number (including the country code). | [optional] +**MobilePhone** | Pointer to **string** | Shopper's mobile phone number (including the country code). | [optional] +**PasswordChangeDate** | Pointer to **time.Time** | Date when the shopper last changed their password. | [optional] +**PasswordChangeIndicator** | Pointer to **string** | Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days | [optional] +**PastTransactionsDay** | Pointer to **int32** | Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. | [optional] +**PastTransactionsYear** | Pointer to **int32** | Number of all transactions (successful and abandoned) from this shopper in the past year. | [optional] +**PaymentAccountAge** | Pointer to **time.Time** | Date this payment method was added to the shopper's account. | [optional] +**PaymentAccountIndicator** | Pointer to **string** | Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days | [optional] +**PurchasesLast6Months** | Pointer to **int32** | Number of successful purchases in the last six months. | [optional] +**SuspiciousActivity** | Pointer to **bool** | Whether suspicious activity was recorded on this account. | [optional] +**WorkPhone** | Pointer to **string** | Shopper's work phone number (including the country code). | [optional] + +## Methods + +### NewAccountInfo2 + +`func NewAccountInfo2() *AccountInfo2` + +NewAccountInfo2 instantiates a new AccountInfo2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountInfo2WithDefaults + +`func NewAccountInfo2WithDefaults() *AccountInfo2` + +NewAccountInfo2WithDefaults instantiates a new AccountInfo2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountAgeIndicator + +`func (o *AccountInfo2) GetAccountAgeIndicator() string` + +GetAccountAgeIndicator returns the AccountAgeIndicator field if non-nil, zero value otherwise. + +### GetAccountAgeIndicatorOk + +`func (o *AccountInfo2) GetAccountAgeIndicatorOk() (*string, bool)` + +GetAccountAgeIndicatorOk returns a tuple with the AccountAgeIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountAgeIndicator + +`func (o *AccountInfo2) SetAccountAgeIndicator(v string)` + +SetAccountAgeIndicator sets AccountAgeIndicator field to given value. + +### HasAccountAgeIndicator + +`func (o *AccountInfo2) HasAccountAgeIndicator() bool` + +HasAccountAgeIndicator returns a boolean if a field has been set. + +### GetAccountChangeDate + +`func (o *AccountInfo2) GetAccountChangeDate() time.Time` + +GetAccountChangeDate returns the AccountChangeDate field if non-nil, zero value otherwise. + +### GetAccountChangeDateOk + +`func (o *AccountInfo2) GetAccountChangeDateOk() (*time.Time, bool)` + +GetAccountChangeDateOk returns a tuple with the AccountChangeDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountChangeDate + +`func (o *AccountInfo2) SetAccountChangeDate(v time.Time)` + +SetAccountChangeDate sets AccountChangeDate field to given value. + +### HasAccountChangeDate + +`func (o *AccountInfo2) HasAccountChangeDate() bool` + +HasAccountChangeDate returns a boolean if a field has been set. + +### GetAccountChangeIndicator + +`func (o *AccountInfo2) GetAccountChangeIndicator() string` + +GetAccountChangeIndicator returns the AccountChangeIndicator field if non-nil, zero value otherwise. + +### GetAccountChangeIndicatorOk + +`func (o *AccountInfo2) GetAccountChangeIndicatorOk() (*string, bool)` + +GetAccountChangeIndicatorOk returns a tuple with the AccountChangeIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountChangeIndicator + +`func (o *AccountInfo2) SetAccountChangeIndicator(v string)` + +SetAccountChangeIndicator sets AccountChangeIndicator field to given value. + +### HasAccountChangeIndicator + +`func (o *AccountInfo2) HasAccountChangeIndicator() bool` + +HasAccountChangeIndicator returns a boolean if a field has been set. + +### GetAccountCreationDate + +`func (o *AccountInfo2) GetAccountCreationDate() time.Time` + +GetAccountCreationDate returns the AccountCreationDate field if non-nil, zero value otherwise. + +### GetAccountCreationDateOk + +`func (o *AccountInfo2) GetAccountCreationDateOk() (*time.Time, bool)` + +GetAccountCreationDateOk returns a tuple with the AccountCreationDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountCreationDate + +`func (o *AccountInfo2) SetAccountCreationDate(v time.Time)` + +SetAccountCreationDate sets AccountCreationDate field to given value. + +### HasAccountCreationDate + +`func (o *AccountInfo2) HasAccountCreationDate() bool` + +HasAccountCreationDate returns a boolean if a field has been set. + +### GetAccountType + +`func (o *AccountInfo2) GetAccountType() string` + +GetAccountType returns the AccountType field if non-nil, zero value otherwise. + +### GetAccountTypeOk + +`func (o *AccountInfo2) GetAccountTypeOk() (*string, bool)` + +GetAccountTypeOk returns a tuple with the AccountType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountType + +`func (o *AccountInfo2) SetAccountType(v string)` + +SetAccountType sets AccountType field to given value. + +### HasAccountType + +`func (o *AccountInfo2) HasAccountType() bool` + +HasAccountType returns a boolean if a field has been set. + +### GetAddCardAttemptsDay + +`func (o *AccountInfo2) GetAddCardAttemptsDay() int32` + +GetAddCardAttemptsDay returns the AddCardAttemptsDay field if non-nil, zero value otherwise. + +### GetAddCardAttemptsDayOk + +`func (o *AccountInfo2) GetAddCardAttemptsDayOk() (*int32, bool)` + +GetAddCardAttemptsDayOk returns a tuple with the AddCardAttemptsDay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddCardAttemptsDay + +`func (o *AccountInfo2) SetAddCardAttemptsDay(v int32)` + +SetAddCardAttemptsDay sets AddCardAttemptsDay field to given value. + +### HasAddCardAttemptsDay + +`func (o *AccountInfo2) HasAddCardAttemptsDay() bool` + +HasAddCardAttemptsDay returns a boolean if a field has been set. + +### GetDeliveryAddressUsageDate + +`func (o *AccountInfo2) GetDeliveryAddressUsageDate() time.Time` + +GetDeliveryAddressUsageDate returns the DeliveryAddressUsageDate field if non-nil, zero value otherwise. + +### GetDeliveryAddressUsageDateOk + +`func (o *AccountInfo2) GetDeliveryAddressUsageDateOk() (*time.Time, bool)` + +GetDeliveryAddressUsageDateOk returns a tuple with the DeliveryAddressUsageDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddressUsageDate + +`func (o *AccountInfo2) SetDeliveryAddressUsageDate(v time.Time)` + +SetDeliveryAddressUsageDate sets DeliveryAddressUsageDate field to given value. + +### HasDeliveryAddressUsageDate + +`func (o *AccountInfo2) HasDeliveryAddressUsageDate() bool` + +HasDeliveryAddressUsageDate returns a boolean if a field has been set. + +### GetDeliveryAddressUsageIndicator + +`func (o *AccountInfo2) GetDeliveryAddressUsageIndicator() string` + +GetDeliveryAddressUsageIndicator returns the DeliveryAddressUsageIndicator field if non-nil, zero value otherwise. + +### GetDeliveryAddressUsageIndicatorOk + +`func (o *AccountInfo2) GetDeliveryAddressUsageIndicatorOk() (*string, bool)` + +GetDeliveryAddressUsageIndicatorOk returns a tuple with the DeliveryAddressUsageIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddressUsageIndicator + +`func (o *AccountInfo2) SetDeliveryAddressUsageIndicator(v string)` + +SetDeliveryAddressUsageIndicator sets DeliveryAddressUsageIndicator field to given value. + +### HasDeliveryAddressUsageIndicator + +`func (o *AccountInfo2) HasDeliveryAddressUsageIndicator() bool` + +HasDeliveryAddressUsageIndicator returns a boolean if a field has been set. + +### GetHomePhone + +`func (o *AccountInfo2) GetHomePhone() string` + +GetHomePhone returns the HomePhone field if non-nil, zero value otherwise. + +### GetHomePhoneOk + +`func (o *AccountInfo2) GetHomePhoneOk() (*string, bool)` + +GetHomePhoneOk returns a tuple with the HomePhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHomePhone + +`func (o *AccountInfo2) SetHomePhone(v string)` + +SetHomePhone sets HomePhone field to given value. + +### HasHomePhone + +`func (o *AccountInfo2) HasHomePhone() bool` + +HasHomePhone returns a boolean if a field has been set. + +### GetMobilePhone + +`func (o *AccountInfo2) GetMobilePhone() string` + +GetMobilePhone returns the MobilePhone field if non-nil, zero value otherwise. + +### GetMobilePhoneOk + +`func (o *AccountInfo2) GetMobilePhoneOk() (*string, bool)` + +GetMobilePhoneOk returns a tuple with the MobilePhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobilePhone + +`func (o *AccountInfo2) SetMobilePhone(v string)` + +SetMobilePhone sets MobilePhone field to given value. + +### HasMobilePhone + +`func (o *AccountInfo2) HasMobilePhone() bool` + +HasMobilePhone returns a boolean if a field has been set. + +### GetPasswordChangeDate + +`func (o *AccountInfo2) GetPasswordChangeDate() time.Time` + +GetPasswordChangeDate returns the PasswordChangeDate field if non-nil, zero value otherwise. + +### GetPasswordChangeDateOk + +`func (o *AccountInfo2) GetPasswordChangeDateOk() (*time.Time, bool)` + +GetPasswordChangeDateOk returns a tuple with the PasswordChangeDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPasswordChangeDate + +`func (o *AccountInfo2) SetPasswordChangeDate(v time.Time)` + +SetPasswordChangeDate sets PasswordChangeDate field to given value. + +### HasPasswordChangeDate + +`func (o *AccountInfo2) HasPasswordChangeDate() bool` + +HasPasswordChangeDate returns a boolean if a field has been set. + +### GetPasswordChangeIndicator + +`func (o *AccountInfo2) GetPasswordChangeIndicator() string` + +GetPasswordChangeIndicator returns the PasswordChangeIndicator field if non-nil, zero value otherwise. + +### GetPasswordChangeIndicatorOk + +`func (o *AccountInfo2) GetPasswordChangeIndicatorOk() (*string, bool)` + +GetPasswordChangeIndicatorOk returns a tuple with the PasswordChangeIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPasswordChangeIndicator + +`func (o *AccountInfo2) SetPasswordChangeIndicator(v string)` + +SetPasswordChangeIndicator sets PasswordChangeIndicator field to given value. + +### HasPasswordChangeIndicator + +`func (o *AccountInfo2) HasPasswordChangeIndicator() bool` + +HasPasswordChangeIndicator returns a boolean if a field has been set. + +### GetPastTransactionsDay + +`func (o *AccountInfo2) GetPastTransactionsDay() int32` + +GetPastTransactionsDay returns the PastTransactionsDay field if non-nil, zero value otherwise. + +### GetPastTransactionsDayOk + +`func (o *AccountInfo2) GetPastTransactionsDayOk() (*int32, bool)` + +GetPastTransactionsDayOk returns a tuple with the PastTransactionsDay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPastTransactionsDay + +`func (o *AccountInfo2) SetPastTransactionsDay(v int32)` + +SetPastTransactionsDay sets PastTransactionsDay field to given value. + +### HasPastTransactionsDay + +`func (o *AccountInfo2) HasPastTransactionsDay() bool` + +HasPastTransactionsDay returns a boolean if a field has been set. + +### GetPastTransactionsYear + +`func (o *AccountInfo2) GetPastTransactionsYear() int32` + +GetPastTransactionsYear returns the PastTransactionsYear field if non-nil, zero value otherwise. + +### GetPastTransactionsYearOk + +`func (o *AccountInfo2) GetPastTransactionsYearOk() (*int32, bool)` + +GetPastTransactionsYearOk returns a tuple with the PastTransactionsYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPastTransactionsYear + +`func (o *AccountInfo2) SetPastTransactionsYear(v int32)` + +SetPastTransactionsYear sets PastTransactionsYear field to given value. + +### HasPastTransactionsYear + +`func (o *AccountInfo2) HasPastTransactionsYear() bool` + +HasPastTransactionsYear returns a boolean if a field has been set. + +### GetPaymentAccountAge + +`func (o *AccountInfo2) GetPaymentAccountAge() time.Time` + +GetPaymentAccountAge returns the PaymentAccountAge field if non-nil, zero value otherwise. + +### GetPaymentAccountAgeOk + +`func (o *AccountInfo2) GetPaymentAccountAgeOk() (*time.Time, bool)` + +GetPaymentAccountAgeOk returns a tuple with the PaymentAccountAge field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentAccountAge + +`func (o *AccountInfo2) SetPaymentAccountAge(v time.Time)` + +SetPaymentAccountAge sets PaymentAccountAge field to given value. + +### HasPaymentAccountAge + +`func (o *AccountInfo2) HasPaymentAccountAge() bool` + +HasPaymentAccountAge returns a boolean if a field has been set. + +### GetPaymentAccountIndicator + +`func (o *AccountInfo2) GetPaymentAccountIndicator() string` + +GetPaymentAccountIndicator returns the PaymentAccountIndicator field if non-nil, zero value otherwise. + +### GetPaymentAccountIndicatorOk + +`func (o *AccountInfo2) GetPaymentAccountIndicatorOk() (*string, bool)` + +GetPaymentAccountIndicatorOk returns a tuple with the PaymentAccountIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentAccountIndicator + +`func (o *AccountInfo2) SetPaymentAccountIndicator(v string)` + +SetPaymentAccountIndicator sets PaymentAccountIndicator field to given value. + +### HasPaymentAccountIndicator + +`func (o *AccountInfo2) HasPaymentAccountIndicator() bool` + +HasPaymentAccountIndicator returns a boolean if a field has been set. + +### GetPurchasesLast6Months + +`func (o *AccountInfo2) GetPurchasesLast6Months() int32` + +GetPurchasesLast6Months returns the PurchasesLast6Months field if non-nil, zero value otherwise. + +### GetPurchasesLast6MonthsOk + +`func (o *AccountInfo2) GetPurchasesLast6MonthsOk() (*int32, bool)` + +GetPurchasesLast6MonthsOk returns a tuple with the PurchasesLast6Months field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasesLast6Months + +`func (o *AccountInfo2) SetPurchasesLast6Months(v int32)` + +SetPurchasesLast6Months sets PurchasesLast6Months field to given value. + +### HasPurchasesLast6Months + +`func (o *AccountInfo2) HasPurchasesLast6Months() bool` + +HasPurchasesLast6Months returns a boolean if a field has been set. + +### GetSuspiciousActivity + +`func (o *AccountInfo2) GetSuspiciousActivity() bool` + +GetSuspiciousActivity returns the SuspiciousActivity field if non-nil, zero value otherwise. + +### GetSuspiciousActivityOk + +`func (o *AccountInfo2) GetSuspiciousActivityOk() (*bool, bool)` + +GetSuspiciousActivityOk returns a tuple with the SuspiciousActivity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuspiciousActivity + +`func (o *AccountInfo2) SetSuspiciousActivity(v bool)` + +SetSuspiciousActivity sets SuspiciousActivity field to given value. + +### HasSuspiciousActivity + +`func (o *AccountInfo2) HasSuspiciousActivity() bool` + +HasSuspiciousActivity returns a boolean if a field has been set. + +### GetWorkPhone + +`func (o *AccountInfo2) GetWorkPhone() string` + +GetWorkPhone returns the WorkPhone field if non-nil, zero value otherwise. + +### GetWorkPhoneOk + +`func (o *AccountInfo2) GetWorkPhoneOk() (*string, bool)` + +GetWorkPhoneOk returns a tuple with the WorkPhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkPhone + +`func (o *AccountInfo2) SetWorkPhone(v string)` + +SetWorkPhone sets WorkPhone field to given value. + +### HasWorkPhone + +`func (o *AccountInfo2) HasWorkPhone() bool` + +HasWorkPhone returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Address2.md b/src/checkout/docs/Address2.md new file mode 100644 index 000000000..87037bfd1 --- /dev/null +++ b/src/checkout/docs/Address2.md @@ -0,0 +1,186 @@ +# Address2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**City** | Pointer to **string** | The name of the city. Maximum length: 3000 characters. | [optional] +**Country** | Pointer to **string** | The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. | [optional] +**HouseNumberOrName** | Pointer to **string** | The number or name of the house. Maximum length: 3000 characters. | [optional] +**PostalCode** | Pointer to **string** | A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. | [optional] +**StateOrProvince** | Pointer to **string** | The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. | [optional] +**Street** | Pointer to **string** | The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. | [optional] + +## Methods + +### NewAddress2 + +`func NewAddress2() *Address2` + +NewAddress2 instantiates a new Address2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddress2WithDefaults + +`func NewAddress2WithDefaults() *Address2` + +NewAddress2WithDefaults instantiates a new Address2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCity + +`func (o *Address2) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *Address2) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *Address2) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *Address2) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### GetCountry + +`func (o *Address2) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *Address2) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *Address2) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *Address2) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetHouseNumberOrName + +`func (o *Address2) GetHouseNumberOrName() string` + +GetHouseNumberOrName returns the HouseNumberOrName field if non-nil, zero value otherwise. + +### GetHouseNumberOrNameOk + +`func (o *Address2) GetHouseNumberOrNameOk() (*string, bool)` + +GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHouseNumberOrName + +`func (o *Address2) SetHouseNumberOrName(v string)` + +SetHouseNumberOrName sets HouseNumberOrName field to given value. + +### HasHouseNumberOrName + +`func (o *Address2) HasHouseNumberOrName() bool` + +HasHouseNumberOrName returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *Address2) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *Address2) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *Address2) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *Address2) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + +### GetStateOrProvince + +`func (o *Address2) GetStateOrProvince() string` + +GetStateOrProvince returns the StateOrProvince field if non-nil, zero value otherwise. + +### GetStateOrProvinceOk + +`func (o *Address2) GetStateOrProvinceOk() (*string, bool)` + +GetStateOrProvinceOk returns a tuple with the StateOrProvince field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateOrProvince + +`func (o *Address2) SetStateOrProvince(v string)` + +SetStateOrProvince sets StateOrProvince field to given value. + +### HasStateOrProvince + +`func (o *Address2) HasStateOrProvince() bool` + +HasStateOrProvince returns a boolean if a field has been set. + +### GetStreet + +`func (o *Address2) GetStreet() string` + +GetStreet returns the Street field if non-nil, zero value otherwise. + +### GetStreetOk + +`func (o *Address2) GetStreetOk() (*string, bool)` + +GetStreetOk returns a tuple with the Street field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreet + +`func (o *Address2) SetStreet(v string)` + +SetStreet sets Street field to given value. + +### HasStreet + +`func (o *Address2) HasStreet() bool` + +HasStreet returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Amount2.md b/src/checkout/docs/Amount2.md new file mode 100644 index 000000000..f3598c560 --- /dev/null +++ b/src/checkout/docs/Amount2.md @@ -0,0 +1,82 @@ +# Amount2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Currency** | Pointer to **string** | The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). | [optional] +**Value** | Pointer to **int64** | The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). | [optional] + +## Methods + +### NewAmount2 + +`func NewAmount2() *Amount2` + +NewAmount2 instantiates a new Amount2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAmount2WithDefaults + +`func NewAmount2WithDefaults() *Amount2` + +NewAmount2WithDefaults instantiates a new Amount2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *Amount2) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Amount2) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Amount2) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *Amount2) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetValue + +`func (o *Amount2) GetValue() int64` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *Amount2) GetValueOk() (*int64, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *Amount2) SetValue(v int64)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *Amount2) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/ApplicationInfo2.md b/src/checkout/docs/ApplicationInfo2.md new file mode 100644 index 000000000..5d2c0eb99 --- /dev/null +++ b/src/checkout/docs/ApplicationInfo2.md @@ -0,0 +1,186 @@ +# ApplicationInfo2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdyenLibrary** | Pointer to [**CommonField**](CommonField.md) | | [optional] +**AdyenPaymentSource** | Pointer to [**CommonField**](CommonField.md) | | [optional] +**ExternalPlatform** | Pointer to [**ExternalPlatform**](ExternalPlatform.md) | | [optional] +**MerchantApplication** | Pointer to [**CommonField**](CommonField.md) | | [optional] +**MerchantDevice** | Pointer to [**MerchantDevice**](MerchantDevice.md) | | [optional] +**ShopperInteractionDevice** | Pointer to [**ShopperInteractionDevice**](ShopperInteractionDevice.md) | | [optional] + +## Methods + +### NewApplicationInfo2 + +`func NewApplicationInfo2() *ApplicationInfo2` + +NewApplicationInfo2 instantiates a new ApplicationInfo2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewApplicationInfo2WithDefaults + +`func NewApplicationInfo2WithDefaults() *ApplicationInfo2` + +NewApplicationInfo2WithDefaults instantiates a new ApplicationInfo2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAdyenLibrary + +`func (o *ApplicationInfo2) GetAdyenLibrary() CommonField` + +GetAdyenLibrary returns the AdyenLibrary field if non-nil, zero value otherwise. + +### GetAdyenLibraryOk + +`func (o *ApplicationInfo2) GetAdyenLibraryOk() (*CommonField, bool)` + +GetAdyenLibraryOk returns a tuple with the AdyenLibrary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdyenLibrary + +`func (o *ApplicationInfo2) SetAdyenLibrary(v CommonField)` + +SetAdyenLibrary sets AdyenLibrary field to given value. + +### HasAdyenLibrary + +`func (o *ApplicationInfo2) HasAdyenLibrary() bool` + +HasAdyenLibrary returns a boolean if a field has been set. + +### GetAdyenPaymentSource + +`func (o *ApplicationInfo2) GetAdyenPaymentSource() CommonField` + +GetAdyenPaymentSource returns the AdyenPaymentSource field if non-nil, zero value otherwise. + +### GetAdyenPaymentSourceOk + +`func (o *ApplicationInfo2) GetAdyenPaymentSourceOk() (*CommonField, bool)` + +GetAdyenPaymentSourceOk returns a tuple with the AdyenPaymentSource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdyenPaymentSource + +`func (o *ApplicationInfo2) SetAdyenPaymentSource(v CommonField)` + +SetAdyenPaymentSource sets AdyenPaymentSource field to given value. + +### HasAdyenPaymentSource + +`func (o *ApplicationInfo2) HasAdyenPaymentSource() bool` + +HasAdyenPaymentSource returns a boolean if a field has been set. + +### GetExternalPlatform + +`func (o *ApplicationInfo2) GetExternalPlatform() ExternalPlatform` + +GetExternalPlatform returns the ExternalPlatform field if non-nil, zero value otherwise. + +### GetExternalPlatformOk + +`func (o *ApplicationInfo2) GetExternalPlatformOk() (*ExternalPlatform, bool)` + +GetExternalPlatformOk returns a tuple with the ExternalPlatform field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalPlatform + +`func (o *ApplicationInfo2) SetExternalPlatform(v ExternalPlatform)` + +SetExternalPlatform sets ExternalPlatform field to given value. + +### HasExternalPlatform + +`func (o *ApplicationInfo2) HasExternalPlatform() bool` + +HasExternalPlatform returns a boolean if a field has been set. + +### GetMerchantApplication + +`func (o *ApplicationInfo2) GetMerchantApplication() CommonField` + +GetMerchantApplication returns the MerchantApplication field if non-nil, zero value otherwise. + +### GetMerchantApplicationOk + +`func (o *ApplicationInfo2) GetMerchantApplicationOk() (*CommonField, bool)` + +GetMerchantApplicationOk returns a tuple with the MerchantApplication field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantApplication + +`func (o *ApplicationInfo2) SetMerchantApplication(v CommonField)` + +SetMerchantApplication sets MerchantApplication field to given value. + +### HasMerchantApplication + +`func (o *ApplicationInfo2) HasMerchantApplication() bool` + +HasMerchantApplication returns a boolean if a field has been set. + +### GetMerchantDevice + +`func (o *ApplicationInfo2) GetMerchantDevice() MerchantDevice` + +GetMerchantDevice returns the MerchantDevice field if non-nil, zero value otherwise. + +### GetMerchantDeviceOk + +`func (o *ApplicationInfo2) GetMerchantDeviceOk() (*MerchantDevice, bool)` + +GetMerchantDeviceOk returns a tuple with the MerchantDevice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantDevice + +`func (o *ApplicationInfo2) SetMerchantDevice(v MerchantDevice)` + +SetMerchantDevice sets MerchantDevice field to given value. + +### HasMerchantDevice + +`func (o *ApplicationInfo2) HasMerchantDevice() bool` + +HasMerchantDevice returns a boolean if a field has been set. + +### GetShopperInteractionDevice + +`func (o *ApplicationInfo2) GetShopperInteractionDevice() ShopperInteractionDevice` + +GetShopperInteractionDevice returns the ShopperInteractionDevice field if non-nil, zero value otherwise. + +### GetShopperInteractionDeviceOk + +`func (o *ApplicationInfo2) GetShopperInteractionDeviceOk() (*ShopperInteractionDevice, bool)` + +GetShopperInteractionDeviceOk returns a tuple with the ShopperInteractionDevice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperInteractionDevice + +`func (o *ApplicationInfo2) SetShopperInteractionDevice(v ShopperInteractionDevice)` + +SetShopperInteractionDevice sets ShopperInteractionDevice field to given value. + +### HasShopperInteractionDevice + +`func (o *ApplicationInfo2) HasShopperInteractionDevice() bool` + +HasShopperInteractionDevice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/BrowserInfo2.md b/src/checkout/docs/BrowserInfo2.md new file mode 100644 index 000000000..f6e26d139 --- /dev/null +++ b/src/checkout/docs/BrowserInfo2.md @@ -0,0 +1,264 @@ +# BrowserInfo2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AcceptHeader** | Pointer to **string** | The accept header value of the shopper's browser. | [optional] +**ColorDepth** | Pointer to **int32** | The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. | [optional] +**JavaEnabled** | Pointer to **bool** | Boolean value indicating if the shopper's browser is able to execute Java. | [optional] +**JavaScriptEnabled** | Pointer to **bool** | Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. | [optional] [default to true] +**Language** | Pointer to **string** | The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). | [optional] +**ScreenHeight** | Pointer to **int32** | The total height of the shopper's device screen in pixels. | [optional] +**ScreenWidth** | Pointer to **int32** | The total width of the shopper's device screen in pixels. | [optional] +**TimeZoneOffset** | Pointer to **int32** | Time difference between UTC time and the shopper's browser local time, in minutes. | [optional] +**UserAgent** | Pointer to **string** | The user agent value of the shopper's browser. | [optional] + +## Methods + +### NewBrowserInfo2 + +`func NewBrowserInfo2() *BrowserInfo2` + +NewBrowserInfo2 instantiates a new BrowserInfo2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBrowserInfo2WithDefaults + +`func NewBrowserInfo2WithDefaults() *BrowserInfo2` + +NewBrowserInfo2WithDefaults instantiates a new BrowserInfo2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAcceptHeader + +`func (o *BrowserInfo2) GetAcceptHeader() string` + +GetAcceptHeader returns the AcceptHeader field if non-nil, zero value otherwise. + +### GetAcceptHeaderOk + +`func (o *BrowserInfo2) GetAcceptHeaderOk() (*string, bool)` + +GetAcceptHeaderOk returns a tuple with the AcceptHeader field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAcceptHeader + +`func (o *BrowserInfo2) SetAcceptHeader(v string)` + +SetAcceptHeader sets AcceptHeader field to given value. + +### HasAcceptHeader + +`func (o *BrowserInfo2) HasAcceptHeader() bool` + +HasAcceptHeader returns a boolean if a field has been set. + +### GetColorDepth + +`func (o *BrowserInfo2) GetColorDepth() int32` + +GetColorDepth returns the ColorDepth field if non-nil, zero value otherwise. + +### GetColorDepthOk + +`func (o *BrowserInfo2) GetColorDepthOk() (*int32, bool)` + +GetColorDepthOk returns a tuple with the ColorDepth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetColorDepth + +`func (o *BrowserInfo2) SetColorDepth(v int32)` + +SetColorDepth sets ColorDepth field to given value. + +### HasColorDepth + +`func (o *BrowserInfo2) HasColorDepth() bool` + +HasColorDepth returns a boolean if a field has been set. + +### GetJavaEnabled + +`func (o *BrowserInfo2) GetJavaEnabled() bool` + +GetJavaEnabled returns the JavaEnabled field if non-nil, zero value otherwise. + +### GetJavaEnabledOk + +`func (o *BrowserInfo2) GetJavaEnabledOk() (*bool, bool)` + +GetJavaEnabledOk returns a tuple with the JavaEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJavaEnabled + +`func (o *BrowserInfo2) SetJavaEnabled(v bool)` + +SetJavaEnabled sets JavaEnabled field to given value. + +### HasJavaEnabled + +`func (o *BrowserInfo2) HasJavaEnabled() bool` + +HasJavaEnabled returns a boolean if a field has been set. + +### GetJavaScriptEnabled + +`func (o *BrowserInfo2) GetJavaScriptEnabled() bool` + +GetJavaScriptEnabled returns the JavaScriptEnabled field if non-nil, zero value otherwise. + +### GetJavaScriptEnabledOk + +`func (o *BrowserInfo2) GetJavaScriptEnabledOk() (*bool, bool)` + +GetJavaScriptEnabledOk returns a tuple with the JavaScriptEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJavaScriptEnabled + +`func (o *BrowserInfo2) SetJavaScriptEnabled(v bool)` + +SetJavaScriptEnabled sets JavaScriptEnabled field to given value. + +### HasJavaScriptEnabled + +`func (o *BrowserInfo2) HasJavaScriptEnabled() bool` + +HasJavaScriptEnabled returns a boolean if a field has been set. + +### GetLanguage + +`func (o *BrowserInfo2) GetLanguage() string` + +GetLanguage returns the Language field if non-nil, zero value otherwise. + +### GetLanguageOk + +`func (o *BrowserInfo2) GetLanguageOk() (*string, bool)` + +GetLanguageOk returns a tuple with the Language field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLanguage + +`func (o *BrowserInfo2) SetLanguage(v string)` + +SetLanguage sets Language field to given value. + +### HasLanguage + +`func (o *BrowserInfo2) HasLanguage() bool` + +HasLanguage returns a boolean if a field has been set. + +### GetScreenHeight + +`func (o *BrowserInfo2) GetScreenHeight() int32` + +GetScreenHeight returns the ScreenHeight field if non-nil, zero value otherwise. + +### GetScreenHeightOk + +`func (o *BrowserInfo2) GetScreenHeightOk() (*int32, bool)` + +GetScreenHeightOk returns a tuple with the ScreenHeight field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScreenHeight + +`func (o *BrowserInfo2) SetScreenHeight(v int32)` + +SetScreenHeight sets ScreenHeight field to given value. + +### HasScreenHeight + +`func (o *BrowserInfo2) HasScreenHeight() bool` + +HasScreenHeight returns a boolean if a field has been set. + +### GetScreenWidth + +`func (o *BrowserInfo2) GetScreenWidth() int32` + +GetScreenWidth returns the ScreenWidth field if non-nil, zero value otherwise. + +### GetScreenWidthOk + +`func (o *BrowserInfo2) GetScreenWidthOk() (*int32, bool)` + +GetScreenWidthOk returns a tuple with the ScreenWidth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScreenWidth + +`func (o *BrowserInfo2) SetScreenWidth(v int32)` + +SetScreenWidth sets ScreenWidth field to given value. + +### HasScreenWidth + +`func (o *BrowserInfo2) HasScreenWidth() bool` + +HasScreenWidth returns a boolean if a field has been set. + +### GetTimeZoneOffset + +`func (o *BrowserInfo2) GetTimeZoneOffset() int32` + +GetTimeZoneOffset returns the TimeZoneOffset field if non-nil, zero value otherwise. + +### GetTimeZoneOffsetOk + +`func (o *BrowserInfo2) GetTimeZoneOffsetOk() (*int32, bool)` + +GetTimeZoneOffsetOk returns a tuple with the TimeZoneOffset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeZoneOffset + +`func (o *BrowserInfo2) SetTimeZoneOffset(v int32)` + +SetTimeZoneOffset sets TimeZoneOffset field to given value. + +### HasTimeZoneOffset + +`func (o *BrowserInfo2) HasTimeZoneOffset() bool` + +HasTimeZoneOffset returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *BrowserInfo2) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *BrowserInfo2) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *BrowserInfo2) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *BrowserInfo2) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/CheckoutBalanceCheckRequest.md b/src/checkout/docs/CheckoutBalanceCheckRequest.md index 97eb1248e..436a0cf8f 100644 --- a/src/checkout/docs/CheckoutBalanceCheckRequest.md +++ b/src/checkout/docs/CheckoutBalanceCheckRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **AccountInfo** | Pointer to [**AccountInfo**](AccountInfo.md) | | [optional] **AdditionalAmount** | Pointer to [**Amount**](Amount.md) | | [optional] **AdditionalData** | Pointer to **map[string]string** | This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. | [optional] -**Amount** | Pointer to [**Amount**](Amount.md) | | [optional] +**Amount** | [**Amount**](Amount.md) | | **ApplicationInfo** | Pointer to [**ApplicationInfo**](ApplicationInfo.md) | | [optional] **BillingAddress** | Pointer to [**Address**](Address.md) | | [optional] **BrowserInfo** | Pointer to [**BrowserInfo**](BrowserInfo.md) | | [optional] @@ -53,7 +53,7 @@ Name | Type | Description | Notes ### NewCheckoutBalanceCheckRequest -`func NewCheckoutBalanceCheckRequest(merchantAccount string, paymentMethod map[string]string, ) *CheckoutBalanceCheckRequest` +`func NewCheckoutBalanceCheckRequest(amount Amount, merchantAccount string, paymentMethod map[string]string, ) *CheckoutBalanceCheckRequest` NewCheckoutBalanceCheckRequest instantiates a new CheckoutBalanceCheckRequest object This constructor will assign default values to properties that have it defined, @@ -162,11 +162,6 @@ and a boolean to check if the value has been set. SetAmount sets Amount field to given value. -### HasAmount - -`func (o *CheckoutBalanceCheckRequest) HasAmount() bool` - -HasAmount returns a boolean if a field has been set. ### GetApplicationInfo diff --git a/src/checkout/docs/CheckoutDonationPaymentRequest.md b/src/checkout/docs/CheckoutDonationPaymentRequest.md new file mode 100644 index 000000000..378a29d38 --- /dev/null +++ b/src/checkout/docs/CheckoutDonationPaymentRequest.md @@ -0,0 +1,1767 @@ +# CheckoutDonationPaymentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountInfo** | Pointer to [**AccountInfo2**](AccountInfo2.md) | | [optional] +**AdditionalAmount** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**AdditionalData** | Pointer to **map[string]string** | This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. | [optional] +**Amount** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**ApplicationInfo** | Pointer to [**ApplicationInfo2**](ApplicationInfo2.md) | | [optional] +**AuthenticationData** | Pointer to [**AuthenticationData**](AuthenticationData.md) | | [optional] +**BillingAddress** | Pointer to [**Address2**](Address2.md) | | [optional] +**BrowserInfo** | Pointer to [**BrowserInfo2**](BrowserInfo2.md) | | [optional] +**CaptureDelayHours** | Pointer to **int32** | The delay between the authorisation and scheduled auto-capture, specified in hours. | [optional] +**Channel** | Pointer to **string** | The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web | [optional] +**CheckoutAttemptId** | Pointer to **string** | Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. | [optional] +**Company** | Pointer to [**Company**](Company.md) | | [optional] +**ConversionId** | Pointer to **string** | Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. | [optional] +**CountryCode** | Pointer to **string** | The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE | [optional] +**DateOfBirth** | Pointer to **time.Time** | The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD | [optional] +**DccQuote** | Pointer to [**ForexQuote2**](ForexQuote2.md) | | [optional] +**DeliveryAddress** | Pointer to [**Address2**](Address2.md) | | [optional] +**DeliveryDate** | Pointer to **time.Time** | The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 | [optional] +**DeviceFingerprint** | Pointer to **string** | A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). | [optional] +**DonationAccount** | **string** | Donation account to which the transaction is credited. | +**DonationOriginalPspReference** | Pointer to **string** | PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. | [optional] +**DonationToken** | Pointer to **string** | Donation token received in the `/payments` call. | [optional] +**EnableOneClick** | Pointer to **bool** | When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. | [optional] +**EnablePayOut** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for payouts. | [optional] +**EnableRecurring** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. | [optional] +**EntityType** | Pointer to **string** | The type of the entity the payment is processed for. | [optional] +**FraudOffset** | Pointer to **int32** | An integer value that is added to the normal fraud score. The value can be either positive or negative. | [optional] +**IndustryUsage** | Pointer to **string** | The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** | [optional] +**Installments** | Pointer to [**Installments2**](Installments2.md) | | [optional] +**LineItems** | Pointer to [**[]LineItem**](LineItem.md) | Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. | [optional] +**LocalizedShopperStatement** | Pointer to **map[string]string** | This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. | [optional] +**Mandate** | Pointer to [**Mandate**](Mandate.md) | | [optional] +**Mcc** | Pointer to **string** | The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. | [optional] +**MerchantAccount** | Pointer to **string** | The merchant account identifier, with which you want to process the transaction. | [optional] +**MerchantOrderReference** | Pointer to **string** | This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. | [optional] +**MerchantRiskIndicator** | Pointer to [**MerchantRiskIndicator2**](MerchantRiskIndicator2.md) | | [optional] +**Metadata** | Pointer to **map[string]string** | Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. | [optional] +**MpiData** | Pointer to [**ThreeDSecureData**](ThreeDSecureData.md) | | [optional] +**Order** | Pointer to [**EncryptedOrderData**](EncryptedOrderData.md) | | [optional] +**OrderReference** | Pointer to **string** | When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. | [optional] +**Origin** | Pointer to **string** | Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. | [optional] +**PaymentMethod** | Pointer to [**CheckoutDonationPaymentRequestPaymentMethod**](CheckoutDonationPaymentRequestPaymentMethod.md) | | [optional] +**PlatformChargebackLogic** | Pointer to [**PlatformChargebackLogic**](PlatformChargebackLogic.md) | | [optional] +**RecurringExpiry** | Pointer to **string** | Date after which no further authorisations shall be performed. Only for 3D Secure 2. | [optional] +**RecurringFrequency** | Pointer to **string** | Minimum number of days between authorisations. Only for 3D Secure 2. | [optional] +**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] +**RedirectFromIssuerMethod** | Pointer to **string** | Specifies the redirect method (GET or POST) when redirecting back from the issuer. | [optional] +**RedirectToIssuerMethod** | Pointer to **string** | Specifies the redirect method (GET or POST) when redirecting to the issuer. | [optional] +**Reference** | Pointer to **string** | The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. | [optional] +**ReturnUrl** | Pointer to **string** | The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` | [optional] +**RiskData** | Pointer to [**RiskData**](RiskData.md) | | [optional] +**SessionValidity** | Pointer to **string** | The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 | [optional] +**ShopperEmail** | Pointer to **string** | The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. | [optional] +**ShopperIP** | Pointer to **string** | The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). | [optional] +**ShopperInteraction** | Pointer to **string** | Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. | [optional] +**ShopperLocale** | Pointer to **string** | The combination of a language code and a country code to specify the language to be used in the payment. | [optional] +**ShopperName** | Pointer to [**Name2**](Name2.md) | | [optional] +**ShopperReference** | Pointer to **string** | Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. | [optional] +**ShopperStatement** | Pointer to **string** | The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. | [optional] +**SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] +**Splits** | Pointer to [**[]Split2**](Split2.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] +**Store** | Pointer to **string** | The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. | [optional] +**StorePaymentMethod** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be stored. | [optional] +**TelephoneNumber** | Pointer to **string** | The shopper's telephone number. | [optional] +**ThreeDS2RequestData** | Pointer to [**ThreeDS2RequestData2**](ThreeDS2RequestData2.md) | | [optional] +**ThreeDSAuthenticationOnly** | Pointer to **bool** | If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. | [optional] [default to false] +**TrustedShopper** | Pointer to **bool** | Set to true if the payment should be routed to a trusted MID. | [optional] + +## Methods + +### NewCheckoutDonationPaymentRequest + +`func NewCheckoutDonationPaymentRequest(donationAccount string, ) *CheckoutDonationPaymentRequest` + +NewCheckoutDonationPaymentRequest instantiates a new CheckoutDonationPaymentRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCheckoutDonationPaymentRequestWithDefaults + +`func NewCheckoutDonationPaymentRequestWithDefaults() *CheckoutDonationPaymentRequest` + +NewCheckoutDonationPaymentRequestWithDefaults instantiates a new CheckoutDonationPaymentRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountInfo + +`func (o *CheckoutDonationPaymentRequest) GetAccountInfo() AccountInfo2` + +GetAccountInfo returns the AccountInfo field if non-nil, zero value otherwise. + +### GetAccountInfoOk + +`func (o *CheckoutDonationPaymentRequest) GetAccountInfoOk() (*AccountInfo2, bool)` + +GetAccountInfoOk returns a tuple with the AccountInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountInfo + +`func (o *CheckoutDonationPaymentRequest) SetAccountInfo(v AccountInfo2)` + +SetAccountInfo sets AccountInfo field to given value. + +### HasAccountInfo + +`func (o *CheckoutDonationPaymentRequest) HasAccountInfo() bool` + +HasAccountInfo returns a boolean if a field has been set. + +### GetAdditionalAmount + +`func (o *CheckoutDonationPaymentRequest) GetAdditionalAmount() Amount2` + +GetAdditionalAmount returns the AdditionalAmount field if non-nil, zero value otherwise. + +### GetAdditionalAmountOk + +`func (o *CheckoutDonationPaymentRequest) GetAdditionalAmountOk() (*Amount2, bool)` + +GetAdditionalAmountOk returns a tuple with the AdditionalAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalAmount + +`func (o *CheckoutDonationPaymentRequest) SetAdditionalAmount(v Amount2)` + +SetAdditionalAmount sets AdditionalAmount field to given value. + +### HasAdditionalAmount + +`func (o *CheckoutDonationPaymentRequest) HasAdditionalAmount() bool` + +HasAdditionalAmount returns a boolean if a field has been set. + +### GetAdditionalData + +`func (o *CheckoutDonationPaymentRequest) GetAdditionalData() map[string]string` + +GetAdditionalData returns the AdditionalData field if non-nil, zero value otherwise. + +### GetAdditionalDataOk + +`func (o *CheckoutDonationPaymentRequest) GetAdditionalDataOk() (*map[string]string, bool)` + +GetAdditionalDataOk returns a tuple with the AdditionalData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalData + +`func (o *CheckoutDonationPaymentRequest) SetAdditionalData(v map[string]string)` + +SetAdditionalData sets AdditionalData field to given value. + +### HasAdditionalData + +`func (o *CheckoutDonationPaymentRequest) HasAdditionalData() bool` + +HasAdditionalData returns a boolean if a field has been set. + +### GetAmount + +`func (o *CheckoutDonationPaymentRequest) GetAmount() Amount2` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *CheckoutDonationPaymentRequest) GetAmountOk() (*Amount2, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *CheckoutDonationPaymentRequest) SetAmount(v Amount2)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *CheckoutDonationPaymentRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetApplicationInfo + +`func (o *CheckoutDonationPaymentRequest) GetApplicationInfo() ApplicationInfo2` + +GetApplicationInfo returns the ApplicationInfo field if non-nil, zero value otherwise. + +### GetApplicationInfoOk + +`func (o *CheckoutDonationPaymentRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool)` + +GetApplicationInfoOk returns a tuple with the ApplicationInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplicationInfo + +`func (o *CheckoutDonationPaymentRequest) SetApplicationInfo(v ApplicationInfo2)` + +SetApplicationInfo sets ApplicationInfo field to given value. + +### HasApplicationInfo + +`func (o *CheckoutDonationPaymentRequest) HasApplicationInfo() bool` + +HasApplicationInfo returns a boolean if a field has been set. + +### GetAuthenticationData + +`func (o *CheckoutDonationPaymentRequest) GetAuthenticationData() AuthenticationData` + +GetAuthenticationData returns the AuthenticationData field if non-nil, zero value otherwise. + +### GetAuthenticationDataOk + +`func (o *CheckoutDonationPaymentRequest) GetAuthenticationDataOk() (*AuthenticationData, bool)` + +GetAuthenticationDataOk returns a tuple with the AuthenticationData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthenticationData + +`func (o *CheckoutDonationPaymentRequest) SetAuthenticationData(v AuthenticationData)` + +SetAuthenticationData sets AuthenticationData field to given value. + +### HasAuthenticationData + +`func (o *CheckoutDonationPaymentRequest) HasAuthenticationData() bool` + +HasAuthenticationData returns a boolean if a field has been set. + +### GetBillingAddress + +`func (o *CheckoutDonationPaymentRequest) GetBillingAddress() Address2` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *CheckoutDonationPaymentRequest) GetBillingAddressOk() (*Address2, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *CheckoutDonationPaymentRequest) SetBillingAddress(v Address2)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *CheckoutDonationPaymentRequest) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetBrowserInfo + +`func (o *CheckoutDonationPaymentRequest) GetBrowserInfo() BrowserInfo2` + +GetBrowserInfo returns the BrowserInfo field if non-nil, zero value otherwise. + +### GetBrowserInfoOk + +`func (o *CheckoutDonationPaymentRequest) GetBrowserInfoOk() (*BrowserInfo2, bool)` + +GetBrowserInfoOk returns a tuple with the BrowserInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowserInfo + +`func (o *CheckoutDonationPaymentRequest) SetBrowserInfo(v BrowserInfo2)` + +SetBrowserInfo sets BrowserInfo field to given value. + +### HasBrowserInfo + +`func (o *CheckoutDonationPaymentRequest) HasBrowserInfo() bool` + +HasBrowserInfo returns a boolean if a field has been set. + +### GetCaptureDelayHours + +`func (o *CheckoutDonationPaymentRequest) GetCaptureDelayHours() int32` + +GetCaptureDelayHours returns the CaptureDelayHours field if non-nil, zero value otherwise. + +### GetCaptureDelayHoursOk + +`func (o *CheckoutDonationPaymentRequest) GetCaptureDelayHoursOk() (*int32, bool)` + +GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaptureDelayHours + +`func (o *CheckoutDonationPaymentRequest) SetCaptureDelayHours(v int32)` + +SetCaptureDelayHours sets CaptureDelayHours field to given value. + +### HasCaptureDelayHours + +`func (o *CheckoutDonationPaymentRequest) HasCaptureDelayHours() bool` + +HasCaptureDelayHours returns a boolean if a field has been set. + +### GetChannel + +`func (o *CheckoutDonationPaymentRequest) GetChannel() string` + +GetChannel returns the Channel field if non-nil, zero value otherwise. + +### GetChannelOk + +`func (o *CheckoutDonationPaymentRequest) GetChannelOk() (*string, bool)` + +GetChannelOk returns a tuple with the Channel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannel + +`func (o *CheckoutDonationPaymentRequest) SetChannel(v string)` + +SetChannel sets Channel field to given value. + +### HasChannel + +`func (o *CheckoutDonationPaymentRequest) HasChannel() bool` + +HasChannel returns a boolean if a field has been set. + +### GetCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequest) GetCheckoutAttemptId() string` + +GetCheckoutAttemptId returns the CheckoutAttemptId field if non-nil, zero value otherwise. + +### GetCheckoutAttemptIdOk + +`func (o *CheckoutDonationPaymentRequest) GetCheckoutAttemptIdOk() (*string, bool)` + +GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequest) SetCheckoutAttemptId(v string)` + +SetCheckoutAttemptId sets CheckoutAttemptId field to given value. + +### HasCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequest) HasCheckoutAttemptId() bool` + +HasCheckoutAttemptId returns a boolean if a field has been set. + +### GetCompany + +`func (o *CheckoutDonationPaymentRequest) GetCompany() Company` + +GetCompany returns the Company field if non-nil, zero value otherwise. + +### GetCompanyOk + +`func (o *CheckoutDonationPaymentRequest) GetCompanyOk() (*Company, bool)` + +GetCompanyOk returns a tuple with the Company field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompany + +`func (o *CheckoutDonationPaymentRequest) SetCompany(v Company)` + +SetCompany sets Company field to given value. + +### HasCompany + +`func (o *CheckoutDonationPaymentRequest) HasCompany() bool` + +HasCompany returns a boolean if a field has been set. + +### GetConversionId + +`func (o *CheckoutDonationPaymentRequest) GetConversionId() string` + +GetConversionId returns the ConversionId field if non-nil, zero value otherwise. + +### GetConversionIdOk + +`func (o *CheckoutDonationPaymentRequest) GetConversionIdOk() (*string, bool)` + +GetConversionIdOk returns a tuple with the ConversionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConversionId + +`func (o *CheckoutDonationPaymentRequest) SetConversionId(v string)` + +SetConversionId sets ConversionId field to given value. + +### HasConversionId + +`func (o *CheckoutDonationPaymentRequest) HasConversionId() bool` + +HasConversionId returns a boolean if a field has been set. + +### GetCountryCode + +`func (o *CheckoutDonationPaymentRequest) GetCountryCode() string` + +GetCountryCode returns the CountryCode field if non-nil, zero value otherwise. + +### GetCountryCodeOk + +`func (o *CheckoutDonationPaymentRequest) GetCountryCodeOk() (*string, bool)` + +GetCountryCodeOk returns a tuple with the CountryCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryCode + +`func (o *CheckoutDonationPaymentRequest) SetCountryCode(v string)` + +SetCountryCode sets CountryCode field to given value. + +### HasCountryCode + +`func (o *CheckoutDonationPaymentRequest) HasCountryCode() bool` + +HasCountryCode returns a boolean if a field has been set. + +### GetDateOfBirth + +`func (o *CheckoutDonationPaymentRequest) GetDateOfBirth() time.Time` + +GetDateOfBirth returns the DateOfBirth field if non-nil, zero value otherwise. + +### GetDateOfBirthOk + +`func (o *CheckoutDonationPaymentRequest) GetDateOfBirthOk() (*time.Time, bool)` + +GetDateOfBirthOk returns a tuple with the DateOfBirth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateOfBirth + +`func (o *CheckoutDonationPaymentRequest) SetDateOfBirth(v time.Time)` + +SetDateOfBirth sets DateOfBirth field to given value. + +### HasDateOfBirth + +`func (o *CheckoutDonationPaymentRequest) HasDateOfBirth() bool` + +HasDateOfBirth returns a boolean if a field has been set. + +### GetDccQuote + +`func (o *CheckoutDonationPaymentRequest) GetDccQuote() ForexQuote2` + +GetDccQuote returns the DccQuote field if non-nil, zero value otherwise. + +### GetDccQuoteOk + +`func (o *CheckoutDonationPaymentRequest) GetDccQuoteOk() (*ForexQuote2, bool)` + +GetDccQuoteOk returns a tuple with the DccQuote field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDccQuote + +`func (o *CheckoutDonationPaymentRequest) SetDccQuote(v ForexQuote2)` + +SetDccQuote sets DccQuote field to given value. + +### HasDccQuote + +`func (o *CheckoutDonationPaymentRequest) HasDccQuote() bool` + +HasDccQuote returns a boolean if a field has been set. + +### GetDeliveryAddress + +`func (o *CheckoutDonationPaymentRequest) GetDeliveryAddress() Address2` + +GetDeliveryAddress returns the DeliveryAddress field if non-nil, zero value otherwise. + +### GetDeliveryAddressOk + +`func (o *CheckoutDonationPaymentRequest) GetDeliveryAddressOk() (*Address2, bool)` + +GetDeliveryAddressOk returns a tuple with the DeliveryAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddress + +`func (o *CheckoutDonationPaymentRequest) SetDeliveryAddress(v Address2)` + +SetDeliveryAddress sets DeliveryAddress field to given value. + +### HasDeliveryAddress + +`func (o *CheckoutDonationPaymentRequest) HasDeliveryAddress() bool` + +HasDeliveryAddress returns a boolean if a field has been set. + +### GetDeliveryDate + +`func (o *CheckoutDonationPaymentRequest) GetDeliveryDate() time.Time` + +GetDeliveryDate returns the DeliveryDate field if non-nil, zero value otherwise. + +### GetDeliveryDateOk + +`func (o *CheckoutDonationPaymentRequest) GetDeliveryDateOk() (*time.Time, bool)` + +GetDeliveryDateOk returns a tuple with the DeliveryDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryDate + +`func (o *CheckoutDonationPaymentRequest) SetDeliveryDate(v time.Time)` + +SetDeliveryDate sets DeliveryDate field to given value. + +### HasDeliveryDate + +`func (o *CheckoutDonationPaymentRequest) HasDeliveryDate() bool` + +HasDeliveryDate returns a boolean if a field has been set. + +### GetDeviceFingerprint + +`func (o *CheckoutDonationPaymentRequest) GetDeviceFingerprint() string` + +GetDeviceFingerprint returns the DeviceFingerprint field if non-nil, zero value otherwise. + +### GetDeviceFingerprintOk + +`func (o *CheckoutDonationPaymentRequest) GetDeviceFingerprintOk() (*string, bool)` + +GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceFingerprint + +`func (o *CheckoutDonationPaymentRequest) SetDeviceFingerprint(v string)` + +SetDeviceFingerprint sets DeviceFingerprint field to given value. + +### HasDeviceFingerprint + +`func (o *CheckoutDonationPaymentRequest) HasDeviceFingerprint() bool` + +HasDeviceFingerprint returns a boolean if a field has been set. + +### GetDonationAccount + +`func (o *CheckoutDonationPaymentRequest) GetDonationAccount() string` + +GetDonationAccount returns the DonationAccount field if non-nil, zero value otherwise. + +### GetDonationAccountOk + +`func (o *CheckoutDonationPaymentRequest) GetDonationAccountOk() (*string, bool)` + +GetDonationAccountOk returns a tuple with the DonationAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDonationAccount + +`func (o *CheckoutDonationPaymentRequest) SetDonationAccount(v string)` + +SetDonationAccount sets DonationAccount field to given value. + + +### GetDonationOriginalPspReference + +`func (o *CheckoutDonationPaymentRequest) GetDonationOriginalPspReference() string` + +GetDonationOriginalPspReference returns the DonationOriginalPspReference field if non-nil, zero value otherwise. + +### GetDonationOriginalPspReferenceOk + +`func (o *CheckoutDonationPaymentRequest) GetDonationOriginalPspReferenceOk() (*string, bool)` + +GetDonationOriginalPspReferenceOk returns a tuple with the DonationOriginalPspReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDonationOriginalPspReference + +`func (o *CheckoutDonationPaymentRequest) SetDonationOriginalPspReference(v string)` + +SetDonationOriginalPspReference sets DonationOriginalPspReference field to given value. + +### HasDonationOriginalPspReference + +`func (o *CheckoutDonationPaymentRequest) HasDonationOriginalPspReference() bool` + +HasDonationOriginalPspReference returns a boolean if a field has been set. + +### GetDonationToken + +`func (o *CheckoutDonationPaymentRequest) GetDonationToken() string` + +GetDonationToken returns the DonationToken field if non-nil, zero value otherwise. + +### GetDonationTokenOk + +`func (o *CheckoutDonationPaymentRequest) GetDonationTokenOk() (*string, bool)` + +GetDonationTokenOk returns a tuple with the DonationToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDonationToken + +`func (o *CheckoutDonationPaymentRequest) SetDonationToken(v string)` + +SetDonationToken sets DonationToken field to given value. + +### HasDonationToken + +`func (o *CheckoutDonationPaymentRequest) HasDonationToken() bool` + +HasDonationToken returns a boolean if a field has been set. + +### GetEnableOneClick + +`func (o *CheckoutDonationPaymentRequest) GetEnableOneClick() bool` + +GetEnableOneClick returns the EnableOneClick field if non-nil, zero value otherwise. + +### GetEnableOneClickOk + +`func (o *CheckoutDonationPaymentRequest) GetEnableOneClickOk() (*bool, bool)` + +GetEnableOneClickOk returns a tuple with the EnableOneClick field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnableOneClick + +`func (o *CheckoutDonationPaymentRequest) SetEnableOneClick(v bool)` + +SetEnableOneClick sets EnableOneClick field to given value. + +### HasEnableOneClick + +`func (o *CheckoutDonationPaymentRequest) HasEnableOneClick() bool` + +HasEnableOneClick returns a boolean if a field has been set. + +### GetEnablePayOut + +`func (o *CheckoutDonationPaymentRequest) GetEnablePayOut() bool` + +GetEnablePayOut returns the EnablePayOut field if non-nil, zero value otherwise. + +### GetEnablePayOutOk + +`func (o *CheckoutDonationPaymentRequest) GetEnablePayOutOk() (*bool, bool)` + +GetEnablePayOutOk returns a tuple with the EnablePayOut field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnablePayOut + +`func (o *CheckoutDonationPaymentRequest) SetEnablePayOut(v bool)` + +SetEnablePayOut sets EnablePayOut field to given value. + +### HasEnablePayOut + +`func (o *CheckoutDonationPaymentRequest) HasEnablePayOut() bool` + +HasEnablePayOut returns a boolean if a field has been set. + +### GetEnableRecurring + +`func (o *CheckoutDonationPaymentRequest) GetEnableRecurring() bool` + +GetEnableRecurring returns the EnableRecurring field if non-nil, zero value otherwise. + +### GetEnableRecurringOk + +`func (o *CheckoutDonationPaymentRequest) GetEnableRecurringOk() (*bool, bool)` + +GetEnableRecurringOk returns a tuple with the EnableRecurring field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnableRecurring + +`func (o *CheckoutDonationPaymentRequest) SetEnableRecurring(v bool)` + +SetEnableRecurring sets EnableRecurring field to given value. + +### HasEnableRecurring + +`func (o *CheckoutDonationPaymentRequest) HasEnableRecurring() bool` + +HasEnableRecurring returns a boolean if a field has been set. + +### GetEntityType + +`func (o *CheckoutDonationPaymentRequest) GetEntityType() string` + +GetEntityType returns the EntityType field if non-nil, zero value otherwise. + +### GetEntityTypeOk + +`func (o *CheckoutDonationPaymentRequest) GetEntityTypeOk() (*string, bool)` + +GetEntityTypeOk returns a tuple with the EntityType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntityType + +`func (o *CheckoutDonationPaymentRequest) SetEntityType(v string)` + +SetEntityType sets EntityType field to given value. + +### HasEntityType + +`func (o *CheckoutDonationPaymentRequest) HasEntityType() bool` + +HasEntityType returns a boolean if a field has been set. + +### GetFraudOffset + +`func (o *CheckoutDonationPaymentRequest) GetFraudOffset() int32` + +GetFraudOffset returns the FraudOffset field if non-nil, zero value otherwise. + +### GetFraudOffsetOk + +`func (o *CheckoutDonationPaymentRequest) GetFraudOffsetOk() (*int32, bool)` + +GetFraudOffsetOk returns a tuple with the FraudOffset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFraudOffset + +`func (o *CheckoutDonationPaymentRequest) SetFraudOffset(v int32)` + +SetFraudOffset sets FraudOffset field to given value. + +### HasFraudOffset + +`func (o *CheckoutDonationPaymentRequest) HasFraudOffset() bool` + +HasFraudOffset returns a boolean if a field has been set. + +### GetIndustryUsage + +`func (o *CheckoutDonationPaymentRequest) GetIndustryUsage() string` + +GetIndustryUsage returns the IndustryUsage field if non-nil, zero value otherwise. + +### GetIndustryUsageOk + +`func (o *CheckoutDonationPaymentRequest) GetIndustryUsageOk() (*string, bool)` + +GetIndustryUsageOk returns a tuple with the IndustryUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndustryUsage + +`func (o *CheckoutDonationPaymentRequest) SetIndustryUsage(v string)` + +SetIndustryUsage sets IndustryUsage field to given value. + +### HasIndustryUsage + +`func (o *CheckoutDonationPaymentRequest) HasIndustryUsage() bool` + +HasIndustryUsage returns a boolean if a field has been set. + +### GetInstallments + +`func (o *CheckoutDonationPaymentRequest) GetInstallments() Installments2` + +GetInstallments returns the Installments field if non-nil, zero value otherwise. + +### GetInstallmentsOk + +`func (o *CheckoutDonationPaymentRequest) GetInstallmentsOk() (*Installments2, bool)` + +GetInstallmentsOk returns a tuple with the Installments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstallments + +`func (o *CheckoutDonationPaymentRequest) SetInstallments(v Installments2)` + +SetInstallments sets Installments field to given value. + +### HasInstallments + +`func (o *CheckoutDonationPaymentRequest) HasInstallments() bool` + +HasInstallments returns a boolean if a field has been set. + +### GetLineItems + +`func (o *CheckoutDonationPaymentRequest) GetLineItems() []LineItem` + +GetLineItems returns the LineItems field if non-nil, zero value otherwise. + +### GetLineItemsOk + +`func (o *CheckoutDonationPaymentRequest) GetLineItemsOk() (*[]LineItem, bool)` + +GetLineItemsOk returns a tuple with the LineItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLineItems + +`func (o *CheckoutDonationPaymentRequest) SetLineItems(v []LineItem)` + +SetLineItems sets LineItems field to given value. + +### HasLineItems + +`func (o *CheckoutDonationPaymentRequest) HasLineItems() bool` + +HasLineItems returns a boolean if a field has been set. + +### GetLocalizedShopperStatement + +`func (o *CheckoutDonationPaymentRequest) GetLocalizedShopperStatement() map[string]string` + +GetLocalizedShopperStatement returns the LocalizedShopperStatement field if non-nil, zero value otherwise. + +### GetLocalizedShopperStatementOk + +`func (o *CheckoutDonationPaymentRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool)` + +GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocalizedShopperStatement + +`func (o *CheckoutDonationPaymentRequest) SetLocalizedShopperStatement(v map[string]string)` + +SetLocalizedShopperStatement sets LocalizedShopperStatement field to given value. + +### HasLocalizedShopperStatement + +`func (o *CheckoutDonationPaymentRequest) HasLocalizedShopperStatement() bool` + +HasLocalizedShopperStatement returns a boolean if a field has been set. + +### GetMandate + +`func (o *CheckoutDonationPaymentRequest) GetMandate() Mandate` + +GetMandate returns the Mandate field if non-nil, zero value otherwise. + +### GetMandateOk + +`func (o *CheckoutDonationPaymentRequest) GetMandateOk() (*Mandate, bool)` + +GetMandateOk returns a tuple with the Mandate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMandate + +`func (o *CheckoutDonationPaymentRequest) SetMandate(v Mandate)` + +SetMandate sets Mandate field to given value. + +### HasMandate + +`func (o *CheckoutDonationPaymentRequest) HasMandate() bool` + +HasMandate returns a boolean if a field has been set. + +### GetMcc + +`func (o *CheckoutDonationPaymentRequest) GetMcc() string` + +GetMcc returns the Mcc field if non-nil, zero value otherwise. + +### GetMccOk + +`func (o *CheckoutDonationPaymentRequest) GetMccOk() (*string, bool)` + +GetMccOk returns a tuple with the Mcc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMcc + +`func (o *CheckoutDonationPaymentRequest) SetMcc(v string)` + +SetMcc sets Mcc field to given value. + +### HasMcc + +`func (o *CheckoutDonationPaymentRequest) HasMcc() bool` + +HasMcc returns a boolean if a field has been set. + +### GetMerchantAccount + +`func (o *CheckoutDonationPaymentRequest) GetMerchantAccount() string` + +GetMerchantAccount returns the MerchantAccount field if non-nil, zero value otherwise. + +### GetMerchantAccountOk + +`func (o *CheckoutDonationPaymentRequest) GetMerchantAccountOk() (*string, bool)` + +GetMerchantAccountOk returns a tuple with the MerchantAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantAccount + +`func (o *CheckoutDonationPaymentRequest) SetMerchantAccount(v string)` + +SetMerchantAccount sets MerchantAccount field to given value. + +### HasMerchantAccount + +`func (o *CheckoutDonationPaymentRequest) HasMerchantAccount() bool` + +HasMerchantAccount returns a boolean if a field has been set. + +### GetMerchantOrderReference + +`func (o *CheckoutDonationPaymentRequest) GetMerchantOrderReference() string` + +GetMerchantOrderReference returns the MerchantOrderReference field if non-nil, zero value otherwise. + +### GetMerchantOrderReferenceOk + +`func (o *CheckoutDonationPaymentRequest) GetMerchantOrderReferenceOk() (*string, bool)` + +GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantOrderReference + +`func (o *CheckoutDonationPaymentRequest) SetMerchantOrderReference(v string)` + +SetMerchantOrderReference sets MerchantOrderReference field to given value. + +### HasMerchantOrderReference + +`func (o *CheckoutDonationPaymentRequest) HasMerchantOrderReference() bool` + +HasMerchantOrderReference returns a boolean if a field has been set. + +### GetMerchantRiskIndicator + +`func (o *CheckoutDonationPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator2` + +GetMerchantRiskIndicator returns the MerchantRiskIndicator field if non-nil, zero value otherwise. + +### GetMerchantRiskIndicatorOk + +`func (o *CheckoutDonationPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator2, bool)` + +GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantRiskIndicator + +`func (o *CheckoutDonationPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator2)` + +SetMerchantRiskIndicator sets MerchantRiskIndicator field to given value. + +### HasMerchantRiskIndicator + +`func (o *CheckoutDonationPaymentRequest) HasMerchantRiskIndicator() bool` + +HasMerchantRiskIndicator returns a boolean if a field has been set. + +### GetMetadata + +`func (o *CheckoutDonationPaymentRequest) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CheckoutDonationPaymentRequest) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CheckoutDonationPaymentRequest) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CheckoutDonationPaymentRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetMpiData + +`func (o *CheckoutDonationPaymentRequest) GetMpiData() ThreeDSecureData` + +GetMpiData returns the MpiData field if non-nil, zero value otherwise. + +### GetMpiDataOk + +`func (o *CheckoutDonationPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool)` + +GetMpiDataOk returns a tuple with the MpiData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMpiData + +`func (o *CheckoutDonationPaymentRequest) SetMpiData(v ThreeDSecureData)` + +SetMpiData sets MpiData field to given value. + +### HasMpiData + +`func (o *CheckoutDonationPaymentRequest) HasMpiData() bool` + +HasMpiData returns a boolean if a field has been set. + +### GetOrder + +`func (o *CheckoutDonationPaymentRequest) GetOrder() EncryptedOrderData` + +GetOrder returns the Order field if non-nil, zero value otherwise. + +### GetOrderOk + +`func (o *CheckoutDonationPaymentRequest) GetOrderOk() (*EncryptedOrderData, bool)` + +GetOrderOk returns a tuple with the Order field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrder + +`func (o *CheckoutDonationPaymentRequest) SetOrder(v EncryptedOrderData)` + +SetOrder sets Order field to given value. + +### HasOrder + +`func (o *CheckoutDonationPaymentRequest) HasOrder() bool` + +HasOrder returns a boolean if a field has been set. + +### GetOrderReference + +`func (o *CheckoutDonationPaymentRequest) GetOrderReference() string` + +GetOrderReference returns the OrderReference field if non-nil, zero value otherwise. + +### GetOrderReferenceOk + +`func (o *CheckoutDonationPaymentRequest) GetOrderReferenceOk() (*string, bool)` + +GetOrderReferenceOk returns a tuple with the OrderReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderReference + +`func (o *CheckoutDonationPaymentRequest) SetOrderReference(v string)` + +SetOrderReference sets OrderReference field to given value. + +### HasOrderReference + +`func (o *CheckoutDonationPaymentRequest) HasOrderReference() bool` + +HasOrderReference returns a boolean if a field has been set. + +### GetOrigin + +`func (o *CheckoutDonationPaymentRequest) GetOrigin() string` + +GetOrigin returns the Origin field if non-nil, zero value otherwise. + +### GetOriginOk + +`func (o *CheckoutDonationPaymentRequest) GetOriginOk() (*string, bool)` + +GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrigin + +`func (o *CheckoutDonationPaymentRequest) SetOrigin(v string)` + +SetOrigin sets Origin field to given value. + +### HasOrigin + +`func (o *CheckoutDonationPaymentRequest) HasOrigin() bool` + +HasOrigin returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *CheckoutDonationPaymentRequest) GetPaymentMethod() CheckoutDonationPaymentRequestPaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *CheckoutDonationPaymentRequest) GetPaymentMethodOk() (*CheckoutDonationPaymentRequestPaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *CheckoutDonationPaymentRequest) SetPaymentMethod(v CheckoutDonationPaymentRequestPaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *CheckoutDonationPaymentRequest) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetPlatformChargebackLogic + +`func (o *CheckoutDonationPaymentRequest) GetPlatformChargebackLogic() PlatformChargebackLogic` + +GetPlatformChargebackLogic returns the PlatformChargebackLogic field if non-nil, zero value otherwise. + +### GetPlatformChargebackLogicOk + +`func (o *CheckoutDonationPaymentRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool)` + +GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlatformChargebackLogic + +`func (o *CheckoutDonationPaymentRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic)` + +SetPlatformChargebackLogic sets PlatformChargebackLogic field to given value. + +### HasPlatformChargebackLogic + +`func (o *CheckoutDonationPaymentRequest) HasPlatformChargebackLogic() bool` + +HasPlatformChargebackLogic returns a boolean if a field has been set. + +### GetRecurringExpiry + +`func (o *CheckoutDonationPaymentRequest) GetRecurringExpiry() string` + +GetRecurringExpiry returns the RecurringExpiry field if non-nil, zero value otherwise. + +### GetRecurringExpiryOk + +`func (o *CheckoutDonationPaymentRequest) GetRecurringExpiryOk() (*string, bool)` + +GetRecurringExpiryOk returns a tuple with the RecurringExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringExpiry + +`func (o *CheckoutDonationPaymentRequest) SetRecurringExpiry(v string)` + +SetRecurringExpiry sets RecurringExpiry field to given value. + +### HasRecurringExpiry + +`func (o *CheckoutDonationPaymentRequest) HasRecurringExpiry() bool` + +HasRecurringExpiry returns a boolean if a field has been set. + +### GetRecurringFrequency + +`func (o *CheckoutDonationPaymentRequest) GetRecurringFrequency() string` + +GetRecurringFrequency returns the RecurringFrequency field if non-nil, zero value otherwise. + +### GetRecurringFrequencyOk + +`func (o *CheckoutDonationPaymentRequest) GetRecurringFrequencyOk() (*string, bool)` + +GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringFrequency + +`func (o *CheckoutDonationPaymentRequest) SetRecurringFrequency(v string)` + +SetRecurringFrequency sets RecurringFrequency field to given value. + +### HasRecurringFrequency + +`func (o *CheckoutDonationPaymentRequest) HasRecurringFrequency() bool` + +HasRecurringFrequency returns a boolean if a field has been set. + +### GetRecurringProcessingModel + +`func (o *CheckoutDonationPaymentRequest) GetRecurringProcessingModel() string` + +GetRecurringProcessingModel returns the RecurringProcessingModel field if non-nil, zero value otherwise. + +### GetRecurringProcessingModelOk + +`func (o *CheckoutDonationPaymentRequest) GetRecurringProcessingModelOk() (*string, bool)` + +GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringProcessingModel + +`func (o *CheckoutDonationPaymentRequest) SetRecurringProcessingModel(v string)` + +SetRecurringProcessingModel sets RecurringProcessingModel field to given value. + +### HasRecurringProcessingModel + +`func (o *CheckoutDonationPaymentRequest) HasRecurringProcessingModel() bool` + +HasRecurringProcessingModel returns a boolean if a field has been set. + +### GetRedirectFromIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) GetRedirectFromIssuerMethod() string` + +GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field if non-nil, zero value otherwise. + +### GetRedirectFromIssuerMethodOk + +`func (o *CheckoutDonationPaymentRequest) GetRedirectFromIssuerMethodOk() (*string, bool)` + +GetRedirectFromIssuerMethodOk returns a tuple with the RedirectFromIssuerMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectFromIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) SetRedirectFromIssuerMethod(v string)` + +SetRedirectFromIssuerMethod sets RedirectFromIssuerMethod field to given value. + +### HasRedirectFromIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) HasRedirectFromIssuerMethod() bool` + +HasRedirectFromIssuerMethod returns a boolean if a field has been set. + +### GetRedirectToIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) GetRedirectToIssuerMethod() string` + +GetRedirectToIssuerMethod returns the RedirectToIssuerMethod field if non-nil, zero value otherwise. + +### GetRedirectToIssuerMethodOk + +`func (o *CheckoutDonationPaymentRequest) GetRedirectToIssuerMethodOk() (*string, bool)` + +GetRedirectToIssuerMethodOk returns a tuple with the RedirectToIssuerMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectToIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) SetRedirectToIssuerMethod(v string)` + +SetRedirectToIssuerMethod sets RedirectToIssuerMethod field to given value. + +### HasRedirectToIssuerMethod + +`func (o *CheckoutDonationPaymentRequest) HasRedirectToIssuerMethod() bool` + +HasRedirectToIssuerMethod returns a boolean if a field has been set. + +### GetReference + +`func (o *CheckoutDonationPaymentRequest) GetReference() string` + +GetReference returns the Reference field if non-nil, zero value otherwise. + +### GetReferenceOk + +`func (o *CheckoutDonationPaymentRequest) GetReferenceOk() (*string, bool)` + +GetReferenceOk returns a tuple with the Reference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReference + +`func (o *CheckoutDonationPaymentRequest) SetReference(v string)` + +SetReference sets Reference field to given value. + +### HasReference + +`func (o *CheckoutDonationPaymentRequest) HasReference() bool` + +HasReference returns a boolean if a field has been set. + +### GetReturnUrl + +`func (o *CheckoutDonationPaymentRequest) GetReturnUrl() string` + +GetReturnUrl returns the ReturnUrl field if non-nil, zero value otherwise. + +### GetReturnUrlOk + +`func (o *CheckoutDonationPaymentRequest) GetReturnUrlOk() (*string, bool)` + +GetReturnUrlOk returns a tuple with the ReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReturnUrl + +`func (o *CheckoutDonationPaymentRequest) SetReturnUrl(v string)` + +SetReturnUrl sets ReturnUrl field to given value. + +### HasReturnUrl + +`func (o *CheckoutDonationPaymentRequest) HasReturnUrl() bool` + +HasReturnUrl returns a boolean if a field has been set. + +### GetRiskData + +`func (o *CheckoutDonationPaymentRequest) GetRiskData() RiskData` + +GetRiskData returns the RiskData field if non-nil, zero value otherwise. + +### GetRiskDataOk + +`func (o *CheckoutDonationPaymentRequest) GetRiskDataOk() (*RiskData, bool)` + +GetRiskDataOk returns a tuple with the RiskData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRiskData + +`func (o *CheckoutDonationPaymentRequest) SetRiskData(v RiskData)` + +SetRiskData sets RiskData field to given value. + +### HasRiskData + +`func (o *CheckoutDonationPaymentRequest) HasRiskData() bool` + +HasRiskData returns a boolean if a field has been set. + +### GetSessionValidity + +`func (o *CheckoutDonationPaymentRequest) GetSessionValidity() string` + +GetSessionValidity returns the SessionValidity field if non-nil, zero value otherwise. + +### GetSessionValidityOk + +`func (o *CheckoutDonationPaymentRequest) GetSessionValidityOk() (*string, bool)` + +GetSessionValidityOk returns a tuple with the SessionValidity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionValidity + +`func (o *CheckoutDonationPaymentRequest) SetSessionValidity(v string)` + +SetSessionValidity sets SessionValidity field to given value. + +### HasSessionValidity + +`func (o *CheckoutDonationPaymentRequest) HasSessionValidity() bool` + +HasSessionValidity returns a boolean if a field has been set. + +### GetShopperEmail + +`func (o *CheckoutDonationPaymentRequest) GetShopperEmail() string` + +GetShopperEmail returns the ShopperEmail field if non-nil, zero value otherwise. + +### GetShopperEmailOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperEmailOk() (*string, bool)` + +GetShopperEmailOk returns a tuple with the ShopperEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperEmail + +`func (o *CheckoutDonationPaymentRequest) SetShopperEmail(v string)` + +SetShopperEmail sets ShopperEmail field to given value. + +### HasShopperEmail + +`func (o *CheckoutDonationPaymentRequest) HasShopperEmail() bool` + +HasShopperEmail returns a boolean if a field has been set. + +### GetShopperIP + +`func (o *CheckoutDonationPaymentRequest) GetShopperIP() string` + +GetShopperIP returns the ShopperIP field if non-nil, zero value otherwise. + +### GetShopperIPOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperIPOk() (*string, bool)` + +GetShopperIPOk returns a tuple with the ShopperIP field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperIP + +`func (o *CheckoutDonationPaymentRequest) SetShopperIP(v string)` + +SetShopperIP sets ShopperIP field to given value. + +### HasShopperIP + +`func (o *CheckoutDonationPaymentRequest) HasShopperIP() bool` + +HasShopperIP returns a boolean if a field has been set. + +### GetShopperInteraction + +`func (o *CheckoutDonationPaymentRequest) GetShopperInteraction() string` + +GetShopperInteraction returns the ShopperInteraction field if non-nil, zero value otherwise. + +### GetShopperInteractionOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperInteractionOk() (*string, bool)` + +GetShopperInteractionOk returns a tuple with the ShopperInteraction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperInteraction + +`func (o *CheckoutDonationPaymentRequest) SetShopperInteraction(v string)` + +SetShopperInteraction sets ShopperInteraction field to given value. + +### HasShopperInteraction + +`func (o *CheckoutDonationPaymentRequest) HasShopperInteraction() bool` + +HasShopperInteraction returns a boolean if a field has been set. + +### GetShopperLocale + +`func (o *CheckoutDonationPaymentRequest) GetShopperLocale() string` + +GetShopperLocale returns the ShopperLocale field if non-nil, zero value otherwise. + +### GetShopperLocaleOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperLocaleOk() (*string, bool)` + +GetShopperLocaleOk returns a tuple with the ShopperLocale field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperLocale + +`func (o *CheckoutDonationPaymentRequest) SetShopperLocale(v string)` + +SetShopperLocale sets ShopperLocale field to given value. + +### HasShopperLocale + +`func (o *CheckoutDonationPaymentRequest) HasShopperLocale() bool` + +HasShopperLocale returns a boolean if a field has been set. + +### GetShopperName + +`func (o *CheckoutDonationPaymentRequest) GetShopperName() Name2` + +GetShopperName returns the ShopperName field if non-nil, zero value otherwise. + +### GetShopperNameOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperNameOk() (*Name2, bool)` + +GetShopperNameOk returns a tuple with the ShopperName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperName + +`func (o *CheckoutDonationPaymentRequest) SetShopperName(v Name2)` + +SetShopperName sets ShopperName field to given value. + +### HasShopperName + +`func (o *CheckoutDonationPaymentRequest) HasShopperName() bool` + +HasShopperName returns a boolean if a field has been set. + +### GetShopperReference + +`func (o *CheckoutDonationPaymentRequest) GetShopperReference() string` + +GetShopperReference returns the ShopperReference field if non-nil, zero value otherwise. + +### GetShopperReferenceOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperReferenceOk() (*string, bool)` + +GetShopperReferenceOk returns a tuple with the ShopperReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperReference + +`func (o *CheckoutDonationPaymentRequest) SetShopperReference(v string)` + +SetShopperReference sets ShopperReference field to given value. + +### HasShopperReference + +`func (o *CheckoutDonationPaymentRequest) HasShopperReference() bool` + +HasShopperReference returns a boolean if a field has been set. + +### GetShopperStatement + +`func (o *CheckoutDonationPaymentRequest) GetShopperStatement() string` + +GetShopperStatement returns the ShopperStatement field if non-nil, zero value otherwise. + +### GetShopperStatementOk + +`func (o *CheckoutDonationPaymentRequest) GetShopperStatementOk() (*string, bool)` + +GetShopperStatementOk returns a tuple with the ShopperStatement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperStatement + +`func (o *CheckoutDonationPaymentRequest) SetShopperStatement(v string)` + +SetShopperStatement sets ShopperStatement field to given value. + +### HasShopperStatement + +`func (o *CheckoutDonationPaymentRequest) HasShopperStatement() bool` + +HasShopperStatement returns a boolean if a field has been set. + +### GetSocialSecurityNumber + +`func (o *CheckoutDonationPaymentRequest) GetSocialSecurityNumber() string` + +GetSocialSecurityNumber returns the SocialSecurityNumber field if non-nil, zero value otherwise. + +### GetSocialSecurityNumberOk + +`func (o *CheckoutDonationPaymentRequest) GetSocialSecurityNumberOk() (*string, bool)` + +GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSocialSecurityNumber + +`func (o *CheckoutDonationPaymentRequest) SetSocialSecurityNumber(v string)` + +SetSocialSecurityNumber sets SocialSecurityNumber field to given value. + +### HasSocialSecurityNumber + +`func (o *CheckoutDonationPaymentRequest) HasSocialSecurityNumber() bool` + +HasSocialSecurityNumber returns a boolean if a field has been set. + +### GetSplits + +`func (o *CheckoutDonationPaymentRequest) GetSplits() []Split2` + +GetSplits returns the Splits field if non-nil, zero value otherwise. + +### GetSplitsOk + +`func (o *CheckoutDonationPaymentRequest) GetSplitsOk() (*[]Split2, bool)` + +GetSplitsOk returns a tuple with the Splits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSplits + +`func (o *CheckoutDonationPaymentRequest) SetSplits(v []Split2)` + +SetSplits sets Splits field to given value. + +### HasSplits + +`func (o *CheckoutDonationPaymentRequest) HasSplits() bool` + +HasSplits returns a boolean if a field has been set. + +### GetStore + +`func (o *CheckoutDonationPaymentRequest) GetStore() string` + +GetStore returns the Store field if non-nil, zero value otherwise. + +### GetStoreOk + +`func (o *CheckoutDonationPaymentRequest) GetStoreOk() (*string, bool)` + +GetStoreOk returns a tuple with the Store field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStore + +`func (o *CheckoutDonationPaymentRequest) SetStore(v string)` + +SetStore sets Store field to given value. + +### HasStore + +`func (o *CheckoutDonationPaymentRequest) HasStore() bool` + +HasStore returns a boolean if a field has been set. + +### GetStorePaymentMethod + +`func (o *CheckoutDonationPaymentRequest) GetStorePaymentMethod() bool` + +GetStorePaymentMethod returns the StorePaymentMethod field if non-nil, zero value otherwise. + +### GetStorePaymentMethodOk + +`func (o *CheckoutDonationPaymentRequest) GetStorePaymentMethodOk() (*bool, bool)` + +GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorePaymentMethod + +`func (o *CheckoutDonationPaymentRequest) SetStorePaymentMethod(v bool)` + +SetStorePaymentMethod sets StorePaymentMethod field to given value. + +### HasStorePaymentMethod + +`func (o *CheckoutDonationPaymentRequest) HasStorePaymentMethod() bool` + +HasStorePaymentMethod returns a boolean if a field has been set. + +### GetTelephoneNumber + +`func (o *CheckoutDonationPaymentRequest) GetTelephoneNumber() string` + +GetTelephoneNumber returns the TelephoneNumber field if non-nil, zero value otherwise. + +### GetTelephoneNumberOk + +`func (o *CheckoutDonationPaymentRequest) GetTelephoneNumberOk() (*string, bool)` + +GetTelephoneNumberOk returns a tuple with the TelephoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTelephoneNumber + +`func (o *CheckoutDonationPaymentRequest) SetTelephoneNumber(v string)` + +SetTelephoneNumber sets TelephoneNumber field to given value. + +### HasTelephoneNumber + +`func (o *CheckoutDonationPaymentRequest) HasTelephoneNumber() bool` + +HasTelephoneNumber returns a boolean if a field has been set. + +### GetThreeDS2RequestData + +`func (o *CheckoutDonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2` + +GetThreeDS2RequestData returns the ThreeDS2RequestData field if non-nil, zero value otherwise. + +### GetThreeDS2RequestDataOk + +`func (o *CheckoutDonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool)` + +GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDS2RequestData + +`func (o *CheckoutDonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2)` + +SetThreeDS2RequestData sets ThreeDS2RequestData field to given value. + +### HasThreeDS2RequestData + +`func (o *CheckoutDonationPaymentRequest) HasThreeDS2RequestData() bool` + +HasThreeDS2RequestData returns a boolean if a field has been set. + +### GetThreeDSAuthenticationOnly + +`func (o *CheckoutDonationPaymentRequest) GetThreeDSAuthenticationOnly() bool` + +GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field if non-nil, zero value otherwise. + +### GetThreeDSAuthenticationOnlyOk + +`func (o *CheckoutDonationPaymentRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool)` + +GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSAuthenticationOnly + +`func (o *CheckoutDonationPaymentRequest) SetThreeDSAuthenticationOnly(v bool)` + +SetThreeDSAuthenticationOnly sets ThreeDSAuthenticationOnly field to given value. + +### HasThreeDSAuthenticationOnly + +`func (o *CheckoutDonationPaymentRequest) HasThreeDSAuthenticationOnly() bool` + +HasThreeDSAuthenticationOnly returns a boolean if a field has been set. + +### GetTrustedShopper + +`func (o *CheckoutDonationPaymentRequest) GetTrustedShopper() bool` + +GetTrustedShopper returns the TrustedShopper field if non-nil, zero value otherwise. + +### GetTrustedShopperOk + +`func (o *CheckoutDonationPaymentRequest) GetTrustedShopperOk() (*bool, bool)` + +GetTrustedShopperOk returns a tuple with the TrustedShopper field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrustedShopper + +`func (o *CheckoutDonationPaymentRequest) SetTrustedShopper(v bool)` + +SetTrustedShopper sets TrustedShopper field to given value. + +### HasTrustedShopper + +`func (o *CheckoutDonationPaymentRequest) HasTrustedShopper() bool` + +HasTrustedShopper returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/CheckoutDonationPaymentRequestPaymentMethod.md b/src/checkout/docs/CheckoutDonationPaymentRequestPaymentMethod.md new file mode 100644 index 000000000..da8262258 --- /dev/null +++ b/src/checkout/docs/CheckoutDonationPaymentRequestPaymentMethod.md @@ -0,0 +1,1255 @@ +# CheckoutDonationPaymentRequestPaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BankAccountNumber** | **string** | The bank account number (without separators). | +**BankLocationId** | Pointer to **string** | The bank routing number of the account. | [optional] +**CheckoutAttemptId** | Pointer to **string** | The checkout attempt identifier. | [optional] +**EncryptedBankAccountNumber** | Pointer to **string** | Encrypted bank account number. The bank account number (without separators). | [optional] +**EncryptedBankLocationId** | Pointer to **string** | Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. | [optional] +**OwnerName** | **string** | The name of the bank account holder. | +**RecurringDetailReference** | Pointer to **string** | This is the `recurringDetailReference` returned in the response when you created the token. | [optional] +**StoredPaymentMethodId** | Pointer to **string** | This is the `recurringDetailReference` returned in the response when you created the token. | [optional] +**Type** | **string** | **zip** | [default to "zip"] +**BillingAddress** | Pointer to **string** | The address where to send the invoice. | [optional] +**DeliveryAddress** | Pointer to **string** | The address where the goods should be delivered. | [optional] +**PersonalDetails** | Pointer to **string** | Shopper name, date of birth, phone number, and email address. | [optional] +**AmazonPayToken** | Pointer to **string** | This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. | [optional] +**ApplePayToken** | **string** | The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. | +**FundingSource** | Pointer to **string** | The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. | [optional] +**HolderName** | Pointer to **string** | The name of the card holder. | [optional] +**Issuer** | **string** | The shopper's bank. Specify this with the issuer value that corresponds to this bank. | +**BlikCode** | Pointer to **string** | BLIK code consisting of 6 digits. | [optional] +**Brand** | Pointer to **string** | Secondary brand of the card. For example: **plastix**, **hmclub**. | [optional] +**CupsecureplusSmscode** | Pointer to **string** | | [optional] +**Cvc** | Pointer to **string** | The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). | [optional] +**EncryptedCardNumber** | Pointer to **string** | The encrypted card number. | [optional] +**EncryptedExpiryMonth** | Pointer to **string** | The encrypted card expiry month. | [optional] +**EncryptedExpiryYear** | Pointer to **string** | The encrypted card expiry year. | [optional] +**EncryptedSecurityCode** | Pointer to **string** | The encrypted card verification code. | [optional] +**ExpiryMonth** | Pointer to **string** | The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). | [optional] +**ExpiryYear** | Pointer to **string** | The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). | [optional] +**NetworkPaymentReference** | Pointer to **string** | The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. | [optional] +**Number** | Pointer to **string** | The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). | [optional] +**ShopperNotificationReference** | Pointer to **string** | The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. | [optional] +**ThreeDS2SdkVersion** | Pointer to **string** | Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. | [optional] +**FirstName** | **string** | The shopper's first name. | +**LastName** | **string** | The shopper's last name. | +**ShopperEmail** | **string** | | +**TelephoneNumber** | **string** | | +**GooglePayToken** | **string** | The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. | +**MasterpassTransactionId** | **string** | The Masterpass transaction ID. | +**OrderID** | Pointer to **string** | The unique ID associated with the order. | [optional] +**PayeePreferred** | Pointer to **string** | IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED | [optional] +**PayerID** | Pointer to **string** | The unique ID associated with the payer. | [optional] +**PayerSelected** | Pointer to **string** | PAYPAL or PAYPAL_CREDIT | [optional] +**Subtype** | Pointer to **string** | The type of flow to initiate. | [optional] +**VirtualPaymentAddress** | Pointer to **string** | The virtual payment address for UPI. | [optional] +**SamsungPayToken** | **string** | The payload you received from the Samsung Pay SDK response. | +**Iban** | **string** | The International Bank Account Number (IBAN). | +**BillingSequenceNumber** | **string** | The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. | +**VisaCheckoutCallId** | **string** | The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. | +**AppId** | Pointer to **string** | | [optional] +**Openid** | Pointer to **string** | | [optional] +**ClickAndCollect** | Pointer to **string** | Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. | [optional] + +## Methods + +### NewCheckoutDonationPaymentRequestPaymentMethod + +`func NewCheckoutDonationPaymentRequestPaymentMethod(bankAccountNumber string, ownerName string, type_ string, applePayToken string, issuer string, firstName string, lastName string, shopperEmail string, telephoneNumber string, googlePayToken string, masterpassTransactionId string, samsungPayToken string, iban string, billingSequenceNumber string, visaCheckoutCallId string, ) *CheckoutDonationPaymentRequestPaymentMethod` + +NewCheckoutDonationPaymentRequestPaymentMethod instantiates a new CheckoutDonationPaymentRequestPaymentMethod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCheckoutDonationPaymentRequestPaymentMethodWithDefaults + +`func NewCheckoutDonationPaymentRequestPaymentMethodWithDefaults() *CheckoutDonationPaymentRequestPaymentMethod` + +NewCheckoutDonationPaymentRequestPaymentMethodWithDefaults instantiates a new CheckoutDonationPaymentRequestPaymentMethod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBankAccountNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBankAccountNumber() string` + +GetBankAccountNumber returns the BankAccountNumber field if non-nil, zero value otherwise. + +### GetBankAccountNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBankAccountNumberOk() (*string, bool)` + +GetBankAccountNumberOk returns a tuple with the BankAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccountNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBankAccountNumber(v string)` + +SetBankAccountNumber sets BankAccountNumber field to given value. + + +### GetBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBankLocationId() string` + +GetBankLocationId returns the BankLocationId field if non-nil, zero value otherwise. + +### GetBankLocationIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBankLocationIdOk() (*string, bool)` + +GetBankLocationIdOk returns a tuple with the BankLocationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBankLocationId(v string)` + +SetBankLocationId sets BankLocationId field to given value. + +### HasBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasBankLocationId() bool` + +HasBankLocationId returns a boolean if a field has been set. + +### GetCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCheckoutAttemptId() string` + +GetCheckoutAttemptId returns the CheckoutAttemptId field if non-nil, zero value otherwise. + +### GetCheckoutAttemptIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCheckoutAttemptIdOk() (*string, bool)` + +GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetCheckoutAttemptId(v string)` + +SetCheckoutAttemptId sets CheckoutAttemptId field to given value. + +### HasCheckoutAttemptId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasCheckoutAttemptId() bool` + +HasCheckoutAttemptId returns a boolean if a field has been set. + +### GetEncryptedBankAccountNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedBankAccountNumber() string` + +GetEncryptedBankAccountNumber returns the EncryptedBankAccountNumber field if non-nil, zero value otherwise. + +### GetEncryptedBankAccountNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedBankAccountNumberOk() (*string, bool)` + +GetEncryptedBankAccountNumberOk returns a tuple with the EncryptedBankAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedBankAccountNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedBankAccountNumber(v string)` + +SetEncryptedBankAccountNumber sets EncryptedBankAccountNumber field to given value. + +### HasEncryptedBankAccountNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedBankAccountNumber() bool` + +HasEncryptedBankAccountNumber returns a boolean if a field has been set. + +### GetEncryptedBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedBankLocationId() string` + +GetEncryptedBankLocationId returns the EncryptedBankLocationId field if non-nil, zero value otherwise. + +### GetEncryptedBankLocationIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedBankLocationIdOk() (*string, bool)` + +GetEncryptedBankLocationIdOk returns a tuple with the EncryptedBankLocationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedBankLocationId(v string)` + +SetEncryptedBankLocationId sets EncryptedBankLocationId field to given value. + +### HasEncryptedBankLocationId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedBankLocationId() bool` + +HasEncryptedBankLocationId returns a boolean if a field has been set. + +### GetOwnerName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOwnerName() string` + +GetOwnerName returns the OwnerName field if non-nil, zero value otherwise. + +### GetOwnerNameOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOwnerNameOk() (*string, bool)` + +GetOwnerNameOk returns a tuple with the OwnerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwnerName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetOwnerName(v string)` + +SetOwnerName sets OwnerName field to given value. + + +### GetRecurringDetailReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetRecurringDetailReference() string` + +GetRecurringDetailReference returns the RecurringDetailReference field if non-nil, zero value otherwise. + +### GetRecurringDetailReferenceOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetRecurringDetailReferenceOk() (*string, bool)` + +GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringDetailReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetRecurringDetailReference(v string)` + +SetRecurringDetailReference sets RecurringDetailReference field to given value. + +### HasRecurringDetailReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasRecurringDetailReference() bool` + +HasRecurringDetailReference returns a boolean if a field has been set. + +### GetStoredPaymentMethodId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetStoredPaymentMethodId() string` + +GetStoredPaymentMethodId returns the StoredPaymentMethodId field if non-nil, zero value otherwise. + +### GetStoredPaymentMethodIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetStoredPaymentMethodIdOk() (*string, bool)` + +GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStoredPaymentMethodId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetStoredPaymentMethodId(v string)` + +SetStoredPaymentMethodId sets StoredPaymentMethodId field to given value. + +### HasStoredPaymentMethodId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasStoredPaymentMethodId() bool` + +HasStoredPaymentMethodId returns a boolean if a field has been set. + +### GetType + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetType(v string)` + +SetType sets Type field to given value. + + +### GetBillingAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBillingAddress() string` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBillingAddressOk() (*string, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBillingAddress(v string)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetDeliveryAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetDeliveryAddress() string` + +GetDeliveryAddress returns the DeliveryAddress field if non-nil, zero value otherwise. + +### GetDeliveryAddressOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetDeliveryAddressOk() (*string, bool)` + +GetDeliveryAddressOk returns a tuple with the DeliveryAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetDeliveryAddress(v string)` + +SetDeliveryAddress sets DeliveryAddress field to given value. + +### HasDeliveryAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasDeliveryAddress() bool` + +HasDeliveryAddress returns a boolean if a field has been set. + +### GetPersonalDetails + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPersonalDetails() string` + +GetPersonalDetails returns the PersonalDetails field if non-nil, zero value otherwise. + +### GetPersonalDetailsOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPersonalDetailsOk() (*string, bool)` + +GetPersonalDetailsOk returns a tuple with the PersonalDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPersonalDetails + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetPersonalDetails(v string)` + +SetPersonalDetails sets PersonalDetails field to given value. + +### HasPersonalDetails + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasPersonalDetails() bool` + +HasPersonalDetails returns a boolean if a field has been set. + +### GetAmazonPayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetAmazonPayToken() string` + +GetAmazonPayToken returns the AmazonPayToken field if non-nil, zero value otherwise. + +### GetAmazonPayTokenOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetAmazonPayTokenOk() (*string, bool)` + +GetAmazonPayTokenOk returns a tuple with the AmazonPayToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmazonPayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetAmazonPayToken(v string)` + +SetAmazonPayToken sets AmazonPayToken field to given value. + +### HasAmazonPayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasAmazonPayToken() bool` + +HasAmazonPayToken returns a boolean if a field has been set. + +### GetApplePayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetApplePayToken() string` + +GetApplePayToken returns the ApplePayToken field if non-nil, zero value otherwise. + +### GetApplePayTokenOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetApplePayTokenOk() (*string, bool)` + +GetApplePayTokenOk returns a tuple with the ApplePayToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplePayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetApplePayToken(v string)` + +SetApplePayToken sets ApplePayToken field to given value. + + +### GetFundingSource + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetFundingSource() string` + +GetFundingSource returns the FundingSource field if non-nil, zero value otherwise. + +### GetFundingSourceOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetFundingSourceOk() (*string, bool)` + +GetFundingSourceOk returns a tuple with the FundingSource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFundingSource + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetFundingSource(v string)` + +SetFundingSource sets FundingSource field to given value. + +### HasFundingSource + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasFundingSource() bool` + +HasFundingSource returns a boolean if a field has been set. + +### GetHolderName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetHolderName() string` + +GetHolderName returns the HolderName field if non-nil, zero value otherwise. + +### GetHolderNameOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetHolderNameOk() (*string, bool)` + +GetHolderNameOk returns a tuple with the HolderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHolderName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetHolderName(v string)` + +SetHolderName sets HolderName field to given value. + +### HasHolderName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasHolderName() bool` + +HasHolderName returns a boolean if a field has been set. + +### GetIssuer + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + + +### GetBlikCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBlikCode() string` + +GetBlikCode returns the BlikCode field if non-nil, zero value otherwise. + +### GetBlikCodeOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBlikCodeOk() (*string, bool)` + +GetBlikCodeOk returns a tuple with the BlikCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlikCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBlikCode(v string)` + +SetBlikCode sets BlikCode field to given value. + +### HasBlikCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasBlikCode() bool` + +HasBlikCode returns a boolean if a field has been set. + +### GetBrand + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBrand() string` + +GetBrand returns the Brand field if non-nil, zero value otherwise. + +### GetBrandOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBrandOk() (*string, bool)` + +GetBrandOk returns a tuple with the Brand field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrand + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBrand(v string)` + +SetBrand sets Brand field to given value. + +### HasBrand + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasBrand() bool` + +HasBrand returns a boolean if a field has been set. + +### GetCupsecureplusSmscode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCupsecureplusSmscode() string` + +GetCupsecureplusSmscode returns the CupsecureplusSmscode field if non-nil, zero value otherwise. + +### GetCupsecureplusSmscodeOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCupsecureplusSmscodeOk() (*string, bool)` + +GetCupsecureplusSmscodeOk returns a tuple with the CupsecureplusSmscode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCupsecureplusSmscode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetCupsecureplusSmscode(v string)` + +SetCupsecureplusSmscode sets CupsecureplusSmscode field to given value. + +### HasCupsecureplusSmscode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasCupsecureplusSmscode() bool` + +HasCupsecureplusSmscode returns a boolean if a field has been set. + +### GetCvc + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCvc() string` + +GetCvc returns the Cvc field if non-nil, zero value otherwise. + +### GetCvcOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetCvcOk() (*string, bool)` + +GetCvcOk returns a tuple with the Cvc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvc + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetCvc(v string)` + +SetCvc sets Cvc field to given value. + +### HasCvc + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasCvc() bool` + +HasCvc returns a boolean if a field has been set. + +### GetEncryptedCardNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedCardNumber() string` + +GetEncryptedCardNumber returns the EncryptedCardNumber field if non-nil, zero value otherwise. + +### GetEncryptedCardNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedCardNumberOk() (*string, bool)` + +GetEncryptedCardNumberOk returns a tuple with the EncryptedCardNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedCardNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedCardNumber(v string)` + +SetEncryptedCardNumber sets EncryptedCardNumber field to given value. + +### HasEncryptedCardNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedCardNumber() bool` + +HasEncryptedCardNumber returns a boolean if a field has been set. + +### GetEncryptedExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedExpiryMonth() string` + +GetEncryptedExpiryMonth returns the EncryptedExpiryMonth field if non-nil, zero value otherwise. + +### GetEncryptedExpiryMonthOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedExpiryMonthOk() (*string, bool)` + +GetEncryptedExpiryMonthOk returns a tuple with the EncryptedExpiryMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedExpiryMonth(v string)` + +SetEncryptedExpiryMonth sets EncryptedExpiryMonth field to given value. + +### HasEncryptedExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedExpiryMonth() bool` + +HasEncryptedExpiryMonth returns a boolean if a field has been set. + +### GetEncryptedExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedExpiryYear() string` + +GetEncryptedExpiryYear returns the EncryptedExpiryYear field if non-nil, zero value otherwise. + +### GetEncryptedExpiryYearOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedExpiryYearOk() (*string, bool)` + +GetEncryptedExpiryYearOk returns a tuple with the EncryptedExpiryYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedExpiryYear(v string)` + +SetEncryptedExpiryYear sets EncryptedExpiryYear field to given value. + +### HasEncryptedExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedExpiryYear() bool` + +HasEncryptedExpiryYear returns a boolean if a field has been set. + +### GetEncryptedSecurityCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedSecurityCode() string` + +GetEncryptedSecurityCode returns the EncryptedSecurityCode field if non-nil, zero value otherwise. + +### GetEncryptedSecurityCodeOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetEncryptedSecurityCodeOk() (*string, bool)` + +GetEncryptedSecurityCodeOk returns a tuple with the EncryptedSecurityCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEncryptedSecurityCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetEncryptedSecurityCode(v string)` + +SetEncryptedSecurityCode sets EncryptedSecurityCode field to given value. + +### HasEncryptedSecurityCode + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasEncryptedSecurityCode() bool` + +HasEncryptedSecurityCode returns a boolean if a field has been set. + +### GetExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetExpiryMonth() string` + +GetExpiryMonth returns the ExpiryMonth field if non-nil, zero value otherwise. + +### GetExpiryMonthOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetExpiryMonthOk() (*string, bool)` + +GetExpiryMonthOk returns a tuple with the ExpiryMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetExpiryMonth(v string)` + +SetExpiryMonth sets ExpiryMonth field to given value. + +### HasExpiryMonth + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasExpiryMonth() bool` + +HasExpiryMonth returns a boolean if a field has been set. + +### GetExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetExpiryYear() string` + +GetExpiryYear returns the ExpiryYear field if non-nil, zero value otherwise. + +### GetExpiryYearOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetExpiryYearOk() (*string, bool)` + +GetExpiryYearOk returns a tuple with the ExpiryYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetExpiryYear(v string)` + +SetExpiryYear sets ExpiryYear field to given value. + +### HasExpiryYear + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasExpiryYear() bool` + +HasExpiryYear returns a boolean if a field has been set. + +### GetNetworkPaymentReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetNetworkPaymentReference() string` + +GetNetworkPaymentReference returns the NetworkPaymentReference field if non-nil, zero value otherwise. + +### GetNetworkPaymentReferenceOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetNetworkPaymentReferenceOk() (*string, bool)` + +GetNetworkPaymentReferenceOk returns a tuple with the NetworkPaymentReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkPaymentReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetNetworkPaymentReference(v string)` + +SetNetworkPaymentReference sets NetworkPaymentReference field to given value. + +### HasNetworkPaymentReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasNetworkPaymentReference() bool` + +HasNetworkPaymentReference returns a boolean if a field has been set. + +### GetNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetNumber() string` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetNumberOk() (*string, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetNumber(v string)` + +SetNumber sets Number field to given value. + +### HasNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### GetShopperNotificationReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetShopperNotificationReference() string` + +GetShopperNotificationReference returns the ShopperNotificationReference field if non-nil, zero value otherwise. + +### GetShopperNotificationReferenceOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetShopperNotificationReferenceOk() (*string, bool)` + +GetShopperNotificationReferenceOk returns a tuple with the ShopperNotificationReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperNotificationReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetShopperNotificationReference(v string)` + +SetShopperNotificationReference sets ShopperNotificationReference field to given value. + +### HasShopperNotificationReference + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasShopperNotificationReference() bool` + +HasShopperNotificationReference returns a boolean if a field has been set. + +### GetThreeDS2SdkVersion + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetThreeDS2SdkVersion() string` + +GetThreeDS2SdkVersion returns the ThreeDS2SdkVersion field if non-nil, zero value otherwise. + +### GetThreeDS2SdkVersionOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetThreeDS2SdkVersionOk() (*string, bool)` + +GetThreeDS2SdkVersionOk returns a tuple with the ThreeDS2SdkVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDS2SdkVersion + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetThreeDS2SdkVersion(v string)` + +SetThreeDS2SdkVersion sets ThreeDS2SdkVersion field to given value. + +### HasThreeDS2SdkVersion + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasThreeDS2SdkVersion() bool` + +HasThreeDS2SdkVersion returns a boolean if a field has been set. + +### GetFirstName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + + +### GetLastName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetLastName(v string)` + +SetLastName sets LastName field to given value. + + +### GetShopperEmail + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetShopperEmail() string` + +GetShopperEmail returns the ShopperEmail field if non-nil, zero value otherwise. + +### GetShopperEmailOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetShopperEmailOk() (*string, bool)` + +GetShopperEmailOk returns a tuple with the ShopperEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperEmail + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetShopperEmail(v string)` + +SetShopperEmail sets ShopperEmail field to given value. + + +### GetTelephoneNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetTelephoneNumber() string` + +GetTelephoneNumber returns the TelephoneNumber field if non-nil, zero value otherwise. + +### GetTelephoneNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetTelephoneNumberOk() (*string, bool)` + +GetTelephoneNumberOk returns a tuple with the TelephoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTelephoneNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetTelephoneNumber(v string)` + +SetTelephoneNumber sets TelephoneNumber field to given value. + + +### GetGooglePayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetGooglePayToken() string` + +GetGooglePayToken returns the GooglePayToken field if non-nil, zero value otherwise. + +### GetGooglePayTokenOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetGooglePayTokenOk() (*string, bool)` + +GetGooglePayTokenOk returns a tuple with the GooglePayToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGooglePayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetGooglePayToken(v string)` + +SetGooglePayToken sets GooglePayToken field to given value. + + +### GetMasterpassTransactionId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetMasterpassTransactionId() string` + +GetMasterpassTransactionId returns the MasterpassTransactionId field if non-nil, zero value otherwise. + +### GetMasterpassTransactionIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetMasterpassTransactionIdOk() (*string, bool)` + +GetMasterpassTransactionIdOk returns a tuple with the MasterpassTransactionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMasterpassTransactionId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetMasterpassTransactionId(v string)` + +SetMasterpassTransactionId sets MasterpassTransactionId field to given value. + + +### GetOrderID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + +### HasOrderID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasOrderID() bool` + +HasOrderID returns a boolean if a field has been set. + +### GetPayeePreferred + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayeePreferred() string` + +GetPayeePreferred returns the PayeePreferred field if non-nil, zero value otherwise. + +### GetPayeePreferredOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayeePreferredOk() (*string, bool)` + +GetPayeePreferredOk returns a tuple with the PayeePreferred field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayeePreferred + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetPayeePreferred(v string)` + +SetPayeePreferred sets PayeePreferred field to given value. + +### HasPayeePreferred + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasPayeePreferred() bool` + +HasPayeePreferred returns a boolean if a field has been set. + +### GetPayerID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayerID() string` + +GetPayerID returns the PayerID field if non-nil, zero value otherwise. + +### GetPayerIDOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayerIDOk() (*string, bool)` + +GetPayerIDOk returns a tuple with the PayerID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetPayerID(v string)` + +SetPayerID sets PayerID field to given value. + +### HasPayerID + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasPayerID() bool` + +HasPayerID returns a boolean if a field has been set. + +### GetPayerSelected + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayerSelected() string` + +GetPayerSelected returns the PayerSelected field if non-nil, zero value otherwise. + +### GetPayerSelectedOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetPayerSelectedOk() (*string, bool)` + +GetPayerSelectedOk returns a tuple with the PayerSelected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerSelected + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetPayerSelected(v string)` + +SetPayerSelected sets PayerSelected field to given value. + +### HasPayerSelected + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasPayerSelected() bool` + +HasPayerSelected returns a boolean if a field has been set. + +### GetSubtype + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetSubtype() string` + +GetSubtype returns the Subtype field if non-nil, zero value otherwise. + +### GetSubtypeOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetSubtypeOk() (*string, bool)` + +GetSubtypeOk returns a tuple with the Subtype field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubtype + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetSubtype(v string)` + +SetSubtype sets Subtype field to given value. + +### HasSubtype + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasSubtype() bool` + +HasSubtype returns a boolean if a field has been set. + +### GetVirtualPaymentAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetVirtualPaymentAddress() string` + +GetVirtualPaymentAddress returns the VirtualPaymentAddress field if non-nil, zero value otherwise. + +### GetVirtualPaymentAddressOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetVirtualPaymentAddressOk() (*string, bool)` + +GetVirtualPaymentAddressOk returns a tuple with the VirtualPaymentAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualPaymentAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetVirtualPaymentAddress(v string)` + +SetVirtualPaymentAddress sets VirtualPaymentAddress field to given value. + +### HasVirtualPaymentAddress + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasVirtualPaymentAddress() bool` + +HasVirtualPaymentAddress returns a boolean if a field has been set. + +### GetSamsungPayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetSamsungPayToken() string` + +GetSamsungPayToken returns the SamsungPayToken field if non-nil, zero value otherwise. + +### GetSamsungPayTokenOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetSamsungPayTokenOk() (*string, bool)` + +GetSamsungPayTokenOk returns a tuple with the SamsungPayToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSamsungPayToken + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetSamsungPayToken(v string)` + +SetSamsungPayToken sets SamsungPayToken field to given value. + + +### GetIban + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetIban() string` + +GetIban returns the Iban field if non-nil, zero value otherwise. + +### GetIbanOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetIbanOk() (*string, bool)` + +GetIbanOk returns a tuple with the Iban field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIban + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetIban(v string)` + +SetIban sets Iban field to given value. + + +### GetBillingSequenceNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBillingSequenceNumber() string` + +GetBillingSequenceNumber returns the BillingSequenceNumber field if non-nil, zero value otherwise. + +### GetBillingSequenceNumberOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetBillingSequenceNumberOk() (*string, bool)` + +GetBillingSequenceNumberOk returns a tuple with the BillingSequenceNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingSequenceNumber + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetBillingSequenceNumber(v string)` + +SetBillingSequenceNumber sets BillingSequenceNumber field to given value. + + +### GetVisaCheckoutCallId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetVisaCheckoutCallId() string` + +GetVisaCheckoutCallId returns the VisaCheckoutCallId field if non-nil, zero value otherwise. + +### GetVisaCheckoutCallIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetVisaCheckoutCallIdOk() (*string, bool)` + +GetVisaCheckoutCallIdOk returns a tuple with the VisaCheckoutCallId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVisaCheckoutCallId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetVisaCheckoutCallId(v string)` + +SetVisaCheckoutCallId sets VisaCheckoutCallId field to given value. + + +### GetAppId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetAppId() string` + +GetAppId returns the AppId field if non-nil, zero value otherwise. + +### GetAppIdOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetAppIdOk() (*string, bool)` + +GetAppIdOk returns a tuple with the AppId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAppId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetAppId(v string)` + +SetAppId sets AppId field to given value. + +### HasAppId + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasAppId() bool` + +HasAppId returns a boolean if a field has been set. + +### GetOpenid + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOpenid() string` + +GetOpenid returns the Openid field if non-nil, zero value otherwise. + +### GetOpenidOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetOpenidOk() (*string, bool)` + +GetOpenidOk returns a tuple with the Openid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpenid + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetOpenid(v string)` + +SetOpenid sets Openid field to given value. + +### HasOpenid + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasOpenid() bool` + +HasOpenid returns a boolean if a field has been set. + +### GetClickAndCollect + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetClickAndCollect() string` + +GetClickAndCollect returns the ClickAndCollect field if non-nil, zero value otherwise. + +### GetClickAndCollectOk + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) GetClickAndCollectOk() (*string, bool)` + +GetClickAndCollectOk returns a tuple with the ClickAndCollect field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClickAndCollect + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) SetClickAndCollect(v string)` + +SetClickAndCollect sets ClickAndCollect field to given value. + +### HasClickAndCollect + +`func (o *CheckoutDonationPaymentRequestPaymentMethod) HasClickAndCollect() bool` + +HasClickAndCollect returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/CheckoutPaymentRequest.md b/src/checkout/docs/CheckoutPaymentRequest.md new file mode 100644 index 000000000..cc7cd0e4f --- /dev/null +++ b/src/checkout/docs/CheckoutPaymentRequest.md @@ -0,0 +1,1694 @@ +# CheckoutPaymentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountInfo** | Pointer to [**AccountInfo2**](AccountInfo2.md) | | [optional] +**AdditionalAmount** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**AdditionalData** | Pointer to **map[string]string** | This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. | [optional] +**Amount** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**ApplicationInfo** | Pointer to [**ApplicationInfo2**](ApplicationInfo2.md) | | [optional] +**AuthenticationData** | Pointer to [**AuthenticationData**](AuthenticationData.md) | | [optional] +**BillingAddress** | Pointer to [**Address2**](Address2.md) | | [optional] +**BrowserInfo** | Pointer to [**BrowserInfo2**](BrowserInfo2.md) | | [optional] +**CaptureDelayHours** | Pointer to **int32** | The delay between the authorisation and scheduled auto-capture, specified in hours. | [optional] +**Channel** | Pointer to **string** | The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web | [optional] +**CheckoutAttemptId** | Pointer to **string** | Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. | [optional] +**Company** | Pointer to [**Company**](Company.md) | | [optional] +**ConversionId** | Pointer to **string** | Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. | [optional] +**CountryCode** | Pointer to **string** | The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE | [optional] +**DateOfBirth** | Pointer to **time.Time** | The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD | [optional] +**DccQuote** | Pointer to [**ForexQuote2**](ForexQuote2.md) | | [optional] +**DeliveryAddress** | Pointer to [**Address2**](Address2.md) | | [optional] +**DeliveryDate** | Pointer to **time.Time** | The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 | [optional] +**DeviceFingerprint** | Pointer to **string** | A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). | [optional] +**EnableOneClick** | Pointer to **bool** | When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. | [optional] +**EnablePayOut** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for payouts. | [optional] +**EnableRecurring** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. | [optional] +**EntityType** | Pointer to **string** | The type of the entity the payment is processed for. | [optional] +**FraudOffset** | Pointer to **int32** | An integer value that is added to the normal fraud score. The value can be either positive or negative. | [optional] +**IndustryUsage** | Pointer to **string** | The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** | [optional] +**Installments** | Pointer to [**Installments2**](Installments2.md) | | [optional] +**LineItems** | Pointer to [**[]LineItem**](LineItem.md) | Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. | [optional] +**LocalizedShopperStatement** | Pointer to **map[string]string** | This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. | [optional] +**Mandate** | Pointer to [**Mandate**](Mandate.md) | | [optional] +**Mcc** | Pointer to **string** | The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. | [optional] +**MerchantAccount** | Pointer to **string** | The merchant account identifier, with which you want to process the transaction. | [optional] +**MerchantOrderReference** | Pointer to **string** | This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. | [optional] +**MerchantRiskIndicator** | Pointer to [**MerchantRiskIndicator2**](MerchantRiskIndicator2.md) | | [optional] +**Metadata** | Pointer to **map[string]string** | Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. | [optional] +**MpiData** | Pointer to [**ThreeDSecureData**](ThreeDSecureData.md) | | [optional] +**Order** | Pointer to [**EncryptedOrderData**](EncryptedOrderData.md) | | [optional] +**OrderReference** | Pointer to **string** | When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. | [optional] +**Origin** | Pointer to **string** | Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. | [optional] +**PaymentMethod** | Pointer to [**CheckoutDonationPaymentRequestPaymentMethod**](CheckoutDonationPaymentRequestPaymentMethod.md) | | [optional] +**PlatformChargebackLogic** | Pointer to [**PlatformChargebackLogic**](PlatformChargebackLogic.md) | | [optional] +**RecurringExpiry** | Pointer to **string** | Date after which no further authorisations shall be performed. Only for 3D Secure 2. | [optional] +**RecurringFrequency** | Pointer to **string** | Minimum number of days between authorisations. Only for 3D Secure 2. | [optional] +**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] +**RedirectFromIssuerMethod** | Pointer to **string** | Specifies the redirect method (GET or POST) when redirecting back from the issuer. | [optional] +**RedirectToIssuerMethod** | Pointer to **string** | Specifies the redirect method (GET or POST) when redirecting to the issuer. | [optional] +**Reference** | Pointer to **string** | The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. | [optional] +**ReturnUrl** | Pointer to **string** | The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` | [optional] +**RiskData** | Pointer to [**RiskData**](RiskData.md) | | [optional] +**SessionValidity** | Pointer to **string** | The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 | [optional] +**ShopperEmail** | Pointer to **string** | The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. | [optional] +**ShopperIP** | Pointer to **string** | The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). | [optional] +**ShopperInteraction** | Pointer to **string** | Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. | [optional] +**ShopperLocale** | Pointer to **string** | The combination of a language code and a country code to specify the language to be used in the payment. | [optional] +**ShopperName** | Pointer to [**Name2**](Name2.md) | | [optional] +**ShopperReference** | Pointer to **string** | Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. | [optional] +**ShopperStatement** | Pointer to **string** | The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. | [optional] +**SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] +**Splits** | Pointer to [**[]Split2**](Split2.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] +**Store** | Pointer to **string** | The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. | [optional] +**StorePaymentMethod** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be stored. | [optional] +**TelephoneNumber** | Pointer to **string** | The shopper's telephone number. | [optional] +**ThreeDS2RequestData** | Pointer to [**ThreeDS2RequestData2**](ThreeDS2RequestData2.md) | | [optional] +**ThreeDSAuthenticationOnly** | Pointer to **bool** | If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. | [optional] [default to false] +**TrustedShopper** | Pointer to **bool** | Set to true if the payment should be routed to a trusted MID. | [optional] + +## Methods + +### NewCheckoutPaymentRequest + +`func NewCheckoutPaymentRequest() *CheckoutPaymentRequest` + +NewCheckoutPaymentRequest instantiates a new CheckoutPaymentRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCheckoutPaymentRequestWithDefaults + +`func NewCheckoutPaymentRequestWithDefaults() *CheckoutPaymentRequest` + +NewCheckoutPaymentRequestWithDefaults instantiates a new CheckoutPaymentRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountInfo + +`func (o *CheckoutPaymentRequest) GetAccountInfo() AccountInfo2` + +GetAccountInfo returns the AccountInfo field if non-nil, zero value otherwise. + +### GetAccountInfoOk + +`func (o *CheckoutPaymentRequest) GetAccountInfoOk() (*AccountInfo2, bool)` + +GetAccountInfoOk returns a tuple with the AccountInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountInfo + +`func (o *CheckoutPaymentRequest) SetAccountInfo(v AccountInfo2)` + +SetAccountInfo sets AccountInfo field to given value. + +### HasAccountInfo + +`func (o *CheckoutPaymentRequest) HasAccountInfo() bool` + +HasAccountInfo returns a boolean if a field has been set. + +### GetAdditionalAmount + +`func (o *CheckoutPaymentRequest) GetAdditionalAmount() Amount2` + +GetAdditionalAmount returns the AdditionalAmount field if non-nil, zero value otherwise. + +### GetAdditionalAmountOk + +`func (o *CheckoutPaymentRequest) GetAdditionalAmountOk() (*Amount2, bool)` + +GetAdditionalAmountOk returns a tuple with the AdditionalAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalAmount + +`func (o *CheckoutPaymentRequest) SetAdditionalAmount(v Amount2)` + +SetAdditionalAmount sets AdditionalAmount field to given value. + +### HasAdditionalAmount + +`func (o *CheckoutPaymentRequest) HasAdditionalAmount() bool` + +HasAdditionalAmount returns a boolean if a field has been set. + +### GetAdditionalData + +`func (o *CheckoutPaymentRequest) GetAdditionalData() map[string]string` + +GetAdditionalData returns the AdditionalData field if non-nil, zero value otherwise. + +### GetAdditionalDataOk + +`func (o *CheckoutPaymentRequest) GetAdditionalDataOk() (*map[string]string, bool)` + +GetAdditionalDataOk returns a tuple with the AdditionalData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalData + +`func (o *CheckoutPaymentRequest) SetAdditionalData(v map[string]string)` + +SetAdditionalData sets AdditionalData field to given value. + +### HasAdditionalData + +`func (o *CheckoutPaymentRequest) HasAdditionalData() bool` + +HasAdditionalData returns a boolean if a field has been set. + +### GetAmount + +`func (o *CheckoutPaymentRequest) GetAmount() Amount2` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *CheckoutPaymentRequest) GetAmountOk() (*Amount2, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *CheckoutPaymentRequest) SetAmount(v Amount2)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *CheckoutPaymentRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetApplicationInfo + +`func (o *CheckoutPaymentRequest) GetApplicationInfo() ApplicationInfo2` + +GetApplicationInfo returns the ApplicationInfo field if non-nil, zero value otherwise. + +### GetApplicationInfoOk + +`func (o *CheckoutPaymentRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool)` + +GetApplicationInfoOk returns a tuple with the ApplicationInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApplicationInfo + +`func (o *CheckoutPaymentRequest) SetApplicationInfo(v ApplicationInfo2)` + +SetApplicationInfo sets ApplicationInfo field to given value. + +### HasApplicationInfo + +`func (o *CheckoutPaymentRequest) HasApplicationInfo() bool` + +HasApplicationInfo returns a boolean if a field has been set. + +### GetAuthenticationData + +`func (o *CheckoutPaymentRequest) GetAuthenticationData() AuthenticationData` + +GetAuthenticationData returns the AuthenticationData field if non-nil, zero value otherwise. + +### GetAuthenticationDataOk + +`func (o *CheckoutPaymentRequest) GetAuthenticationDataOk() (*AuthenticationData, bool)` + +GetAuthenticationDataOk returns a tuple with the AuthenticationData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthenticationData + +`func (o *CheckoutPaymentRequest) SetAuthenticationData(v AuthenticationData)` + +SetAuthenticationData sets AuthenticationData field to given value. + +### HasAuthenticationData + +`func (o *CheckoutPaymentRequest) HasAuthenticationData() bool` + +HasAuthenticationData returns a boolean if a field has been set. + +### GetBillingAddress + +`func (o *CheckoutPaymentRequest) GetBillingAddress() Address2` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *CheckoutPaymentRequest) GetBillingAddressOk() (*Address2, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *CheckoutPaymentRequest) SetBillingAddress(v Address2)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *CheckoutPaymentRequest) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetBrowserInfo + +`func (o *CheckoutPaymentRequest) GetBrowserInfo() BrowserInfo2` + +GetBrowserInfo returns the BrowserInfo field if non-nil, zero value otherwise. + +### GetBrowserInfoOk + +`func (o *CheckoutPaymentRequest) GetBrowserInfoOk() (*BrowserInfo2, bool)` + +GetBrowserInfoOk returns a tuple with the BrowserInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowserInfo + +`func (o *CheckoutPaymentRequest) SetBrowserInfo(v BrowserInfo2)` + +SetBrowserInfo sets BrowserInfo field to given value. + +### HasBrowserInfo + +`func (o *CheckoutPaymentRequest) HasBrowserInfo() bool` + +HasBrowserInfo returns a boolean if a field has been set. + +### GetCaptureDelayHours + +`func (o *CheckoutPaymentRequest) GetCaptureDelayHours() int32` + +GetCaptureDelayHours returns the CaptureDelayHours field if non-nil, zero value otherwise. + +### GetCaptureDelayHoursOk + +`func (o *CheckoutPaymentRequest) GetCaptureDelayHoursOk() (*int32, bool)` + +GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaptureDelayHours + +`func (o *CheckoutPaymentRequest) SetCaptureDelayHours(v int32)` + +SetCaptureDelayHours sets CaptureDelayHours field to given value. + +### HasCaptureDelayHours + +`func (o *CheckoutPaymentRequest) HasCaptureDelayHours() bool` + +HasCaptureDelayHours returns a boolean if a field has been set. + +### GetChannel + +`func (o *CheckoutPaymentRequest) GetChannel() string` + +GetChannel returns the Channel field if non-nil, zero value otherwise. + +### GetChannelOk + +`func (o *CheckoutPaymentRequest) GetChannelOk() (*string, bool)` + +GetChannelOk returns a tuple with the Channel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannel + +`func (o *CheckoutPaymentRequest) SetChannel(v string)` + +SetChannel sets Channel field to given value. + +### HasChannel + +`func (o *CheckoutPaymentRequest) HasChannel() bool` + +HasChannel returns a boolean if a field has been set. + +### GetCheckoutAttemptId + +`func (o *CheckoutPaymentRequest) GetCheckoutAttemptId() string` + +GetCheckoutAttemptId returns the CheckoutAttemptId field if non-nil, zero value otherwise. + +### GetCheckoutAttemptIdOk + +`func (o *CheckoutPaymentRequest) GetCheckoutAttemptIdOk() (*string, bool)` + +GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCheckoutAttemptId + +`func (o *CheckoutPaymentRequest) SetCheckoutAttemptId(v string)` + +SetCheckoutAttemptId sets CheckoutAttemptId field to given value. + +### HasCheckoutAttemptId + +`func (o *CheckoutPaymentRequest) HasCheckoutAttemptId() bool` + +HasCheckoutAttemptId returns a boolean if a field has been set. + +### GetCompany + +`func (o *CheckoutPaymentRequest) GetCompany() Company` + +GetCompany returns the Company field if non-nil, zero value otherwise. + +### GetCompanyOk + +`func (o *CheckoutPaymentRequest) GetCompanyOk() (*Company, bool)` + +GetCompanyOk returns a tuple with the Company field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompany + +`func (o *CheckoutPaymentRequest) SetCompany(v Company)` + +SetCompany sets Company field to given value. + +### HasCompany + +`func (o *CheckoutPaymentRequest) HasCompany() bool` + +HasCompany returns a boolean if a field has been set. + +### GetConversionId + +`func (o *CheckoutPaymentRequest) GetConversionId() string` + +GetConversionId returns the ConversionId field if non-nil, zero value otherwise. + +### GetConversionIdOk + +`func (o *CheckoutPaymentRequest) GetConversionIdOk() (*string, bool)` + +GetConversionIdOk returns a tuple with the ConversionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConversionId + +`func (o *CheckoutPaymentRequest) SetConversionId(v string)` + +SetConversionId sets ConversionId field to given value. + +### HasConversionId + +`func (o *CheckoutPaymentRequest) HasConversionId() bool` + +HasConversionId returns a boolean if a field has been set. + +### GetCountryCode + +`func (o *CheckoutPaymentRequest) GetCountryCode() string` + +GetCountryCode returns the CountryCode field if non-nil, zero value otherwise. + +### GetCountryCodeOk + +`func (o *CheckoutPaymentRequest) GetCountryCodeOk() (*string, bool)` + +GetCountryCodeOk returns a tuple with the CountryCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryCode + +`func (o *CheckoutPaymentRequest) SetCountryCode(v string)` + +SetCountryCode sets CountryCode field to given value. + +### HasCountryCode + +`func (o *CheckoutPaymentRequest) HasCountryCode() bool` + +HasCountryCode returns a boolean if a field has been set. + +### GetDateOfBirth + +`func (o *CheckoutPaymentRequest) GetDateOfBirth() time.Time` + +GetDateOfBirth returns the DateOfBirth field if non-nil, zero value otherwise. + +### GetDateOfBirthOk + +`func (o *CheckoutPaymentRequest) GetDateOfBirthOk() (*time.Time, bool)` + +GetDateOfBirthOk returns a tuple with the DateOfBirth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateOfBirth + +`func (o *CheckoutPaymentRequest) SetDateOfBirth(v time.Time)` + +SetDateOfBirth sets DateOfBirth field to given value. + +### HasDateOfBirth + +`func (o *CheckoutPaymentRequest) HasDateOfBirth() bool` + +HasDateOfBirth returns a boolean if a field has been set. + +### GetDccQuote + +`func (o *CheckoutPaymentRequest) GetDccQuote() ForexQuote2` + +GetDccQuote returns the DccQuote field if non-nil, zero value otherwise. + +### GetDccQuoteOk + +`func (o *CheckoutPaymentRequest) GetDccQuoteOk() (*ForexQuote2, bool)` + +GetDccQuoteOk returns a tuple with the DccQuote field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDccQuote + +`func (o *CheckoutPaymentRequest) SetDccQuote(v ForexQuote2)` + +SetDccQuote sets DccQuote field to given value. + +### HasDccQuote + +`func (o *CheckoutPaymentRequest) HasDccQuote() bool` + +HasDccQuote returns a boolean if a field has been set. + +### GetDeliveryAddress + +`func (o *CheckoutPaymentRequest) GetDeliveryAddress() Address2` + +GetDeliveryAddress returns the DeliveryAddress field if non-nil, zero value otherwise. + +### GetDeliveryAddressOk + +`func (o *CheckoutPaymentRequest) GetDeliveryAddressOk() (*Address2, bool)` + +GetDeliveryAddressOk returns a tuple with the DeliveryAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddress + +`func (o *CheckoutPaymentRequest) SetDeliveryAddress(v Address2)` + +SetDeliveryAddress sets DeliveryAddress field to given value. + +### HasDeliveryAddress + +`func (o *CheckoutPaymentRequest) HasDeliveryAddress() bool` + +HasDeliveryAddress returns a boolean if a field has been set. + +### GetDeliveryDate + +`func (o *CheckoutPaymentRequest) GetDeliveryDate() time.Time` + +GetDeliveryDate returns the DeliveryDate field if non-nil, zero value otherwise. + +### GetDeliveryDateOk + +`func (o *CheckoutPaymentRequest) GetDeliveryDateOk() (*time.Time, bool)` + +GetDeliveryDateOk returns a tuple with the DeliveryDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryDate + +`func (o *CheckoutPaymentRequest) SetDeliveryDate(v time.Time)` + +SetDeliveryDate sets DeliveryDate field to given value. + +### HasDeliveryDate + +`func (o *CheckoutPaymentRequest) HasDeliveryDate() bool` + +HasDeliveryDate returns a boolean if a field has been set. + +### GetDeviceFingerprint + +`func (o *CheckoutPaymentRequest) GetDeviceFingerprint() string` + +GetDeviceFingerprint returns the DeviceFingerprint field if non-nil, zero value otherwise. + +### GetDeviceFingerprintOk + +`func (o *CheckoutPaymentRequest) GetDeviceFingerprintOk() (*string, bool)` + +GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceFingerprint + +`func (o *CheckoutPaymentRequest) SetDeviceFingerprint(v string)` + +SetDeviceFingerprint sets DeviceFingerprint field to given value. + +### HasDeviceFingerprint + +`func (o *CheckoutPaymentRequest) HasDeviceFingerprint() bool` + +HasDeviceFingerprint returns a boolean if a field has been set. + +### GetEnableOneClick + +`func (o *CheckoutPaymentRequest) GetEnableOneClick() bool` + +GetEnableOneClick returns the EnableOneClick field if non-nil, zero value otherwise. + +### GetEnableOneClickOk + +`func (o *CheckoutPaymentRequest) GetEnableOneClickOk() (*bool, bool)` + +GetEnableOneClickOk returns a tuple with the EnableOneClick field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnableOneClick + +`func (o *CheckoutPaymentRequest) SetEnableOneClick(v bool)` + +SetEnableOneClick sets EnableOneClick field to given value. + +### HasEnableOneClick + +`func (o *CheckoutPaymentRequest) HasEnableOneClick() bool` + +HasEnableOneClick returns a boolean if a field has been set. + +### GetEnablePayOut + +`func (o *CheckoutPaymentRequest) GetEnablePayOut() bool` + +GetEnablePayOut returns the EnablePayOut field if non-nil, zero value otherwise. + +### GetEnablePayOutOk + +`func (o *CheckoutPaymentRequest) GetEnablePayOutOk() (*bool, bool)` + +GetEnablePayOutOk returns a tuple with the EnablePayOut field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnablePayOut + +`func (o *CheckoutPaymentRequest) SetEnablePayOut(v bool)` + +SetEnablePayOut sets EnablePayOut field to given value. + +### HasEnablePayOut + +`func (o *CheckoutPaymentRequest) HasEnablePayOut() bool` + +HasEnablePayOut returns a boolean if a field has been set. + +### GetEnableRecurring + +`func (o *CheckoutPaymentRequest) GetEnableRecurring() bool` + +GetEnableRecurring returns the EnableRecurring field if non-nil, zero value otherwise. + +### GetEnableRecurringOk + +`func (o *CheckoutPaymentRequest) GetEnableRecurringOk() (*bool, bool)` + +GetEnableRecurringOk returns a tuple with the EnableRecurring field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnableRecurring + +`func (o *CheckoutPaymentRequest) SetEnableRecurring(v bool)` + +SetEnableRecurring sets EnableRecurring field to given value. + +### HasEnableRecurring + +`func (o *CheckoutPaymentRequest) HasEnableRecurring() bool` + +HasEnableRecurring returns a boolean if a field has been set. + +### GetEntityType + +`func (o *CheckoutPaymentRequest) GetEntityType() string` + +GetEntityType returns the EntityType field if non-nil, zero value otherwise. + +### GetEntityTypeOk + +`func (o *CheckoutPaymentRequest) GetEntityTypeOk() (*string, bool)` + +GetEntityTypeOk returns a tuple with the EntityType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntityType + +`func (o *CheckoutPaymentRequest) SetEntityType(v string)` + +SetEntityType sets EntityType field to given value. + +### HasEntityType + +`func (o *CheckoutPaymentRequest) HasEntityType() bool` + +HasEntityType returns a boolean if a field has been set. + +### GetFraudOffset + +`func (o *CheckoutPaymentRequest) GetFraudOffset() int32` + +GetFraudOffset returns the FraudOffset field if non-nil, zero value otherwise. + +### GetFraudOffsetOk + +`func (o *CheckoutPaymentRequest) GetFraudOffsetOk() (*int32, bool)` + +GetFraudOffsetOk returns a tuple with the FraudOffset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFraudOffset + +`func (o *CheckoutPaymentRequest) SetFraudOffset(v int32)` + +SetFraudOffset sets FraudOffset field to given value. + +### HasFraudOffset + +`func (o *CheckoutPaymentRequest) HasFraudOffset() bool` + +HasFraudOffset returns a boolean if a field has been set. + +### GetIndustryUsage + +`func (o *CheckoutPaymentRequest) GetIndustryUsage() string` + +GetIndustryUsage returns the IndustryUsage field if non-nil, zero value otherwise. + +### GetIndustryUsageOk + +`func (o *CheckoutPaymentRequest) GetIndustryUsageOk() (*string, bool)` + +GetIndustryUsageOk returns a tuple with the IndustryUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndustryUsage + +`func (o *CheckoutPaymentRequest) SetIndustryUsage(v string)` + +SetIndustryUsage sets IndustryUsage field to given value. + +### HasIndustryUsage + +`func (o *CheckoutPaymentRequest) HasIndustryUsage() bool` + +HasIndustryUsage returns a boolean if a field has been set. + +### GetInstallments + +`func (o *CheckoutPaymentRequest) GetInstallments() Installments2` + +GetInstallments returns the Installments field if non-nil, zero value otherwise. + +### GetInstallmentsOk + +`func (o *CheckoutPaymentRequest) GetInstallmentsOk() (*Installments2, bool)` + +GetInstallmentsOk returns a tuple with the Installments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstallments + +`func (o *CheckoutPaymentRequest) SetInstallments(v Installments2)` + +SetInstallments sets Installments field to given value. + +### HasInstallments + +`func (o *CheckoutPaymentRequest) HasInstallments() bool` + +HasInstallments returns a boolean if a field has been set. + +### GetLineItems + +`func (o *CheckoutPaymentRequest) GetLineItems() []LineItem` + +GetLineItems returns the LineItems field if non-nil, zero value otherwise. + +### GetLineItemsOk + +`func (o *CheckoutPaymentRequest) GetLineItemsOk() (*[]LineItem, bool)` + +GetLineItemsOk returns a tuple with the LineItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLineItems + +`func (o *CheckoutPaymentRequest) SetLineItems(v []LineItem)` + +SetLineItems sets LineItems field to given value. + +### HasLineItems + +`func (o *CheckoutPaymentRequest) HasLineItems() bool` + +HasLineItems returns a boolean if a field has been set. + +### GetLocalizedShopperStatement + +`func (o *CheckoutPaymentRequest) GetLocalizedShopperStatement() map[string]string` + +GetLocalizedShopperStatement returns the LocalizedShopperStatement field if non-nil, zero value otherwise. + +### GetLocalizedShopperStatementOk + +`func (o *CheckoutPaymentRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool)` + +GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocalizedShopperStatement + +`func (o *CheckoutPaymentRequest) SetLocalizedShopperStatement(v map[string]string)` + +SetLocalizedShopperStatement sets LocalizedShopperStatement field to given value. + +### HasLocalizedShopperStatement + +`func (o *CheckoutPaymentRequest) HasLocalizedShopperStatement() bool` + +HasLocalizedShopperStatement returns a boolean if a field has been set. + +### GetMandate + +`func (o *CheckoutPaymentRequest) GetMandate() Mandate` + +GetMandate returns the Mandate field if non-nil, zero value otherwise. + +### GetMandateOk + +`func (o *CheckoutPaymentRequest) GetMandateOk() (*Mandate, bool)` + +GetMandateOk returns a tuple with the Mandate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMandate + +`func (o *CheckoutPaymentRequest) SetMandate(v Mandate)` + +SetMandate sets Mandate field to given value. + +### HasMandate + +`func (o *CheckoutPaymentRequest) HasMandate() bool` + +HasMandate returns a boolean if a field has been set. + +### GetMcc + +`func (o *CheckoutPaymentRequest) GetMcc() string` + +GetMcc returns the Mcc field if non-nil, zero value otherwise. + +### GetMccOk + +`func (o *CheckoutPaymentRequest) GetMccOk() (*string, bool)` + +GetMccOk returns a tuple with the Mcc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMcc + +`func (o *CheckoutPaymentRequest) SetMcc(v string)` + +SetMcc sets Mcc field to given value. + +### HasMcc + +`func (o *CheckoutPaymentRequest) HasMcc() bool` + +HasMcc returns a boolean if a field has been set. + +### GetMerchantAccount + +`func (o *CheckoutPaymentRequest) GetMerchantAccount() string` + +GetMerchantAccount returns the MerchantAccount field if non-nil, zero value otherwise. + +### GetMerchantAccountOk + +`func (o *CheckoutPaymentRequest) GetMerchantAccountOk() (*string, bool)` + +GetMerchantAccountOk returns a tuple with the MerchantAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantAccount + +`func (o *CheckoutPaymentRequest) SetMerchantAccount(v string)` + +SetMerchantAccount sets MerchantAccount field to given value. + +### HasMerchantAccount + +`func (o *CheckoutPaymentRequest) HasMerchantAccount() bool` + +HasMerchantAccount returns a boolean if a field has been set. + +### GetMerchantOrderReference + +`func (o *CheckoutPaymentRequest) GetMerchantOrderReference() string` + +GetMerchantOrderReference returns the MerchantOrderReference field if non-nil, zero value otherwise. + +### GetMerchantOrderReferenceOk + +`func (o *CheckoutPaymentRequest) GetMerchantOrderReferenceOk() (*string, bool)` + +GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantOrderReference + +`func (o *CheckoutPaymentRequest) SetMerchantOrderReference(v string)` + +SetMerchantOrderReference sets MerchantOrderReference field to given value. + +### HasMerchantOrderReference + +`func (o *CheckoutPaymentRequest) HasMerchantOrderReference() bool` + +HasMerchantOrderReference returns a boolean if a field has been set. + +### GetMerchantRiskIndicator + +`func (o *CheckoutPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator2` + +GetMerchantRiskIndicator returns the MerchantRiskIndicator field if non-nil, zero value otherwise. + +### GetMerchantRiskIndicatorOk + +`func (o *CheckoutPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator2, bool)` + +GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantRiskIndicator + +`func (o *CheckoutPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator2)` + +SetMerchantRiskIndicator sets MerchantRiskIndicator field to given value. + +### HasMerchantRiskIndicator + +`func (o *CheckoutPaymentRequest) HasMerchantRiskIndicator() bool` + +HasMerchantRiskIndicator returns a boolean if a field has been set. + +### GetMetadata + +`func (o *CheckoutPaymentRequest) GetMetadata() map[string]string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CheckoutPaymentRequest) GetMetadataOk() (*map[string]string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CheckoutPaymentRequest) SetMetadata(v map[string]string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CheckoutPaymentRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetMpiData + +`func (o *CheckoutPaymentRequest) GetMpiData() ThreeDSecureData` + +GetMpiData returns the MpiData field if non-nil, zero value otherwise. + +### GetMpiDataOk + +`func (o *CheckoutPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool)` + +GetMpiDataOk returns a tuple with the MpiData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMpiData + +`func (o *CheckoutPaymentRequest) SetMpiData(v ThreeDSecureData)` + +SetMpiData sets MpiData field to given value. + +### HasMpiData + +`func (o *CheckoutPaymentRequest) HasMpiData() bool` + +HasMpiData returns a boolean if a field has been set. + +### GetOrder + +`func (o *CheckoutPaymentRequest) GetOrder() EncryptedOrderData` + +GetOrder returns the Order field if non-nil, zero value otherwise. + +### GetOrderOk + +`func (o *CheckoutPaymentRequest) GetOrderOk() (*EncryptedOrderData, bool)` + +GetOrderOk returns a tuple with the Order field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrder + +`func (o *CheckoutPaymentRequest) SetOrder(v EncryptedOrderData)` + +SetOrder sets Order field to given value. + +### HasOrder + +`func (o *CheckoutPaymentRequest) HasOrder() bool` + +HasOrder returns a boolean if a field has been set. + +### GetOrderReference + +`func (o *CheckoutPaymentRequest) GetOrderReference() string` + +GetOrderReference returns the OrderReference field if non-nil, zero value otherwise. + +### GetOrderReferenceOk + +`func (o *CheckoutPaymentRequest) GetOrderReferenceOk() (*string, bool)` + +GetOrderReferenceOk returns a tuple with the OrderReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderReference + +`func (o *CheckoutPaymentRequest) SetOrderReference(v string)` + +SetOrderReference sets OrderReference field to given value. + +### HasOrderReference + +`func (o *CheckoutPaymentRequest) HasOrderReference() bool` + +HasOrderReference returns a boolean if a field has been set. + +### GetOrigin + +`func (o *CheckoutPaymentRequest) GetOrigin() string` + +GetOrigin returns the Origin field if non-nil, zero value otherwise. + +### GetOriginOk + +`func (o *CheckoutPaymentRequest) GetOriginOk() (*string, bool)` + +GetOriginOk returns a tuple with the Origin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrigin + +`func (o *CheckoutPaymentRequest) SetOrigin(v string)` + +SetOrigin sets Origin field to given value. + +### HasOrigin + +`func (o *CheckoutPaymentRequest) HasOrigin() bool` + +HasOrigin returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *CheckoutPaymentRequest) GetPaymentMethod() CheckoutDonationPaymentRequestPaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *CheckoutPaymentRequest) GetPaymentMethodOk() (*CheckoutDonationPaymentRequestPaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *CheckoutPaymentRequest) SetPaymentMethod(v CheckoutDonationPaymentRequestPaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *CheckoutPaymentRequest) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetPlatformChargebackLogic + +`func (o *CheckoutPaymentRequest) GetPlatformChargebackLogic() PlatformChargebackLogic` + +GetPlatformChargebackLogic returns the PlatformChargebackLogic field if non-nil, zero value otherwise. + +### GetPlatformChargebackLogicOk + +`func (o *CheckoutPaymentRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool)` + +GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlatformChargebackLogic + +`func (o *CheckoutPaymentRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic)` + +SetPlatformChargebackLogic sets PlatformChargebackLogic field to given value. + +### HasPlatformChargebackLogic + +`func (o *CheckoutPaymentRequest) HasPlatformChargebackLogic() bool` + +HasPlatformChargebackLogic returns a boolean if a field has been set. + +### GetRecurringExpiry + +`func (o *CheckoutPaymentRequest) GetRecurringExpiry() string` + +GetRecurringExpiry returns the RecurringExpiry field if non-nil, zero value otherwise. + +### GetRecurringExpiryOk + +`func (o *CheckoutPaymentRequest) GetRecurringExpiryOk() (*string, bool)` + +GetRecurringExpiryOk returns a tuple with the RecurringExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringExpiry + +`func (o *CheckoutPaymentRequest) SetRecurringExpiry(v string)` + +SetRecurringExpiry sets RecurringExpiry field to given value. + +### HasRecurringExpiry + +`func (o *CheckoutPaymentRequest) HasRecurringExpiry() bool` + +HasRecurringExpiry returns a boolean if a field has been set. + +### GetRecurringFrequency + +`func (o *CheckoutPaymentRequest) GetRecurringFrequency() string` + +GetRecurringFrequency returns the RecurringFrequency field if non-nil, zero value otherwise. + +### GetRecurringFrequencyOk + +`func (o *CheckoutPaymentRequest) GetRecurringFrequencyOk() (*string, bool)` + +GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringFrequency + +`func (o *CheckoutPaymentRequest) SetRecurringFrequency(v string)` + +SetRecurringFrequency sets RecurringFrequency field to given value. + +### HasRecurringFrequency + +`func (o *CheckoutPaymentRequest) HasRecurringFrequency() bool` + +HasRecurringFrequency returns a boolean if a field has been set. + +### GetRecurringProcessingModel + +`func (o *CheckoutPaymentRequest) GetRecurringProcessingModel() string` + +GetRecurringProcessingModel returns the RecurringProcessingModel field if non-nil, zero value otherwise. + +### GetRecurringProcessingModelOk + +`func (o *CheckoutPaymentRequest) GetRecurringProcessingModelOk() (*string, bool)` + +GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringProcessingModel + +`func (o *CheckoutPaymentRequest) SetRecurringProcessingModel(v string)` + +SetRecurringProcessingModel sets RecurringProcessingModel field to given value. + +### HasRecurringProcessingModel + +`func (o *CheckoutPaymentRequest) HasRecurringProcessingModel() bool` + +HasRecurringProcessingModel returns a boolean if a field has been set. + +### GetRedirectFromIssuerMethod + +`func (o *CheckoutPaymentRequest) GetRedirectFromIssuerMethod() string` + +GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field if non-nil, zero value otherwise. + +### GetRedirectFromIssuerMethodOk + +`func (o *CheckoutPaymentRequest) GetRedirectFromIssuerMethodOk() (*string, bool)` + +GetRedirectFromIssuerMethodOk returns a tuple with the RedirectFromIssuerMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectFromIssuerMethod + +`func (o *CheckoutPaymentRequest) SetRedirectFromIssuerMethod(v string)` + +SetRedirectFromIssuerMethod sets RedirectFromIssuerMethod field to given value. + +### HasRedirectFromIssuerMethod + +`func (o *CheckoutPaymentRequest) HasRedirectFromIssuerMethod() bool` + +HasRedirectFromIssuerMethod returns a boolean if a field has been set. + +### GetRedirectToIssuerMethod + +`func (o *CheckoutPaymentRequest) GetRedirectToIssuerMethod() string` + +GetRedirectToIssuerMethod returns the RedirectToIssuerMethod field if non-nil, zero value otherwise. + +### GetRedirectToIssuerMethodOk + +`func (o *CheckoutPaymentRequest) GetRedirectToIssuerMethodOk() (*string, bool)` + +GetRedirectToIssuerMethodOk returns a tuple with the RedirectToIssuerMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectToIssuerMethod + +`func (o *CheckoutPaymentRequest) SetRedirectToIssuerMethod(v string)` + +SetRedirectToIssuerMethod sets RedirectToIssuerMethod field to given value. + +### HasRedirectToIssuerMethod + +`func (o *CheckoutPaymentRequest) HasRedirectToIssuerMethod() bool` + +HasRedirectToIssuerMethod returns a boolean if a field has been set. + +### GetReference + +`func (o *CheckoutPaymentRequest) GetReference() string` + +GetReference returns the Reference field if non-nil, zero value otherwise. + +### GetReferenceOk + +`func (o *CheckoutPaymentRequest) GetReferenceOk() (*string, bool)` + +GetReferenceOk returns a tuple with the Reference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReference + +`func (o *CheckoutPaymentRequest) SetReference(v string)` + +SetReference sets Reference field to given value. + +### HasReference + +`func (o *CheckoutPaymentRequest) HasReference() bool` + +HasReference returns a boolean if a field has been set. + +### GetReturnUrl + +`func (o *CheckoutPaymentRequest) GetReturnUrl() string` + +GetReturnUrl returns the ReturnUrl field if non-nil, zero value otherwise. + +### GetReturnUrlOk + +`func (o *CheckoutPaymentRequest) GetReturnUrlOk() (*string, bool)` + +GetReturnUrlOk returns a tuple with the ReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReturnUrl + +`func (o *CheckoutPaymentRequest) SetReturnUrl(v string)` + +SetReturnUrl sets ReturnUrl field to given value. + +### HasReturnUrl + +`func (o *CheckoutPaymentRequest) HasReturnUrl() bool` + +HasReturnUrl returns a boolean if a field has been set. + +### GetRiskData + +`func (o *CheckoutPaymentRequest) GetRiskData() RiskData` + +GetRiskData returns the RiskData field if non-nil, zero value otherwise. + +### GetRiskDataOk + +`func (o *CheckoutPaymentRequest) GetRiskDataOk() (*RiskData, bool)` + +GetRiskDataOk returns a tuple with the RiskData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRiskData + +`func (o *CheckoutPaymentRequest) SetRiskData(v RiskData)` + +SetRiskData sets RiskData field to given value. + +### HasRiskData + +`func (o *CheckoutPaymentRequest) HasRiskData() bool` + +HasRiskData returns a boolean if a field has been set. + +### GetSessionValidity + +`func (o *CheckoutPaymentRequest) GetSessionValidity() string` + +GetSessionValidity returns the SessionValidity field if non-nil, zero value otherwise. + +### GetSessionValidityOk + +`func (o *CheckoutPaymentRequest) GetSessionValidityOk() (*string, bool)` + +GetSessionValidityOk returns a tuple with the SessionValidity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessionValidity + +`func (o *CheckoutPaymentRequest) SetSessionValidity(v string)` + +SetSessionValidity sets SessionValidity field to given value. + +### HasSessionValidity + +`func (o *CheckoutPaymentRequest) HasSessionValidity() bool` + +HasSessionValidity returns a boolean if a field has been set. + +### GetShopperEmail + +`func (o *CheckoutPaymentRequest) GetShopperEmail() string` + +GetShopperEmail returns the ShopperEmail field if non-nil, zero value otherwise. + +### GetShopperEmailOk + +`func (o *CheckoutPaymentRequest) GetShopperEmailOk() (*string, bool)` + +GetShopperEmailOk returns a tuple with the ShopperEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperEmail + +`func (o *CheckoutPaymentRequest) SetShopperEmail(v string)` + +SetShopperEmail sets ShopperEmail field to given value. + +### HasShopperEmail + +`func (o *CheckoutPaymentRequest) HasShopperEmail() bool` + +HasShopperEmail returns a boolean if a field has been set. + +### GetShopperIP + +`func (o *CheckoutPaymentRequest) GetShopperIP() string` + +GetShopperIP returns the ShopperIP field if non-nil, zero value otherwise. + +### GetShopperIPOk + +`func (o *CheckoutPaymentRequest) GetShopperIPOk() (*string, bool)` + +GetShopperIPOk returns a tuple with the ShopperIP field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperIP + +`func (o *CheckoutPaymentRequest) SetShopperIP(v string)` + +SetShopperIP sets ShopperIP field to given value. + +### HasShopperIP + +`func (o *CheckoutPaymentRequest) HasShopperIP() bool` + +HasShopperIP returns a boolean if a field has been set. + +### GetShopperInteraction + +`func (o *CheckoutPaymentRequest) GetShopperInteraction() string` + +GetShopperInteraction returns the ShopperInteraction field if non-nil, zero value otherwise. + +### GetShopperInteractionOk + +`func (o *CheckoutPaymentRequest) GetShopperInteractionOk() (*string, bool)` + +GetShopperInteractionOk returns a tuple with the ShopperInteraction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperInteraction + +`func (o *CheckoutPaymentRequest) SetShopperInteraction(v string)` + +SetShopperInteraction sets ShopperInteraction field to given value. + +### HasShopperInteraction + +`func (o *CheckoutPaymentRequest) HasShopperInteraction() bool` + +HasShopperInteraction returns a boolean if a field has been set. + +### GetShopperLocale + +`func (o *CheckoutPaymentRequest) GetShopperLocale() string` + +GetShopperLocale returns the ShopperLocale field if non-nil, zero value otherwise. + +### GetShopperLocaleOk + +`func (o *CheckoutPaymentRequest) GetShopperLocaleOk() (*string, bool)` + +GetShopperLocaleOk returns a tuple with the ShopperLocale field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperLocale + +`func (o *CheckoutPaymentRequest) SetShopperLocale(v string)` + +SetShopperLocale sets ShopperLocale field to given value. + +### HasShopperLocale + +`func (o *CheckoutPaymentRequest) HasShopperLocale() bool` + +HasShopperLocale returns a boolean if a field has been set. + +### GetShopperName + +`func (o *CheckoutPaymentRequest) GetShopperName() Name2` + +GetShopperName returns the ShopperName field if non-nil, zero value otherwise. + +### GetShopperNameOk + +`func (o *CheckoutPaymentRequest) GetShopperNameOk() (*Name2, bool)` + +GetShopperNameOk returns a tuple with the ShopperName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperName + +`func (o *CheckoutPaymentRequest) SetShopperName(v Name2)` + +SetShopperName sets ShopperName field to given value. + +### HasShopperName + +`func (o *CheckoutPaymentRequest) HasShopperName() bool` + +HasShopperName returns a boolean if a field has been set. + +### GetShopperReference + +`func (o *CheckoutPaymentRequest) GetShopperReference() string` + +GetShopperReference returns the ShopperReference field if non-nil, zero value otherwise. + +### GetShopperReferenceOk + +`func (o *CheckoutPaymentRequest) GetShopperReferenceOk() (*string, bool)` + +GetShopperReferenceOk returns a tuple with the ShopperReference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperReference + +`func (o *CheckoutPaymentRequest) SetShopperReference(v string)` + +SetShopperReference sets ShopperReference field to given value. + +### HasShopperReference + +`func (o *CheckoutPaymentRequest) HasShopperReference() bool` + +HasShopperReference returns a boolean if a field has been set. + +### GetShopperStatement + +`func (o *CheckoutPaymentRequest) GetShopperStatement() string` + +GetShopperStatement returns the ShopperStatement field if non-nil, zero value otherwise. + +### GetShopperStatementOk + +`func (o *CheckoutPaymentRequest) GetShopperStatementOk() (*string, bool)` + +GetShopperStatementOk returns a tuple with the ShopperStatement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShopperStatement + +`func (o *CheckoutPaymentRequest) SetShopperStatement(v string)` + +SetShopperStatement sets ShopperStatement field to given value. + +### HasShopperStatement + +`func (o *CheckoutPaymentRequest) HasShopperStatement() bool` + +HasShopperStatement returns a boolean if a field has been set. + +### GetSocialSecurityNumber + +`func (o *CheckoutPaymentRequest) GetSocialSecurityNumber() string` + +GetSocialSecurityNumber returns the SocialSecurityNumber field if non-nil, zero value otherwise. + +### GetSocialSecurityNumberOk + +`func (o *CheckoutPaymentRequest) GetSocialSecurityNumberOk() (*string, bool)` + +GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSocialSecurityNumber + +`func (o *CheckoutPaymentRequest) SetSocialSecurityNumber(v string)` + +SetSocialSecurityNumber sets SocialSecurityNumber field to given value. + +### HasSocialSecurityNumber + +`func (o *CheckoutPaymentRequest) HasSocialSecurityNumber() bool` + +HasSocialSecurityNumber returns a boolean if a field has been set. + +### GetSplits + +`func (o *CheckoutPaymentRequest) GetSplits() []Split2` + +GetSplits returns the Splits field if non-nil, zero value otherwise. + +### GetSplitsOk + +`func (o *CheckoutPaymentRequest) GetSplitsOk() (*[]Split2, bool)` + +GetSplitsOk returns a tuple with the Splits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSplits + +`func (o *CheckoutPaymentRequest) SetSplits(v []Split2)` + +SetSplits sets Splits field to given value. + +### HasSplits + +`func (o *CheckoutPaymentRequest) HasSplits() bool` + +HasSplits returns a boolean if a field has been set. + +### GetStore + +`func (o *CheckoutPaymentRequest) GetStore() string` + +GetStore returns the Store field if non-nil, zero value otherwise. + +### GetStoreOk + +`func (o *CheckoutPaymentRequest) GetStoreOk() (*string, bool)` + +GetStoreOk returns a tuple with the Store field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStore + +`func (o *CheckoutPaymentRequest) SetStore(v string)` + +SetStore sets Store field to given value. + +### HasStore + +`func (o *CheckoutPaymentRequest) HasStore() bool` + +HasStore returns a boolean if a field has been set. + +### GetStorePaymentMethod + +`func (o *CheckoutPaymentRequest) GetStorePaymentMethod() bool` + +GetStorePaymentMethod returns the StorePaymentMethod field if non-nil, zero value otherwise. + +### GetStorePaymentMethodOk + +`func (o *CheckoutPaymentRequest) GetStorePaymentMethodOk() (*bool, bool)` + +GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorePaymentMethod + +`func (o *CheckoutPaymentRequest) SetStorePaymentMethod(v bool)` + +SetStorePaymentMethod sets StorePaymentMethod field to given value. + +### HasStorePaymentMethod + +`func (o *CheckoutPaymentRequest) HasStorePaymentMethod() bool` + +HasStorePaymentMethod returns a boolean if a field has been set. + +### GetTelephoneNumber + +`func (o *CheckoutPaymentRequest) GetTelephoneNumber() string` + +GetTelephoneNumber returns the TelephoneNumber field if non-nil, zero value otherwise. + +### GetTelephoneNumberOk + +`func (o *CheckoutPaymentRequest) GetTelephoneNumberOk() (*string, bool)` + +GetTelephoneNumberOk returns a tuple with the TelephoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTelephoneNumber + +`func (o *CheckoutPaymentRequest) SetTelephoneNumber(v string)` + +SetTelephoneNumber sets TelephoneNumber field to given value. + +### HasTelephoneNumber + +`func (o *CheckoutPaymentRequest) HasTelephoneNumber() bool` + +HasTelephoneNumber returns a boolean if a field has been set. + +### GetThreeDS2RequestData + +`func (o *CheckoutPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2` + +GetThreeDS2RequestData returns the ThreeDS2RequestData field if non-nil, zero value otherwise. + +### GetThreeDS2RequestDataOk + +`func (o *CheckoutPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool)` + +GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDS2RequestData + +`func (o *CheckoutPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2)` + +SetThreeDS2RequestData sets ThreeDS2RequestData field to given value. + +### HasThreeDS2RequestData + +`func (o *CheckoutPaymentRequest) HasThreeDS2RequestData() bool` + +HasThreeDS2RequestData returns a boolean if a field has been set. + +### GetThreeDSAuthenticationOnly + +`func (o *CheckoutPaymentRequest) GetThreeDSAuthenticationOnly() bool` + +GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field if non-nil, zero value otherwise. + +### GetThreeDSAuthenticationOnlyOk + +`func (o *CheckoutPaymentRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool)` + +GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSAuthenticationOnly + +`func (o *CheckoutPaymentRequest) SetThreeDSAuthenticationOnly(v bool)` + +SetThreeDSAuthenticationOnly sets ThreeDSAuthenticationOnly field to given value. + +### HasThreeDSAuthenticationOnly + +`func (o *CheckoutPaymentRequest) HasThreeDSAuthenticationOnly() bool` + +HasThreeDSAuthenticationOnly returns a boolean if a field has been set. + +### GetTrustedShopper + +`func (o *CheckoutPaymentRequest) GetTrustedShopper() bool` + +GetTrustedShopper returns the TrustedShopper field if non-nil, zero value otherwise. + +### GetTrustedShopperOk + +`func (o *CheckoutPaymentRequest) GetTrustedShopperOk() (*bool, bool)` + +GetTrustedShopperOk returns a tuple with the TrustedShopper field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrustedShopper + +`func (o *CheckoutPaymentRequest) SetTrustedShopper(v bool)` + +SetTrustedShopper sets TrustedShopper field to given value. + +### HasTrustedShopper + +`func (o *CheckoutPaymentRequest) HasTrustedShopper() bool` + +HasTrustedShopper returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/CreateCheckoutSessionRequest.md b/src/checkout/docs/CreateCheckoutSessionRequest.md index 61b46bfcd..ff59b742b 100644 --- a/src/checkout/docs/CreateCheckoutSessionRequest.md +++ b/src/checkout/docs/CreateCheckoutSessionRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountInfo** | Pointer to [**AccountInfo**](AccountInfo.md) | | [optional] -**AdditionalAmount** | Pointer to [**Amount**](Amount.md) | | [optional] +**AccountInfo** | Pointer to [**AccountInfo2**](AccountInfo2.md) | | [optional] +**AdditionalAmount** | Pointer to [**Amount2**](Amount2.md) | | [optional] **AdditionalData** | Pointer to **map[string]string** | This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. | [optional] **AllowedPaymentMethods** | Pointer to **[]string** | List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` | [optional] -**Amount** | [**Amount**](Amount.md) | | -**ApplicationInfo** | Pointer to [**ApplicationInfo**](ApplicationInfo.md) | | [optional] +**Amount** | [**Amount2**](Amount2.md) | | +**ApplicationInfo** | Pointer to [**ApplicationInfo2**](ApplicationInfo2.md) | | [optional] **AuthenticationData** | Pointer to [**AuthenticationData**](AuthenticationData.md) | | [optional] -**BillingAddress** | Pointer to [**Address**](Address.md) | | [optional] +**BillingAddress** | Pointer to [**Address2**](Address2.md) | | [optional] **BlockedPaymentMethods** | Pointer to **[]string** | List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` | [optional] **CaptureDelayHours** | Pointer to **int32** | The delay between the authorisation and scheduled auto-capture, specified in hours. | [optional] **Channel** | Pointer to **string** | The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** | [optional] @@ -19,7 +19,7 @@ Name | Type | Description | Notes **CountryCode** | Pointer to **string** | The shopper's two-letter country code. | [optional] **DateOfBirth** | Pointer to **string** | The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD | [optional] **DeliverAt** | Pointer to **time.Time** | The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. | [optional] -**DeliveryAddress** | Pointer to [**Address**](Address.md) | | [optional] +**DeliveryAddress** | Pointer to [**Address2**](Address2.md) | | [optional] **EnableOneClick** | Pointer to **bool** | When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. | [optional] **EnablePayOut** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for payouts. | [optional] **EnableRecurring** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. | [optional] @@ -46,12 +46,12 @@ Name | Type | Description | Notes **ShopperIP** | Pointer to **string** | The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). | [optional] **ShopperInteraction** | Pointer to **string** | Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. | [optional] **ShopperLocale** | Pointer to **string** | The combination of a language code and a country code to specify the language to be used in the payment. | [optional] -**ShopperName** | Pointer to [**Name**](Name.md) | | [optional] +**ShopperName** | Pointer to [**Name2**](Name2.md) | | [optional] **ShopperReference** | Pointer to **string** | Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. | [optional] **ShopperStatement** | Pointer to **string** | The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. | [optional] **SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] **SplitCardFundingSources** | Pointer to **bool** | Boolean value indicating whether the card payment method should be split into separate debit and credit options. | [optional] [default to false] -**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] +**Splits** | Pointer to [**[]Split2**](Split2.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] **Store** | Pointer to **string** | The ecommerce or point-of-sale store that is processing the payment. | [optional] **StorePaymentMethod** | Pointer to **bool** | When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. | [optional] **StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. | [optional] @@ -63,7 +63,7 @@ Name | Type | Description | Notes ### NewCreateCheckoutSessionRequest -`func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, reference string, returnUrl string, ) *CreateCheckoutSessionRequest` +`func NewCreateCheckoutSessionRequest(amount Amount2, merchantAccount string, reference string, returnUrl string, ) *CreateCheckoutSessionRequest` NewCreateCheckoutSessionRequest instantiates a new CreateCheckoutSessionRequest object This constructor will assign default values to properties that have it defined, @@ -80,20 +80,20 @@ but it doesn't guarantee that properties required by API are set ### GetAccountInfo -`func (o *CreateCheckoutSessionRequest) GetAccountInfo() AccountInfo` +`func (o *CreateCheckoutSessionRequest) GetAccountInfo() AccountInfo2` GetAccountInfo returns the AccountInfo field if non-nil, zero value otherwise. ### GetAccountInfoOk -`func (o *CreateCheckoutSessionRequest) GetAccountInfoOk() (*AccountInfo, bool)` +`func (o *CreateCheckoutSessionRequest) GetAccountInfoOk() (*AccountInfo2, bool)` GetAccountInfoOk returns a tuple with the AccountInfo field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccountInfo -`func (o *CreateCheckoutSessionRequest) SetAccountInfo(v AccountInfo)` +`func (o *CreateCheckoutSessionRequest) SetAccountInfo(v AccountInfo2)` SetAccountInfo sets AccountInfo field to given value. @@ -105,20 +105,20 @@ HasAccountInfo returns a boolean if a field has been set. ### GetAdditionalAmount -`func (o *CreateCheckoutSessionRequest) GetAdditionalAmount() Amount` +`func (o *CreateCheckoutSessionRequest) GetAdditionalAmount() Amount2` GetAdditionalAmount returns the AdditionalAmount field if non-nil, zero value otherwise. ### GetAdditionalAmountOk -`func (o *CreateCheckoutSessionRequest) GetAdditionalAmountOk() (*Amount, bool)` +`func (o *CreateCheckoutSessionRequest) GetAdditionalAmountOk() (*Amount2, bool)` GetAdditionalAmountOk returns a tuple with the AdditionalAmount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAdditionalAmount -`func (o *CreateCheckoutSessionRequest) SetAdditionalAmount(v Amount)` +`func (o *CreateCheckoutSessionRequest) SetAdditionalAmount(v Amount2)` SetAdditionalAmount sets AdditionalAmount field to given value. @@ -180,40 +180,40 @@ HasAllowedPaymentMethods returns a boolean if a field has been set. ### GetAmount -`func (o *CreateCheckoutSessionRequest) GetAmount() Amount` +`func (o *CreateCheckoutSessionRequest) GetAmount() Amount2` GetAmount returns the Amount field if non-nil, zero value otherwise. ### GetAmountOk -`func (o *CreateCheckoutSessionRequest) GetAmountOk() (*Amount, bool)` +`func (o *CreateCheckoutSessionRequest) GetAmountOk() (*Amount2, bool)` GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAmount -`func (o *CreateCheckoutSessionRequest) SetAmount(v Amount)` +`func (o *CreateCheckoutSessionRequest) SetAmount(v Amount2)` SetAmount sets Amount field to given value. ### GetApplicationInfo -`func (o *CreateCheckoutSessionRequest) GetApplicationInfo() ApplicationInfo` +`func (o *CreateCheckoutSessionRequest) GetApplicationInfo() ApplicationInfo2` GetApplicationInfo returns the ApplicationInfo field if non-nil, zero value otherwise. ### GetApplicationInfoOk -`func (o *CreateCheckoutSessionRequest) GetApplicationInfoOk() (*ApplicationInfo, bool)` +`func (o *CreateCheckoutSessionRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool)` GetApplicationInfoOk returns a tuple with the ApplicationInfo field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetApplicationInfo -`func (o *CreateCheckoutSessionRequest) SetApplicationInfo(v ApplicationInfo)` +`func (o *CreateCheckoutSessionRequest) SetApplicationInfo(v ApplicationInfo2)` SetApplicationInfo sets ApplicationInfo field to given value. @@ -250,20 +250,20 @@ HasAuthenticationData returns a boolean if a field has been set. ### GetBillingAddress -`func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address` +`func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address2` GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. ### GetBillingAddressOk -`func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*Address, bool)` +`func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*Address2, bool)` GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBillingAddress -`func (o *CreateCheckoutSessionRequest) SetBillingAddress(v Address)` +`func (o *CreateCheckoutSessionRequest) SetBillingAddress(v Address2)` SetBillingAddress sets BillingAddress field to given value. @@ -450,20 +450,20 @@ HasDeliverAt returns a boolean if a field has been set. ### GetDeliveryAddress -`func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address` +`func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address2` GetDeliveryAddress returns the DeliveryAddress field if non-nil, zero value otherwise. ### GetDeliveryAddressOk -`func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*Address, bool)` +`func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*Address2, bool)` GetDeliveryAddressOk returns a tuple with the DeliveryAddress field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDeliveryAddress -`func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v Address)` +`func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v Address2)` SetDeliveryAddress sets DeliveryAddress field to given value. @@ -1110,20 +1110,20 @@ HasShopperLocale returns a boolean if a field has been set. ### GetShopperName -`func (o *CreateCheckoutSessionRequest) GetShopperName() Name` +`func (o *CreateCheckoutSessionRequest) GetShopperName() Name2` GetShopperName returns the ShopperName field if non-nil, zero value otherwise. ### GetShopperNameOk -`func (o *CreateCheckoutSessionRequest) GetShopperNameOk() (*Name, bool)` +`func (o *CreateCheckoutSessionRequest) GetShopperNameOk() (*Name2, bool)` GetShopperNameOk returns a tuple with the ShopperName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetShopperName -`func (o *CreateCheckoutSessionRequest) SetShopperName(v Name)` +`func (o *CreateCheckoutSessionRequest) SetShopperName(v Name2)` SetShopperName sets ShopperName field to given value. @@ -1235,20 +1235,20 @@ HasSplitCardFundingSources returns a boolean if a field has been set. ### GetSplits -`func (o *CreateCheckoutSessionRequest) GetSplits() []Split` +`func (o *CreateCheckoutSessionRequest) GetSplits() []Split2` GetSplits returns the Splits field if non-nil, zero value otherwise. ### GetSplitsOk -`func (o *CreateCheckoutSessionRequest) GetSplitsOk() (*[]Split, bool)` +`func (o *CreateCheckoutSessionRequest) GetSplitsOk() (*[]Split2, bool)` GetSplitsOk returns a tuple with the Splits field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSplits -`func (o *CreateCheckoutSessionRequest) SetSplits(v []Split)` +`func (o *CreateCheckoutSessionRequest) SetSplits(v []Split2)` SetSplits sets Splits field to given value. diff --git a/src/checkout/docs/CreateCheckoutSessionResponse.md b/src/checkout/docs/CreateCheckoutSessionResponse.md index 30e256938..f9ee6b54a 100644 --- a/src/checkout/docs/CreateCheckoutSessionResponse.md +++ b/src/checkout/docs/CreateCheckoutSessionResponse.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountInfo** | Pointer to [**AccountInfo**](AccountInfo.md) | | [optional] -**AdditionalAmount** | Pointer to [**Amount**](Amount.md) | | [optional] +**AccountInfo** | Pointer to [**AccountInfo2**](AccountInfo2.md) | | [optional] +**AdditionalAmount** | Pointer to [**Amount2**](Amount2.md) | | [optional] **AdditionalData** | Pointer to **map[string]string** | This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. | [optional] **AllowedPaymentMethods** | Pointer to **[]string** | List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` | [optional] -**Amount** | [**Amount**](Amount.md) | | -**ApplicationInfo** | Pointer to [**ApplicationInfo**](ApplicationInfo.md) | | [optional] +**Amount** | [**Amount2**](Amount2.md) | | +**ApplicationInfo** | Pointer to [**ApplicationInfo2**](ApplicationInfo2.md) | | [optional] **AuthenticationData** | Pointer to [**AuthenticationData**](AuthenticationData.md) | | [optional] -**BillingAddress** | Pointer to [**Address**](Address.md) | | [optional] +**BillingAddress** | Pointer to [**Address2**](Address2.md) | | [optional] **BlockedPaymentMethods** | Pointer to **[]string** | List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` | [optional] **CaptureDelayHours** | Pointer to **int32** | The delay between the authorisation and scheduled auto-capture, specified in hours. | [optional] **Channel** | Pointer to **string** | The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** | [optional] @@ -19,7 +19,7 @@ Name | Type | Description | Notes **CountryCode** | Pointer to **string** | The shopper's two-letter country code. | [optional] **DateOfBirth** | Pointer to **string** | The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD | [optional] **DeliverAt** | Pointer to **time.Time** | The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. | [optional] -**DeliveryAddress** | Pointer to [**Address**](Address.md) | | [optional] +**DeliveryAddress** | Pointer to [**Address2**](Address2.md) | | [optional] **EnableOneClick** | Pointer to **bool** | When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. | [optional] **EnablePayOut** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for payouts. | [optional] **EnableRecurring** | Pointer to **bool** | When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. | [optional] @@ -49,12 +49,12 @@ Name | Type | Description | Notes **ShopperIP** | Pointer to **string** | The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). | [optional] **ShopperInteraction** | Pointer to **string** | Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. | [optional] **ShopperLocale** | Pointer to **string** | The combination of a language code and a country code to specify the language to be used in the payment. | [optional] -**ShopperName** | Pointer to [**Name**](Name.md) | | [optional] +**ShopperName** | Pointer to [**Name2**](Name2.md) | | [optional] **ShopperReference** | Pointer to **string** | Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. | [optional] **ShopperStatement** | Pointer to **string** | The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. | [optional] **SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] **SplitCardFundingSources** | Pointer to **bool** | Boolean value indicating whether the card payment method should be split into separate debit and credit options. | [optional] [default to false] -**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] +**Splits** | Pointer to [**[]Split2**](Split2.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] **Store** | Pointer to **string** | The ecommerce or point-of-sale store that is processing the payment. | [optional] **StorePaymentMethod** | Pointer to **bool** | When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. | [optional] **StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. | [optional] @@ -66,7 +66,7 @@ Name | Type | Description | Notes ### NewCreateCheckoutSessionResponse -`func NewCreateCheckoutSessionResponse(amount Amount, expiresAt time.Time, id string, merchantAccount string, reference string, returnUrl string, ) *CreateCheckoutSessionResponse` +`func NewCreateCheckoutSessionResponse(amount Amount2, expiresAt time.Time, id string, merchantAccount string, reference string, returnUrl string, ) *CreateCheckoutSessionResponse` NewCreateCheckoutSessionResponse instantiates a new CreateCheckoutSessionResponse object This constructor will assign default values to properties that have it defined, @@ -83,20 +83,20 @@ but it doesn't guarantee that properties required by API are set ### GetAccountInfo -`func (o *CreateCheckoutSessionResponse) GetAccountInfo() AccountInfo` +`func (o *CreateCheckoutSessionResponse) GetAccountInfo() AccountInfo2` GetAccountInfo returns the AccountInfo field if non-nil, zero value otherwise. ### GetAccountInfoOk -`func (o *CreateCheckoutSessionResponse) GetAccountInfoOk() (*AccountInfo, bool)` +`func (o *CreateCheckoutSessionResponse) GetAccountInfoOk() (*AccountInfo2, bool)` GetAccountInfoOk returns a tuple with the AccountInfo field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAccountInfo -`func (o *CreateCheckoutSessionResponse) SetAccountInfo(v AccountInfo)` +`func (o *CreateCheckoutSessionResponse) SetAccountInfo(v AccountInfo2)` SetAccountInfo sets AccountInfo field to given value. @@ -108,20 +108,20 @@ HasAccountInfo returns a boolean if a field has been set. ### GetAdditionalAmount -`func (o *CreateCheckoutSessionResponse) GetAdditionalAmount() Amount` +`func (o *CreateCheckoutSessionResponse) GetAdditionalAmount() Amount2` GetAdditionalAmount returns the AdditionalAmount field if non-nil, zero value otherwise. ### GetAdditionalAmountOk -`func (o *CreateCheckoutSessionResponse) GetAdditionalAmountOk() (*Amount, bool)` +`func (o *CreateCheckoutSessionResponse) GetAdditionalAmountOk() (*Amount2, bool)` GetAdditionalAmountOk returns a tuple with the AdditionalAmount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAdditionalAmount -`func (o *CreateCheckoutSessionResponse) SetAdditionalAmount(v Amount)` +`func (o *CreateCheckoutSessionResponse) SetAdditionalAmount(v Amount2)` SetAdditionalAmount sets AdditionalAmount field to given value. @@ -183,40 +183,40 @@ HasAllowedPaymentMethods returns a boolean if a field has been set. ### GetAmount -`func (o *CreateCheckoutSessionResponse) GetAmount() Amount` +`func (o *CreateCheckoutSessionResponse) GetAmount() Amount2` GetAmount returns the Amount field if non-nil, zero value otherwise. ### GetAmountOk -`func (o *CreateCheckoutSessionResponse) GetAmountOk() (*Amount, bool)` +`func (o *CreateCheckoutSessionResponse) GetAmountOk() (*Amount2, bool)` GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAmount -`func (o *CreateCheckoutSessionResponse) SetAmount(v Amount)` +`func (o *CreateCheckoutSessionResponse) SetAmount(v Amount2)` SetAmount sets Amount field to given value. ### GetApplicationInfo -`func (o *CreateCheckoutSessionResponse) GetApplicationInfo() ApplicationInfo` +`func (o *CreateCheckoutSessionResponse) GetApplicationInfo() ApplicationInfo2` GetApplicationInfo returns the ApplicationInfo field if non-nil, zero value otherwise. ### GetApplicationInfoOk -`func (o *CreateCheckoutSessionResponse) GetApplicationInfoOk() (*ApplicationInfo, bool)` +`func (o *CreateCheckoutSessionResponse) GetApplicationInfoOk() (*ApplicationInfo2, bool)` GetApplicationInfoOk returns a tuple with the ApplicationInfo field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetApplicationInfo -`func (o *CreateCheckoutSessionResponse) SetApplicationInfo(v ApplicationInfo)` +`func (o *CreateCheckoutSessionResponse) SetApplicationInfo(v ApplicationInfo2)` SetApplicationInfo sets ApplicationInfo field to given value. @@ -253,20 +253,20 @@ HasAuthenticationData returns a boolean if a field has been set. ### GetBillingAddress -`func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address` +`func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address2` GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. ### GetBillingAddressOk -`func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*Address, bool)` +`func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*Address2, bool)` GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBillingAddress -`func (o *CreateCheckoutSessionResponse) SetBillingAddress(v Address)` +`func (o *CreateCheckoutSessionResponse) SetBillingAddress(v Address2)` SetBillingAddress sets BillingAddress field to given value. @@ -453,20 +453,20 @@ HasDeliverAt returns a boolean if a field has been set. ### GetDeliveryAddress -`func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address` +`func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address2` GetDeliveryAddress returns the DeliveryAddress field if non-nil, zero value otherwise. ### GetDeliveryAddressOk -`func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*Address, bool)` +`func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*Address2, bool)` GetDeliveryAddressOk returns a tuple with the DeliveryAddress field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDeliveryAddress -`func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v Address)` +`func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v Address2)` SetDeliveryAddress sets DeliveryAddress field to given value. @@ -1178,20 +1178,20 @@ HasShopperLocale returns a boolean if a field has been set. ### GetShopperName -`func (o *CreateCheckoutSessionResponse) GetShopperName() Name` +`func (o *CreateCheckoutSessionResponse) GetShopperName() Name2` GetShopperName returns the ShopperName field if non-nil, zero value otherwise. ### GetShopperNameOk -`func (o *CreateCheckoutSessionResponse) GetShopperNameOk() (*Name, bool)` +`func (o *CreateCheckoutSessionResponse) GetShopperNameOk() (*Name2, bool)` GetShopperNameOk returns a tuple with the ShopperName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetShopperName -`func (o *CreateCheckoutSessionResponse) SetShopperName(v Name)` +`func (o *CreateCheckoutSessionResponse) SetShopperName(v Name2)` SetShopperName sets ShopperName field to given value. @@ -1303,20 +1303,20 @@ HasSplitCardFundingSources returns a boolean if a field has been set. ### GetSplits -`func (o *CreateCheckoutSessionResponse) GetSplits() []Split` +`func (o *CreateCheckoutSessionResponse) GetSplits() []Split2` GetSplits returns the Splits field if non-nil, zero value otherwise. ### GetSplitsOk -`func (o *CreateCheckoutSessionResponse) GetSplitsOk() (*[]Split, bool)` +`func (o *CreateCheckoutSessionResponse) GetSplitsOk() (*[]Split2, bool)` GetSplitsOk returns a tuple with the Splits field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSplits -`func (o *CreateCheckoutSessionResponse) SetSplits(v []Split)` +`func (o *CreateCheckoutSessionResponse) SetSplits(v []Split2)` SetSplits sets Splits field to given value. diff --git a/src/checkout/docs/CreatePaymentLinkRequest.md b/src/checkout/docs/CreatePaymentLinkRequest.md index 864a6d4e1..d4ab171e3 100644 --- a/src/checkout/docs/CreatePaymentLinkRequest.md +++ b/src/checkout/docs/CreatePaymentLinkRequest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **DeliverAt** | Pointer to **time.Time** | The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. | [optional] **DeliveryAddress** | Pointer to [**Address**](Address.md) | | [optional] **Description** | Pointer to **string** | A short description visible on the payment page. Maximum length: 280 characters. | [optional] -**ExpiresAt** | Pointer to **string** | The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. | [optional] +**ExpiresAt** | Pointer to **string** | The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.This value is represented in Zulu format which is utilized for API v70 and lower. | [optional] **InstallmentOptions** | Pointer to [**map[string]InstallmentOption**](InstallmentOption.md) | A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. | [optional] **LineItems** | Pointer to [**[]LineItem**](LineItem.md) | Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. | [optional] **ManualCapture** | Pointer to **bool** | Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). | [optional] @@ -23,7 +23,7 @@ Name | Type | Description | Notes **MerchantAccount** | **string** | The merchant account identifier for which the payment link is created. | **MerchantOrderReference** | Pointer to **string** | This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. | [optional] **Metadata** | Pointer to **map[string]string** | Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. | [optional] -**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] +**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] **Reference** | **string** | A reference that is used to uniquely identify the payment in future communications about the payment status. | **RequiredShopperFields** | Pointer to **[]string** | List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. | [optional] **ReturnUrl** | Pointer to **string** | Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. | [optional] @@ -37,9 +37,9 @@ Name | Type | Description | Notes **ShowRemovePaymentMethodButton** | Pointer to **bool** | Set to **false** to hide the button that lets the shopper remove a stored payment method. | [optional] [default to true] **SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] **SplitCardFundingSources** | Pointer to **bool** | Boolean value indicating whether the card payment method should be split into separate debit and credit options. | [optional] [default to false] -**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). | [optional] +**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] **Store** | Pointer to **string** | The physical store, for which this payment is processed. | [optional] -**StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. | [optional] +**StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. | [optional] **TelephoneNumber** | Pointer to **string** | The shopper's telephone number. | [optional] **ThemeId** | Pointer to **string** | A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. | [optional] diff --git a/src/checkout/docs/ForexQuote2.md b/src/checkout/docs/ForexQuote2.md new file mode 100644 index 000000000..1f92ed61b --- /dev/null +++ b/src/checkout/docs/ForexQuote2.md @@ -0,0 +1,342 @@ +# ForexQuote2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Account** | Pointer to **string** | The account name. | [optional] +**AccountType** | Pointer to **string** | The account type. | [optional] +**BaseAmount** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**BasePoints** | Pointer to **int32** | The base points. | [optional] +**Buy** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**Interbank** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**Reference** | Pointer to **string** | The reference assigned to the forex quote request. | [optional] +**Sell** | Pointer to [**Amount2**](Amount2.md) | | [optional] +**Signature** | Pointer to **string** | The signature to validate the integrity. | [optional] +**Source** | Pointer to **string** | The source of the forex quote. | [optional] +**Type** | Pointer to **string** | The type of forex. | [optional] +**ValidTill** | Pointer to **time.Time** | The date until which the forex quote is valid. | [optional] + +## Methods + +### NewForexQuote2 + +`func NewForexQuote2() *ForexQuote2` + +NewForexQuote2 instantiates a new ForexQuote2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewForexQuote2WithDefaults + +`func NewForexQuote2WithDefaults() *ForexQuote2` + +NewForexQuote2WithDefaults instantiates a new ForexQuote2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccount + +`func (o *ForexQuote2) GetAccount() string` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *ForexQuote2) GetAccountOk() (*string, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *ForexQuote2) SetAccount(v string)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *ForexQuote2) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + +### GetAccountType + +`func (o *ForexQuote2) GetAccountType() string` + +GetAccountType returns the AccountType field if non-nil, zero value otherwise. + +### GetAccountTypeOk + +`func (o *ForexQuote2) GetAccountTypeOk() (*string, bool)` + +GetAccountTypeOk returns a tuple with the AccountType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountType + +`func (o *ForexQuote2) SetAccountType(v string)` + +SetAccountType sets AccountType field to given value. + +### HasAccountType + +`func (o *ForexQuote2) HasAccountType() bool` + +HasAccountType returns a boolean if a field has been set. + +### GetBaseAmount + +`func (o *ForexQuote2) GetBaseAmount() Amount2` + +GetBaseAmount returns the BaseAmount field if non-nil, zero value otherwise. + +### GetBaseAmountOk + +`func (o *ForexQuote2) GetBaseAmountOk() (*Amount2, bool)` + +GetBaseAmountOk returns a tuple with the BaseAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseAmount + +`func (o *ForexQuote2) SetBaseAmount(v Amount2)` + +SetBaseAmount sets BaseAmount field to given value. + +### HasBaseAmount + +`func (o *ForexQuote2) HasBaseAmount() bool` + +HasBaseAmount returns a boolean if a field has been set. + +### GetBasePoints + +`func (o *ForexQuote2) GetBasePoints() int32` + +GetBasePoints returns the BasePoints field if non-nil, zero value otherwise. + +### GetBasePointsOk + +`func (o *ForexQuote2) GetBasePointsOk() (*int32, bool)` + +GetBasePointsOk returns a tuple with the BasePoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBasePoints + +`func (o *ForexQuote2) SetBasePoints(v int32)` + +SetBasePoints sets BasePoints field to given value. + +### HasBasePoints + +`func (o *ForexQuote2) HasBasePoints() bool` + +HasBasePoints returns a boolean if a field has been set. + +### GetBuy + +`func (o *ForexQuote2) GetBuy() Amount2` + +GetBuy returns the Buy field if non-nil, zero value otherwise. + +### GetBuyOk + +`func (o *ForexQuote2) GetBuyOk() (*Amount2, bool)` + +GetBuyOk returns a tuple with the Buy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuy + +`func (o *ForexQuote2) SetBuy(v Amount2)` + +SetBuy sets Buy field to given value. + +### HasBuy + +`func (o *ForexQuote2) HasBuy() bool` + +HasBuy returns a boolean if a field has been set. + +### GetInterbank + +`func (o *ForexQuote2) GetInterbank() Amount2` + +GetInterbank returns the Interbank field if non-nil, zero value otherwise. + +### GetInterbankOk + +`func (o *ForexQuote2) GetInterbankOk() (*Amount2, bool)` + +GetInterbankOk returns a tuple with the Interbank field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInterbank + +`func (o *ForexQuote2) SetInterbank(v Amount2)` + +SetInterbank sets Interbank field to given value. + +### HasInterbank + +`func (o *ForexQuote2) HasInterbank() bool` + +HasInterbank returns a boolean if a field has been set. + +### GetReference + +`func (o *ForexQuote2) GetReference() string` + +GetReference returns the Reference field if non-nil, zero value otherwise. + +### GetReferenceOk + +`func (o *ForexQuote2) GetReferenceOk() (*string, bool)` + +GetReferenceOk returns a tuple with the Reference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReference + +`func (o *ForexQuote2) SetReference(v string)` + +SetReference sets Reference field to given value. + +### HasReference + +`func (o *ForexQuote2) HasReference() bool` + +HasReference returns a boolean if a field has been set. + +### GetSell + +`func (o *ForexQuote2) GetSell() Amount2` + +GetSell returns the Sell field if non-nil, zero value otherwise. + +### GetSellOk + +`func (o *ForexQuote2) GetSellOk() (*Amount2, bool)` + +GetSellOk returns a tuple with the Sell field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSell + +`func (o *ForexQuote2) SetSell(v Amount2)` + +SetSell sets Sell field to given value. + +### HasSell + +`func (o *ForexQuote2) HasSell() bool` + +HasSell returns a boolean if a field has been set. + +### GetSignature + +`func (o *ForexQuote2) GetSignature() string` + +GetSignature returns the Signature field if non-nil, zero value otherwise. + +### GetSignatureOk + +`func (o *ForexQuote2) GetSignatureOk() (*string, bool)` + +GetSignatureOk returns a tuple with the Signature field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSignature + +`func (o *ForexQuote2) SetSignature(v string)` + +SetSignature sets Signature field to given value. + +### HasSignature + +`func (o *ForexQuote2) HasSignature() bool` + +HasSignature returns a boolean if a field has been set. + +### GetSource + +`func (o *ForexQuote2) GetSource() string` + +GetSource returns the Source field if non-nil, zero value otherwise. + +### GetSourceOk + +`func (o *ForexQuote2) GetSourceOk() (*string, bool)` + +GetSourceOk returns a tuple with the Source field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSource + +`func (o *ForexQuote2) SetSource(v string)` + +SetSource sets Source field to given value. + +### HasSource + +`func (o *ForexQuote2) HasSource() bool` + +HasSource returns a boolean if a field has been set. + +### GetType + +`func (o *ForexQuote2) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ForexQuote2) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ForexQuote2) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ForexQuote2) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetValidTill + +`func (o *ForexQuote2) GetValidTill() time.Time` + +GetValidTill returns the ValidTill field if non-nil, zero value otherwise. + +### GetValidTillOk + +`func (o *ForexQuote2) GetValidTillOk() (*time.Time, bool)` + +GetValidTillOk returns a tuple with the ValidTill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValidTill + +`func (o *ForexQuote2) SetValidTill(v time.Time)` + +SetValidTill sets ValidTill field to given value. + +### HasValidTill + +`func (o *ForexQuote2) HasValidTill() bool` + +HasValidTill returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Installments2.md b/src/checkout/docs/Installments2.md new file mode 100644 index 000000000..6eaba53e8 --- /dev/null +++ b/src/checkout/docs/Installments2.md @@ -0,0 +1,82 @@ +# Installments2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Plan** | Pointer to **string** | The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** | [optional] +**Value** | Pointer to **int32** | Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. | [optional] + +## Methods + +### NewInstallments2 + +`func NewInstallments2() *Installments2` + +NewInstallments2 instantiates a new Installments2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInstallments2WithDefaults + +`func NewInstallments2WithDefaults() *Installments2` + +NewInstallments2WithDefaults instantiates a new Installments2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPlan + +`func (o *Installments2) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *Installments2) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *Installments2) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *Installments2) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetValue + +`func (o *Installments2) GetValue() int32` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *Installments2) GetValueOk() (*int32, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *Installments2) SetValue(v int32)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *Installments2) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Mandate.md b/src/checkout/docs/Mandate.md index 34d9f011c..f5937e4cf 100644 --- a/src/checkout/docs/Mandate.md +++ b/src/checkout/docs/Mandate.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Amount** | **string** | The billing amount (in minor units) of the recurring transactions. | +**Amount** | Pointer to **string** | The billing amount (in minor units) of the recurring transactions. | [optional] **AmountRule** | Pointer to **string** | The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. | [optional] **BillingAttemptsRule** | Pointer to **string** | The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. | [optional] **BillingDay** | Pointer to **string** | The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. | [optional] -**EndsAt** | **string** | End date of the billing plan, in YYYY-MM-DD format. | -**Frequency** | **string** | The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. | +**EndsAt** | Pointer to **string** | End date of the billing plan, in YYYY-MM-DD format. | [optional] +**Frequency** | Pointer to **string** | The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. | [optional] **Remarks** | Pointer to **string** | The message shown by UPI to the shopper on the approval screen. | [optional] **StartsAt** | Pointer to **string** | Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. | [optional] @@ -17,7 +17,7 @@ Name | Type | Description | Notes ### NewMandate -`func NewMandate(amount string, endsAt string, frequency string, ) *Mandate` +`func NewMandate() *Mandate` NewMandate instantiates a new Mandate object This constructor will assign default values to properties that have it defined, @@ -51,6 +51,11 @@ and a boolean to check if the value has been set. SetAmount sets Amount field to given value. +### HasAmount + +`func (o *Mandate) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. ### GetAmountRule @@ -146,6 +151,11 @@ and a boolean to check if the value has been set. SetEndsAt sets EndsAt field to given value. +### HasEndsAt + +`func (o *Mandate) HasEndsAt() bool` + +HasEndsAt returns a boolean if a field has been set. ### GetFrequency @@ -166,6 +176,11 @@ and a boolean to check if the value has been set. SetFrequency sets Frequency field to given value. +### HasFrequency + +`func (o *Mandate) HasFrequency() bool` + +HasFrequency returns a boolean if a field has been set. ### GetRemarks diff --git a/src/checkout/docs/Mandate2.md b/src/checkout/docs/Mandate2.md new file mode 100644 index 000000000..4393e28f7 --- /dev/null +++ b/src/checkout/docs/Mandate2.md @@ -0,0 +1,223 @@ +# Mandate2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | **string** | The billing amount (in minor units) of the recurring transactions. | +**AmountRule** | Pointer to **string** | The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. | [optional] +**BillingAttemptsRule** | Pointer to **string** | The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. | [optional] +**BillingDay** | Pointer to **string** | The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. | [optional] +**EndsAt** | **string** | End date of the billing plan, in YYYY-MM-DD format. | +**Frequency** | **string** | The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. | +**Remarks** | Pointer to **string** | The message shown by UPI to the shopper on the approval screen. | [optional] +**StartsAt** | Pointer to **string** | Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. | [optional] + +## Methods + +### NewMandate2 + +`func NewMandate2(amount string, endsAt string, frequency string, ) *Mandate2` + +NewMandate2 instantiates a new Mandate2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMandate2WithDefaults + +`func NewMandate2WithDefaults() *Mandate2` + +NewMandate2WithDefaults instantiates a new Mandate2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *Mandate2) GetAmount() string` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Mandate2) GetAmountOk() (*string, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Mandate2) SetAmount(v string)` + +SetAmount sets Amount field to given value. + + +### GetAmountRule + +`func (o *Mandate2) GetAmountRule() string` + +GetAmountRule returns the AmountRule field if non-nil, zero value otherwise. + +### GetAmountRuleOk + +`func (o *Mandate2) GetAmountRuleOk() (*string, bool)` + +GetAmountRuleOk returns a tuple with the AmountRule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountRule + +`func (o *Mandate2) SetAmountRule(v string)` + +SetAmountRule sets AmountRule field to given value. + +### HasAmountRule + +`func (o *Mandate2) HasAmountRule() bool` + +HasAmountRule returns a boolean if a field has been set. + +### GetBillingAttemptsRule + +`func (o *Mandate2) GetBillingAttemptsRule() string` + +GetBillingAttemptsRule returns the BillingAttemptsRule field if non-nil, zero value otherwise. + +### GetBillingAttemptsRuleOk + +`func (o *Mandate2) GetBillingAttemptsRuleOk() (*string, bool)` + +GetBillingAttemptsRuleOk returns a tuple with the BillingAttemptsRule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAttemptsRule + +`func (o *Mandate2) SetBillingAttemptsRule(v string)` + +SetBillingAttemptsRule sets BillingAttemptsRule field to given value. + +### HasBillingAttemptsRule + +`func (o *Mandate2) HasBillingAttemptsRule() bool` + +HasBillingAttemptsRule returns a boolean if a field has been set. + +### GetBillingDay + +`func (o *Mandate2) GetBillingDay() string` + +GetBillingDay returns the BillingDay field if non-nil, zero value otherwise. + +### GetBillingDayOk + +`func (o *Mandate2) GetBillingDayOk() (*string, bool)` + +GetBillingDayOk returns a tuple with the BillingDay field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingDay + +`func (o *Mandate2) SetBillingDay(v string)` + +SetBillingDay sets BillingDay field to given value. + +### HasBillingDay + +`func (o *Mandate2) HasBillingDay() bool` + +HasBillingDay returns a boolean if a field has been set. + +### GetEndsAt + +`func (o *Mandate2) GetEndsAt() string` + +GetEndsAt returns the EndsAt field if non-nil, zero value otherwise. + +### GetEndsAtOk + +`func (o *Mandate2) GetEndsAtOk() (*string, bool)` + +GetEndsAtOk returns a tuple with the EndsAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndsAt + +`func (o *Mandate2) SetEndsAt(v string)` + +SetEndsAt sets EndsAt field to given value. + + +### GetFrequency + +`func (o *Mandate2) GetFrequency() string` + +GetFrequency returns the Frequency field if non-nil, zero value otherwise. + +### GetFrequencyOk + +`func (o *Mandate2) GetFrequencyOk() (*string, bool)` + +GetFrequencyOk returns a tuple with the Frequency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFrequency + +`func (o *Mandate2) SetFrequency(v string)` + +SetFrequency sets Frequency field to given value. + + +### GetRemarks + +`func (o *Mandate2) GetRemarks() string` + +GetRemarks returns the Remarks field if non-nil, zero value otherwise. + +### GetRemarksOk + +`func (o *Mandate2) GetRemarksOk() (*string, bool)` + +GetRemarksOk returns a tuple with the Remarks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRemarks + +`func (o *Mandate2) SetRemarks(v string)` + +SetRemarks sets Remarks field to given value. + +### HasRemarks + +`func (o *Mandate2) HasRemarks() bool` + +HasRemarks returns a boolean if a field has been set. + +### GetStartsAt + +`func (o *Mandate2) GetStartsAt() string` + +GetStartsAt returns the StartsAt field if non-nil, zero value otherwise. + +### GetStartsAtOk + +`func (o *Mandate2) GetStartsAtOk() (*string, bool)` + +GetStartsAtOk returns a tuple with the StartsAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartsAt + +`func (o *Mandate2) SetStartsAt(v string)` + +SetStartsAt sets StartsAt field to given value. + +### HasStartsAt + +`func (o *Mandate2) HasStartsAt() bool` + +HasStartsAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/MerchantRiskIndicator2.md b/src/checkout/docs/MerchantRiskIndicator2.md new file mode 100644 index 000000000..7cb0aeaa6 --- /dev/null +++ b/src/checkout/docs/MerchantRiskIndicator2.md @@ -0,0 +1,394 @@ +# MerchantRiskIndicator2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressMatch** | Pointer to **bool** | Whether the chosen delivery address is identical to the billing address. | [optional] +**DeliveryAddressIndicator** | Pointer to **string** | Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` | [optional] +**DeliveryEmail** | Pointer to **string** | The delivery email address (for digital goods). | [optional] +**DeliveryEmailAddress** | Pointer to **string** | For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. | [optional] +**DeliveryTimeframe** | Pointer to **string** | The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` | [optional] +**GiftCardAmount** | Pointer to [**Amount**](Amount.md) | | [optional] +**GiftCardCount** | Pointer to **int32** | For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. | [optional] +**GiftCardCurr** | Pointer to **string** | For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. | [optional] +**PreOrderDate** | Pointer to **time.Time** | For pre-order purchases, the expected date this product will be available to the shopper. | [optional] +**PreOrderPurchase** | Pointer to **bool** | Indicator for whether this transaction is for pre-ordering a product. | [optional] +**PreOrderPurchaseInd** | Pointer to **string** | Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. | [optional] +**ReorderItems** | Pointer to **bool** | Indicator for whether the shopper has already purchased the same items in the past. | [optional] +**ReorderItemsInd** | Pointer to **string** | Indicates whether the cardholder is reordering previously purchased merchandise. | [optional] +**ShipIndicator** | Pointer to **string** | Indicates shipping method chosen for the transaction. | [optional] + +## Methods + +### NewMerchantRiskIndicator2 + +`func NewMerchantRiskIndicator2() *MerchantRiskIndicator2` + +NewMerchantRiskIndicator2 instantiates a new MerchantRiskIndicator2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMerchantRiskIndicator2WithDefaults + +`func NewMerchantRiskIndicator2WithDefaults() *MerchantRiskIndicator2` + +NewMerchantRiskIndicator2WithDefaults instantiates a new MerchantRiskIndicator2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressMatch + +`func (o *MerchantRiskIndicator2) GetAddressMatch() bool` + +GetAddressMatch returns the AddressMatch field if non-nil, zero value otherwise. + +### GetAddressMatchOk + +`func (o *MerchantRiskIndicator2) GetAddressMatchOk() (*bool, bool)` + +GetAddressMatchOk returns a tuple with the AddressMatch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressMatch + +`func (o *MerchantRiskIndicator2) SetAddressMatch(v bool)` + +SetAddressMatch sets AddressMatch field to given value. + +### HasAddressMatch + +`func (o *MerchantRiskIndicator2) HasAddressMatch() bool` + +HasAddressMatch returns a boolean if a field has been set. + +### GetDeliveryAddressIndicator + +`func (o *MerchantRiskIndicator2) GetDeliveryAddressIndicator() string` + +GetDeliveryAddressIndicator returns the DeliveryAddressIndicator field if non-nil, zero value otherwise. + +### GetDeliveryAddressIndicatorOk + +`func (o *MerchantRiskIndicator2) GetDeliveryAddressIndicatorOk() (*string, bool)` + +GetDeliveryAddressIndicatorOk returns a tuple with the DeliveryAddressIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryAddressIndicator + +`func (o *MerchantRiskIndicator2) SetDeliveryAddressIndicator(v string)` + +SetDeliveryAddressIndicator sets DeliveryAddressIndicator field to given value. + +### HasDeliveryAddressIndicator + +`func (o *MerchantRiskIndicator2) HasDeliveryAddressIndicator() bool` + +HasDeliveryAddressIndicator returns a boolean if a field has been set. + +### GetDeliveryEmail + +`func (o *MerchantRiskIndicator2) GetDeliveryEmail() string` + +GetDeliveryEmail returns the DeliveryEmail field if non-nil, zero value otherwise. + +### GetDeliveryEmailOk + +`func (o *MerchantRiskIndicator2) GetDeliveryEmailOk() (*string, bool)` + +GetDeliveryEmailOk returns a tuple with the DeliveryEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryEmail + +`func (o *MerchantRiskIndicator2) SetDeliveryEmail(v string)` + +SetDeliveryEmail sets DeliveryEmail field to given value. + +### HasDeliveryEmail + +`func (o *MerchantRiskIndicator2) HasDeliveryEmail() bool` + +HasDeliveryEmail returns a boolean if a field has been set. + +### GetDeliveryEmailAddress + +`func (o *MerchantRiskIndicator2) GetDeliveryEmailAddress() string` + +GetDeliveryEmailAddress returns the DeliveryEmailAddress field if non-nil, zero value otherwise. + +### GetDeliveryEmailAddressOk + +`func (o *MerchantRiskIndicator2) GetDeliveryEmailAddressOk() (*string, bool)` + +GetDeliveryEmailAddressOk returns a tuple with the DeliveryEmailAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryEmailAddress + +`func (o *MerchantRiskIndicator2) SetDeliveryEmailAddress(v string)` + +SetDeliveryEmailAddress sets DeliveryEmailAddress field to given value. + +### HasDeliveryEmailAddress + +`func (o *MerchantRiskIndicator2) HasDeliveryEmailAddress() bool` + +HasDeliveryEmailAddress returns a boolean if a field has been set. + +### GetDeliveryTimeframe + +`func (o *MerchantRiskIndicator2) GetDeliveryTimeframe() string` + +GetDeliveryTimeframe returns the DeliveryTimeframe field if non-nil, zero value otherwise. + +### GetDeliveryTimeframeOk + +`func (o *MerchantRiskIndicator2) GetDeliveryTimeframeOk() (*string, bool)` + +GetDeliveryTimeframeOk returns a tuple with the DeliveryTimeframe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryTimeframe + +`func (o *MerchantRiskIndicator2) SetDeliveryTimeframe(v string)` + +SetDeliveryTimeframe sets DeliveryTimeframe field to given value. + +### HasDeliveryTimeframe + +`func (o *MerchantRiskIndicator2) HasDeliveryTimeframe() bool` + +HasDeliveryTimeframe returns a boolean if a field has been set. + +### GetGiftCardAmount + +`func (o *MerchantRiskIndicator2) GetGiftCardAmount() Amount` + +GetGiftCardAmount returns the GiftCardAmount field if non-nil, zero value otherwise. + +### GetGiftCardAmountOk + +`func (o *MerchantRiskIndicator2) GetGiftCardAmountOk() (*Amount, bool)` + +GetGiftCardAmountOk returns a tuple with the GiftCardAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGiftCardAmount + +`func (o *MerchantRiskIndicator2) SetGiftCardAmount(v Amount)` + +SetGiftCardAmount sets GiftCardAmount field to given value. + +### HasGiftCardAmount + +`func (o *MerchantRiskIndicator2) HasGiftCardAmount() bool` + +HasGiftCardAmount returns a boolean if a field has been set. + +### GetGiftCardCount + +`func (o *MerchantRiskIndicator2) GetGiftCardCount() int32` + +GetGiftCardCount returns the GiftCardCount field if non-nil, zero value otherwise. + +### GetGiftCardCountOk + +`func (o *MerchantRiskIndicator2) GetGiftCardCountOk() (*int32, bool)` + +GetGiftCardCountOk returns a tuple with the GiftCardCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGiftCardCount + +`func (o *MerchantRiskIndicator2) SetGiftCardCount(v int32)` + +SetGiftCardCount sets GiftCardCount field to given value. + +### HasGiftCardCount + +`func (o *MerchantRiskIndicator2) HasGiftCardCount() bool` + +HasGiftCardCount returns a boolean if a field has been set. + +### GetGiftCardCurr + +`func (o *MerchantRiskIndicator2) GetGiftCardCurr() string` + +GetGiftCardCurr returns the GiftCardCurr field if non-nil, zero value otherwise. + +### GetGiftCardCurrOk + +`func (o *MerchantRiskIndicator2) GetGiftCardCurrOk() (*string, bool)` + +GetGiftCardCurrOk returns a tuple with the GiftCardCurr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGiftCardCurr + +`func (o *MerchantRiskIndicator2) SetGiftCardCurr(v string)` + +SetGiftCardCurr sets GiftCardCurr field to given value. + +### HasGiftCardCurr + +`func (o *MerchantRiskIndicator2) HasGiftCardCurr() bool` + +HasGiftCardCurr returns a boolean if a field has been set. + +### GetPreOrderDate + +`func (o *MerchantRiskIndicator2) GetPreOrderDate() time.Time` + +GetPreOrderDate returns the PreOrderDate field if non-nil, zero value otherwise. + +### GetPreOrderDateOk + +`func (o *MerchantRiskIndicator2) GetPreOrderDateOk() (*time.Time, bool)` + +GetPreOrderDateOk returns a tuple with the PreOrderDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreOrderDate + +`func (o *MerchantRiskIndicator2) SetPreOrderDate(v time.Time)` + +SetPreOrderDate sets PreOrderDate field to given value. + +### HasPreOrderDate + +`func (o *MerchantRiskIndicator2) HasPreOrderDate() bool` + +HasPreOrderDate returns a boolean if a field has been set. + +### GetPreOrderPurchase + +`func (o *MerchantRiskIndicator2) GetPreOrderPurchase() bool` + +GetPreOrderPurchase returns the PreOrderPurchase field if non-nil, zero value otherwise. + +### GetPreOrderPurchaseOk + +`func (o *MerchantRiskIndicator2) GetPreOrderPurchaseOk() (*bool, bool)` + +GetPreOrderPurchaseOk returns a tuple with the PreOrderPurchase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreOrderPurchase + +`func (o *MerchantRiskIndicator2) SetPreOrderPurchase(v bool)` + +SetPreOrderPurchase sets PreOrderPurchase field to given value. + +### HasPreOrderPurchase + +`func (o *MerchantRiskIndicator2) HasPreOrderPurchase() bool` + +HasPreOrderPurchase returns a boolean if a field has been set. + +### GetPreOrderPurchaseInd + +`func (o *MerchantRiskIndicator2) GetPreOrderPurchaseInd() string` + +GetPreOrderPurchaseInd returns the PreOrderPurchaseInd field if non-nil, zero value otherwise. + +### GetPreOrderPurchaseIndOk + +`func (o *MerchantRiskIndicator2) GetPreOrderPurchaseIndOk() (*string, bool)` + +GetPreOrderPurchaseIndOk returns a tuple with the PreOrderPurchaseInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreOrderPurchaseInd + +`func (o *MerchantRiskIndicator2) SetPreOrderPurchaseInd(v string)` + +SetPreOrderPurchaseInd sets PreOrderPurchaseInd field to given value. + +### HasPreOrderPurchaseInd + +`func (o *MerchantRiskIndicator2) HasPreOrderPurchaseInd() bool` + +HasPreOrderPurchaseInd returns a boolean if a field has been set. + +### GetReorderItems + +`func (o *MerchantRiskIndicator2) GetReorderItems() bool` + +GetReorderItems returns the ReorderItems field if non-nil, zero value otherwise. + +### GetReorderItemsOk + +`func (o *MerchantRiskIndicator2) GetReorderItemsOk() (*bool, bool)` + +GetReorderItemsOk returns a tuple with the ReorderItems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReorderItems + +`func (o *MerchantRiskIndicator2) SetReorderItems(v bool)` + +SetReorderItems sets ReorderItems field to given value. + +### HasReorderItems + +`func (o *MerchantRiskIndicator2) HasReorderItems() bool` + +HasReorderItems returns a boolean if a field has been set. + +### GetReorderItemsInd + +`func (o *MerchantRiskIndicator2) GetReorderItemsInd() string` + +GetReorderItemsInd returns the ReorderItemsInd field if non-nil, zero value otherwise. + +### GetReorderItemsIndOk + +`func (o *MerchantRiskIndicator2) GetReorderItemsIndOk() (*string, bool)` + +GetReorderItemsIndOk returns a tuple with the ReorderItemsInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReorderItemsInd + +`func (o *MerchantRiskIndicator2) SetReorderItemsInd(v string)` + +SetReorderItemsInd sets ReorderItemsInd field to given value. + +### HasReorderItemsInd + +`func (o *MerchantRiskIndicator2) HasReorderItemsInd() bool` + +HasReorderItemsInd returns a boolean if a field has been set. + +### GetShipIndicator + +`func (o *MerchantRiskIndicator2) GetShipIndicator() string` + +GetShipIndicator returns the ShipIndicator field if non-nil, zero value otherwise. + +### GetShipIndicatorOk + +`func (o *MerchantRiskIndicator2) GetShipIndicatorOk() (*string, bool)` + +GetShipIndicatorOk returns a tuple with the ShipIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShipIndicator + +`func (o *MerchantRiskIndicator2) SetShipIndicator(v string)` + +SetShipIndicator sets ShipIndicator field to given value. + +### HasShipIndicator + +`func (o *MerchantRiskIndicator2) HasShipIndicator() bool` + +HasShipIndicator returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Name2.md b/src/checkout/docs/Name2.md new file mode 100644 index 000000000..090bf148c --- /dev/null +++ b/src/checkout/docs/Name2.md @@ -0,0 +1,82 @@ +# Name2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | Pointer to **string** | The first name. | [optional] +**LastName** | Pointer to **string** | The last name. | [optional] + +## Methods + +### NewName2 + +`func NewName2() *Name2` + +NewName2 instantiates a new Name2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewName2WithDefaults + +`func NewName2WithDefaults() *Name2` + +NewName2WithDefaults instantiates a new Name2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFirstName + +`func (o *Name2) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *Name2) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *Name2) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *Name2) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastName + +`func (o *Name2) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *Name2) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *Name2) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *Name2) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/PayPalDetails.md b/src/checkout/docs/PayPalDetails.md index 2f390cdfa..bc0870fb7 100644 --- a/src/checkout/docs/PayPalDetails.md +++ b/src/checkout/docs/PayPalDetails.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CheckoutAttemptId** | Pointer to **string** | The checkout attempt identifier. | [optional] **OrderID** | Pointer to **string** | The unique ID associated with the order. | [optional] +**PayeePreferred** | Pointer to **string** | IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED | [optional] **PayerID** | Pointer to **string** | The unique ID associated with the payer. | [optional] +**PayerSelected** | Pointer to **string** | PAYPAL or PAYPAL_CREDIT | [optional] **RecurringDetailReference** | Pointer to **string** | This is the `recurringDetailReference` returned in the response when you created the token. | [optional] **StoredPaymentMethodId** | Pointer to **string** | This is the `recurringDetailReference` returned in the response when you created the token. | [optional] **Subtype** | Pointer to **string** | The type of flow to initiate. | [optional] @@ -81,6 +83,31 @@ SetOrderID sets OrderID field to given value. HasOrderID returns a boolean if a field has been set. +### GetPayeePreferred + +`func (o *PayPalDetails) GetPayeePreferred() string` + +GetPayeePreferred returns the PayeePreferred field if non-nil, zero value otherwise. + +### GetPayeePreferredOk + +`func (o *PayPalDetails) GetPayeePreferredOk() (*string, bool)` + +GetPayeePreferredOk returns a tuple with the PayeePreferred field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayeePreferred + +`func (o *PayPalDetails) SetPayeePreferred(v string)` + +SetPayeePreferred sets PayeePreferred field to given value. + +### HasPayeePreferred + +`func (o *PayPalDetails) HasPayeePreferred() bool` + +HasPayeePreferred returns a boolean if a field has been set. + ### GetPayerID `func (o *PayPalDetails) GetPayerID() string` @@ -106,6 +133,31 @@ SetPayerID sets PayerID field to given value. HasPayerID returns a boolean if a field has been set. +### GetPayerSelected + +`func (o *PayPalDetails) GetPayerSelected() string` + +GetPayerSelected returns the PayerSelected field if non-nil, zero value otherwise. + +### GetPayerSelectedOk + +`func (o *PayPalDetails) GetPayerSelectedOk() (*string, bool)` + +GetPayerSelectedOk returns a tuple with the PayerSelected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerSelected + +`func (o *PayPalDetails) SetPayerSelected(v string)` + +SetPayerSelected sets PayerSelected field to given value. + +### HasPayerSelected + +`func (o *PayPalDetails) HasPayerSelected() bool` + +HasPayerSelected returns a boolean if a field has been set. + ### GetRecurringDetailReference `func (o *PayPalDetails) GetRecurringDetailReference() string` diff --git a/src/checkout/docs/PaymentLinkResponse.md b/src/checkout/docs/PaymentLinkResponse.md index c594e1ec1..9da2852fd 100644 --- a/src/checkout/docs/PaymentLinkResponse.md +++ b/src/checkout/docs/PaymentLinkResponse.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **DeliverAt** | Pointer to **time.Time** | The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. | [optional] **DeliveryAddress** | Pointer to [**Address**](Address.md) | | [optional] **Description** | Pointer to **string** | A short description visible on the payment page. Maximum length: 280 characters. | [optional] -**ExpiresAt** | Pointer to **string** | The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. | [optional] +**ExpiresAt** | Pointer to **string** | The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.This value is represented in Zulu format which is utilized for API v70 and lower. | [optional] **Id** | **string** | A unique identifier of the payment link. | [readonly] **InstallmentOptions** | Pointer to [**map[string]InstallmentOption**](InstallmentOption.md) | A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. | [optional] **LineItems** | Pointer to [**[]LineItem**](LineItem.md) | Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. | [optional] @@ -24,7 +24,7 @@ Name | Type | Description | Notes **MerchantAccount** | **string** | The merchant account identifier for which the payment link is created. | **MerchantOrderReference** | Pointer to **string** | This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. | [optional] **Metadata** | Pointer to **map[string]string** | Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. | [optional] -**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] +**RecurringProcessingModel** | Pointer to **string** | Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. | [optional] **Reference** | **string** | A reference that is used to uniquely identify the payment in future communications about the payment status. | **RequiredShopperFields** | Pointer to **[]string** | List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. | [optional] **ReturnUrl** | Pointer to **string** | Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. | [optional] @@ -38,10 +38,10 @@ Name | Type | Description | Notes **ShowRemovePaymentMethodButton** | Pointer to **bool** | Set to **false** to hide the button that lets the shopper remove a stored payment method. | [optional] [default to true] **SocialSecurityNumber** | Pointer to **string** | The shopper's social security number. | [optional] **SplitCardFundingSources** | Pointer to **bool** | Boolean value indicating whether the card payment method should be split into separate debit and credit options. | [optional] [default to false] -**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). | [optional] +**Splits** | Pointer to [**[]Split**](Split.md) | An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). | [optional] **Status** | **string** | Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. | **Store** | Pointer to **string** | The physical store, for which this payment is processed. | [optional] -**StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. | [optional] +**StorePaymentMethodMode** | Pointer to **string** | Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. | [optional] **TelephoneNumber** | Pointer to **string** | The shopper's telephone number. | [optional] **ThemeId** | Pointer to **string** | A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. | [optional] **UpdatedAt** | Pointer to **time.Time** | The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. | [optional] diff --git a/src/checkout/docs/PaymentSetupRequest.md b/src/checkout/docs/PaymentSetupRequest.md index fc306b587..049d0fb5e 100644 --- a/src/checkout/docs/PaymentSetupRequest.md +++ b/src/checkout/docs/PaymentSetupRequest.md @@ -30,14 +30,14 @@ Name | Type | Description | Notes **Installments** | Pointer to [**Installments**](Installments.md) | | [optional] **LineItems** | Pointer to [**[]LineItem**](LineItem.md) | Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. | [optional] **LocalizedShopperStatement** | Pointer to **map[string]string** | This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. | [optional] -**Mandate** | Pointer to [**Mandate**](Mandate.md) | | [optional] +**Mandate** | Pointer to [**Mandate2**](Mandate2.md) | | [optional] **Mcc** | Pointer to **string** | The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. | [optional] **MerchantAccount** | **string** | The merchant account identifier, with which you want to process the transaction. | **MerchantOrderReference** | Pointer to **string** | This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. | [optional] **Metadata** | Pointer to **map[string]string** | Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. | [optional] **OrderReference** | Pointer to **string** | When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. | [optional] **Origin** | Pointer to **string** | Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. | [optional] -**PlatformChargebackLogic** | Pointer to [**PlatformChargebackLogic**](PlatformChargebackLogic.md) | | [optional] +**PlatformChargebackLogic** | Pointer to [**PlatformChargebackLogic2**](PlatformChargebackLogic2.md) | | [optional] **RecurringExpiry** | Pointer to **string** | Date after which no further authorisations shall be performed. Only for 3D Secure 2. | [optional] **RecurringFrequency** | Pointer to **string** | Minimum number of days between authorisations. Only for 3D Secure 2. | [optional] **Reference** | **string** | The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. | @@ -722,20 +722,20 @@ HasLocalizedShopperStatement returns a boolean if a field has been set. ### GetMandate -`func (o *PaymentSetupRequest) GetMandate() Mandate` +`func (o *PaymentSetupRequest) GetMandate() Mandate2` GetMandate returns the Mandate field if non-nil, zero value otherwise. ### GetMandateOk -`func (o *PaymentSetupRequest) GetMandateOk() (*Mandate, bool)` +`func (o *PaymentSetupRequest) GetMandateOk() (*Mandate2, bool)` GetMandateOk returns a tuple with the Mandate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMandate -`func (o *PaymentSetupRequest) SetMandate(v Mandate)` +`func (o *PaymentSetupRequest) SetMandate(v Mandate2)` SetMandate sets Mandate field to given value. @@ -892,20 +892,20 @@ HasOrigin returns a boolean if a field has been set. ### GetPlatformChargebackLogic -`func (o *PaymentSetupRequest) GetPlatformChargebackLogic() PlatformChargebackLogic` +`func (o *PaymentSetupRequest) GetPlatformChargebackLogic() PlatformChargebackLogic2` GetPlatformChargebackLogic returns the PlatformChargebackLogic field if non-nil, zero value otherwise. ### GetPlatformChargebackLogicOk -`func (o *PaymentSetupRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool)` +`func (o *PaymentSetupRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic2, bool)` GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPlatformChargebackLogic -`func (o *PaymentSetupRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic)` +`func (o *PaymentSetupRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic2)` SetPlatformChargebackLogic sets PlatformChargebackLogic field to given value. diff --git a/src/checkout/docs/PlatformChargebackLogic.md b/src/checkout/docs/PlatformChargebackLogic.md index f433b781e..9bbda4372 100644 --- a/src/checkout/docs/PlatformChargebackLogic.md +++ b/src/checkout/docs/PlatformChargebackLogic.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Behavior** | Pointer to **string** | | [optional] -**CostAllocationAccount** | Pointer to **string** | | [optional] -**TargetAccount** | Pointer to **string** | | [optional] +**Behavior** | Pointer to **string** | The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. | [optional] +**CostAllocationAccount** | Pointer to **string** | The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. | [optional] +**TargetAccount** | Pointer to **string** | The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. | [optional] ## Methods diff --git a/src/checkout/docs/PlatformChargebackLogic2.md b/src/checkout/docs/PlatformChargebackLogic2.md new file mode 100644 index 000000000..d52c05123 --- /dev/null +++ b/src/checkout/docs/PlatformChargebackLogic2.md @@ -0,0 +1,108 @@ +# PlatformChargebackLogic2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Behavior** | Pointer to **string** | The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. | [optional] +**CostAllocationAccount** | Pointer to **string** | The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. | [optional] +**TargetAccount** | Pointer to **string** | The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. | [optional] + +## Methods + +### NewPlatformChargebackLogic2 + +`func NewPlatformChargebackLogic2() *PlatformChargebackLogic2` + +NewPlatformChargebackLogic2 instantiates a new PlatformChargebackLogic2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlatformChargebackLogic2WithDefaults + +`func NewPlatformChargebackLogic2WithDefaults() *PlatformChargebackLogic2` + +NewPlatformChargebackLogic2WithDefaults instantiates a new PlatformChargebackLogic2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBehavior + +`func (o *PlatformChargebackLogic2) GetBehavior() string` + +GetBehavior returns the Behavior field if non-nil, zero value otherwise. + +### GetBehaviorOk + +`func (o *PlatformChargebackLogic2) GetBehaviorOk() (*string, bool)` + +GetBehaviorOk returns a tuple with the Behavior field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBehavior + +`func (o *PlatformChargebackLogic2) SetBehavior(v string)` + +SetBehavior sets Behavior field to given value. + +### HasBehavior + +`func (o *PlatformChargebackLogic2) HasBehavior() bool` + +HasBehavior returns a boolean if a field has been set. + +### GetCostAllocationAccount + +`func (o *PlatformChargebackLogic2) GetCostAllocationAccount() string` + +GetCostAllocationAccount returns the CostAllocationAccount field if non-nil, zero value otherwise. + +### GetCostAllocationAccountOk + +`func (o *PlatformChargebackLogic2) GetCostAllocationAccountOk() (*string, bool)` + +GetCostAllocationAccountOk returns a tuple with the CostAllocationAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCostAllocationAccount + +`func (o *PlatformChargebackLogic2) SetCostAllocationAccount(v string)` + +SetCostAllocationAccount sets CostAllocationAccount field to given value. + +### HasCostAllocationAccount + +`func (o *PlatformChargebackLogic2) HasCostAllocationAccount() bool` + +HasCostAllocationAccount returns a boolean if a field has been set. + +### GetTargetAccount + +`func (o *PlatformChargebackLogic2) GetTargetAccount() string` + +GetTargetAccount returns the TargetAccount field if non-nil, zero value otherwise. + +### GetTargetAccountOk + +`func (o *PlatformChargebackLogic2) GetTargetAccountOk() (*string, bool)` + +GetTargetAccountOk returns a tuple with the TargetAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetAccount + +`func (o *PlatformChargebackLogic2) SetTargetAccount(v string)` + +SetTargetAccount sets TargetAccount field to given value. + +### HasTargetAccount + +`func (o *PlatformChargebackLogic2) HasTargetAccount() bool` + +HasTargetAccount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/Split2.md b/src/checkout/docs/Split2.md new file mode 100644 index 000000000..8af7a8de1 --- /dev/null +++ b/src/checkout/docs/Split2.md @@ -0,0 +1,155 @@ +# Split2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Account** | Pointer to **string** | The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. | [optional] +**Amount** | Pointer to [**SplitAmount**](SplitAmount.md) | | [optional] +**Description** | Pointer to **string** | Your description for the split item. | [optional] +**Reference** | Pointer to **string** | Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. | [optional] +**Type** | **string** | The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. | + +## Methods + +### NewSplit2 + +`func NewSplit2(type_ string, ) *Split2` + +NewSplit2 instantiates a new Split2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSplit2WithDefaults + +`func NewSplit2WithDefaults() *Split2` + +NewSplit2WithDefaults instantiates a new Split2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccount + +`func (o *Split2) GetAccount() string` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *Split2) GetAccountOk() (*string, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *Split2) SetAccount(v string)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *Split2) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + +### GetAmount + +`func (o *Split2) GetAmount() SplitAmount` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Split2) GetAmountOk() (*SplitAmount, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Split2) SetAmount(v SplitAmount)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *Split2) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetDescription + +`func (o *Split2) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Split2) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Split2) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Split2) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetReference + +`func (o *Split2) GetReference() string` + +GetReference returns the Reference field if non-nil, zero value otherwise. + +### GetReferenceOk + +`func (o *Split2) GetReferenceOk() (*string, bool)` + +GetReferenceOk returns a tuple with the Reference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReference + +`func (o *Split2) SetReference(v string)` + +SetReference sets Reference field to given value. + +### HasReference + +`func (o *Split2) HasReference() bool` + +HasReference returns a boolean if a field has been set. + +### GetType + +`func (o *Split2) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Split2) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Split2) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/docs/ThreeDS2RequestData2.md b/src/checkout/docs/ThreeDS2RequestData2.md new file mode 100644 index 000000000..1f7dd9df8 --- /dev/null +++ b/src/checkout/docs/ThreeDS2RequestData2.md @@ -0,0 +1,966 @@ +# ThreeDS2RequestData2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AcctInfo** | Pointer to [**AcctInfo**](AcctInfo.md) | | [optional] +**AcctType** | Pointer to **string** | Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit | [optional] +**AcquirerBIN** | Pointer to **string** | Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. | [optional] +**AcquirerMerchantID** | Pointer to **string** | Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. | [optional] +**AddrMatch** | Pointer to **string** | Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. | [optional] +**AuthenticationOnly** | Pointer to **bool** | If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. | [optional] [default to false] +**ChallengeIndicator** | Pointer to **string** | Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` | [optional] +**DeviceRenderOptions** | Pointer to [**DeviceRenderOptions**](DeviceRenderOptions.md) | | [optional] +**HomePhone** | Pointer to [**Phone**](Phone.md) | | [optional] +**Mcc** | Pointer to **string** | Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. | [optional] +**MerchantName** | Pointer to **string** | Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. | [optional] +**MessageVersion** | Pointer to **string** | The `messageVersion` value indicating the 3D Secure 2 protocol version. | [optional] [default to "2.1.0"] +**MobilePhone** | Pointer to [**Phone**](Phone.md) | | [optional] +**NotificationURL** | Pointer to **string** | URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. | [optional] +**PayTokenInd** | Pointer to **bool** | Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. | [optional] +**PaymentAuthenticationUseCase** | Pointer to **string** | Indicates the type of payment for which an authentication is requested (message extension) | [optional] +**PurchaseInstalData** | Pointer to **string** | Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. | [optional] +**RecurringExpiry** | Pointer to **string** | Date after which no further authorisations shall be performed. Format: YYYYMMDD | [optional] +**RecurringFrequency** | Pointer to **string** | Indicates the minimum number of days between authorisations. Maximum length: 4 characters. | [optional] +**SdkAppID** | Pointer to **string** | The `sdkAppID` value as received from the 3D Secure 2 SDK. | [optional] +**SdkEphemPubKey** | Pointer to [**SDKEphemPubKey**](SDKEphemPubKey.md) | | [optional] +**SdkMaxTimeout** | Pointer to **int32** | The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. | [optional] [default to 60] +**SdkReferenceNumber** | Pointer to **string** | The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. | [optional] +**SdkTransID** | Pointer to **string** | The `sdkTransID` value as received from the 3D Secure 2 SDK. | [optional] +**ThreeDSCompInd** | Pointer to **string** | Completion indicator for the device fingerprinting. | [optional] +**ThreeDSRequestorAuthenticationInd** | Pointer to **string** | Indicates the type of Authentication request. | [optional] +**ThreeDSRequestorAuthenticationInfo** | Pointer to [**ThreeDSRequestorAuthenticationInfo**](ThreeDSRequestorAuthenticationInfo.md) | | [optional] +**ThreeDSRequestorChallengeInd** | Pointer to **string** | Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only | [optional] +**ThreeDSRequestorID** | Pointer to **string** | Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. | [optional] +**ThreeDSRequestorName** | Pointer to **string** | Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. | [optional] +**ThreeDSRequestorPriorAuthenticationInfo** | Pointer to [**ThreeDSRequestorPriorAuthenticationInfo**](ThreeDSRequestorPriorAuthenticationInfo.md) | | [optional] +**ThreeDSRequestorURL** | Pointer to **string** | URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. | [optional] +**TransType** | Pointer to **string** | Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load | [optional] +**TransactionType** | Pointer to **string** | Identify the type of the transaction being authenticated. | [optional] +**WhiteListStatus** | Pointer to **string** | The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. | [optional] +**WorkPhone** | Pointer to [**Phone**](Phone.md) | | [optional] + +## Methods + +### NewThreeDS2RequestData2 + +`func NewThreeDS2RequestData2() *ThreeDS2RequestData2` + +NewThreeDS2RequestData2 instantiates a new ThreeDS2RequestData2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewThreeDS2RequestData2WithDefaults + +`func NewThreeDS2RequestData2WithDefaults() *ThreeDS2RequestData2` + +NewThreeDS2RequestData2WithDefaults instantiates a new ThreeDS2RequestData2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAcctInfo + +`func (o *ThreeDS2RequestData2) GetAcctInfo() AcctInfo` + +GetAcctInfo returns the AcctInfo field if non-nil, zero value otherwise. + +### GetAcctInfoOk + +`func (o *ThreeDS2RequestData2) GetAcctInfoOk() (*AcctInfo, bool)` + +GetAcctInfoOk returns a tuple with the AcctInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAcctInfo + +`func (o *ThreeDS2RequestData2) SetAcctInfo(v AcctInfo)` + +SetAcctInfo sets AcctInfo field to given value. + +### HasAcctInfo + +`func (o *ThreeDS2RequestData2) HasAcctInfo() bool` + +HasAcctInfo returns a boolean if a field has been set. + +### GetAcctType + +`func (o *ThreeDS2RequestData2) GetAcctType() string` + +GetAcctType returns the AcctType field if non-nil, zero value otherwise. + +### GetAcctTypeOk + +`func (o *ThreeDS2RequestData2) GetAcctTypeOk() (*string, bool)` + +GetAcctTypeOk returns a tuple with the AcctType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAcctType + +`func (o *ThreeDS2RequestData2) SetAcctType(v string)` + +SetAcctType sets AcctType field to given value. + +### HasAcctType + +`func (o *ThreeDS2RequestData2) HasAcctType() bool` + +HasAcctType returns a boolean if a field has been set. + +### GetAcquirerBIN + +`func (o *ThreeDS2RequestData2) GetAcquirerBIN() string` + +GetAcquirerBIN returns the AcquirerBIN field if non-nil, zero value otherwise. + +### GetAcquirerBINOk + +`func (o *ThreeDS2RequestData2) GetAcquirerBINOk() (*string, bool)` + +GetAcquirerBINOk returns a tuple with the AcquirerBIN field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAcquirerBIN + +`func (o *ThreeDS2RequestData2) SetAcquirerBIN(v string)` + +SetAcquirerBIN sets AcquirerBIN field to given value. + +### HasAcquirerBIN + +`func (o *ThreeDS2RequestData2) HasAcquirerBIN() bool` + +HasAcquirerBIN returns a boolean if a field has been set. + +### GetAcquirerMerchantID + +`func (o *ThreeDS2RequestData2) GetAcquirerMerchantID() string` + +GetAcquirerMerchantID returns the AcquirerMerchantID field if non-nil, zero value otherwise. + +### GetAcquirerMerchantIDOk + +`func (o *ThreeDS2RequestData2) GetAcquirerMerchantIDOk() (*string, bool)` + +GetAcquirerMerchantIDOk returns a tuple with the AcquirerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAcquirerMerchantID + +`func (o *ThreeDS2RequestData2) SetAcquirerMerchantID(v string)` + +SetAcquirerMerchantID sets AcquirerMerchantID field to given value. + +### HasAcquirerMerchantID + +`func (o *ThreeDS2RequestData2) HasAcquirerMerchantID() bool` + +HasAcquirerMerchantID returns a boolean if a field has been set. + +### GetAddrMatch + +`func (o *ThreeDS2RequestData2) GetAddrMatch() string` + +GetAddrMatch returns the AddrMatch field if non-nil, zero value otherwise. + +### GetAddrMatchOk + +`func (o *ThreeDS2RequestData2) GetAddrMatchOk() (*string, bool)` + +GetAddrMatchOk returns a tuple with the AddrMatch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddrMatch + +`func (o *ThreeDS2RequestData2) SetAddrMatch(v string)` + +SetAddrMatch sets AddrMatch field to given value. + +### HasAddrMatch + +`func (o *ThreeDS2RequestData2) HasAddrMatch() bool` + +HasAddrMatch returns a boolean if a field has been set. + +### GetAuthenticationOnly + +`func (o *ThreeDS2RequestData2) GetAuthenticationOnly() bool` + +GetAuthenticationOnly returns the AuthenticationOnly field if non-nil, zero value otherwise. + +### GetAuthenticationOnlyOk + +`func (o *ThreeDS2RequestData2) GetAuthenticationOnlyOk() (*bool, bool)` + +GetAuthenticationOnlyOk returns a tuple with the AuthenticationOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthenticationOnly + +`func (o *ThreeDS2RequestData2) SetAuthenticationOnly(v bool)` + +SetAuthenticationOnly sets AuthenticationOnly field to given value. + +### HasAuthenticationOnly + +`func (o *ThreeDS2RequestData2) HasAuthenticationOnly() bool` + +HasAuthenticationOnly returns a boolean if a field has been set. + +### GetChallengeIndicator + +`func (o *ThreeDS2RequestData2) GetChallengeIndicator() string` + +GetChallengeIndicator returns the ChallengeIndicator field if non-nil, zero value otherwise. + +### GetChallengeIndicatorOk + +`func (o *ThreeDS2RequestData2) GetChallengeIndicatorOk() (*string, bool)` + +GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChallengeIndicator + +`func (o *ThreeDS2RequestData2) SetChallengeIndicator(v string)` + +SetChallengeIndicator sets ChallengeIndicator field to given value. + +### HasChallengeIndicator + +`func (o *ThreeDS2RequestData2) HasChallengeIndicator() bool` + +HasChallengeIndicator returns a boolean if a field has been set. + +### GetDeviceRenderOptions + +`func (o *ThreeDS2RequestData2) GetDeviceRenderOptions() DeviceRenderOptions` + +GetDeviceRenderOptions returns the DeviceRenderOptions field if non-nil, zero value otherwise. + +### GetDeviceRenderOptionsOk + +`func (o *ThreeDS2RequestData2) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, bool)` + +GetDeviceRenderOptionsOk returns a tuple with the DeviceRenderOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceRenderOptions + +`func (o *ThreeDS2RequestData2) SetDeviceRenderOptions(v DeviceRenderOptions)` + +SetDeviceRenderOptions sets DeviceRenderOptions field to given value. + +### HasDeviceRenderOptions + +`func (o *ThreeDS2RequestData2) HasDeviceRenderOptions() bool` + +HasDeviceRenderOptions returns a boolean if a field has been set. + +### GetHomePhone + +`func (o *ThreeDS2RequestData2) GetHomePhone() Phone` + +GetHomePhone returns the HomePhone field if non-nil, zero value otherwise. + +### GetHomePhoneOk + +`func (o *ThreeDS2RequestData2) GetHomePhoneOk() (*Phone, bool)` + +GetHomePhoneOk returns a tuple with the HomePhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHomePhone + +`func (o *ThreeDS2RequestData2) SetHomePhone(v Phone)` + +SetHomePhone sets HomePhone field to given value. + +### HasHomePhone + +`func (o *ThreeDS2RequestData2) HasHomePhone() bool` + +HasHomePhone returns a boolean if a field has been set. + +### GetMcc + +`func (o *ThreeDS2RequestData2) GetMcc() string` + +GetMcc returns the Mcc field if non-nil, zero value otherwise. + +### GetMccOk + +`func (o *ThreeDS2RequestData2) GetMccOk() (*string, bool)` + +GetMccOk returns a tuple with the Mcc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMcc + +`func (o *ThreeDS2RequestData2) SetMcc(v string)` + +SetMcc sets Mcc field to given value. + +### HasMcc + +`func (o *ThreeDS2RequestData2) HasMcc() bool` + +HasMcc returns a boolean if a field has been set. + +### GetMerchantName + +`func (o *ThreeDS2RequestData2) GetMerchantName() string` + +GetMerchantName returns the MerchantName field if non-nil, zero value otherwise. + +### GetMerchantNameOk + +`func (o *ThreeDS2RequestData2) GetMerchantNameOk() (*string, bool)` + +GetMerchantNameOk returns a tuple with the MerchantName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantName + +`func (o *ThreeDS2RequestData2) SetMerchantName(v string)` + +SetMerchantName sets MerchantName field to given value. + +### HasMerchantName + +`func (o *ThreeDS2RequestData2) HasMerchantName() bool` + +HasMerchantName returns a boolean if a field has been set. + +### GetMessageVersion + +`func (o *ThreeDS2RequestData2) GetMessageVersion() string` + +GetMessageVersion returns the MessageVersion field if non-nil, zero value otherwise. + +### GetMessageVersionOk + +`func (o *ThreeDS2RequestData2) GetMessageVersionOk() (*string, bool)` + +GetMessageVersionOk returns a tuple with the MessageVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessageVersion + +`func (o *ThreeDS2RequestData2) SetMessageVersion(v string)` + +SetMessageVersion sets MessageVersion field to given value. + +### HasMessageVersion + +`func (o *ThreeDS2RequestData2) HasMessageVersion() bool` + +HasMessageVersion returns a boolean if a field has been set. + +### GetMobilePhone + +`func (o *ThreeDS2RequestData2) GetMobilePhone() Phone` + +GetMobilePhone returns the MobilePhone field if non-nil, zero value otherwise. + +### GetMobilePhoneOk + +`func (o *ThreeDS2RequestData2) GetMobilePhoneOk() (*Phone, bool)` + +GetMobilePhoneOk returns a tuple with the MobilePhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobilePhone + +`func (o *ThreeDS2RequestData2) SetMobilePhone(v Phone)` + +SetMobilePhone sets MobilePhone field to given value. + +### HasMobilePhone + +`func (o *ThreeDS2RequestData2) HasMobilePhone() bool` + +HasMobilePhone returns a boolean if a field has been set. + +### GetNotificationURL + +`func (o *ThreeDS2RequestData2) GetNotificationURL() string` + +GetNotificationURL returns the NotificationURL field if non-nil, zero value otherwise. + +### GetNotificationURLOk + +`func (o *ThreeDS2RequestData2) GetNotificationURLOk() (*string, bool)` + +GetNotificationURLOk returns a tuple with the NotificationURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationURL + +`func (o *ThreeDS2RequestData2) SetNotificationURL(v string)` + +SetNotificationURL sets NotificationURL field to given value. + +### HasNotificationURL + +`func (o *ThreeDS2RequestData2) HasNotificationURL() bool` + +HasNotificationURL returns a boolean if a field has been set. + +### GetPayTokenInd + +`func (o *ThreeDS2RequestData2) GetPayTokenInd() bool` + +GetPayTokenInd returns the PayTokenInd field if non-nil, zero value otherwise. + +### GetPayTokenIndOk + +`func (o *ThreeDS2RequestData2) GetPayTokenIndOk() (*bool, bool)` + +GetPayTokenIndOk returns a tuple with the PayTokenInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayTokenInd + +`func (o *ThreeDS2RequestData2) SetPayTokenInd(v bool)` + +SetPayTokenInd sets PayTokenInd field to given value. + +### HasPayTokenInd + +`func (o *ThreeDS2RequestData2) HasPayTokenInd() bool` + +HasPayTokenInd returns a boolean if a field has been set. + +### GetPaymentAuthenticationUseCase + +`func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCase() string` + +GetPaymentAuthenticationUseCase returns the PaymentAuthenticationUseCase field if non-nil, zero value otherwise. + +### GetPaymentAuthenticationUseCaseOk + +`func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCaseOk() (*string, bool)` + +GetPaymentAuthenticationUseCaseOk returns a tuple with the PaymentAuthenticationUseCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentAuthenticationUseCase + +`func (o *ThreeDS2RequestData2) SetPaymentAuthenticationUseCase(v string)` + +SetPaymentAuthenticationUseCase sets PaymentAuthenticationUseCase field to given value. + +### HasPaymentAuthenticationUseCase + +`func (o *ThreeDS2RequestData2) HasPaymentAuthenticationUseCase() bool` + +HasPaymentAuthenticationUseCase returns a boolean if a field has been set. + +### GetPurchaseInstalData + +`func (o *ThreeDS2RequestData2) GetPurchaseInstalData() string` + +GetPurchaseInstalData returns the PurchaseInstalData field if non-nil, zero value otherwise. + +### GetPurchaseInstalDataOk + +`func (o *ThreeDS2RequestData2) GetPurchaseInstalDataOk() (*string, bool)` + +GetPurchaseInstalDataOk returns a tuple with the PurchaseInstalData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchaseInstalData + +`func (o *ThreeDS2RequestData2) SetPurchaseInstalData(v string)` + +SetPurchaseInstalData sets PurchaseInstalData field to given value. + +### HasPurchaseInstalData + +`func (o *ThreeDS2RequestData2) HasPurchaseInstalData() bool` + +HasPurchaseInstalData returns a boolean if a field has been set. + +### GetRecurringExpiry + +`func (o *ThreeDS2RequestData2) GetRecurringExpiry() string` + +GetRecurringExpiry returns the RecurringExpiry field if non-nil, zero value otherwise. + +### GetRecurringExpiryOk + +`func (o *ThreeDS2RequestData2) GetRecurringExpiryOk() (*string, bool)` + +GetRecurringExpiryOk returns a tuple with the RecurringExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringExpiry + +`func (o *ThreeDS2RequestData2) SetRecurringExpiry(v string)` + +SetRecurringExpiry sets RecurringExpiry field to given value. + +### HasRecurringExpiry + +`func (o *ThreeDS2RequestData2) HasRecurringExpiry() bool` + +HasRecurringExpiry returns a boolean if a field has been set. + +### GetRecurringFrequency + +`func (o *ThreeDS2RequestData2) GetRecurringFrequency() string` + +GetRecurringFrequency returns the RecurringFrequency field if non-nil, zero value otherwise. + +### GetRecurringFrequencyOk + +`func (o *ThreeDS2RequestData2) GetRecurringFrequencyOk() (*string, bool)` + +GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringFrequency + +`func (o *ThreeDS2RequestData2) SetRecurringFrequency(v string)` + +SetRecurringFrequency sets RecurringFrequency field to given value. + +### HasRecurringFrequency + +`func (o *ThreeDS2RequestData2) HasRecurringFrequency() bool` + +HasRecurringFrequency returns a boolean if a field has been set. + +### GetSdkAppID + +`func (o *ThreeDS2RequestData2) GetSdkAppID() string` + +GetSdkAppID returns the SdkAppID field if non-nil, zero value otherwise. + +### GetSdkAppIDOk + +`func (o *ThreeDS2RequestData2) GetSdkAppIDOk() (*string, bool)` + +GetSdkAppIDOk returns a tuple with the SdkAppID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdkAppID + +`func (o *ThreeDS2RequestData2) SetSdkAppID(v string)` + +SetSdkAppID sets SdkAppID field to given value. + +### HasSdkAppID + +`func (o *ThreeDS2RequestData2) HasSdkAppID() bool` + +HasSdkAppID returns a boolean if a field has been set. + +### GetSdkEphemPubKey + +`func (o *ThreeDS2RequestData2) GetSdkEphemPubKey() SDKEphemPubKey` + +GetSdkEphemPubKey returns the SdkEphemPubKey field if non-nil, zero value otherwise. + +### GetSdkEphemPubKeyOk + +`func (o *ThreeDS2RequestData2) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool)` + +GetSdkEphemPubKeyOk returns a tuple with the SdkEphemPubKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdkEphemPubKey + +`func (o *ThreeDS2RequestData2) SetSdkEphemPubKey(v SDKEphemPubKey)` + +SetSdkEphemPubKey sets SdkEphemPubKey field to given value. + +### HasSdkEphemPubKey + +`func (o *ThreeDS2RequestData2) HasSdkEphemPubKey() bool` + +HasSdkEphemPubKey returns a boolean if a field has been set. + +### GetSdkMaxTimeout + +`func (o *ThreeDS2RequestData2) GetSdkMaxTimeout() int32` + +GetSdkMaxTimeout returns the SdkMaxTimeout field if non-nil, zero value otherwise. + +### GetSdkMaxTimeoutOk + +`func (o *ThreeDS2RequestData2) GetSdkMaxTimeoutOk() (*int32, bool)` + +GetSdkMaxTimeoutOk returns a tuple with the SdkMaxTimeout field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdkMaxTimeout + +`func (o *ThreeDS2RequestData2) SetSdkMaxTimeout(v int32)` + +SetSdkMaxTimeout sets SdkMaxTimeout field to given value. + +### HasSdkMaxTimeout + +`func (o *ThreeDS2RequestData2) HasSdkMaxTimeout() bool` + +HasSdkMaxTimeout returns a boolean if a field has been set. + +### GetSdkReferenceNumber + +`func (o *ThreeDS2RequestData2) GetSdkReferenceNumber() string` + +GetSdkReferenceNumber returns the SdkReferenceNumber field if non-nil, zero value otherwise. + +### GetSdkReferenceNumberOk + +`func (o *ThreeDS2RequestData2) GetSdkReferenceNumberOk() (*string, bool)` + +GetSdkReferenceNumberOk returns a tuple with the SdkReferenceNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdkReferenceNumber + +`func (o *ThreeDS2RequestData2) SetSdkReferenceNumber(v string)` + +SetSdkReferenceNumber sets SdkReferenceNumber field to given value. + +### HasSdkReferenceNumber + +`func (o *ThreeDS2RequestData2) HasSdkReferenceNumber() bool` + +HasSdkReferenceNumber returns a boolean if a field has been set. + +### GetSdkTransID + +`func (o *ThreeDS2RequestData2) GetSdkTransID() string` + +GetSdkTransID returns the SdkTransID field if non-nil, zero value otherwise. + +### GetSdkTransIDOk + +`func (o *ThreeDS2RequestData2) GetSdkTransIDOk() (*string, bool)` + +GetSdkTransIDOk returns a tuple with the SdkTransID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSdkTransID + +`func (o *ThreeDS2RequestData2) SetSdkTransID(v string)` + +SetSdkTransID sets SdkTransID field to given value. + +### HasSdkTransID + +`func (o *ThreeDS2RequestData2) HasSdkTransID() bool` + +HasSdkTransID returns a boolean if a field has been set. + +### GetThreeDSCompInd + +`func (o *ThreeDS2RequestData2) GetThreeDSCompInd() string` + +GetThreeDSCompInd returns the ThreeDSCompInd field if non-nil, zero value otherwise. + +### GetThreeDSCompIndOk + +`func (o *ThreeDS2RequestData2) GetThreeDSCompIndOk() (*string, bool)` + +GetThreeDSCompIndOk returns a tuple with the ThreeDSCompInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSCompInd + +`func (o *ThreeDS2RequestData2) SetThreeDSCompInd(v string)` + +SetThreeDSCompInd sets ThreeDSCompInd field to given value. + +### HasThreeDSCompInd + +`func (o *ThreeDS2RequestData2) HasThreeDSCompInd() bool` + +HasThreeDSCompInd returns a boolean if a field has been set. + +### GetThreeDSRequestorAuthenticationInd + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInd() string` + +GetThreeDSRequestorAuthenticationInd returns the ThreeDSRequestorAuthenticationInd field if non-nil, zero value otherwise. + +### GetThreeDSRequestorAuthenticationIndOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationIndOk() (*string, bool)` + +GetThreeDSRequestorAuthenticationIndOk returns a tuple with the ThreeDSRequestorAuthenticationInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorAuthenticationInd + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInd(v string)` + +SetThreeDSRequestorAuthenticationInd sets ThreeDSRequestorAuthenticationInd field to given value. + +### HasThreeDSRequestorAuthenticationInd + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInd() bool` + +HasThreeDSRequestorAuthenticationInd returns a boolean if a field has been set. + +### GetThreeDSRequestorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfo() ThreeDSRequestorAuthenticationInfo` + +GetThreeDSRequestorAuthenticationInfo returns the ThreeDSRequestorAuthenticationInfo field if non-nil, zero value otherwise. + +### GetThreeDSRequestorAuthenticationInfoOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfoOk() (*ThreeDSRequestorAuthenticationInfo, bool)` + +GetThreeDSRequestorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorAuthenticationInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInfo(v ThreeDSRequestorAuthenticationInfo)` + +SetThreeDSRequestorAuthenticationInfo sets ThreeDSRequestorAuthenticationInfo field to given value. + +### HasThreeDSRequestorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInfo() bool` + +HasThreeDSRequestorAuthenticationInfo returns a boolean if a field has been set. + +### GetThreeDSRequestorChallengeInd + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeInd() string` + +GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field if non-nil, zero value otherwise. + +### GetThreeDSRequestorChallengeIndOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeIndOk() (*string, bool)` + +GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorChallengeInd + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorChallengeInd(v string)` + +SetThreeDSRequestorChallengeInd sets ThreeDSRequestorChallengeInd field to given value. + +### HasThreeDSRequestorChallengeInd + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorChallengeInd() bool` + +HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. + +### GetThreeDSRequestorID + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorID() string` + +GetThreeDSRequestorID returns the ThreeDSRequestorID field if non-nil, zero value otherwise. + +### GetThreeDSRequestorIDOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorIDOk() (*string, bool)` + +GetThreeDSRequestorIDOk returns a tuple with the ThreeDSRequestorID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorID + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorID(v string)` + +SetThreeDSRequestorID sets ThreeDSRequestorID field to given value. + +### HasThreeDSRequestorID + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorID() bool` + +HasThreeDSRequestorID returns a boolean if a field has been set. + +### GetThreeDSRequestorName + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorName() string` + +GetThreeDSRequestorName returns the ThreeDSRequestorName field if non-nil, zero value otherwise. + +### GetThreeDSRequestorNameOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorNameOk() (*string, bool)` + +GetThreeDSRequestorNameOk returns a tuple with the ThreeDSRequestorName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorName + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorName(v string)` + +SetThreeDSRequestorName sets ThreeDSRequestorName field to given value. + +### HasThreeDSRequestorName + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorName() bool` + +HasThreeDSRequestorName returns a boolean if a field has been set. + +### GetThreeDSRequestorPriorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfo() ThreeDSRequestorPriorAuthenticationInfo` + +GetThreeDSRequestorPriorAuthenticationInfo returns the ThreeDSRequestorPriorAuthenticationInfo field if non-nil, zero value otherwise. + +### GetThreeDSRequestorPriorAuthenticationInfoOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfoOk() (*ThreeDSRequestorPriorAuthenticationInfo, bool)` + +GetThreeDSRequestorPriorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorPriorAuthenticationInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorPriorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorPriorAuthenticationInfo(v ThreeDSRequestorPriorAuthenticationInfo)` + +SetThreeDSRequestorPriorAuthenticationInfo sets ThreeDSRequestorPriorAuthenticationInfo field to given value. + +### HasThreeDSRequestorPriorAuthenticationInfo + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorPriorAuthenticationInfo() bool` + +HasThreeDSRequestorPriorAuthenticationInfo returns a boolean if a field has been set. + +### GetThreeDSRequestorURL + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorURL() string` + +GetThreeDSRequestorURL returns the ThreeDSRequestorURL field if non-nil, zero value otherwise. + +### GetThreeDSRequestorURLOk + +`func (o *ThreeDS2RequestData2) GetThreeDSRequestorURLOk() (*string, bool)` + +GetThreeDSRequestorURLOk returns a tuple with the ThreeDSRequestorURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSRequestorURL + +`func (o *ThreeDS2RequestData2) SetThreeDSRequestorURL(v string)` + +SetThreeDSRequestorURL sets ThreeDSRequestorURL field to given value. + +### HasThreeDSRequestorURL + +`func (o *ThreeDS2RequestData2) HasThreeDSRequestorURL() bool` + +HasThreeDSRequestorURL returns a boolean if a field has been set. + +### GetTransType + +`func (o *ThreeDS2RequestData2) GetTransType() string` + +GetTransType returns the TransType field if non-nil, zero value otherwise. + +### GetTransTypeOk + +`func (o *ThreeDS2RequestData2) GetTransTypeOk() (*string, bool)` + +GetTransTypeOk returns a tuple with the TransType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransType + +`func (o *ThreeDS2RequestData2) SetTransType(v string)` + +SetTransType sets TransType field to given value. + +### HasTransType + +`func (o *ThreeDS2RequestData2) HasTransType() bool` + +HasTransType returns a boolean if a field has been set. + +### GetTransactionType + +`func (o *ThreeDS2RequestData2) GetTransactionType() string` + +GetTransactionType returns the TransactionType field if non-nil, zero value otherwise. + +### GetTransactionTypeOk + +`func (o *ThreeDS2RequestData2) GetTransactionTypeOk() (*string, bool)` + +GetTransactionTypeOk returns a tuple with the TransactionType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionType + +`func (o *ThreeDS2RequestData2) SetTransactionType(v string)` + +SetTransactionType sets TransactionType field to given value. + +### HasTransactionType + +`func (o *ThreeDS2RequestData2) HasTransactionType() bool` + +HasTransactionType returns a boolean if a field has been set. + +### GetWhiteListStatus + +`func (o *ThreeDS2RequestData2) GetWhiteListStatus() string` + +GetWhiteListStatus returns the WhiteListStatus field if non-nil, zero value otherwise. + +### GetWhiteListStatusOk + +`func (o *ThreeDS2RequestData2) GetWhiteListStatusOk() (*string, bool)` + +GetWhiteListStatusOk returns a tuple with the WhiteListStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWhiteListStatus + +`func (o *ThreeDS2RequestData2) SetWhiteListStatus(v string)` + +SetWhiteListStatus sets WhiteListStatus field to given value. + +### HasWhiteListStatus + +`func (o *ThreeDS2RequestData2) HasWhiteListStatus() bool` + +HasWhiteListStatus returns a boolean if a field has been set. + +### GetWorkPhone + +`func (o *ThreeDS2RequestData2) GetWorkPhone() Phone` + +GetWorkPhone returns the WorkPhone field if non-nil, zero value otherwise. + +### GetWorkPhoneOk + +`func (o *ThreeDS2RequestData2) GetWorkPhoneOk() (*Phone, bool)` + +GetWorkPhoneOk returns a tuple with the WorkPhone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkPhone + +`func (o *ThreeDS2RequestData2) SetWorkPhone(v Phone)` + +SetWorkPhone sets WorkPhone field to given value. + +### HasWorkPhone + +`func (o *ThreeDS2RequestData2) HasWorkPhone() bool` + +HasWorkPhone returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/checkout/model_account_info.go b/src/checkout/model_account_info.go index 989e967cd..caadfdb0e 100644 --- a/src/checkout/model_account_info.go +++ b/src/checkout/model_account_info.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountInfo type satisfies the MappedNullable interface at compile time @@ -698,7 +697,7 @@ func (o *AccountInfo) SetWorkPhone(v string) { } func (o AccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -803,57 +802,59 @@ func (v *NullableAccountInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountInfo) isValidAccountAgeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountAgeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountAgeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountChangeIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountType() bool { - var allowedEnumValues = []string{"notApplicable", "credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidDeliveryAddressUsageIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressUsageIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressUsageIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPasswordChangeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPasswordChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPasswordChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPaymentAccountIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccountIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccountIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_account_info_2.go b/src/checkout/model_account_info_2.go new file mode 100644 index 000000000..a878f956b --- /dev/null +++ b/src/checkout/model_account_info_2.go @@ -0,0 +1,860 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the AccountInfo2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountInfo2{} + +// AccountInfo2 struct for AccountInfo2 +type AccountInfo2 struct { + // Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + AccountAgeIndicator *string `json:"accountAgeIndicator,omitempty"` + // Date when the shopper's account was last changed. + AccountChangeDate *time.Time `json:"accountChangeDate,omitempty"` + // Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + AccountChangeIndicator *string `json:"accountChangeIndicator,omitempty"` + // Date when the shopper's account was created. + AccountCreationDate *time.Time `json:"accountCreationDate,omitempty"` + // Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + AccountType *string `json:"accountType,omitempty"` + // Number of attempts the shopper tried to add a card to their account in the last day. + AddCardAttemptsDay *int32 `json:"addCardAttemptsDay,omitempty"` + // Date the selected delivery address was first used. + DeliveryAddressUsageDate *time.Time `json:"deliveryAddressUsageDate,omitempty"` + // Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + DeliveryAddressUsageIndicator *string `json:"deliveryAddressUsageIndicator,omitempty"` + // Shopper's home phone number (including the country code). + // Deprecated + HomePhone *string `json:"homePhone,omitempty"` + // Shopper's mobile phone number (including the country code). + // Deprecated + MobilePhone *string `json:"mobilePhone,omitempty"` + // Date when the shopper last changed their password. + PasswordChangeDate *time.Time `json:"passwordChangeDate,omitempty"` + // Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + PasswordChangeIndicator *string `json:"passwordChangeIndicator,omitempty"` + // Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + PastTransactionsDay *int32 `json:"pastTransactionsDay,omitempty"` + // Number of all transactions (successful and abandoned) from this shopper in the past year. + PastTransactionsYear *int32 `json:"pastTransactionsYear,omitempty"` + // Date this payment method was added to the shopper's account. + PaymentAccountAge *time.Time `json:"paymentAccountAge,omitempty"` + // Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + PaymentAccountIndicator *string `json:"paymentAccountIndicator,omitempty"` + // Number of successful purchases in the last six months. + PurchasesLast6Months *int32 `json:"purchasesLast6Months,omitempty"` + // Whether suspicious activity was recorded on this account. + SuspiciousActivity *bool `json:"suspiciousActivity,omitempty"` + // Shopper's work phone number (including the country code). + // Deprecated + WorkPhone *string `json:"workPhone,omitempty"` +} + +// NewAccountInfo2 instantiates a new AccountInfo2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountInfo2() *AccountInfo2 { + this := AccountInfo2{} + return &this +} + +// NewAccountInfo2WithDefaults instantiates a new AccountInfo2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountInfo2WithDefaults() *AccountInfo2 { + this := AccountInfo2{} + return &this +} + +// GetAccountAgeIndicator returns the AccountAgeIndicator field value if set, zero value otherwise. +func (o *AccountInfo2) GetAccountAgeIndicator() string { + if o == nil || common.IsNil(o.AccountAgeIndicator) { + var ret string + return ret + } + return *o.AccountAgeIndicator +} + +// GetAccountAgeIndicatorOk returns a tuple with the AccountAgeIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAccountAgeIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountAgeIndicator) { + return nil, false + } + return o.AccountAgeIndicator, true +} + +// HasAccountAgeIndicator returns a boolean if a field has been set. +func (o *AccountInfo2) HasAccountAgeIndicator() bool { + if o != nil && !common.IsNil(o.AccountAgeIndicator) { + return true + } + + return false +} + +// SetAccountAgeIndicator gets a reference to the given string and assigns it to the AccountAgeIndicator field. +func (o *AccountInfo2) SetAccountAgeIndicator(v string) { + o.AccountAgeIndicator = &v +} + +// GetAccountChangeDate returns the AccountChangeDate field value if set, zero value otherwise. +func (o *AccountInfo2) GetAccountChangeDate() time.Time { + if o == nil || common.IsNil(o.AccountChangeDate) { + var ret time.Time + return ret + } + return *o.AccountChangeDate +} + +// GetAccountChangeDateOk returns a tuple with the AccountChangeDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAccountChangeDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.AccountChangeDate) { + return nil, false + } + return o.AccountChangeDate, true +} + +// HasAccountChangeDate returns a boolean if a field has been set. +func (o *AccountInfo2) HasAccountChangeDate() bool { + if o != nil && !common.IsNil(o.AccountChangeDate) { + return true + } + + return false +} + +// SetAccountChangeDate gets a reference to the given time.Time and assigns it to the AccountChangeDate field. +func (o *AccountInfo2) SetAccountChangeDate(v time.Time) { + o.AccountChangeDate = &v +} + +// GetAccountChangeIndicator returns the AccountChangeIndicator field value if set, zero value otherwise. +func (o *AccountInfo2) GetAccountChangeIndicator() string { + if o == nil || common.IsNil(o.AccountChangeIndicator) { + var ret string + return ret + } + return *o.AccountChangeIndicator +} + +// GetAccountChangeIndicatorOk returns a tuple with the AccountChangeIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAccountChangeIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountChangeIndicator) { + return nil, false + } + return o.AccountChangeIndicator, true +} + +// HasAccountChangeIndicator returns a boolean if a field has been set. +func (o *AccountInfo2) HasAccountChangeIndicator() bool { + if o != nil && !common.IsNil(o.AccountChangeIndicator) { + return true + } + + return false +} + +// SetAccountChangeIndicator gets a reference to the given string and assigns it to the AccountChangeIndicator field. +func (o *AccountInfo2) SetAccountChangeIndicator(v string) { + o.AccountChangeIndicator = &v +} + +// GetAccountCreationDate returns the AccountCreationDate field value if set, zero value otherwise. +func (o *AccountInfo2) GetAccountCreationDate() time.Time { + if o == nil || common.IsNil(o.AccountCreationDate) { + var ret time.Time + return ret + } + return *o.AccountCreationDate +} + +// GetAccountCreationDateOk returns a tuple with the AccountCreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAccountCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.AccountCreationDate) { + return nil, false + } + return o.AccountCreationDate, true +} + +// HasAccountCreationDate returns a boolean if a field has been set. +func (o *AccountInfo2) HasAccountCreationDate() bool { + if o != nil && !common.IsNil(o.AccountCreationDate) { + return true + } + + return false +} + +// SetAccountCreationDate gets a reference to the given time.Time and assigns it to the AccountCreationDate field. +func (o *AccountInfo2) SetAccountCreationDate(v time.Time) { + o.AccountCreationDate = &v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *AccountInfo2) GetAccountType() string { + if o == nil || common.IsNil(o.AccountType) { + var ret string + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *AccountInfo2) HasAccountType() bool { + if o != nil && !common.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given string and assigns it to the AccountType field. +func (o *AccountInfo2) SetAccountType(v string) { + o.AccountType = &v +} + +// GetAddCardAttemptsDay returns the AddCardAttemptsDay field value if set, zero value otherwise. +func (o *AccountInfo2) GetAddCardAttemptsDay() int32 { + if o == nil || common.IsNil(o.AddCardAttemptsDay) { + var ret int32 + return ret + } + return *o.AddCardAttemptsDay +} + +// GetAddCardAttemptsDayOk returns a tuple with the AddCardAttemptsDay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetAddCardAttemptsDayOk() (*int32, bool) { + if o == nil || common.IsNil(o.AddCardAttemptsDay) { + return nil, false + } + return o.AddCardAttemptsDay, true +} + +// HasAddCardAttemptsDay returns a boolean if a field has been set. +func (o *AccountInfo2) HasAddCardAttemptsDay() bool { + if o != nil && !common.IsNil(o.AddCardAttemptsDay) { + return true + } + + return false +} + +// SetAddCardAttemptsDay gets a reference to the given int32 and assigns it to the AddCardAttemptsDay field. +func (o *AccountInfo2) SetAddCardAttemptsDay(v int32) { + o.AddCardAttemptsDay = &v +} + +// GetDeliveryAddressUsageDate returns the DeliveryAddressUsageDate field value if set, zero value otherwise. +func (o *AccountInfo2) GetDeliveryAddressUsageDate() time.Time { + if o == nil || common.IsNil(o.DeliveryAddressUsageDate) { + var ret time.Time + return ret + } + return *o.DeliveryAddressUsageDate +} + +// GetDeliveryAddressUsageDateOk returns a tuple with the DeliveryAddressUsageDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetDeliveryAddressUsageDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DeliveryAddressUsageDate) { + return nil, false + } + return o.DeliveryAddressUsageDate, true +} + +// HasDeliveryAddressUsageDate returns a boolean if a field has been set. +func (o *AccountInfo2) HasDeliveryAddressUsageDate() bool { + if o != nil && !common.IsNil(o.DeliveryAddressUsageDate) { + return true + } + + return false +} + +// SetDeliveryAddressUsageDate gets a reference to the given time.Time and assigns it to the DeliveryAddressUsageDate field. +func (o *AccountInfo2) SetDeliveryAddressUsageDate(v time.Time) { + o.DeliveryAddressUsageDate = &v +} + +// GetDeliveryAddressUsageIndicator returns the DeliveryAddressUsageIndicator field value if set, zero value otherwise. +func (o *AccountInfo2) GetDeliveryAddressUsageIndicator() string { + if o == nil || common.IsNil(o.DeliveryAddressUsageIndicator) { + var ret string + return ret + } + return *o.DeliveryAddressUsageIndicator +} + +// GetDeliveryAddressUsageIndicatorOk returns a tuple with the DeliveryAddressUsageIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetDeliveryAddressUsageIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.DeliveryAddressUsageIndicator) { + return nil, false + } + return o.DeliveryAddressUsageIndicator, true +} + +// HasDeliveryAddressUsageIndicator returns a boolean if a field has been set. +func (o *AccountInfo2) HasDeliveryAddressUsageIndicator() bool { + if o != nil && !common.IsNil(o.DeliveryAddressUsageIndicator) { + return true + } + + return false +} + +// SetDeliveryAddressUsageIndicator gets a reference to the given string and assigns it to the DeliveryAddressUsageIndicator field. +func (o *AccountInfo2) SetDeliveryAddressUsageIndicator(v string) { + o.DeliveryAddressUsageIndicator = &v +} + +// GetHomePhone returns the HomePhone field value if set, zero value otherwise. +// Deprecated +func (o *AccountInfo2) GetHomePhone() string { + if o == nil || common.IsNil(o.HomePhone) { + var ret string + return ret + } + return *o.HomePhone +} + +// GetHomePhoneOk returns a tuple with the HomePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *AccountInfo2) GetHomePhoneOk() (*string, bool) { + if o == nil || common.IsNil(o.HomePhone) { + return nil, false + } + return o.HomePhone, true +} + +// HasHomePhone returns a boolean if a field has been set. +func (o *AccountInfo2) HasHomePhone() bool { + if o != nil && !common.IsNil(o.HomePhone) { + return true + } + + return false +} + +// SetHomePhone gets a reference to the given string and assigns it to the HomePhone field. +// Deprecated +func (o *AccountInfo2) SetHomePhone(v string) { + o.HomePhone = &v +} + +// GetMobilePhone returns the MobilePhone field value if set, zero value otherwise. +// Deprecated +func (o *AccountInfo2) GetMobilePhone() string { + if o == nil || common.IsNil(o.MobilePhone) { + var ret string + return ret + } + return *o.MobilePhone +} + +// GetMobilePhoneOk returns a tuple with the MobilePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *AccountInfo2) GetMobilePhoneOk() (*string, bool) { + if o == nil || common.IsNil(o.MobilePhone) { + return nil, false + } + return o.MobilePhone, true +} + +// HasMobilePhone returns a boolean if a field has been set. +func (o *AccountInfo2) HasMobilePhone() bool { + if o != nil && !common.IsNil(o.MobilePhone) { + return true + } + + return false +} + +// SetMobilePhone gets a reference to the given string and assigns it to the MobilePhone field. +// Deprecated +func (o *AccountInfo2) SetMobilePhone(v string) { + o.MobilePhone = &v +} + +// GetPasswordChangeDate returns the PasswordChangeDate field value if set, zero value otherwise. +func (o *AccountInfo2) GetPasswordChangeDate() time.Time { + if o == nil || common.IsNil(o.PasswordChangeDate) { + var ret time.Time + return ret + } + return *o.PasswordChangeDate +} + +// GetPasswordChangeDateOk returns a tuple with the PasswordChangeDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPasswordChangeDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.PasswordChangeDate) { + return nil, false + } + return o.PasswordChangeDate, true +} + +// HasPasswordChangeDate returns a boolean if a field has been set. +func (o *AccountInfo2) HasPasswordChangeDate() bool { + if o != nil && !common.IsNil(o.PasswordChangeDate) { + return true + } + + return false +} + +// SetPasswordChangeDate gets a reference to the given time.Time and assigns it to the PasswordChangeDate field. +func (o *AccountInfo2) SetPasswordChangeDate(v time.Time) { + o.PasswordChangeDate = &v +} + +// GetPasswordChangeIndicator returns the PasswordChangeIndicator field value if set, zero value otherwise. +func (o *AccountInfo2) GetPasswordChangeIndicator() string { + if o == nil || common.IsNil(o.PasswordChangeIndicator) { + var ret string + return ret + } + return *o.PasswordChangeIndicator +} + +// GetPasswordChangeIndicatorOk returns a tuple with the PasswordChangeIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPasswordChangeIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.PasswordChangeIndicator) { + return nil, false + } + return o.PasswordChangeIndicator, true +} + +// HasPasswordChangeIndicator returns a boolean if a field has been set. +func (o *AccountInfo2) HasPasswordChangeIndicator() bool { + if o != nil && !common.IsNil(o.PasswordChangeIndicator) { + return true + } + + return false +} + +// SetPasswordChangeIndicator gets a reference to the given string and assigns it to the PasswordChangeIndicator field. +func (o *AccountInfo2) SetPasswordChangeIndicator(v string) { + o.PasswordChangeIndicator = &v +} + +// GetPastTransactionsDay returns the PastTransactionsDay field value if set, zero value otherwise. +func (o *AccountInfo2) GetPastTransactionsDay() int32 { + if o == nil || common.IsNil(o.PastTransactionsDay) { + var ret int32 + return ret + } + return *o.PastTransactionsDay +} + +// GetPastTransactionsDayOk returns a tuple with the PastTransactionsDay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPastTransactionsDayOk() (*int32, bool) { + if o == nil || common.IsNil(o.PastTransactionsDay) { + return nil, false + } + return o.PastTransactionsDay, true +} + +// HasPastTransactionsDay returns a boolean if a field has been set. +func (o *AccountInfo2) HasPastTransactionsDay() bool { + if o != nil && !common.IsNil(o.PastTransactionsDay) { + return true + } + + return false +} + +// SetPastTransactionsDay gets a reference to the given int32 and assigns it to the PastTransactionsDay field. +func (o *AccountInfo2) SetPastTransactionsDay(v int32) { + o.PastTransactionsDay = &v +} + +// GetPastTransactionsYear returns the PastTransactionsYear field value if set, zero value otherwise. +func (o *AccountInfo2) GetPastTransactionsYear() int32 { + if o == nil || common.IsNil(o.PastTransactionsYear) { + var ret int32 + return ret + } + return *o.PastTransactionsYear +} + +// GetPastTransactionsYearOk returns a tuple with the PastTransactionsYear field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPastTransactionsYearOk() (*int32, bool) { + if o == nil || common.IsNil(o.PastTransactionsYear) { + return nil, false + } + return o.PastTransactionsYear, true +} + +// HasPastTransactionsYear returns a boolean if a field has been set. +func (o *AccountInfo2) HasPastTransactionsYear() bool { + if o != nil && !common.IsNil(o.PastTransactionsYear) { + return true + } + + return false +} + +// SetPastTransactionsYear gets a reference to the given int32 and assigns it to the PastTransactionsYear field. +func (o *AccountInfo2) SetPastTransactionsYear(v int32) { + o.PastTransactionsYear = &v +} + +// GetPaymentAccountAge returns the PaymentAccountAge field value if set, zero value otherwise. +func (o *AccountInfo2) GetPaymentAccountAge() time.Time { + if o == nil || common.IsNil(o.PaymentAccountAge) { + var ret time.Time + return ret + } + return *o.PaymentAccountAge +} + +// GetPaymentAccountAgeOk returns a tuple with the PaymentAccountAge field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPaymentAccountAgeOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.PaymentAccountAge) { + return nil, false + } + return o.PaymentAccountAge, true +} + +// HasPaymentAccountAge returns a boolean if a field has been set. +func (o *AccountInfo2) HasPaymentAccountAge() bool { + if o != nil && !common.IsNil(o.PaymentAccountAge) { + return true + } + + return false +} + +// SetPaymentAccountAge gets a reference to the given time.Time and assigns it to the PaymentAccountAge field. +func (o *AccountInfo2) SetPaymentAccountAge(v time.Time) { + o.PaymentAccountAge = &v +} + +// GetPaymentAccountIndicator returns the PaymentAccountIndicator field value if set, zero value otherwise. +func (o *AccountInfo2) GetPaymentAccountIndicator() string { + if o == nil || common.IsNil(o.PaymentAccountIndicator) { + var ret string + return ret + } + return *o.PaymentAccountIndicator +} + +// GetPaymentAccountIndicatorOk returns a tuple with the PaymentAccountIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPaymentAccountIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentAccountIndicator) { + return nil, false + } + return o.PaymentAccountIndicator, true +} + +// HasPaymentAccountIndicator returns a boolean if a field has been set. +func (o *AccountInfo2) HasPaymentAccountIndicator() bool { + if o != nil && !common.IsNil(o.PaymentAccountIndicator) { + return true + } + + return false +} + +// SetPaymentAccountIndicator gets a reference to the given string and assigns it to the PaymentAccountIndicator field. +func (o *AccountInfo2) SetPaymentAccountIndicator(v string) { + o.PaymentAccountIndicator = &v +} + +// GetPurchasesLast6Months returns the PurchasesLast6Months field value if set, zero value otherwise. +func (o *AccountInfo2) GetPurchasesLast6Months() int32 { + if o == nil || common.IsNil(o.PurchasesLast6Months) { + var ret int32 + return ret + } + return *o.PurchasesLast6Months +} + +// GetPurchasesLast6MonthsOk returns a tuple with the PurchasesLast6Months field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetPurchasesLast6MonthsOk() (*int32, bool) { + if o == nil || common.IsNil(o.PurchasesLast6Months) { + return nil, false + } + return o.PurchasesLast6Months, true +} + +// HasPurchasesLast6Months returns a boolean if a field has been set. +func (o *AccountInfo2) HasPurchasesLast6Months() bool { + if o != nil && !common.IsNil(o.PurchasesLast6Months) { + return true + } + + return false +} + +// SetPurchasesLast6Months gets a reference to the given int32 and assigns it to the PurchasesLast6Months field. +func (o *AccountInfo2) SetPurchasesLast6Months(v int32) { + o.PurchasesLast6Months = &v +} + +// GetSuspiciousActivity returns the SuspiciousActivity field value if set, zero value otherwise. +func (o *AccountInfo2) GetSuspiciousActivity() bool { + if o == nil || common.IsNil(o.SuspiciousActivity) { + var ret bool + return ret + } + return *o.SuspiciousActivity +} + +// GetSuspiciousActivityOk returns a tuple with the SuspiciousActivity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountInfo2) GetSuspiciousActivityOk() (*bool, bool) { + if o == nil || common.IsNil(o.SuspiciousActivity) { + return nil, false + } + return o.SuspiciousActivity, true +} + +// HasSuspiciousActivity returns a boolean if a field has been set. +func (o *AccountInfo2) HasSuspiciousActivity() bool { + if o != nil && !common.IsNil(o.SuspiciousActivity) { + return true + } + + return false +} + +// SetSuspiciousActivity gets a reference to the given bool and assigns it to the SuspiciousActivity field. +func (o *AccountInfo2) SetSuspiciousActivity(v bool) { + o.SuspiciousActivity = &v +} + +// GetWorkPhone returns the WorkPhone field value if set, zero value otherwise. +// Deprecated +func (o *AccountInfo2) GetWorkPhone() string { + if o == nil || common.IsNil(o.WorkPhone) { + var ret string + return ret + } + return *o.WorkPhone +} + +// GetWorkPhoneOk returns a tuple with the WorkPhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *AccountInfo2) GetWorkPhoneOk() (*string, bool) { + if o == nil || common.IsNil(o.WorkPhone) { + return nil, false + } + return o.WorkPhone, true +} + +// HasWorkPhone returns a boolean if a field has been set. +func (o *AccountInfo2) HasWorkPhone() bool { + if o != nil && !common.IsNil(o.WorkPhone) { + return true + } + + return false +} + +// SetWorkPhone gets a reference to the given string and assigns it to the WorkPhone field. +// Deprecated +func (o *AccountInfo2) SetWorkPhone(v string) { + o.WorkPhone = &v +} + +func (o AccountInfo2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountInfo2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountAgeIndicator) { + toSerialize["accountAgeIndicator"] = o.AccountAgeIndicator + } + if !common.IsNil(o.AccountChangeDate) { + toSerialize["accountChangeDate"] = o.AccountChangeDate + } + if !common.IsNil(o.AccountChangeIndicator) { + toSerialize["accountChangeIndicator"] = o.AccountChangeIndicator + } + if !common.IsNil(o.AccountCreationDate) { + toSerialize["accountCreationDate"] = o.AccountCreationDate + } + if !common.IsNil(o.AccountType) { + toSerialize["accountType"] = o.AccountType + } + if !common.IsNil(o.AddCardAttemptsDay) { + toSerialize["addCardAttemptsDay"] = o.AddCardAttemptsDay + } + if !common.IsNil(o.DeliveryAddressUsageDate) { + toSerialize["deliveryAddressUsageDate"] = o.DeliveryAddressUsageDate + } + if !common.IsNil(o.DeliveryAddressUsageIndicator) { + toSerialize["deliveryAddressUsageIndicator"] = o.DeliveryAddressUsageIndicator + } + if !common.IsNil(o.HomePhone) { + toSerialize["homePhone"] = o.HomePhone + } + if !common.IsNil(o.MobilePhone) { + toSerialize["mobilePhone"] = o.MobilePhone + } + if !common.IsNil(o.PasswordChangeDate) { + toSerialize["passwordChangeDate"] = o.PasswordChangeDate + } + if !common.IsNil(o.PasswordChangeIndicator) { + toSerialize["passwordChangeIndicator"] = o.PasswordChangeIndicator + } + if !common.IsNil(o.PastTransactionsDay) { + toSerialize["pastTransactionsDay"] = o.PastTransactionsDay + } + if !common.IsNil(o.PastTransactionsYear) { + toSerialize["pastTransactionsYear"] = o.PastTransactionsYear + } + if !common.IsNil(o.PaymentAccountAge) { + toSerialize["paymentAccountAge"] = o.PaymentAccountAge + } + if !common.IsNil(o.PaymentAccountIndicator) { + toSerialize["paymentAccountIndicator"] = o.PaymentAccountIndicator + } + if !common.IsNil(o.PurchasesLast6Months) { + toSerialize["purchasesLast6Months"] = o.PurchasesLast6Months + } + if !common.IsNil(o.SuspiciousActivity) { + toSerialize["suspiciousActivity"] = o.SuspiciousActivity + } + if !common.IsNil(o.WorkPhone) { + toSerialize["workPhone"] = o.WorkPhone + } + return toSerialize, nil +} + +type NullableAccountInfo2 struct { + value *AccountInfo2 + isSet bool +} + +func (v NullableAccountInfo2) Get() *AccountInfo2 { + return v.value +} + +func (v *NullableAccountInfo2) Set(val *AccountInfo2) { + v.value = val + v.isSet = true +} + +func (v NullableAccountInfo2) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountInfo2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountInfo2(val *AccountInfo2) *NullableAccountInfo2 { + return &NullableAccountInfo2{value: val, isSet: true} +} + +func (v NullableAccountInfo2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountInfo2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AccountInfo2) isValidAccountAgeIndicator() bool { + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountAgeIndicator() == allowed { + return true + } + } + return false +} +func (o *AccountInfo2) isValidAccountChangeIndicator() bool { + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountChangeIndicator() == allowed { + return true + } + } + return false +} +func (o *AccountInfo2) isValidAccountType() bool { + var allowedEnumValues = []string{ "notApplicable", "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false +} +func (o *AccountInfo2) isValidDeliveryAddressUsageIndicator() bool { + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressUsageIndicator() == allowed { + return true + } + } + return false +} +func (o *AccountInfo2) isValidPasswordChangeIndicator() bool { + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPasswordChangeIndicator() == allowed { + return true + } + } + return false +} +func (o *AccountInfo2) isValidPaymentAccountIndicator() bool { + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccountIndicator() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_acct_info.go b/src/checkout/model_acct_info.go index 7ec75c036..943eced89 100644 --- a/src/checkout/model_acct_info.go +++ b/src/checkout/model_acct_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AcctInfo type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AcctInfo) SetTxnActivityYear(v string) { } func (o AcctInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,66 +678,68 @@ func (v *NullableAcctInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcctInfo) isValidChAccAgeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccAgeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccAgeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetChAccChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetChAccChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccPwChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccPwChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccPwChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidPaymentAccInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipAddressUsageInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetShipAddressUsageInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetShipAddressUsageInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipNameIndicator() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetShipNameIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetShipNameIndicator() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidSuspiciousAccActivity() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetSuspiciousAccActivity() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetSuspiciousAccActivity() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_ach_details.go b/src/checkout/model_ach_details.go index 37434f7fc..2ebaf6cc9 100644 --- a/src/checkout/model_ach_details.go +++ b/src/checkout/model_ach_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AchDetails type satisfies the MappedNullable interface at compile time @@ -346,7 +345,7 @@ func (o *AchDetails) SetType(v string) { } func (o AchDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,12 +418,14 @@ func (v *NullableAchDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AchDetails) isValidType() bool { - var allowedEnumValues = []string{"ach", "ach_plaid"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ach", "ach_plaid" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data3_d_secure.go b/src/checkout/model_additional_data3_d_secure.go index 0d1c96729..2508e6c2a 100644 --- a/src/checkout/model_additional_data3_d_secure.go +++ b/src/checkout/model_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,19 +18,19 @@ var _ common.MappedNullable = &AdditionalData3DSecure{} // AdditionalData3DSecure struct for AdditionalData3DSecure type AdditionalData3DSecure struct { - // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. // Deprecated Allow3DS2 *string `json:"allow3DS2,omitempty"` // Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen ChallengeWindowSize *string `json:"challengeWindowSize,omitempty"` - // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. // Deprecated ExecuteThreeD *string `json:"executeThreeD,omitempty"` // In case of Secure+, this field must be set to **CUPSecurePlus**. MpiImplementationType *string `json:"mpiImplementationType,omitempty"` - // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemption *string `json:"scaExemption,omitempty"` - // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. ThreeDSVersion *string `json:"threeDSVersion,omitempty"` } @@ -251,7 +250,7 @@ func (o *AdditionalData3DSecure) SetThreeDSVersion(v string) { } func (o AdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -317,12 +316,14 @@ func (v *NullableAdditionalData3DSecure) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalData3DSecure) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data_airline.go b/src/checkout/model_additional_data_airline.go index 7789046e6..23ef7ac46 100644 --- a/src/checkout/model_additional_data_airline.go +++ b/src/checkout/model_additional_data_airline.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataAirline type satisfies the MappedNullable interface at compile time @@ -984,7 +983,7 @@ func (o *AdditionalDataAirline) SetAirlineTravelAgencyName(v string) { } func (o AdditionalDataAirline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1113,3 +1112,6 @@ func (v *NullableAdditionalDataAirline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_car_rental.go b/src/checkout/model_additional_data_car_rental.go index 0cc091848..a81fffa71 100644 --- a/src/checkout/model_additional_data_car_rental.go +++ b/src/checkout/model_additional_data_car_rental.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataCarRental type satisfies the MappedNullable interface at compile time @@ -821,7 +820,7 @@ func (o *AdditionalDataCarRental) SetTravelEntertainmentAuthDataMarket(v string) } func (o AdditionalDataCarRental) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -937,3 +936,6 @@ func (v *NullableAdditionalDataCarRental) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_common.go b/src/checkout/model_additional_data_common.go index 0a687d3dc..fb3d2d29a 100644 --- a/src/checkout/model_additional_data_common.go +++ b/src/checkout/model_additional_data_common.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataCommon) SetSubMerchantTaxId(v string) { } func (o AdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,12 +678,14 @@ func (v *NullableAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalDataCommon) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"NoShow", "DelayedCharge"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NoShow", "DelayedCharge" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data_level23.go b/src/checkout/model_additional_data_level23.go index ffb4b270c..3c5aa922d 100644 --- a/src/checkout/model_additional_data_level23.go +++ b/src/checkout/model_additional_data_level23.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataLevel23 type satisfies the MappedNullable interface at compile time @@ -39,7 +38,7 @@ type AdditionalDataLevel23 struct { EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces + // The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` @@ -51,7 +50,7 @@ type AdditionalDataLevel23 struct { EnhancedSchemeDataOrderDate *string `json:"enhancedSchemeData.orderDate,omitempty"` // The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataShipFromPostalCode *string `json:"enhancedSchemeData.shipFromPostalCode,omitempty"` - // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } @@ -617,7 +616,7 @@ func (o *AdditionalDataLevel23) SetEnhancedSchemeDataTotalTaxAmount(v string) { } func (o AdditionalDataLevel23) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableAdditionalDataLevel23) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_lodging.go b/src/checkout/model_additional_data_lodging.go index 25199929c..b38c76bf1 100644 --- a/src/checkout/model_additional_data_lodging.go +++ b/src/checkout/model_additional_data_lodging.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataLodging type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataLodging) SetTravelEntertainmentAuthDataMarket(v string) { } func (o AdditionalDataLodging) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -678,3 +677,6 @@ func (v *NullableAdditionalDataLodging) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_open_invoice.go b/src/checkout/model_additional_data_open_invoice.go index f1b8fbd2c..d3ed13788 100644 --- a/src/checkout/model_additional_data_open_invoice.go +++ b/src/checkout/model_additional_data_open_invoice.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataOpenInvoice type satisfies the MappedNullable interface at compile time @@ -651,7 +650,7 @@ func (o *AdditionalDataOpenInvoice) SetOpeninvoicedataLineItemNrTrackingUri(v st } func (o AdditionalDataOpenInvoice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -752,3 +751,6 @@ func (v *NullableAdditionalDataOpenInvoice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_opi.go b/src/checkout/model_additional_data_opi.go index 27807147b..02afcc2a4 100644 --- a/src/checkout/model_additional_data_opi.go +++ b/src/checkout/model_additional_data_opi.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataOpi) SetOpiIncludeTransToken(v string) { } func (o AdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_ratepay.go b/src/checkout/model_additional_data_ratepay.go index 21b5aa220..d3c551d3e 100644 --- a/src/checkout/model_additional_data_ratepay.go +++ b/src/checkout/model_additional_data_ratepay.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRatepay type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *AdditionalDataRatepay) SetRatepaydataInvoiceId(v string) { } func (o AdditionalDataRatepay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableAdditionalDataRatepay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_retry.go b/src/checkout/model_additional_data_retry.go index ef4e5ebaf..f1897d3af 100644 --- a/src/checkout/model_additional_data_retry.go +++ b/src/checkout/model_additional_data_retry.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRetry type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalDataRetry) SetRetrySkipRetry(v string) { } func (o AdditionalDataRetry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalDataRetry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_risk.go b/src/checkout/model_additional_data_risk.go index 231907140..64f02df9b 100644 --- a/src/checkout/model_additional_data_risk.go +++ b/src/checkout/model_additional_data_risk.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRisk type satisfies the MappedNullable interface at compile time @@ -753,7 +752,7 @@ func (o *AdditionalDataRisk) SetRiskdataSkipRisk(v string) { } func (o AdditionalDataRisk) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,3 +862,6 @@ func (v *NullableAdditionalDataRisk) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_risk_standalone.go b/src/checkout/model_additional_data_risk_standalone.go index 4768d95f7..60abe42dd 100644 --- a/src/checkout/model_additional_data_risk_standalone.go +++ b/src/checkout/model_additional_data_risk_standalone.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRiskStandalone type satisfies the MappedNullable interface at compile time @@ -549,7 +548,7 @@ func (o *AdditionalDataRiskStandalone) SetTokenDataType(v string) { } func (o AdditionalDataRiskStandalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,3 +640,6 @@ func (v *NullableAdditionalDataRiskStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_sub_merchant.go b/src/checkout/model_additional_data_sub_merchant.go index 6fcdba686..f2cbca274 100644 --- a/src/checkout/model_additional_data_sub_merchant.go +++ b/src/checkout/model_additional_data_sub_merchant.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataSubMerchant type satisfies the MappedNullable interface at compile time @@ -379,7 +378,7 @@ func (o *AdditionalDataSubMerchant) SetSubMerchantSubSellerSubSellerNrTaxId(v st } func (o AdditionalDataSubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,3 +455,6 @@ func (v *NullableAdditionalDataSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_temporary_services.go b/src/checkout/model_additional_data_temporary_services.go index ba3041d42..5b68c609e 100644 --- a/src/checkout/model_additional_data_temporary_services.go +++ b/src/checkout/model_additional_data_temporary_services.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataTemporaryServices type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *AdditionalDataTemporaryServices) SetEnhancedSchemeDataTotalTaxAmount(v } func (o AdditionalDataTemporaryServices) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableAdditionalDataTemporaryServices) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_wallets.go b/src/checkout/model_additional_data_wallets.go index 78b077ab4..cdcb40c98 100644 --- a/src/checkout/model_additional_data_wallets.go +++ b/src/checkout/model_additional_data_wallets.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataWallets type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *AdditionalDataWallets) SetVisacheckoutCallId(v string) { } func (o AdditionalDataWallets) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableAdditionalDataWallets) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_address.go b/src/checkout/model_address.go index a383862b4..fd624bef2 100644 --- a/src/checkout/model_address.go +++ b/src/checkout/model_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_address_2.go b/src/checkout/model_address_2.go new file mode 100644 index 000000000..f5c41ece6 --- /dev/null +++ b/src/checkout/model_address_2.go @@ -0,0 +1,312 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Address2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Address2{} + +// Address2 struct for Address2 +type Address2 struct { + // The name of the city. Maximum length: 3000 characters. + City *string `json:"city,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + Country *string `json:"country,omitempty"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName *string `json:"houseNumberOrName,omitempty"` + // A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + PostalCode *string `json:"postalCode,omitempty"` + // The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + Street *string `json:"street,omitempty"` +} + +// NewAddress2 instantiates a new Address2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddress2() *Address2 { + this := Address2{} + return &this +} + +// NewAddress2WithDefaults instantiates a new Address2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddress2WithDefaults() *Address2 { + this := Address2{} + return &this +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *Address2) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *Address2) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *Address2) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *Address2) GetCountry() string { + if o == nil || common.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetCountryOk() (*string, bool) { + if o == nil || common.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *Address2) HasCountry() bool { + if o != nil && !common.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *Address2) SetCountry(v string) { + o.Country = &v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value if set, zero value otherwise. +func (o *Address2) GetHouseNumberOrName() string { + if o == nil || common.IsNil(o.HouseNumberOrName) { + var ret string + return ret + } + return *o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil || common.IsNil(o.HouseNumberOrName) { + return nil, false + } + return o.HouseNumberOrName, true +} + +// HasHouseNumberOrName returns a boolean if a field has been set. +func (o *Address2) HasHouseNumberOrName() bool { + if o != nil && !common.IsNil(o.HouseNumberOrName) { + return true + } + + return false +} + +// SetHouseNumberOrName gets a reference to the given string and assigns it to the HouseNumberOrName field. +func (o *Address2) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *Address2) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *Address2) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *Address2) SetPostalCode(v string) { + o.PostalCode = &v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *Address2) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *Address2) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *Address2) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value if set, zero value otherwise. +func (o *Address2) GetStreet() string { + if o == nil || common.IsNil(o.Street) { + var ret string + return ret + } + return *o.Street +} + +// GetStreetOk returns a tuple with the Street field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address2) GetStreetOk() (*string, bool) { + if o == nil || common.IsNil(o.Street) { + return nil, false + } + return o.Street, true +} + +// HasStreet returns a boolean if a field has been set. +func (o *Address2) HasStreet() bool { + if o != nil && !common.IsNil(o.Street) { + return true + } + + return false +} + +// SetStreet gets a reference to the given string and assigns it to the Street field. +func (o *Address2) SetStreet(v string) { + o.Street = &v +} + +func (o Address2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Address2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.HouseNumberOrName) { + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + if !common.IsNil(o.Street) { + toSerialize["street"] = o.Street + } + return toSerialize, nil +} + +type NullableAddress2 struct { + value *Address2 + isSet bool +} + +func (v NullableAddress2) Get() *Address2 { + return v.value +} + +func (v *NullableAddress2) Set(val *Address2) { + v.value = val + v.isSet = true +} + +func (v NullableAddress2) IsSet() bool { + return v.isSet +} + +func (v *NullableAddress2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddress2(val *Address2) *NullableAddress2 { + return &NullableAddress2{value: val, isSet: true} +} + +func (v NullableAddress2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddress2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_afterpay_details.go b/src/checkout/model_afterpay_details.go index 2f689d57d..2bf3336de 100644 --- a/src/checkout/model_afterpay_details.go +++ b/src/checkout/model_afterpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AfterpayDetails type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *AfterpayDetails) SetType(v string) { } func (o AfterpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -343,12 +342,14 @@ func (v *NullableAfterpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AfterpayDetails) isValidType() bool { - var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "afterpay_default", "afterpaytouch", "afterpay_b2b" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_amazon_pay_details.go b/src/checkout/model_amazon_pay_details.go index d5b8cd3ec..023203035 100644 --- a/src/checkout/model_amazon_pay_details.go +++ b/src/checkout/model_amazon_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AmazonPayDetails type satisfies the MappedNullable interface at compile time @@ -145,7 +144,7 @@ func (o *AmazonPayDetails) SetType(v string) { } func (o AmazonPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -202,12 +201,14 @@ func (v *NullableAmazonPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AmazonPayDetails) isValidType() bool { - var allowedEnumValues = []string{"amazonpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amazonpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_amount.go b/src/checkout/model_amount.go index 65f941c71..7e594c1fe 100644 --- a/src/checkout/model_amount.go +++ b/src/checkout/model_amount.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_amount_2.go b/src/checkout/model_amount_2.go new file mode 100644 index 000000000..006d16c1f --- /dev/null +++ b/src/checkout/model_amount_2.go @@ -0,0 +1,164 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Amount2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Amount2{} + +// Amount2 struct for Amount2 +type Amount2 struct { + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + Currency *string `json:"currency,omitempty"` + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + Value *int64 `json:"value,omitempty"` +} + +// NewAmount2 instantiates a new Amount2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAmount2() *Amount2 { + this := Amount2{} + return &this +} + +// NewAmount2WithDefaults instantiates a new Amount2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAmount2WithDefaults() *Amount2 { + this := Amount2{} + return &this +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *Amount2) GetCurrency() string { + if o == nil || common.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Amount2) GetCurrencyOk() (*string, bool) { + if o == nil || common.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *Amount2) HasCurrency() bool { + if o != nil && !common.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *Amount2) SetCurrency(v string) { + o.Currency = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *Amount2) GetValue() int64 { + if o == nil || common.IsNil(o.Value) { + var ret int64 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Amount2) GetValueOk() (*int64, bool) { + if o == nil || common.IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *Amount2) HasValue() bool { + if o != nil && !common.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given int64 and assigns it to the Value field. +func (o *Amount2) SetValue(v int64) { + o.Value = &v +} + +func (o Amount2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Amount2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableAmount2 struct { + value *Amount2 + isSet bool +} + +func (v NullableAmount2) Get() *Amount2 { + return v.value +} + +func (v *NullableAmount2) Set(val *Amount2) { + v.value = val + v.isSet = true +} + +func (v NullableAmount2) IsSet() bool { + return v.isSet +} + +func (v *NullableAmount2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmount2(val *Amount2) *NullableAmount2 { + return &NullableAmount2{value: val, isSet: true} +} + +func (v NullableAmount2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmount2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_android_pay_details.go b/src/checkout/model_android_pay_details.go index b48843662..de65028c4 100644 --- a/src/checkout/model_android_pay_details.go +++ b/src/checkout/model_android_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AndroidPayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *AndroidPayDetails) SetType(v string) { } func (o AndroidPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableAndroidPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AndroidPayDetails) isValidType() bool { - var allowedEnumValues = []string{"androidpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "androidpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_apple_pay_details.go b/src/checkout/model_apple_pay_details.go index 05912e800..246ad3ab7 100644 --- a/src/checkout/model_apple_pay_details.go +++ b/src/checkout/model_apple_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApplePayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *ApplePayDetails) SetType(v string) { } func (o ApplePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableApplePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ApplePayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *ApplePayDetails) isValidType() bool { - var allowedEnumValues = []string{"applepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "applepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_apple_pay_session_response.go b/src/checkout/model_apple_pay_session_response.go index ebc50723c..d33e684f8 100644 --- a/src/checkout/model_apple_pay_session_response.go +++ b/src/checkout/model_apple_pay_session_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApplePaySessionResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *ApplePaySessionResponse) SetData(v string) { } func (o ApplePaySessionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableApplePaySessionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_application_info.go b/src/checkout/model_application_info.go index 53a1490c5..3b182ae01 100644 --- a/src/checkout/model_application_info.go +++ b/src/checkout/model_application_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApplicationInfo type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &ApplicationInfo{} // ApplicationInfo struct for ApplicationInfo type ApplicationInfo struct { - AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` - AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` - ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` - MerchantApplication *CommonField `json:"merchantApplication,omitempty"` - MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` + AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` + AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` + ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` + MerchantApplication *CommonField `json:"merchantApplication,omitempty"` + MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` ShopperInteractionDevice *ShopperInteractionDevice `json:"shopperInteractionDevice,omitempty"` } @@ -237,7 +236,7 @@ func (o *ApplicationInfo) SetShopperInteractionDevice(v ShopperInteractionDevice } func (o ApplicationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableApplicationInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_application_info_2.go b/src/checkout/model_application_info_2.go new file mode 100644 index 000000000..d41b706d4 --- /dev/null +++ b/src/checkout/model_application_info_2.go @@ -0,0 +1,306 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the ApplicationInfo2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ApplicationInfo2{} + +// ApplicationInfo2 struct for ApplicationInfo2 +type ApplicationInfo2 struct { + AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` + AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` + ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` + MerchantApplication *CommonField `json:"merchantApplication,omitempty"` + MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` + ShopperInteractionDevice *ShopperInteractionDevice `json:"shopperInteractionDevice,omitempty"` +} + +// NewApplicationInfo2 instantiates a new ApplicationInfo2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplicationInfo2() *ApplicationInfo2 { + this := ApplicationInfo2{} + return &this +} + +// NewApplicationInfo2WithDefaults instantiates a new ApplicationInfo2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationInfo2WithDefaults() *ApplicationInfo2 { + this := ApplicationInfo2{} + return &this +} + +// GetAdyenLibrary returns the AdyenLibrary field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetAdyenLibrary() CommonField { + if o == nil || common.IsNil(o.AdyenLibrary) { + var ret CommonField + return ret + } + return *o.AdyenLibrary +} + +// GetAdyenLibraryOk returns a tuple with the AdyenLibrary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetAdyenLibraryOk() (*CommonField, bool) { + if o == nil || common.IsNil(o.AdyenLibrary) { + return nil, false + } + return o.AdyenLibrary, true +} + +// HasAdyenLibrary returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasAdyenLibrary() bool { + if o != nil && !common.IsNil(o.AdyenLibrary) { + return true + } + + return false +} + +// SetAdyenLibrary gets a reference to the given CommonField and assigns it to the AdyenLibrary field. +func (o *ApplicationInfo2) SetAdyenLibrary(v CommonField) { + o.AdyenLibrary = &v +} + +// GetAdyenPaymentSource returns the AdyenPaymentSource field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetAdyenPaymentSource() CommonField { + if o == nil || common.IsNil(o.AdyenPaymentSource) { + var ret CommonField + return ret + } + return *o.AdyenPaymentSource +} + +// GetAdyenPaymentSourceOk returns a tuple with the AdyenPaymentSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetAdyenPaymentSourceOk() (*CommonField, bool) { + if o == nil || common.IsNil(o.AdyenPaymentSource) { + return nil, false + } + return o.AdyenPaymentSource, true +} + +// HasAdyenPaymentSource returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasAdyenPaymentSource() bool { + if o != nil && !common.IsNil(o.AdyenPaymentSource) { + return true + } + + return false +} + +// SetAdyenPaymentSource gets a reference to the given CommonField and assigns it to the AdyenPaymentSource field. +func (o *ApplicationInfo2) SetAdyenPaymentSource(v CommonField) { + o.AdyenPaymentSource = &v +} + +// GetExternalPlatform returns the ExternalPlatform field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetExternalPlatform() ExternalPlatform { + if o == nil || common.IsNil(o.ExternalPlatform) { + var ret ExternalPlatform + return ret + } + return *o.ExternalPlatform +} + +// GetExternalPlatformOk returns a tuple with the ExternalPlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetExternalPlatformOk() (*ExternalPlatform, bool) { + if o == nil || common.IsNil(o.ExternalPlatform) { + return nil, false + } + return o.ExternalPlatform, true +} + +// HasExternalPlatform returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasExternalPlatform() bool { + if o != nil && !common.IsNil(o.ExternalPlatform) { + return true + } + + return false +} + +// SetExternalPlatform gets a reference to the given ExternalPlatform and assigns it to the ExternalPlatform field. +func (o *ApplicationInfo2) SetExternalPlatform(v ExternalPlatform) { + o.ExternalPlatform = &v +} + +// GetMerchantApplication returns the MerchantApplication field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetMerchantApplication() CommonField { + if o == nil || common.IsNil(o.MerchantApplication) { + var ret CommonField + return ret + } + return *o.MerchantApplication +} + +// GetMerchantApplicationOk returns a tuple with the MerchantApplication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetMerchantApplicationOk() (*CommonField, bool) { + if o == nil || common.IsNil(o.MerchantApplication) { + return nil, false + } + return o.MerchantApplication, true +} + +// HasMerchantApplication returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasMerchantApplication() bool { + if o != nil && !common.IsNil(o.MerchantApplication) { + return true + } + + return false +} + +// SetMerchantApplication gets a reference to the given CommonField and assigns it to the MerchantApplication field. +func (o *ApplicationInfo2) SetMerchantApplication(v CommonField) { + o.MerchantApplication = &v +} + +// GetMerchantDevice returns the MerchantDevice field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetMerchantDevice() MerchantDevice { + if o == nil || common.IsNil(o.MerchantDevice) { + var ret MerchantDevice + return ret + } + return *o.MerchantDevice +} + +// GetMerchantDeviceOk returns a tuple with the MerchantDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetMerchantDeviceOk() (*MerchantDevice, bool) { + if o == nil || common.IsNil(o.MerchantDevice) { + return nil, false + } + return o.MerchantDevice, true +} + +// HasMerchantDevice returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasMerchantDevice() bool { + if o != nil && !common.IsNil(o.MerchantDevice) { + return true + } + + return false +} + +// SetMerchantDevice gets a reference to the given MerchantDevice and assigns it to the MerchantDevice field. +func (o *ApplicationInfo2) SetMerchantDevice(v MerchantDevice) { + o.MerchantDevice = &v +} + +// GetShopperInteractionDevice returns the ShopperInteractionDevice field value if set, zero value otherwise. +func (o *ApplicationInfo2) GetShopperInteractionDevice() ShopperInteractionDevice { + if o == nil || common.IsNil(o.ShopperInteractionDevice) { + var ret ShopperInteractionDevice + return ret + } + return *o.ShopperInteractionDevice +} + +// GetShopperInteractionDeviceOk returns a tuple with the ShopperInteractionDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInfo2) GetShopperInteractionDeviceOk() (*ShopperInteractionDevice, bool) { + if o == nil || common.IsNil(o.ShopperInteractionDevice) { + return nil, false + } + return o.ShopperInteractionDevice, true +} + +// HasShopperInteractionDevice returns a boolean if a field has been set. +func (o *ApplicationInfo2) HasShopperInteractionDevice() bool { + if o != nil && !common.IsNil(o.ShopperInteractionDevice) { + return true + } + + return false +} + +// SetShopperInteractionDevice gets a reference to the given ShopperInteractionDevice and assigns it to the ShopperInteractionDevice field. +func (o *ApplicationInfo2) SetShopperInteractionDevice(v ShopperInteractionDevice) { + o.ShopperInteractionDevice = &v +} + +func (o ApplicationInfo2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationInfo2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AdyenLibrary) { + toSerialize["adyenLibrary"] = o.AdyenLibrary + } + if !common.IsNil(o.AdyenPaymentSource) { + toSerialize["adyenPaymentSource"] = o.AdyenPaymentSource + } + if !common.IsNil(o.ExternalPlatform) { + toSerialize["externalPlatform"] = o.ExternalPlatform + } + if !common.IsNil(o.MerchantApplication) { + toSerialize["merchantApplication"] = o.MerchantApplication + } + if !common.IsNil(o.MerchantDevice) { + toSerialize["merchantDevice"] = o.MerchantDevice + } + if !common.IsNil(o.ShopperInteractionDevice) { + toSerialize["shopperInteractionDevice"] = o.ShopperInteractionDevice + } + return toSerialize, nil +} + +type NullableApplicationInfo2 struct { + value *ApplicationInfo2 + isSet bool +} + +func (v NullableApplicationInfo2) Get() *ApplicationInfo2 { + return v.value +} + +func (v *NullableApplicationInfo2) Set(val *ApplicationInfo2) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationInfo2) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationInfo2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationInfo2(val *ApplicationInfo2) *NullableApplicationInfo2 { + return &NullableApplicationInfo2{value: val, isSet: true} +} + +func (v NullableApplicationInfo2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationInfo2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_authentication_data.go b/src/checkout/model_authentication_data.go index a0eeb0145..cf4cbbddd 100644 --- a/src/checkout/model_authentication_data.go +++ b/src/checkout/model_authentication_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AuthenticationData type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type AuthenticationData struct { // Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. AttemptAuthentication *string `json:"attemptAuthentication,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. - AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` + AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` ThreeDSRequestData *ThreeDSRequestData `json:"threeDSRequestData,omitempty"` } @@ -144,7 +143,7 @@ func (o *AuthenticationData) SetThreeDSRequestData(v ThreeDSRequestData) { } func (o AuthenticationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -201,12 +200,14 @@ func (v *NullableAuthenticationData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AuthenticationData) isValidAttemptAuthentication() bool { - var allowedEnumValues = []string{"always", "never"} - for _, allowed := range allowedEnumValues { - if o.GetAttemptAuthentication() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "always", "never" } + for _, allowed := range allowedEnumValues { + if o.GetAttemptAuthentication() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_avs.go b/src/checkout/model_avs.go index a35cd8d33..011ee584d 100644 --- a/src/checkout/model_avs.go +++ b/src/checkout/model_avs.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Avs type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Avs) SetEnabled(v string) { } func (o Avs) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAvs) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Avs) isValidEnabled() bool { - var allowedEnumValues = []string{"yes", "no", "automatic"} - for _, allowed := range allowedEnumValues { - if o.GetEnabled() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "yes", "no", "automatic" } + for _, allowed := range allowedEnumValues { + if o.GetEnabled() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_bacs_direct_debit_details.go b/src/checkout/model_bacs_direct_debit_details.go index 179b9e4c8..9ce4d7dad 100644 --- a/src/checkout/model_bacs_direct_debit_details.go +++ b/src/checkout/model_bacs_direct_debit_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BacsDirectDebitDetails type satisfies the MappedNullable interface at compile time @@ -285,7 +284,7 @@ func (o *BacsDirectDebitDetails) SetType(v string) { } func (o BacsDirectDebitDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -354,12 +353,14 @@ func (v *NullableBacsDirectDebitDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BacsDirectDebitDetails) isValidType() bool { - var allowedEnumValues = []string{"directdebit_GB"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "directdebit_GB" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_bank_account.go b/src/checkout/model_bank_account.go index e6ec53d85..c2c708acc 100644 --- a/src/checkout/model_bank_account.go +++ b/src/checkout/model_bank_account.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_bill_desk_details.go b/src/checkout/model_bill_desk_details.go index a4614cfb1..3027063d3 100644 --- a/src/checkout/model_bill_desk_details.go +++ b/src/checkout/model_bill_desk_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BillDeskDetails type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *BillDeskDetails) SetType(v string) { } func (o BillDeskDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableBillDeskDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BillDeskDetails) isValidType() bool { - var allowedEnumValues = []string{"billdesk_online", "billdesk_wallet", "onlinebanking_IN", "wallet_IN"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "billdesk_online", "billdesk_wallet", "onlinebanking_IN", "wallet_IN" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_blik_details.go b/src/checkout/model_blik_details.go index 95fc3da72..55b4f81c4 100644 --- a/src/checkout/model_blik_details.go +++ b/src/checkout/model_blik_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BlikDetails type satisfies the MappedNullable interface at compile time @@ -213,7 +212,7 @@ func (o *BlikDetails) SetType(v string) { } func (o BlikDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -276,12 +275,14 @@ func (v *NullableBlikDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BlikDetails) isValidType() bool { - var allowedEnumValues = []string{"blik"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "blik" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_browser_info.go b/src/checkout/model_browser_info.go index b7b46dc16..0d8761d64 100644 --- a/src/checkout/model_browser_info.go +++ b/src/checkout/model_browser_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BrowserInfo type satisfies the MappedNullable interface at compile time @@ -293,7 +292,7 @@ func (o *BrowserInfo) SetUserAgent(v string) { } func (o BrowserInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -351,3 +350,6 @@ func (v *NullableBrowserInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_browser_info_2.go b/src/checkout/model_browser_info_2.go new file mode 100644 index 000000000..9529c8995 --- /dev/null +++ b/src/checkout/model_browser_info_2.go @@ -0,0 +1,427 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the BrowserInfo2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BrowserInfo2{} + +// BrowserInfo2 struct for BrowserInfo2 +type BrowserInfo2 struct { + // The accept header value of the shopper's browser. + AcceptHeader *string `json:"acceptHeader,omitempty"` + // The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + ColorDepth *int32 `json:"colorDepth,omitempty"` + // Boolean value indicating if the shopper's browser is able to execute Java. + JavaEnabled *bool `json:"javaEnabled,omitempty"` + // Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + JavaScriptEnabled *bool `json:"javaScriptEnabled,omitempty"` + // The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). + Language *string `json:"language,omitempty"` + // The total height of the shopper's device screen in pixels. + ScreenHeight *int32 `json:"screenHeight,omitempty"` + // The total width of the shopper's device screen in pixels. + ScreenWidth *int32 `json:"screenWidth,omitempty"` + // Time difference between UTC time and the shopper's browser local time, in minutes. + TimeZoneOffset *int32 `json:"timeZoneOffset,omitempty"` + // The user agent value of the shopper's browser. + UserAgent *string `json:"userAgent,omitempty"` +} + +// NewBrowserInfo2 instantiates a new BrowserInfo2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBrowserInfo2() *BrowserInfo2 { + this := BrowserInfo2{} + var javaScriptEnabled bool = true + this.JavaScriptEnabled = &javaScriptEnabled + return &this +} + +// NewBrowserInfo2WithDefaults instantiates a new BrowserInfo2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBrowserInfo2WithDefaults() *BrowserInfo2 { + this := BrowserInfo2{} + var javaScriptEnabled bool = true + this.JavaScriptEnabled = &javaScriptEnabled + return &this +} + +// GetAcceptHeader returns the AcceptHeader field value if set, zero value otherwise. +func (o *BrowserInfo2) GetAcceptHeader() string { + if o == nil || common.IsNil(o.AcceptHeader) { + var ret string + return ret + } + return *o.AcceptHeader +} + +// GetAcceptHeaderOk returns a tuple with the AcceptHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetAcceptHeaderOk() (*string, bool) { + if o == nil || common.IsNil(o.AcceptHeader) { + return nil, false + } + return o.AcceptHeader, true +} + +// HasAcceptHeader returns a boolean if a field has been set. +func (o *BrowserInfo2) HasAcceptHeader() bool { + if o != nil && !common.IsNil(o.AcceptHeader) { + return true + } + + return false +} + +// SetAcceptHeader gets a reference to the given string and assigns it to the AcceptHeader field. +func (o *BrowserInfo2) SetAcceptHeader(v string) { + o.AcceptHeader = &v +} + +// GetColorDepth returns the ColorDepth field value if set, zero value otherwise. +func (o *BrowserInfo2) GetColorDepth() int32 { + if o == nil || common.IsNil(o.ColorDepth) { + var ret int32 + return ret + } + return *o.ColorDepth +} + +// GetColorDepthOk returns a tuple with the ColorDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetColorDepthOk() (*int32, bool) { + if o == nil || common.IsNil(o.ColorDepth) { + return nil, false + } + return o.ColorDepth, true +} + +// HasColorDepth returns a boolean if a field has been set. +func (o *BrowserInfo2) HasColorDepth() bool { + if o != nil && !common.IsNil(o.ColorDepth) { + return true + } + + return false +} + +// SetColorDepth gets a reference to the given int32 and assigns it to the ColorDepth field. +func (o *BrowserInfo2) SetColorDepth(v int32) { + o.ColorDepth = &v +} + +// GetJavaEnabled returns the JavaEnabled field value if set, zero value otherwise. +func (o *BrowserInfo2) GetJavaEnabled() bool { + if o == nil || common.IsNil(o.JavaEnabled) { + var ret bool + return ret + } + return *o.JavaEnabled +} + +// GetJavaEnabledOk returns a tuple with the JavaEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetJavaEnabledOk() (*bool, bool) { + if o == nil || common.IsNil(o.JavaEnabled) { + return nil, false + } + return o.JavaEnabled, true +} + +// HasJavaEnabled returns a boolean if a field has been set. +func (o *BrowserInfo2) HasJavaEnabled() bool { + if o != nil && !common.IsNil(o.JavaEnabled) { + return true + } + + return false +} + +// SetJavaEnabled gets a reference to the given bool and assigns it to the JavaEnabled field. +func (o *BrowserInfo2) SetJavaEnabled(v bool) { + o.JavaEnabled = &v +} + +// GetJavaScriptEnabled returns the JavaScriptEnabled field value if set, zero value otherwise. +func (o *BrowserInfo2) GetJavaScriptEnabled() bool { + if o == nil || common.IsNil(o.JavaScriptEnabled) { + var ret bool + return ret + } + return *o.JavaScriptEnabled +} + +// GetJavaScriptEnabledOk returns a tuple with the JavaScriptEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetJavaScriptEnabledOk() (*bool, bool) { + if o == nil || common.IsNil(o.JavaScriptEnabled) { + return nil, false + } + return o.JavaScriptEnabled, true +} + +// HasJavaScriptEnabled returns a boolean if a field has been set. +func (o *BrowserInfo2) HasJavaScriptEnabled() bool { + if o != nil && !common.IsNil(o.JavaScriptEnabled) { + return true + } + + return false +} + +// SetJavaScriptEnabled gets a reference to the given bool and assigns it to the JavaScriptEnabled field. +func (o *BrowserInfo2) SetJavaScriptEnabled(v bool) { + o.JavaScriptEnabled = &v +} + +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *BrowserInfo2) GetLanguage() string { + if o == nil || common.IsNil(o.Language) { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetLanguageOk() (*string, bool) { + if o == nil || common.IsNil(o.Language) { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *BrowserInfo2) HasLanguage() bool { + if o != nil && !common.IsNil(o.Language) { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *BrowserInfo2) SetLanguage(v string) { + o.Language = &v +} + +// GetScreenHeight returns the ScreenHeight field value if set, zero value otherwise. +func (o *BrowserInfo2) GetScreenHeight() int32 { + if o == nil || common.IsNil(o.ScreenHeight) { + var ret int32 + return ret + } + return *o.ScreenHeight +} + +// GetScreenHeightOk returns a tuple with the ScreenHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetScreenHeightOk() (*int32, bool) { + if o == nil || common.IsNil(o.ScreenHeight) { + return nil, false + } + return o.ScreenHeight, true +} + +// HasScreenHeight returns a boolean if a field has been set. +func (o *BrowserInfo2) HasScreenHeight() bool { + if o != nil && !common.IsNil(o.ScreenHeight) { + return true + } + + return false +} + +// SetScreenHeight gets a reference to the given int32 and assigns it to the ScreenHeight field. +func (o *BrowserInfo2) SetScreenHeight(v int32) { + o.ScreenHeight = &v +} + +// GetScreenWidth returns the ScreenWidth field value if set, zero value otherwise. +func (o *BrowserInfo2) GetScreenWidth() int32 { + if o == nil || common.IsNil(o.ScreenWidth) { + var ret int32 + return ret + } + return *o.ScreenWidth +} + +// GetScreenWidthOk returns a tuple with the ScreenWidth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetScreenWidthOk() (*int32, bool) { + if o == nil || common.IsNil(o.ScreenWidth) { + return nil, false + } + return o.ScreenWidth, true +} + +// HasScreenWidth returns a boolean if a field has been set. +func (o *BrowserInfo2) HasScreenWidth() bool { + if o != nil && !common.IsNil(o.ScreenWidth) { + return true + } + + return false +} + +// SetScreenWidth gets a reference to the given int32 and assigns it to the ScreenWidth field. +func (o *BrowserInfo2) SetScreenWidth(v int32) { + o.ScreenWidth = &v +} + +// GetTimeZoneOffset returns the TimeZoneOffset field value if set, zero value otherwise. +func (o *BrowserInfo2) GetTimeZoneOffset() int32 { + if o == nil || common.IsNil(o.TimeZoneOffset) { + var ret int32 + return ret + } + return *o.TimeZoneOffset +} + +// GetTimeZoneOffsetOk returns a tuple with the TimeZoneOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetTimeZoneOffsetOk() (*int32, bool) { + if o == nil || common.IsNil(o.TimeZoneOffset) { + return nil, false + } + return o.TimeZoneOffset, true +} + +// HasTimeZoneOffset returns a boolean if a field has been set. +func (o *BrowserInfo2) HasTimeZoneOffset() bool { + if o != nil && !common.IsNil(o.TimeZoneOffset) { + return true + } + + return false +} + +// SetTimeZoneOffset gets a reference to the given int32 and assigns it to the TimeZoneOffset field. +func (o *BrowserInfo2) SetTimeZoneOffset(v int32) { + o.TimeZoneOffset = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *BrowserInfo2) GetUserAgent() string { + if o == nil || common.IsNil(o.UserAgent) { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrowserInfo2) GetUserAgentOk() (*string, bool) { + if o == nil || common.IsNil(o.UserAgent) { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *BrowserInfo2) HasUserAgent() bool { + if o != nil && !common.IsNil(o.UserAgent) { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *BrowserInfo2) SetUserAgent(v string) { + o.UserAgent = &v +} + +func (o BrowserInfo2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BrowserInfo2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcceptHeader) { + toSerialize["acceptHeader"] = o.AcceptHeader + } + if !common.IsNil(o.ColorDepth) { + toSerialize["colorDepth"] = o.ColorDepth + } + if !common.IsNil(o.JavaEnabled) { + toSerialize["javaEnabled"] = o.JavaEnabled + } + if !common.IsNil(o.JavaScriptEnabled) { + toSerialize["javaScriptEnabled"] = o.JavaScriptEnabled + } + if !common.IsNil(o.Language) { + toSerialize["language"] = o.Language + } + if !common.IsNil(o.ScreenHeight) { + toSerialize["screenHeight"] = o.ScreenHeight + } + if !common.IsNil(o.ScreenWidth) { + toSerialize["screenWidth"] = o.ScreenWidth + } + if !common.IsNil(o.TimeZoneOffset) { + toSerialize["timeZoneOffset"] = o.TimeZoneOffset + } + if !common.IsNil(o.UserAgent) { + toSerialize["userAgent"] = o.UserAgent + } + return toSerialize, nil +} + +type NullableBrowserInfo2 struct { + value *BrowserInfo2 + isSet bool +} + +func (v NullableBrowserInfo2) Get() *BrowserInfo2 { + return v.value +} + +func (v *NullableBrowserInfo2) Set(val *BrowserInfo2) { + v.value = val + v.isSet = true +} + +func (v NullableBrowserInfo2) IsSet() bool { + return v.isSet +} + +func (v *NullableBrowserInfo2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBrowserInfo2(val *BrowserInfo2) *NullableBrowserInfo2 { + return &NullableBrowserInfo2{value: val, isSet: true} +} + +func (v NullableBrowserInfo2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBrowserInfo2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_card.go b/src/checkout/model_card.go index badd7828a..0749e3059 100644 --- a/src/checkout/model_card.go +++ b/src/checkout/model_card.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_brand_details.go b/src/checkout/model_card_brand_details.go index 0bef932a7..f09d61cab 100644 --- a/src/checkout/model_card_brand_details.go +++ b/src/checkout/model_card_brand_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardBrandDetails type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CardBrandDetails) SetType(v string) { } func (o CardBrandDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCardBrandDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index b957636a5..8a90a7499 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardDetails type satisfies the MappedNullable interface at compile time @@ -696,7 +695,7 @@ func (o *CardDetails) SetType(v string) { } func (o CardDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -801,21 +800,23 @@ func (v *NullableCardDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CardDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *CardDetails) isValidType() bool { - var allowedEnumValues = []string{"scheme", "networkToken", "giftcard", "alliancedata", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "scheme", "networkToken", "giftcard", "alliancedata", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_card_details_request.go b/src/checkout/model_card_details_request.go index 648b9472f..fac2dbdfd 100644 --- a/src/checkout/model_card_details_request.go +++ b/src/checkout/model_card_details_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardDetailsRequest type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *CardDetailsRequest) SetSupportedBrands(v []string) { } func (o CardDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableCardDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_details_response.go b/src/checkout/model_card_details_response.go index 56d392f05..64b0a7ca0 100644 --- a/src/checkout/model_card_details_response.go +++ b/src/checkout/model_card_details_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardDetailsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CardDetailsResponse) SetBrands(v []CardBrandDetails) { } func (o CardDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCardDetailsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_cellulant_details.go b/src/checkout/model_cellulant_details.go index 602d0cce5..17e027dc3 100644 --- a/src/checkout/model_cellulant_details.go +++ b/src/checkout/model_cellulant_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CellulantDetails type satisfies the MappedNullable interface at compile time @@ -145,7 +144,7 @@ func (o *CellulantDetails) SetType(v string) { } func (o CellulantDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -202,12 +201,14 @@ func (v *NullableCellulantDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CellulantDetails) isValidType() bool { - var allowedEnumValues = []string{"cellulant"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "cellulant" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_await_action.go b/src/checkout/model_checkout_await_action.go index 3d6c7b9fb..9e84b8436 100644 --- a/src/checkout/model_checkout_await_action.go +++ b/src/checkout/model_checkout_await_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutAwaitAction type satisfies the MappedNullable interface at compile time @@ -168,7 +167,7 @@ func (o *CheckoutAwaitAction) SetUrl(v string) { } func (o CheckoutAwaitAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -226,12 +225,14 @@ func (v *NullableCheckoutAwaitAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutAwaitAction) isValidType() bool { - var allowedEnumValues = []string{"await"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "await" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_balance_check_request.go b/src/checkout/model_checkout_balance_check_request.go index 3841354c8..a89847831 100644 --- a/src/checkout/model_checkout_balance_check_request.go +++ b/src/checkout/model_checkout_balance_check_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutBalanceCheckRequest type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &CheckoutBalanceCheckRequest{} // CheckoutBalanceCheckRequest struct for CheckoutBalanceCheckRequest type CheckoutBalanceCheckRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -48,16 +47,16 @@ type CheckoutBalanceCheckRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // The collection that contains the type of the payment method and its specific information. PaymentMethod map[string]string `json:"paymentMethod"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -75,7 +74,7 @@ type CheckoutBalanceCheckRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -87,7 +86,7 @@ type CheckoutBalanceCheckRequest struct { // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated @@ -102,8 +101,9 @@ type CheckoutBalanceCheckRequest struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCheckoutBalanceCheckRequest(merchantAccount string, paymentMethod map[string]string) *CheckoutBalanceCheckRequest { +func NewCheckoutBalanceCheckRequest(amount Amount, merchantAccount string, paymentMethod map[string]string) *CheckoutBalanceCheckRequest { this := CheckoutBalanceCheckRequest{} + this.Amount = amount this.MerchantAccount = merchantAccount this.PaymentMethod = paymentMethod var threeDSAuthenticationOnly bool = false @@ -217,36 +217,28 @@ func (o *CheckoutBalanceCheckRequest) SetAdditionalData(v map[string]string) { o.AdditionalData = &v } -// GetAmount returns the Amount field value if set, zero value otherwise. +// GetAmount returns the Amount field value func (o *CheckoutBalanceCheckRequest) GetAmount() Amount { - if o == nil || common.IsNil(o.Amount) { + if o == nil { var ret Amount return ret } - return *o.Amount + + return o.Amount } -// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// GetAmountOk returns a tuple with the Amount field value // and a boolean to check if the value has been set. func (o *CheckoutBalanceCheckRequest) GetAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.Amount) { + if o == nil { return nil, false } - return o.Amount, true + return &o.Amount, true } -// HasAmount returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasAmount() bool { - if o != nil && !common.IsNil(o.Amount) { - return true - } - - return false -} - -// SetAmount gets a reference to the given Amount and assigns it to the Amount field. +// SetAmount sets field value func (o *CheckoutBalanceCheckRequest) SetAmount(v Amount) { - o.Amount = &v + o.Amount = v } // GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. @@ -1517,7 +1509,7 @@ func (o *CheckoutBalanceCheckRequest) SetTrustedShopper(v bool) { } func (o CheckoutBalanceCheckRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1535,9 +1527,7 @@ func (o CheckoutBalanceCheckRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AdditionalData) { toSerialize["additionalData"] = o.AdditionalData } - if !common.IsNil(o.Amount) { - toSerialize["amount"] = o.Amount - } + toSerialize["amount"] = o.Amount if !common.IsNil(o.ApplicationInfo) { toSerialize["applicationInfo"] = o.ApplicationInfo } @@ -1693,21 +1683,23 @@ func (v *NullableCheckoutBalanceCheckRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutBalanceCheckRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CheckoutBalanceCheckRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_balance_check_response.go b/src/checkout/model_checkout_balance_check_response.go index 4b651ead5..18c920341 100644 --- a/src/checkout/model_checkout_balance_check_response.go +++ b/src/checkout/model_checkout_balance_check_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutBalanceCheckResponse type satisfies the MappedNullable interface at compile time @@ -21,14 +20,14 @@ var _ common.MappedNullable = &CheckoutBalanceCheckResponse{} type CheckoutBalanceCheckResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Balance Amount `json:"balance"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + Balance Amount `json:"balance"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReason *string `json:"refusalReason,omitempty"` // The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - ResultCode string `json:"resultCode"` + ResultCode string `json:"resultCode"` TransactionLimit *Amount `json:"transactionLimit,omitempty"` } @@ -260,7 +259,7 @@ func (o *CheckoutBalanceCheckResponse) SetTransactionLimit(v Amount) { } func (o CheckoutBalanceCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -325,12 +324,14 @@ func (v *NullableCheckoutBalanceCheckResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutBalanceCheckResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "NotEnoughBalance", "Failed"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "NotEnoughBalance", "Failed" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_cancel_order_request.go b/src/checkout/model_checkout_cancel_order_request.go index 5e6d4b05c..245bf6169 100644 --- a/src/checkout/model_checkout_cancel_order_request.go +++ b/src/checkout/model_checkout_cancel_order_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutCancelOrderRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &CheckoutCancelOrderRequest{} // CheckoutCancelOrderRequest struct for CheckoutCancelOrderRequest type CheckoutCancelOrderRequest struct { // The merchant account identifier that orderData belongs to. - MerchantAccount string `json:"merchantAccount"` - Order EncryptedOrderData `json:"order"` + MerchantAccount string `json:"merchantAccount"` + Order EncryptedOrderData `json:"order"` } // NewCheckoutCancelOrderRequest instantiates a new CheckoutCancelOrderRequest object @@ -92,7 +91,7 @@ func (o *CheckoutCancelOrderRequest) SetOrder(v EncryptedOrderData) { } func (o CheckoutCancelOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -141,3 +140,6 @@ func (v *NullableCheckoutCancelOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_cancel_order_response.go b/src/checkout/model_checkout_cancel_order_response.go index abb4b98bb..389ab4b9d 100644 --- a/src/checkout/model_checkout_cancel_order_response.go +++ b/src/checkout/model_checkout_cancel_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutCancelOrderResponse type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *CheckoutCancelOrderResponse) SetResultCode(v string) { } func (o CheckoutCancelOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -143,12 +142,14 @@ func (v *NullableCheckoutCancelOrderResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutCancelOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Received"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Received" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_create_order_request.go b/src/checkout/model_checkout_create_order_request.go index 7744439c8..d1d067c2c 100644 --- a/src/checkout/model_checkout_create_order_request.go +++ b/src/checkout/model_checkout_create_order_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutCreateOrderRequest type satisfies the MappedNullable interface at compile time @@ -153,7 +152,7 @@ func (o *CheckoutCreateOrderRequest) SetReference(v string) { } func (o CheckoutCreateOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -206,3 +205,6 @@ func (v *NullableCheckoutCreateOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_create_order_response.go b/src/checkout/model_checkout_create_order_response.go index a27ee7eaa..0f7c63a33 100644 --- a/src/checkout/model_checkout_create_order_response.go +++ b/src/checkout/model_checkout_create_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutCreateOrderResponse type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &CheckoutCreateOrderResponse{} type CheckoutCreateOrderResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` // The date that the order will expire. - ExpiresAt string `json:"expiresAt"` + ExpiresAt string `json:"expiresAt"` FraudResult *FraudResult `json:"fraudResult,omitempty"` // The encrypted data that will be used by merchant for adding payments to the order. OrderData string `json:"orderData"` @@ -32,8 +31,8 @@ type CheckoutCreateOrderResponse struct { // The reference provided by merchant for creating the order. Reference *string `json:"reference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - RefusalReason *string `json:"refusalReason,omitempty"` - RemainingAmount Amount `json:"remainingAmount"` + RefusalReason *string `json:"refusalReason,omitempty"` + RemainingAmount Amount `json:"remainingAmount"` // The result of the order creation request. The value is always **Success**. ResultCode string `json:"resultCode"` } @@ -341,7 +340,7 @@ func (o *CheckoutCreateOrderResponse) SetResultCode(v string) { } func (o CheckoutCreateOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,12 +408,14 @@ func (v *NullableCheckoutCreateOrderResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutCreateOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_donation_payment_request.go b/src/checkout/model_checkout_donation_payment_request.go new file mode 100644 index 000000000..d192a704d --- /dev/null +++ b/src/checkout/model_checkout_donation_payment_request.go @@ -0,0 +1,2598 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the CheckoutDonationPaymentRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CheckoutDonationPaymentRequest{} + +// CheckoutDonationPaymentRequest struct for CheckoutDonationPaymentRequest +type CheckoutDonationPaymentRequest struct { + AccountInfo *AccountInfo2 `json:"accountInfo,omitempty"` + AdditionalAmount *Amount2 `json:"additionalAmount,omitempty"` + // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount *Amount2 `json:"amount,omitempty"` + ApplicationInfo *ApplicationInfo2 `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *Address2 `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo2 `json:"browserInfo,omitempty"` + // The delay between the authorisation and scheduled auto-capture, specified in hours. + CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` + // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + Channel *string `json:"channel,omitempty"` + // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + Company *Company `json:"company,omitempty"` + // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + // Deprecated + ConversionId *string `json:"conversionId,omitempty"` + // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + CountryCode *string `json:"countryCode,omitempty"` + // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote2 `json:"dccQuote,omitempty"` + DeliveryAddress *Address2 `json:"deliveryAddress,omitempty"` + // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + DeliveryDate *time.Time `json:"deliveryDate,omitempty"` + // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` + // Donation account to which the transaction is credited. + DonationAccount string `json:"donationAccount"` + // PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. + DonationOriginalPspReference *string `json:"donationOriginalPspReference,omitempty"` + // Donation token received in the `/payments` call. + DonationToken *string `json:"donationToken,omitempty"` + // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + EnableOneClick *bool `json:"enableOneClick,omitempty"` + // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + EnablePayOut *bool `json:"enablePayOut,omitempty"` + // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + EnableRecurring *bool `json:"enableRecurring,omitempty"` + // The type of the entity the payment is processed for. + EntityType *string `json:"entityType,omitempty"` + // An integer value that is added to the normal fraud score. The value can be either positive or negative. + FraudOffset *int32 `json:"fraudOffset,omitempty"` + // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + IndustryUsage *string `json:"industryUsage,omitempty"` + Installments *Installments2 `json:"installments,omitempty"` + // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + LineItems []LineItem `json:"lineItems,omitempty"` + // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` + // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + Mcc *string `json:"mcc,omitempty"` + // The merchant account identifier, with which you want to process the transaction. + MerchantAccount *string `json:"merchantAccount,omitempty"` + // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator2 `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Order *EncryptedOrderData `json:"order,omitempty"` + // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + OrderReference *string `json:"orderReference,omitempty"` + // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + Origin *string `json:"origin,omitempty"` + PaymentMethod *CheckoutDonationPaymentRequestPaymentMethod `json:"paymentMethod,omitempty"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + // Date after which no further authorisations shall be performed. Only for 3D Secure 2. + RecurringExpiry *string `json:"recurringExpiry,omitempty"` + // Minimum number of days between authorisations. Only for 3D Secure 2. + RecurringFrequency *string `json:"recurringFrequency,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` + // Specifies the redirect method (GET or POST) when redirecting back from the issuer. + RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` + // Specifies the redirect method (GET or POST) when redirecting to the issuer. + RedirectToIssuerMethod *string `json:"redirectToIssuerMethod,omitempty"` + // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + Reference *string `json:"reference,omitempty"` + // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + ReturnUrl *string `json:"returnUrl,omitempty"` + RiskData *RiskData `json:"riskData,omitempty"` + // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + SessionValidity *string `json:"sessionValidity,omitempty"` + // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + ShopperEmail *string `json:"shopperEmail,omitempty"` + // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + ShopperIP *string `json:"shopperIP,omitempty"` + // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + // The combination of a language code and a country code to specify the language to be used in the payment. + ShopperLocale *string `json:"shopperLocale,omitempty"` + ShopperName *Name2 `json:"shopperName,omitempty"` + // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + ShopperReference *string `json:"shopperReference,omitempty"` + // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + ShopperStatement *string `json:"shopperStatement,omitempty"` + // The shopper's social security number. + SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + Splits []Split2 `json:"splits,omitempty"` + // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + Store *string `json:"store,omitempty"` + // When true and `shopperReference` is provided, the payment details will be stored. + StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` + // The shopper's telephone number. + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,omitempty"` + // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + // Deprecated + ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` + // Set to true if the payment should be routed to a trusted MID. + TrustedShopper *bool `json:"trustedShopper,omitempty"` +} + +// NewCheckoutDonationPaymentRequest instantiates a new CheckoutDonationPaymentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckoutDonationPaymentRequest(donationAccount string) *CheckoutDonationPaymentRequest { + this := CheckoutDonationPaymentRequest{} + this.DonationAccount = donationAccount + var threeDSAuthenticationOnly bool = false + this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly + return &this +} + +// NewCheckoutDonationPaymentRequestWithDefaults instantiates a new CheckoutDonationPaymentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckoutDonationPaymentRequestWithDefaults() *CheckoutDonationPaymentRequest { + this := CheckoutDonationPaymentRequest{} + var threeDSAuthenticationOnly bool = false + this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly + return &this +} + +// GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetAccountInfo() AccountInfo2 { + if o == nil || common.IsNil(o.AccountInfo) { + var ret AccountInfo2 + return ret + } + return *o.AccountInfo +} + +// GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetAccountInfoOk() (*AccountInfo2, bool) { + if o == nil || common.IsNil(o.AccountInfo) { + return nil, false + } + return o.AccountInfo, true +} + +// HasAccountInfo returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasAccountInfo() bool { + if o != nil && !common.IsNil(o.AccountInfo) { + return true + } + + return false +} + +// SetAccountInfo gets a reference to the given AccountInfo2 and assigns it to the AccountInfo field. +func (o *CheckoutDonationPaymentRequest) SetAccountInfo(v AccountInfo2) { + o.AccountInfo = &v +} + +// GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetAdditionalAmount() Amount2 { + if o == nil || common.IsNil(o.AdditionalAmount) { + var ret Amount2 + return ret + } + return *o.AdditionalAmount +} + +// GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetAdditionalAmountOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.AdditionalAmount) { + return nil, false + } + return o.AdditionalAmount, true +} + +// HasAdditionalAmount returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasAdditionalAmount() bool { + if o != nil && !common.IsNil(o.AdditionalAmount) { + return true + } + + return false +} + +// SetAdditionalAmount gets a reference to the given Amount2 and assigns it to the AdditionalAmount field. +func (o *CheckoutDonationPaymentRequest) SetAdditionalAmount(v Amount2) { + o.AdditionalAmount = &v +} + +// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetAdditionalData() map[string]string { + if o == nil || common.IsNil(o.AdditionalData) { + var ret map[string]string + return ret + } + return *o.AdditionalData +} + +// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetAdditionalDataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.AdditionalData) { + return nil, false + } + return o.AdditionalData, true +} + +// HasAdditionalData returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasAdditionalData() bool { + if o != nil && !common.IsNil(o.AdditionalData) { + return true + } + + return false +} + +// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. +func (o *CheckoutDonationPaymentRequest) SetAdditionalData(v map[string]string) { + o.AdditionalData = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetAmount() Amount2 { + if o == nil || common.IsNil(o.Amount) { + var ret Amount2 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetAmountOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given Amount2 and assigns it to the Amount field. +func (o *CheckoutDonationPaymentRequest) SetAmount(v Amount2) { + o.Amount = &v +} + +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetApplicationInfo() ApplicationInfo2 { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo2 + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo2 and assigns it to the ApplicationInfo field. +func (o *CheckoutDonationPaymentRequest) SetApplicationInfo(v ApplicationInfo2) { + o.ApplicationInfo = &v +} + +// GetAuthenticationData returns the AuthenticationData field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetAuthenticationData() AuthenticationData { + if o == nil || common.IsNil(o.AuthenticationData) { + var ret AuthenticationData + return ret + } + return *o.AuthenticationData +} + +// GetAuthenticationDataOk returns a tuple with the AuthenticationData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetAuthenticationDataOk() (*AuthenticationData, bool) { + if o == nil || common.IsNil(o.AuthenticationData) { + return nil, false + } + return o.AuthenticationData, true +} + +// HasAuthenticationData returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasAuthenticationData() bool { + if o != nil && !common.IsNil(o.AuthenticationData) { + return true + } + + return false +} + +// SetAuthenticationData gets a reference to the given AuthenticationData and assigns it to the AuthenticationData field. +func (o *CheckoutDonationPaymentRequest) SetAuthenticationData(v AuthenticationData) { + o.AuthenticationData = &v +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetBillingAddress() Address2 { + if o == nil || common.IsNil(o.BillingAddress) { + var ret Address2 + return ret + } + return *o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetBillingAddressOk() (*Address2, bool) { + if o == nil || common.IsNil(o.BillingAddress) { + return nil, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasBillingAddress() bool { + if o != nil && !common.IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given Address2 and assigns it to the BillingAddress field. +func (o *CheckoutDonationPaymentRequest) SetBillingAddress(v Address2) { + o.BillingAddress = &v +} + +// GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetBrowserInfo() BrowserInfo2 { + if o == nil || common.IsNil(o.BrowserInfo) { + var ret BrowserInfo2 + return ret + } + return *o.BrowserInfo +} + +// GetBrowserInfoOk returns a tuple with the BrowserInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetBrowserInfoOk() (*BrowserInfo2, bool) { + if o == nil || common.IsNil(o.BrowserInfo) { + return nil, false + } + return o.BrowserInfo, true +} + +// HasBrowserInfo returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasBrowserInfo() bool { + if o != nil && !common.IsNil(o.BrowserInfo) { + return true + } + + return false +} + +// SetBrowserInfo gets a reference to the given BrowserInfo2 and assigns it to the BrowserInfo field. +func (o *CheckoutDonationPaymentRequest) SetBrowserInfo(v BrowserInfo2) { + o.BrowserInfo = &v +} + +// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetCaptureDelayHours() int32 { + if o == nil || common.IsNil(o.CaptureDelayHours) { + var ret int32 + return ret + } + return *o.CaptureDelayHours +} + +// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetCaptureDelayHoursOk() (*int32, bool) { + if o == nil || common.IsNil(o.CaptureDelayHours) { + return nil, false + } + return o.CaptureDelayHours, true +} + +// HasCaptureDelayHours returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasCaptureDelayHours() bool { + if o != nil && !common.IsNil(o.CaptureDelayHours) { + return true + } + + return false +} + +// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. +func (o *CheckoutDonationPaymentRequest) SetCaptureDelayHours(v int32) { + o.CaptureDelayHours = &v +} + +// GetChannel returns the Channel field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetChannel() string { + if o == nil || common.IsNil(o.Channel) { + var ret string + return ret + } + return *o.Channel +} + +// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetChannelOk() (*string, bool) { + if o == nil || common.IsNil(o.Channel) { + return nil, false + } + return o.Channel, true +} + +// HasChannel returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasChannel() bool { + if o != nil && !common.IsNil(o.Channel) { + return true + } + + return false +} + +// SetChannel gets a reference to the given string and assigns it to the Channel field. +func (o *CheckoutDonationPaymentRequest) SetChannel(v string) { + o.Channel = &v +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *CheckoutDonationPaymentRequest) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetCompany returns the Company field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetCompany() Company { + if o == nil || common.IsNil(o.Company) { + var ret Company + return ret + } + return *o.Company +} + +// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetCompanyOk() (*Company, bool) { + if o == nil || common.IsNil(o.Company) { + return nil, false + } + return o.Company, true +} + +// HasCompany returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasCompany() bool { + if o != nil && !common.IsNil(o.Company) { + return true + } + + return false +} + +// SetCompany gets a reference to the given Company and assigns it to the Company field. +func (o *CheckoutDonationPaymentRequest) SetCompany(v Company) { + o.Company = &v +} + +// GetConversionId returns the ConversionId field value if set, zero value otherwise. +// Deprecated +func (o *CheckoutDonationPaymentRequest) GetConversionId() string { + if o == nil || common.IsNil(o.ConversionId) { + var ret string + return ret + } + return *o.ConversionId +} + +// GetConversionIdOk returns a tuple with the ConversionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CheckoutDonationPaymentRequest) GetConversionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.ConversionId) { + return nil, false + } + return o.ConversionId, true +} + +// HasConversionId returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasConversionId() bool { + if o != nil && !common.IsNil(o.ConversionId) { + return true + } + + return false +} + +// SetConversionId gets a reference to the given string and assigns it to the ConversionId field. +// Deprecated +func (o *CheckoutDonationPaymentRequest) SetConversionId(v string) { + o.ConversionId = &v +} + +// GetCountryCode returns the CountryCode field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetCountryCode() string { + if o == nil || common.IsNil(o.CountryCode) { + var ret string + return ret + } + return *o.CountryCode +} + +// GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.CountryCode) { + return nil, false + } + return o.CountryCode, true +} + +// HasCountryCode returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasCountryCode() bool { + if o != nil && !common.IsNil(o.CountryCode) { + return true + } + + return false +} + +// SetCountryCode gets a reference to the given string and assigns it to the CountryCode field. +func (o *CheckoutDonationPaymentRequest) SetCountryCode(v string) { + o.CountryCode = &v +} + +// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDateOfBirth() time.Time { + if o == nil || common.IsNil(o.DateOfBirth) { + var ret time.Time + return ret + } + return *o.DateOfBirth +} + +// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDateOfBirthOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DateOfBirth) { + return nil, false + } + return o.DateOfBirth, true +} + +// HasDateOfBirth returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDateOfBirth() bool { + if o != nil && !common.IsNil(o.DateOfBirth) { + return true + } + + return false +} + +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *CheckoutDonationPaymentRequest) SetDateOfBirth(v time.Time) { + o.DateOfBirth = &v +} + +// GetDccQuote returns the DccQuote field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDccQuote() ForexQuote2 { + if o == nil || common.IsNil(o.DccQuote) { + var ret ForexQuote2 + return ret + } + return *o.DccQuote +} + +// GetDccQuoteOk returns a tuple with the DccQuote field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDccQuoteOk() (*ForexQuote2, bool) { + if o == nil || common.IsNil(o.DccQuote) { + return nil, false + } + return o.DccQuote, true +} + +// HasDccQuote returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDccQuote() bool { + if o != nil && !common.IsNil(o.DccQuote) { + return true + } + + return false +} + +// SetDccQuote gets a reference to the given ForexQuote2 and assigns it to the DccQuote field. +func (o *CheckoutDonationPaymentRequest) SetDccQuote(v ForexQuote2) { + o.DccQuote = &v +} + +// GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDeliveryAddress() Address2 { + if o == nil || common.IsNil(o.DeliveryAddress) { + var ret Address2 + return ret + } + return *o.DeliveryAddress +} + +// GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDeliveryAddressOk() (*Address2, bool) { + if o == nil || common.IsNil(o.DeliveryAddress) { + return nil, false + } + return o.DeliveryAddress, true +} + +// HasDeliveryAddress returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDeliveryAddress() bool { + if o != nil && !common.IsNil(o.DeliveryAddress) { + return true + } + + return false +} + +// SetDeliveryAddress gets a reference to the given Address2 and assigns it to the DeliveryAddress field. +func (o *CheckoutDonationPaymentRequest) SetDeliveryAddress(v Address2) { + o.DeliveryAddress = &v +} + +// GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDeliveryDate() time.Time { + if o == nil || common.IsNil(o.DeliveryDate) { + var ret time.Time + return ret + } + return *o.DeliveryDate +} + +// GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DeliveryDate) { + return nil, false + } + return o.DeliveryDate, true +} + +// HasDeliveryDate returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDeliveryDate() bool { + if o != nil && !common.IsNil(o.DeliveryDate) { + return true + } + + return false +} + +// SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. +func (o *CheckoutDonationPaymentRequest) SetDeliveryDate(v time.Time) { + o.DeliveryDate = &v +} + +// GetDeviceFingerprint returns the DeviceFingerprint field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDeviceFingerprint() string { + if o == nil || common.IsNil(o.DeviceFingerprint) { + var ret string + return ret + } + return *o.DeviceFingerprint +} + +// GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDeviceFingerprintOk() (*string, bool) { + if o == nil || common.IsNil(o.DeviceFingerprint) { + return nil, false + } + return o.DeviceFingerprint, true +} + +// HasDeviceFingerprint returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDeviceFingerprint() bool { + if o != nil && !common.IsNil(o.DeviceFingerprint) { + return true + } + + return false +} + +// SetDeviceFingerprint gets a reference to the given string and assigns it to the DeviceFingerprint field. +func (o *CheckoutDonationPaymentRequest) SetDeviceFingerprint(v string) { + o.DeviceFingerprint = &v +} + +// GetDonationAccount returns the DonationAccount field value +func (o *CheckoutDonationPaymentRequest) GetDonationAccount() string { + if o == nil { + var ret string + return ret + } + + return o.DonationAccount +} + +// GetDonationAccountOk returns a tuple with the DonationAccount field value +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDonationAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DonationAccount, true +} + +// SetDonationAccount sets field value +func (o *CheckoutDonationPaymentRequest) SetDonationAccount(v string) { + o.DonationAccount = v +} + +// GetDonationOriginalPspReference returns the DonationOriginalPspReference field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDonationOriginalPspReference() string { + if o == nil || common.IsNil(o.DonationOriginalPspReference) { + var ret string + return ret + } + return *o.DonationOriginalPspReference +} + +// GetDonationOriginalPspReferenceOk returns a tuple with the DonationOriginalPspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDonationOriginalPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.DonationOriginalPspReference) { + return nil, false + } + return o.DonationOriginalPspReference, true +} + +// HasDonationOriginalPspReference returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDonationOriginalPspReference() bool { + if o != nil && !common.IsNil(o.DonationOriginalPspReference) { + return true + } + + return false +} + +// SetDonationOriginalPspReference gets a reference to the given string and assigns it to the DonationOriginalPspReference field. +func (o *CheckoutDonationPaymentRequest) SetDonationOriginalPspReference(v string) { + o.DonationOriginalPspReference = &v +} + +// GetDonationToken returns the DonationToken field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetDonationToken() string { + if o == nil || common.IsNil(o.DonationToken) { + var ret string + return ret + } + return *o.DonationToken +} + +// GetDonationTokenOk returns a tuple with the DonationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetDonationTokenOk() (*string, bool) { + if o == nil || common.IsNil(o.DonationToken) { + return nil, false + } + return o.DonationToken, true +} + +// HasDonationToken returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasDonationToken() bool { + if o != nil && !common.IsNil(o.DonationToken) { + return true + } + + return false +} + +// SetDonationToken gets a reference to the given string and assigns it to the DonationToken field. +func (o *CheckoutDonationPaymentRequest) SetDonationToken(v string) { + o.DonationToken = &v +} + +// GetEnableOneClick returns the EnableOneClick field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetEnableOneClick() bool { + if o == nil || common.IsNil(o.EnableOneClick) { + var ret bool + return ret + } + return *o.EnableOneClick +} + +// GetEnableOneClickOk returns a tuple with the EnableOneClick field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetEnableOneClickOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnableOneClick) { + return nil, false + } + return o.EnableOneClick, true +} + +// HasEnableOneClick returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasEnableOneClick() bool { + if o != nil && !common.IsNil(o.EnableOneClick) { + return true + } + + return false +} + +// SetEnableOneClick gets a reference to the given bool and assigns it to the EnableOneClick field. +func (o *CheckoutDonationPaymentRequest) SetEnableOneClick(v bool) { + o.EnableOneClick = &v +} + +// GetEnablePayOut returns the EnablePayOut field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetEnablePayOut() bool { + if o == nil || common.IsNil(o.EnablePayOut) { + var ret bool + return ret + } + return *o.EnablePayOut +} + +// GetEnablePayOutOk returns a tuple with the EnablePayOut field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetEnablePayOutOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnablePayOut) { + return nil, false + } + return o.EnablePayOut, true +} + +// HasEnablePayOut returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasEnablePayOut() bool { + if o != nil && !common.IsNil(o.EnablePayOut) { + return true + } + + return false +} + +// SetEnablePayOut gets a reference to the given bool and assigns it to the EnablePayOut field. +func (o *CheckoutDonationPaymentRequest) SetEnablePayOut(v bool) { + o.EnablePayOut = &v +} + +// GetEnableRecurring returns the EnableRecurring field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetEnableRecurring() bool { + if o == nil || common.IsNil(o.EnableRecurring) { + var ret bool + return ret + } + return *o.EnableRecurring +} + +// GetEnableRecurringOk returns a tuple with the EnableRecurring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetEnableRecurringOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnableRecurring) { + return nil, false + } + return o.EnableRecurring, true +} + +// HasEnableRecurring returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasEnableRecurring() bool { + if o != nil && !common.IsNil(o.EnableRecurring) { + return true + } + + return false +} + +// SetEnableRecurring gets a reference to the given bool and assigns it to the EnableRecurring field. +func (o *CheckoutDonationPaymentRequest) SetEnableRecurring(v bool) { + o.EnableRecurring = &v +} + +// GetEntityType returns the EntityType field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetEntityType() string { + if o == nil || common.IsNil(o.EntityType) { + var ret string + return ret + } + return *o.EntityType +} + +// GetEntityTypeOk returns a tuple with the EntityType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetEntityTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.EntityType) { + return nil, false + } + return o.EntityType, true +} + +// HasEntityType returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasEntityType() bool { + if o != nil && !common.IsNil(o.EntityType) { + return true + } + + return false +} + +// SetEntityType gets a reference to the given string and assigns it to the EntityType field. +func (o *CheckoutDonationPaymentRequest) SetEntityType(v string) { + o.EntityType = &v +} + +// GetFraudOffset returns the FraudOffset field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetFraudOffset() int32 { + if o == nil || common.IsNil(o.FraudOffset) { + var ret int32 + return ret + } + return *o.FraudOffset +} + +// GetFraudOffsetOk returns a tuple with the FraudOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetFraudOffsetOk() (*int32, bool) { + if o == nil || common.IsNil(o.FraudOffset) { + return nil, false + } + return o.FraudOffset, true +} + +// HasFraudOffset returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasFraudOffset() bool { + if o != nil && !common.IsNil(o.FraudOffset) { + return true + } + + return false +} + +// SetFraudOffset gets a reference to the given int32 and assigns it to the FraudOffset field. +func (o *CheckoutDonationPaymentRequest) SetFraudOffset(v int32) { + o.FraudOffset = &v +} + +// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetIndustryUsage() string { + if o == nil || common.IsNil(o.IndustryUsage) { + var ret string + return ret + } + return *o.IndustryUsage +} + +// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetIndustryUsageOk() (*string, bool) { + if o == nil || common.IsNil(o.IndustryUsage) { + return nil, false + } + return o.IndustryUsage, true +} + +// HasIndustryUsage returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasIndustryUsage() bool { + if o != nil && !common.IsNil(o.IndustryUsage) { + return true + } + + return false +} + +// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. +func (o *CheckoutDonationPaymentRequest) SetIndustryUsage(v string) { + o.IndustryUsage = &v +} + +// GetInstallments returns the Installments field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetInstallments() Installments2 { + if o == nil || common.IsNil(o.Installments) { + var ret Installments2 + return ret + } + return *o.Installments +} + +// GetInstallmentsOk returns a tuple with the Installments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetInstallmentsOk() (*Installments2, bool) { + if o == nil || common.IsNil(o.Installments) { + return nil, false + } + return o.Installments, true +} + +// HasInstallments returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasInstallments() bool { + if o != nil && !common.IsNil(o.Installments) { + return true + } + + return false +} + +// SetInstallments gets a reference to the given Installments2 and assigns it to the Installments field. +func (o *CheckoutDonationPaymentRequest) SetInstallments(v Installments2) { + o.Installments = &v +} + +// GetLineItems returns the LineItems field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetLineItems() []LineItem { + if o == nil || common.IsNil(o.LineItems) { + var ret []LineItem + return ret + } + return o.LineItems +} + +// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetLineItemsOk() ([]LineItem, bool) { + if o == nil || common.IsNil(o.LineItems) { + return nil, false + } + return o.LineItems, true +} + +// HasLineItems returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasLineItems() bool { + if o != nil && !common.IsNil(o.LineItems) { + return true + } + + return false +} + +// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. +func (o *CheckoutDonationPaymentRequest) SetLineItems(v []LineItem) { + o.LineItems = v +} + +// GetLocalizedShopperStatement returns the LocalizedShopperStatement field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetLocalizedShopperStatement() map[string]string { + if o == nil || common.IsNil(o.LocalizedShopperStatement) { + var ret map[string]string + return ret + } + return *o.LocalizedShopperStatement +} + +// GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.LocalizedShopperStatement) { + return nil, false + } + return o.LocalizedShopperStatement, true +} + +// HasLocalizedShopperStatement returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasLocalizedShopperStatement() bool { + if o != nil && !common.IsNil(o.LocalizedShopperStatement) { + return true + } + + return false +} + +// SetLocalizedShopperStatement gets a reference to the given map[string]string and assigns it to the LocalizedShopperStatement field. +func (o *CheckoutDonationPaymentRequest) SetLocalizedShopperStatement(v map[string]string) { + o.LocalizedShopperStatement = &v +} + +// GetMandate returns the Mandate field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMandate() Mandate { + if o == nil || common.IsNil(o.Mandate) { + var ret Mandate + return ret + } + return *o.Mandate +} + +// GetMandateOk returns a tuple with the Mandate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMandateOk() (*Mandate, bool) { + if o == nil || common.IsNil(o.Mandate) { + return nil, false + } + return o.Mandate, true +} + +// HasMandate returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMandate() bool { + if o != nil && !common.IsNil(o.Mandate) { + return true + } + + return false +} + +// SetMandate gets a reference to the given Mandate and assigns it to the Mandate field. +func (o *CheckoutDonationPaymentRequest) SetMandate(v Mandate) { + o.Mandate = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMcc() string { + if o == nil || common.IsNil(o.Mcc) { + var ret string + return ret + } + return *o.Mcc +} + +// GetMccOk returns a tuple with the Mcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMccOk() (*string, bool) { + if o == nil || common.IsNil(o.Mcc) { + return nil, false + } + return o.Mcc, true +} + +// HasMcc returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMcc() bool { + if o != nil && !common.IsNil(o.Mcc) { + return true + } + + return false +} + +// SetMcc gets a reference to the given string and assigns it to the Mcc field. +func (o *CheckoutDonationPaymentRequest) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantAccount returns the MerchantAccount field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMerchantAccount() string { + if o == nil || common.IsNil(o.MerchantAccount) { + var ret string + return ret + } + return *o.MerchantAccount +} + +// GetMerchantAccountOk returns a tuple with the MerchantAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMerchantAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantAccount) { + return nil, false + } + return o.MerchantAccount, true +} + +// HasMerchantAccount returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMerchantAccount() bool { + if o != nil && !common.IsNil(o.MerchantAccount) { + return true + } + + return false +} + +// SetMerchantAccount gets a reference to the given string and assigns it to the MerchantAccount field. +func (o *CheckoutDonationPaymentRequest) SetMerchantAccount(v string) { + o.MerchantAccount = &v +} + +// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMerchantOrderReference() string { + if o == nil || common.IsNil(o.MerchantOrderReference) { + var ret string + return ret + } + return *o.MerchantOrderReference +} + +// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMerchantOrderReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantOrderReference) { + return nil, false + } + return o.MerchantOrderReference, true +} + +// HasMerchantOrderReference returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMerchantOrderReference() bool { + if o != nil && !common.IsNil(o.MerchantOrderReference) { + return true + } + + return false +} + +// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. +func (o *CheckoutDonationPaymentRequest) SetMerchantOrderReference(v string) { + o.MerchantOrderReference = &v +} + +// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator2 { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { + var ret MerchantRiskIndicator2 + return ret + } + return *o.MerchantRiskIndicator +} + +// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator2, bool) { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { + return nil, false + } + return o.MerchantRiskIndicator, true +} + +// HasMerchantRiskIndicator returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMerchantRiskIndicator() bool { + if o != nil && !common.IsNil(o.MerchantRiskIndicator) { + return true + } + + return false +} + +// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator2 and assigns it to the MerchantRiskIndicator field. +func (o *CheckoutDonationPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator2) { + o.MerchantRiskIndicator = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *CheckoutDonationPaymentRequest) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetMpiData returns the MpiData field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetMpiData() ThreeDSecureData { + if o == nil || common.IsNil(o.MpiData) { + var ret ThreeDSecureData + return ret + } + return *o.MpiData +} + +// GetMpiDataOk returns a tuple with the MpiData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool) { + if o == nil || common.IsNil(o.MpiData) { + return nil, false + } + return o.MpiData, true +} + +// HasMpiData returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasMpiData() bool { + if o != nil && !common.IsNil(o.MpiData) { + return true + } + + return false +} + +// SetMpiData gets a reference to the given ThreeDSecureData and assigns it to the MpiData field. +func (o *CheckoutDonationPaymentRequest) SetMpiData(v ThreeDSecureData) { + o.MpiData = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetOrder() EncryptedOrderData { + if o == nil || common.IsNil(o.Order) { + var ret EncryptedOrderData + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetOrderOk() (*EncryptedOrderData, bool) { + if o == nil || common.IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasOrder() bool { + if o != nil && !common.IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given EncryptedOrderData and assigns it to the Order field. +func (o *CheckoutDonationPaymentRequest) SetOrder(v EncryptedOrderData) { + o.Order = &v +} + +// GetOrderReference returns the OrderReference field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetOrderReference() string { + if o == nil || common.IsNil(o.OrderReference) { + var ret string + return ret + } + return *o.OrderReference +} + +// GetOrderReferenceOk returns a tuple with the OrderReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetOrderReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.OrderReference) { + return nil, false + } + return o.OrderReference, true +} + +// HasOrderReference returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasOrderReference() bool { + if o != nil && !common.IsNil(o.OrderReference) { + return true + } + + return false +} + +// SetOrderReference gets a reference to the given string and assigns it to the OrderReference field. +func (o *CheckoutDonationPaymentRequest) SetOrderReference(v string) { + o.OrderReference = &v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetOrigin() string { + if o == nil || common.IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetOriginOk() (*string, bool) { + if o == nil || common.IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasOrigin() bool { + if o != nil && !common.IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *CheckoutDonationPaymentRequest) SetOrigin(v string) { + o.Origin = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetPaymentMethod() CheckoutDonationPaymentRequestPaymentMethod { + if o == nil || common.IsNil(o.PaymentMethod) { + var ret CheckoutDonationPaymentRequestPaymentMethod + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetPaymentMethodOk() (*CheckoutDonationPaymentRequestPaymentMethod, bool) { + if o == nil || common.IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasPaymentMethod() bool { + if o != nil && !common.IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given CheckoutDonationPaymentRequestPaymentMethod and assigns it to the PaymentMethod field. +func (o *CheckoutDonationPaymentRequest) SetPaymentMethod(v CheckoutDonationPaymentRequestPaymentMethod) { + o.PaymentMethod = &v +} + +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + var ret PlatformChargebackLogic + return ret + } + return *o.PlatformChargebackLogic +} + +// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + return nil, false + } + return o.PlatformChargebackLogic, true +} + +// HasPlatformChargebackLogic returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasPlatformChargebackLogic() bool { + if o != nil && !common.IsNil(o.PlatformChargebackLogic) { + return true + } + + return false +} + +// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. +func (o *CheckoutDonationPaymentRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + +// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRecurringExpiry() string { + if o == nil || common.IsNil(o.RecurringExpiry) { + var ret string + return ret + } + return *o.RecurringExpiry +} + +// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRecurringExpiryOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringExpiry) { + return nil, false + } + return o.RecurringExpiry, true +} + +// HasRecurringExpiry returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRecurringExpiry() bool { + if o != nil && !common.IsNil(o.RecurringExpiry) { + return true + } + + return false +} + +// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. +func (o *CheckoutDonationPaymentRequest) SetRecurringExpiry(v string) { + o.RecurringExpiry = &v +} + +// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRecurringFrequency() string { + if o == nil || common.IsNil(o.RecurringFrequency) { + var ret string + return ret + } + return *o.RecurringFrequency +} + +// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRecurringFrequencyOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringFrequency) { + return nil, false + } + return o.RecurringFrequency, true +} + +// HasRecurringFrequency returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRecurringFrequency() bool { + if o != nil && !common.IsNil(o.RecurringFrequency) { + return true + } + + return false +} + +// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. +func (o *CheckoutDonationPaymentRequest) SetRecurringFrequency(v string) { + o.RecurringFrequency = &v +} + +// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRecurringProcessingModel() string { + if o == nil || common.IsNil(o.RecurringProcessingModel) { + var ret string + return ret + } + return *o.RecurringProcessingModel +} + +// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRecurringProcessingModelOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringProcessingModel) { + return nil, false + } + return o.RecurringProcessingModel, true +} + +// HasRecurringProcessingModel returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRecurringProcessingModel() bool { + if o != nil && !common.IsNil(o.RecurringProcessingModel) { + return true + } + + return false +} + +// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. +func (o *CheckoutDonationPaymentRequest) SetRecurringProcessingModel(v string) { + o.RecurringProcessingModel = &v +} + +// GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRedirectFromIssuerMethod() string { + if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { + var ret string + return ret + } + return *o.RedirectFromIssuerMethod +} + +// GetRedirectFromIssuerMethodOk returns a tuple with the RedirectFromIssuerMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRedirectFromIssuerMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { + return nil, false + } + return o.RedirectFromIssuerMethod, true +} + +// HasRedirectFromIssuerMethod returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRedirectFromIssuerMethod() bool { + if o != nil && !common.IsNil(o.RedirectFromIssuerMethod) { + return true + } + + return false +} + +// SetRedirectFromIssuerMethod gets a reference to the given string and assigns it to the RedirectFromIssuerMethod field. +func (o *CheckoutDonationPaymentRequest) SetRedirectFromIssuerMethod(v string) { + o.RedirectFromIssuerMethod = &v +} + +// GetRedirectToIssuerMethod returns the RedirectToIssuerMethod field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRedirectToIssuerMethod() string { + if o == nil || common.IsNil(o.RedirectToIssuerMethod) { + var ret string + return ret + } + return *o.RedirectToIssuerMethod +} + +// GetRedirectToIssuerMethodOk returns a tuple with the RedirectToIssuerMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRedirectToIssuerMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.RedirectToIssuerMethod) { + return nil, false + } + return o.RedirectToIssuerMethod, true +} + +// HasRedirectToIssuerMethod returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRedirectToIssuerMethod() bool { + if o != nil && !common.IsNil(o.RedirectToIssuerMethod) { + return true + } + + return false +} + +// SetRedirectToIssuerMethod gets a reference to the given string and assigns it to the RedirectToIssuerMethod field. +func (o *CheckoutDonationPaymentRequest) SetRedirectToIssuerMethod(v string) { + o.RedirectToIssuerMethod = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *CheckoutDonationPaymentRequest) SetReference(v string) { + o.Reference = &v +} + +// GetReturnUrl returns the ReturnUrl field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetReturnUrl() string { + if o == nil || common.IsNil(o.ReturnUrl) { + var ret string + return ret + } + return *o.ReturnUrl +} + +// GetReturnUrlOk returns a tuple with the ReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetReturnUrlOk() (*string, bool) { + if o == nil || common.IsNil(o.ReturnUrl) { + return nil, false + } + return o.ReturnUrl, true +} + +// HasReturnUrl returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasReturnUrl() bool { + if o != nil && !common.IsNil(o.ReturnUrl) { + return true + } + + return false +} + +// SetReturnUrl gets a reference to the given string and assigns it to the ReturnUrl field. +func (o *CheckoutDonationPaymentRequest) SetReturnUrl(v string) { + o.ReturnUrl = &v +} + +// GetRiskData returns the RiskData field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetRiskData() RiskData { + if o == nil || common.IsNil(o.RiskData) { + var ret RiskData + return ret + } + return *o.RiskData +} + +// GetRiskDataOk returns a tuple with the RiskData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetRiskDataOk() (*RiskData, bool) { + if o == nil || common.IsNil(o.RiskData) { + return nil, false + } + return o.RiskData, true +} + +// HasRiskData returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasRiskData() bool { + if o != nil && !common.IsNil(o.RiskData) { + return true + } + + return false +} + +// SetRiskData gets a reference to the given RiskData and assigns it to the RiskData field. +func (o *CheckoutDonationPaymentRequest) SetRiskData(v RiskData) { + o.RiskData = &v +} + +// GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetSessionValidity() string { + if o == nil || common.IsNil(o.SessionValidity) { + var ret string + return ret + } + return *o.SessionValidity +} + +// GetSessionValidityOk returns a tuple with the SessionValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetSessionValidityOk() (*string, bool) { + if o == nil || common.IsNil(o.SessionValidity) { + return nil, false + } + return o.SessionValidity, true +} + +// HasSessionValidity returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasSessionValidity() bool { + if o != nil && !common.IsNil(o.SessionValidity) { + return true + } + + return false +} + +// SetSessionValidity gets a reference to the given string and assigns it to the SessionValidity field. +func (o *CheckoutDonationPaymentRequest) SetSessionValidity(v string) { + o.SessionValidity = &v +} + +// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperEmail() string { + if o == nil || common.IsNil(o.ShopperEmail) { + var ret string + return ret + } + return *o.ShopperEmail +} + +// GetShopperEmailOk returns a tuple with the ShopperEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperEmail) { + return nil, false + } + return o.ShopperEmail, true +} + +// HasShopperEmail returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperEmail() bool { + if o != nil && !common.IsNil(o.ShopperEmail) { + return true + } + + return false +} + +// SetShopperEmail gets a reference to the given string and assigns it to the ShopperEmail field. +func (o *CheckoutDonationPaymentRequest) SetShopperEmail(v string) { + o.ShopperEmail = &v +} + +// GetShopperIP returns the ShopperIP field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperIP() string { + if o == nil || common.IsNil(o.ShopperIP) { + var ret string + return ret + } + return *o.ShopperIP +} + +// GetShopperIPOk returns a tuple with the ShopperIP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperIPOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperIP) { + return nil, false + } + return o.ShopperIP, true +} + +// HasShopperIP returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperIP() bool { + if o != nil && !common.IsNil(o.ShopperIP) { + return true + } + + return false +} + +// SetShopperIP gets a reference to the given string and assigns it to the ShopperIP field. +func (o *CheckoutDonationPaymentRequest) SetShopperIP(v string) { + o.ShopperIP = &v +} + +// GetShopperInteraction returns the ShopperInteraction field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperInteraction() string { + if o == nil || common.IsNil(o.ShopperInteraction) { + var ret string + return ret + } + return *o.ShopperInteraction +} + +// GetShopperInteractionOk returns a tuple with the ShopperInteraction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperInteractionOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperInteraction) { + return nil, false + } + return o.ShopperInteraction, true +} + +// HasShopperInteraction returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperInteraction() bool { + if o != nil && !common.IsNil(o.ShopperInteraction) { + return true + } + + return false +} + +// SetShopperInteraction gets a reference to the given string and assigns it to the ShopperInteraction field. +func (o *CheckoutDonationPaymentRequest) SetShopperInteraction(v string) { + o.ShopperInteraction = &v +} + +// GetShopperLocale returns the ShopperLocale field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperLocale() string { + if o == nil || common.IsNil(o.ShopperLocale) { + var ret string + return ret + } + return *o.ShopperLocale +} + +// GetShopperLocaleOk returns a tuple with the ShopperLocale field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperLocaleOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperLocale) { + return nil, false + } + return o.ShopperLocale, true +} + +// HasShopperLocale returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperLocale() bool { + if o != nil && !common.IsNil(o.ShopperLocale) { + return true + } + + return false +} + +// SetShopperLocale gets a reference to the given string and assigns it to the ShopperLocale field. +func (o *CheckoutDonationPaymentRequest) SetShopperLocale(v string) { + o.ShopperLocale = &v +} + +// GetShopperName returns the ShopperName field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperName() Name2 { + if o == nil || common.IsNil(o.ShopperName) { + var ret Name2 + return ret + } + return *o.ShopperName +} + +// GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperNameOk() (*Name2, bool) { + if o == nil || common.IsNil(o.ShopperName) { + return nil, false + } + return o.ShopperName, true +} + +// HasShopperName returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperName() bool { + if o != nil && !common.IsNil(o.ShopperName) { + return true + } + + return false +} + +// SetShopperName gets a reference to the given Name2 and assigns it to the ShopperName field. +func (o *CheckoutDonationPaymentRequest) SetShopperName(v Name2) { + o.ShopperName = &v +} + +// GetShopperReference returns the ShopperReference field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperReference() string { + if o == nil || common.IsNil(o.ShopperReference) { + var ret string + return ret + } + return *o.ShopperReference +} + +// GetShopperReferenceOk returns a tuple with the ShopperReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperReference) { + return nil, false + } + return o.ShopperReference, true +} + +// HasShopperReference returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperReference() bool { + if o != nil && !common.IsNil(o.ShopperReference) { + return true + } + + return false +} + +// SetShopperReference gets a reference to the given string and assigns it to the ShopperReference field. +func (o *CheckoutDonationPaymentRequest) SetShopperReference(v string) { + o.ShopperReference = &v +} + +// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetShopperStatement() string { + if o == nil || common.IsNil(o.ShopperStatement) { + var ret string + return ret + } + return *o.ShopperStatement +} + +// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetShopperStatementOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperStatement) { + return nil, false + } + return o.ShopperStatement, true +} + +// HasShopperStatement returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasShopperStatement() bool { + if o != nil && !common.IsNil(o.ShopperStatement) { + return true + } + + return false +} + +// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. +func (o *CheckoutDonationPaymentRequest) SetShopperStatement(v string) { + o.ShopperStatement = &v +} + +// GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetSocialSecurityNumber() string { + if o == nil || common.IsNil(o.SocialSecurityNumber) { + var ret string + return ret + } + return *o.SocialSecurityNumber +} + +// GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetSocialSecurityNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.SocialSecurityNumber) { + return nil, false + } + return o.SocialSecurityNumber, true +} + +// HasSocialSecurityNumber returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasSocialSecurityNumber() bool { + if o != nil && !common.IsNil(o.SocialSecurityNumber) { + return true + } + + return false +} + +// SetSocialSecurityNumber gets a reference to the given string and assigns it to the SocialSecurityNumber field. +func (o *CheckoutDonationPaymentRequest) SetSocialSecurityNumber(v string) { + o.SocialSecurityNumber = &v +} + +// GetSplits returns the Splits field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetSplits() []Split2 { + if o == nil || common.IsNil(o.Splits) { + var ret []Split2 + return ret + } + return o.Splits +} + +// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetSplitsOk() ([]Split2, bool) { + if o == nil || common.IsNil(o.Splits) { + return nil, false + } + return o.Splits, true +} + +// HasSplits returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasSplits() bool { + if o != nil && !common.IsNil(o.Splits) { + return true + } + + return false +} + +// SetSplits gets a reference to the given []Split2 and assigns it to the Splits field. +func (o *CheckoutDonationPaymentRequest) SetSplits(v []Split2) { + o.Splits = v +} + +// GetStore returns the Store field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetStore() string { + if o == nil || common.IsNil(o.Store) { + var ret string + return ret + } + return *o.Store +} + +// GetStoreOk returns a tuple with the Store field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetStoreOk() (*string, bool) { + if o == nil || common.IsNil(o.Store) { + return nil, false + } + return o.Store, true +} + +// HasStore returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasStore() bool { + if o != nil && !common.IsNil(o.Store) { + return true + } + + return false +} + +// SetStore gets a reference to the given string and assigns it to the Store field. +func (o *CheckoutDonationPaymentRequest) SetStore(v string) { + o.Store = &v +} + +// GetStorePaymentMethod returns the StorePaymentMethod field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetStorePaymentMethod() bool { + if o == nil || common.IsNil(o.StorePaymentMethod) { + var ret bool + return ret + } + return *o.StorePaymentMethod +} + +// GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetStorePaymentMethodOk() (*bool, bool) { + if o == nil || common.IsNil(o.StorePaymentMethod) { + return nil, false + } + return o.StorePaymentMethod, true +} + +// HasStorePaymentMethod returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasStorePaymentMethod() bool { + if o != nil && !common.IsNil(o.StorePaymentMethod) { + return true + } + + return false +} + +// SetStorePaymentMethod gets a reference to the given bool and assigns it to the StorePaymentMethod field. +func (o *CheckoutDonationPaymentRequest) SetStorePaymentMethod(v bool) { + o.StorePaymentMethod = &v +} + +// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetTelephoneNumber() string { + if o == nil || common.IsNil(o.TelephoneNumber) { + var ret string + return ret + } + return *o.TelephoneNumber +} + +// GetTelephoneNumberOk returns a tuple with the TelephoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetTelephoneNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TelephoneNumber) { + return nil, false + } + return o.TelephoneNumber, true +} + +// HasTelephoneNumber returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasTelephoneNumber() bool { + if o != nil && !common.IsNil(o.TelephoneNumber) { + return true + } + + return false +} + +// SetTelephoneNumber gets a reference to the given string and assigns it to the TelephoneNumber field. +func (o *CheckoutDonationPaymentRequest) SetTelephoneNumber(v string) { + o.TelephoneNumber = &v +} + +// GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { + if o == nil || common.IsNil(o.ThreeDS2RequestData) { + var ret ThreeDS2RequestData2 + return ret + } + return *o.ThreeDS2RequestData +} + +// GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { + if o == nil || common.IsNil(o.ThreeDS2RequestData) { + return nil, false + } + return o.ThreeDS2RequestData, true +} + +// HasThreeDS2RequestData returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasThreeDS2RequestData() bool { + if o != nil && !common.IsNil(o.ThreeDS2RequestData) { + return true + } + + return false +} + +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. +func (o *CheckoutDonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { + o.ThreeDS2RequestData = &v +} + +// GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field value if set, zero value otherwise. +// Deprecated +func (o *CheckoutDonationPaymentRequest) GetThreeDSAuthenticationOnly() bool { + if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { + var ret bool + return ret + } + return *o.ThreeDSAuthenticationOnly +} + +// GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CheckoutDonationPaymentRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool) { + if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { + return nil, false + } + return o.ThreeDSAuthenticationOnly, true +} + +// HasThreeDSAuthenticationOnly returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasThreeDSAuthenticationOnly() bool { + if o != nil && !common.IsNil(o.ThreeDSAuthenticationOnly) { + return true + } + + return false +} + +// SetThreeDSAuthenticationOnly gets a reference to the given bool and assigns it to the ThreeDSAuthenticationOnly field. +// Deprecated +func (o *CheckoutDonationPaymentRequest) SetThreeDSAuthenticationOnly(v bool) { + o.ThreeDSAuthenticationOnly = &v +} + +// GetTrustedShopper returns the TrustedShopper field value if set, zero value otherwise. +func (o *CheckoutDonationPaymentRequest) GetTrustedShopper() bool { + if o == nil || common.IsNil(o.TrustedShopper) { + var ret bool + return ret + } + return *o.TrustedShopper +} + +// GetTrustedShopperOk returns a tuple with the TrustedShopper field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutDonationPaymentRequest) GetTrustedShopperOk() (*bool, bool) { + if o == nil || common.IsNil(o.TrustedShopper) { + return nil, false + } + return o.TrustedShopper, true +} + +// HasTrustedShopper returns a boolean if a field has been set. +func (o *CheckoutDonationPaymentRequest) HasTrustedShopper() bool { + if o != nil && !common.IsNil(o.TrustedShopper) { + return true + } + + return false +} + +// SetTrustedShopper gets a reference to the given bool and assigns it to the TrustedShopper field. +func (o *CheckoutDonationPaymentRequest) SetTrustedShopper(v bool) { + o.TrustedShopper = &v +} + +func (o CheckoutDonationPaymentRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CheckoutDonationPaymentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountInfo) { + toSerialize["accountInfo"] = o.AccountInfo + } + if !common.IsNil(o.AdditionalAmount) { + toSerialize["additionalAmount"] = o.AdditionalAmount + } + if !common.IsNil(o.AdditionalData) { + toSerialize["additionalData"] = o.AdditionalData + } + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } + if !common.IsNil(o.AuthenticationData) { + toSerialize["authenticationData"] = o.AuthenticationData + } + if !common.IsNil(o.BillingAddress) { + toSerialize["billingAddress"] = o.BillingAddress + } + if !common.IsNil(o.BrowserInfo) { + toSerialize["browserInfo"] = o.BrowserInfo + } + if !common.IsNil(o.CaptureDelayHours) { + toSerialize["captureDelayHours"] = o.CaptureDelayHours + } + if !common.IsNil(o.Channel) { + toSerialize["channel"] = o.Channel + } + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.Company) { + toSerialize["company"] = o.Company + } + if !common.IsNil(o.ConversionId) { + toSerialize["conversionId"] = o.ConversionId + } + if !common.IsNil(o.CountryCode) { + toSerialize["countryCode"] = o.CountryCode + } + if !common.IsNil(o.DateOfBirth) { + toSerialize["dateOfBirth"] = o.DateOfBirth + } + if !common.IsNil(o.DccQuote) { + toSerialize["dccQuote"] = o.DccQuote + } + if !common.IsNil(o.DeliveryAddress) { + toSerialize["deliveryAddress"] = o.DeliveryAddress + } + if !common.IsNil(o.DeliveryDate) { + toSerialize["deliveryDate"] = o.DeliveryDate + } + if !common.IsNil(o.DeviceFingerprint) { + toSerialize["deviceFingerprint"] = o.DeviceFingerprint + } + toSerialize["donationAccount"] = o.DonationAccount + if !common.IsNil(o.DonationOriginalPspReference) { + toSerialize["donationOriginalPspReference"] = o.DonationOriginalPspReference + } + if !common.IsNil(o.DonationToken) { + toSerialize["donationToken"] = o.DonationToken + } + if !common.IsNil(o.EnableOneClick) { + toSerialize["enableOneClick"] = o.EnableOneClick + } + if !common.IsNil(o.EnablePayOut) { + toSerialize["enablePayOut"] = o.EnablePayOut + } + if !common.IsNil(o.EnableRecurring) { + toSerialize["enableRecurring"] = o.EnableRecurring + } + if !common.IsNil(o.EntityType) { + toSerialize["entityType"] = o.EntityType + } + if !common.IsNil(o.FraudOffset) { + toSerialize["fraudOffset"] = o.FraudOffset + } + if !common.IsNil(o.IndustryUsage) { + toSerialize["industryUsage"] = o.IndustryUsage + } + if !common.IsNil(o.Installments) { + toSerialize["installments"] = o.Installments + } + if !common.IsNil(o.LineItems) { + toSerialize["lineItems"] = o.LineItems + } + if !common.IsNil(o.LocalizedShopperStatement) { + toSerialize["localizedShopperStatement"] = o.LocalizedShopperStatement + } + if !common.IsNil(o.Mandate) { + toSerialize["mandate"] = o.Mandate + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantAccount) { + toSerialize["merchantAccount"] = o.MerchantAccount + } + if !common.IsNil(o.MerchantOrderReference) { + toSerialize["merchantOrderReference"] = o.MerchantOrderReference + } + if !common.IsNil(o.MerchantRiskIndicator) { + toSerialize["merchantRiskIndicator"] = o.MerchantRiskIndicator + } + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !common.IsNil(o.MpiData) { + toSerialize["mpiData"] = o.MpiData + } + if !common.IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !common.IsNil(o.OrderReference) { + toSerialize["orderReference"] = o.OrderReference + } + if !common.IsNil(o.Origin) { + toSerialize["origin"] = o.Origin + } + if !common.IsNil(o.PaymentMethod) { + toSerialize["paymentMethod"] = o.PaymentMethod + } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } + if !common.IsNil(o.RecurringExpiry) { + toSerialize["recurringExpiry"] = o.RecurringExpiry + } + if !common.IsNil(o.RecurringFrequency) { + toSerialize["recurringFrequency"] = o.RecurringFrequency + } + if !common.IsNil(o.RecurringProcessingModel) { + toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel + } + if !common.IsNil(o.RedirectFromIssuerMethod) { + toSerialize["redirectFromIssuerMethod"] = o.RedirectFromIssuerMethod + } + if !common.IsNil(o.RedirectToIssuerMethod) { + toSerialize["redirectToIssuerMethod"] = o.RedirectToIssuerMethod + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.ReturnUrl) { + toSerialize["returnUrl"] = o.ReturnUrl + } + if !common.IsNil(o.RiskData) { + toSerialize["riskData"] = o.RiskData + } + if !common.IsNil(o.SessionValidity) { + toSerialize["sessionValidity"] = o.SessionValidity + } + if !common.IsNil(o.ShopperEmail) { + toSerialize["shopperEmail"] = o.ShopperEmail + } + if !common.IsNil(o.ShopperIP) { + toSerialize["shopperIP"] = o.ShopperIP + } + if !common.IsNil(o.ShopperInteraction) { + toSerialize["shopperInteraction"] = o.ShopperInteraction + } + if !common.IsNil(o.ShopperLocale) { + toSerialize["shopperLocale"] = o.ShopperLocale + } + if !common.IsNil(o.ShopperName) { + toSerialize["shopperName"] = o.ShopperName + } + if !common.IsNil(o.ShopperReference) { + toSerialize["shopperReference"] = o.ShopperReference + } + if !common.IsNil(o.ShopperStatement) { + toSerialize["shopperStatement"] = o.ShopperStatement + } + if !common.IsNil(o.SocialSecurityNumber) { + toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber + } + if !common.IsNil(o.Splits) { + toSerialize["splits"] = o.Splits + } + if !common.IsNil(o.Store) { + toSerialize["store"] = o.Store + } + if !common.IsNil(o.StorePaymentMethod) { + toSerialize["storePaymentMethod"] = o.StorePaymentMethod + } + if !common.IsNil(o.TelephoneNumber) { + toSerialize["telephoneNumber"] = o.TelephoneNumber + } + if !common.IsNil(o.ThreeDS2RequestData) { + toSerialize["threeDS2RequestData"] = o.ThreeDS2RequestData + } + if !common.IsNil(o.ThreeDSAuthenticationOnly) { + toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly + } + if !common.IsNil(o.TrustedShopper) { + toSerialize["trustedShopper"] = o.TrustedShopper + } + return toSerialize, nil +} + +type NullableCheckoutDonationPaymentRequest struct { + value *CheckoutDonationPaymentRequest + isSet bool +} + +func (v NullableCheckoutDonationPaymentRequest) Get() *CheckoutDonationPaymentRequest { + return v.value +} + +func (v *NullableCheckoutDonationPaymentRequest) Set(val *CheckoutDonationPaymentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCheckoutDonationPaymentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckoutDonationPaymentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckoutDonationPaymentRequest(val *CheckoutDonationPaymentRequest) *NullableCheckoutDonationPaymentRequest { + return &NullableCheckoutDonationPaymentRequest{value: val, isSet: true} +} + +func (v NullableCheckoutDonationPaymentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckoutDonationPaymentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CheckoutDonationPaymentRequest) isValidChannel() bool { + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false +} +func (o *CheckoutDonationPaymentRequest) isValidEntityType() bool { + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false +} +func (o *CheckoutDonationPaymentRequest) isValidIndustryUsage() bool { + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false +} +func (o *CheckoutDonationPaymentRequest) isValidRecurringProcessingModel() bool { + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false +} +func (o *CheckoutDonationPaymentRequest) isValidShopperInteraction() bool { + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_checkout_donation_payment_request_payment_method.go b/src/checkout/model_checkout_donation_payment_request_payment_method.go new file mode 100644 index 000000000..82cca7005 --- /dev/null +++ b/src/checkout/model_checkout_donation_payment_request_payment_method.go @@ -0,0 +1,1257 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "fmt" +) + +// CheckoutDonationPaymentRequestPaymentMethod - The type and required details of a payment method to use. +type CheckoutDonationPaymentRequestPaymentMethod struct { + AchDetails *AchDetails + AfterpayDetails *AfterpayDetails + AmazonPayDetails *AmazonPayDetails + AndroidPayDetails *AndroidPayDetails + ApplePayDetails *ApplePayDetails + BacsDirectDebitDetails *BacsDirectDebitDetails + BillDeskDetails *BillDeskDetails + BlikDetails *BlikDetails + CardDetails *CardDetails + CellulantDetails *CellulantDetails + DokuDetails *DokuDetails + DotpayDetails *DotpayDetails + DragonpayDetails *DragonpayDetails + EcontextVoucherDetails *EcontextVoucherDetails + GenericIssuerPaymentMethodDetails *GenericIssuerPaymentMethodDetails + GiropayDetails *GiropayDetails + GooglePayDetails *GooglePayDetails + IdealDetails *IdealDetails + KlarnaDetails *KlarnaDetails + MasterpassDetails *MasterpassDetails + MbwayDetails *MbwayDetails + MobilePayDetails *MobilePayDetails + MolPayDetails *MolPayDetails + OpenInvoiceDetails *OpenInvoiceDetails + PayPalDetails *PayPalDetails + PayUUpiDetails *PayUUpiDetails + PayWithGoogleDetails *PayWithGoogleDetails + PaymentDetails *PaymentDetails + RatepayDetails *RatepayDetails + SamsungPayDetails *SamsungPayDetails + SepaDirectDebitDetails *SepaDirectDebitDetails + StoredPaymentMethodDetails *StoredPaymentMethodDetails + UpiCollectDetails *UpiCollectDetails + UpiIntentDetails *UpiIntentDetails + VippsDetails *VippsDetails + VisaCheckoutDetails *VisaCheckoutDetails + WeChatPayDetails *WeChatPayDetails + WeChatPayMiniProgramDetails *WeChatPayMiniProgramDetails + ZipDetails *ZipDetails +} + +// AchDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns AchDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func AchDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *AchDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + AchDetails: v, + } +} + +// AfterpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns AfterpayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func AfterpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *AfterpayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + AfterpayDetails: v, + } +} + +// AmazonPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns AmazonPayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func AmazonPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *AmazonPayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + AmazonPayDetails: v, + } +} + +// AndroidPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns AndroidPayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func AndroidPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *AndroidPayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + AndroidPayDetails: v, + } +} + +// ApplePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns ApplePayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func ApplePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *ApplePayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + ApplePayDetails: v, + } +} + +// BacsDirectDebitDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns BacsDirectDebitDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func BacsDirectDebitDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *BacsDirectDebitDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + BacsDirectDebitDetails: v, + } +} + +// BillDeskDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns BillDeskDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func BillDeskDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *BillDeskDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + BillDeskDetails: v, + } +} + +// BlikDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns BlikDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func BlikDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *BlikDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + BlikDetails: v, + } +} + +// CardDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns CardDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func CardDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *CardDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + CardDetails: v, + } +} + +// CellulantDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns CellulantDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func CellulantDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *CellulantDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + CellulantDetails: v, + } +} + +// DokuDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns DokuDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func DokuDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *DokuDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + DokuDetails: v, + } +} + +// DotpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns DotpayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func DotpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *DotpayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + DotpayDetails: v, + } +} + +// DragonpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns DragonpayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func DragonpayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *DragonpayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + DragonpayDetails: v, + } +} + +// EcontextVoucherDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns EcontextVoucherDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func EcontextVoucherDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *EcontextVoucherDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + EcontextVoucherDetails: v, + } +} + +// GenericIssuerPaymentMethodDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns GenericIssuerPaymentMethodDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func GenericIssuerPaymentMethodDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *GenericIssuerPaymentMethodDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + GenericIssuerPaymentMethodDetails: v, + } +} + +// GiropayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns GiropayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func GiropayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *GiropayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + GiropayDetails: v, + } +} + +// GooglePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns GooglePayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func GooglePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *GooglePayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + GooglePayDetails: v, + } +} + +// IdealDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns IdealDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func IdealDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *IdealDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + IdealDetails: v, + } +} + +// KlarnaDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns KlarnaDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func KlarnaDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *KlarnaDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + KlarnaDetails: v, + } +} + +// MasterpassDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns MasterpassDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func MasterpassDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *MasterpassDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + MasterpassDetails: v, + } +} + +// MbwayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns MbwayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func MbwayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *MbwayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + MbwayDetails: v, + } +} + +// MobilePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns MobilePayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func MobilePayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *MobilePayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + MobilePayDetails: v, + } +} + +// MolPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns MolPayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func MolPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *MolPayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + MolPayDetails: v, + } +} + +// OpenInvoiceDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns OpenInvoiceDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func OpenInvoiceDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *OpenInvoiceDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + OpenInvoiceDetails: v, + } +} + +// PayPalDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns PayPalDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func PayPalDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *PayPalDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + PayPalDetails: v, + } +} + +// PayUUpiDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns PayUUpiDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func PayUUpiDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *PayUUpiDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + PayUUpiDetails: v, + } +} + +// PayWithGoogleDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func PayWithGoogleDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *PayWithGoogleDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + PayWithGoogleDetails: v, + } +} + +// PaymentDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns PaymentDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func PaymentDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *PaymentDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + PaymentDetails: v, + } +} + +// RatepayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns RatepayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func RatepayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *RatepayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + RatepayDetails: v, + } +} + +// SamsungPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns SamsungPayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func SamsungPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *SamsungPayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + SamsungPayDetails: v, + } +} + +// SepaDirectDebitDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns SepaDirectDebitDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func SepaDirectDebitDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *SepaDirectDebitDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + SepaDirectDebitDetails: v, + } +} + +// StoredPaymentMethodDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns StoredPaymentMethodDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func StoredPaymentMethodDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *StoredPaymentMethodDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + StoredPaymentMethodDetails: v, + } +} + +// UpiCollectDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns UpiCollectDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func UpiCollectDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *UpiCollectDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + UpiCollectDetails: v, + } +} + +// UpiIntentDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns UpiIntentDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func UpiIntentDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *UpiIntentDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + UpiIntentDetails: v, + } +} + +// VippsDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns VippsDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func VippsDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *VippsDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + VippsDetails: v, + } +} + +// VisaCheckoutDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns VisaCheckoutDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func VisaCheckoutDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *VisaCheckoutDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + VisaCheckoutDetails: v, + } +} + +// WeChatPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func WeChatPayDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *WeChatPayDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + WeChatPayDetails: v, + } +} + +// WeChatPayMiniProgramDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayMiniProgramDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func WeChatPayMiniProgramDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *WeChatPayMiniProgramDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + WeChatPayMiniProgramDetails: v, + } +} + +// ZipDetailsAsCheckoutDonationPaymentRequestPaymentMethod is a convenience function that returns ZipDetails wrapped in CheckoutDonationPaymentRequestPaymentMethod +func ZipDetailsAsCheckoutDonationPaymentRequestPaymentMethod(v *ZipDetails) CheckoutDonationPaymentRequestPaymentMethod { + return CheckoutDonationPaymentRequestPaymentMethod{ + ZipDetails: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CheckoutDonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AchDetails + err = json.Unmarshal(data, &dst.AchDetails) + if err == nil { + jsonAchDetails, _ := json.Marshal(dst.AchDetails) + if string(jsonAchDetails) == "{}" || !dst.AchDetails.isValidType() { // empty struct + dst.AchDetails = nil + } else { + match++ + } + } else { + dst.AchDetails = nil + } + + // try to unmarshal data into AfterpayDetails + err = json.Unmarshal(data, &dst.AfterpayDetails) + if err == nil { + jsonAfterpayDetails, _ := json.Marshal(dst.AfterpayDetails) + if string(jsonAfterpayDetails) == "{}" || !dst.AfterpayDetails.isValidType() { // empty struct + dst.AfterpayDetails = nil + } else { + match++ + } + } else { + dst.AfterpayDetails = nil + } + + // try to unmarshal data into AmazonPayDetails + err = json.Unmarshal(data, &dst.AmazonPayDetails) + if err == nil { + jsonAmazonPayDetails, _ := json.Marshal(dst.AmazonPayDetails) + if string(jsonAmazonPayDetails) == "{}" || !dst.AmazonPayDetails.isValidType() { // empty struct + dst.AmazonPayDetails = nil + } else { + match++ + } + } else { + dst.AmazonPayDetails = nil + } + + // try to unmarshal data into AndroidPayDetails + err = json.Unmarshal(data, &dst.AndroidPayDetails) + if err == nil { + jsonAndroidPayDetails, _ := json.Marshal(dst.AndroidPayDetails) + if string(jsonAndroidPayDetails) == "{}" || !dst.AndroidPayDetails.isValidType() { // empty struct + dst.AndroidPayDetails = nil + } else { + match++ + } + } else { + dst.AndroidPayDetails = nil + } + + // try to unmarshal data into ApplePayDetails + err = json.Unmarshal(data, &dst.ApplePayDetails) + if err == nil { + jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) + if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct + dst.ApplePayDetails = nil + } else { + match++ + } + } else { + dst.ApplePayDetails = nil + } + + // try to unmarshal data into BacsDirectDebitDetails + err = json.Unmarshal(data, &dst.BacsDirectDebitDetails) + if err == nil { + jsonBacsDirectDebitDetails, _ := json.Marshal(dst.BacsDirectDebitDetails) + if string(jsonBacsDirectDebitDetails) == "{}" || !dst.BacsDirectDebitDetails.isValidType() { // empty struct + dst.BacsDirectDebitDetails = nil + } else { + match++ + } + } else { + dst.BacsDirectDebitDetails = nil + } + + // try to unmarshal data into BillDeskDetails + err = json.Unmarshal(data, &dst.BillDeskDetails) + if err == nil { + jsonBillDeskDetails, _ := json.Marshal(dst.BillDeskDetails) + if string(jsonBillDeskDetails) == "{}" || !dst.BillDeskDetails.isValidType() { // empty struct + dst.BillDeskDetails = nil + } else { + match++ + } + } else { + dst.BillDeskDetails = nil + } + + // try to unmarshal data into BlikDetails + err = json.Unmarshal(data, &dst.BlikDetails) + if err == nil { + jsonBlikDetails, _ := json.Marshal(dst.BlikDetails) + if string(jsonBlikDetails) == "{}" || !dst.BlikDetails.isValidType() { // empty struct + dst.BlikDetails = nil + } else { + match++ + } + } else { + dst.BlikDetails = nil + } + + // try to unmarshal data into CardDetails + err = json.Unmarshal(data, &dst.CardDetails) + if err == nil { + jsonCardDetails, _ := json.Marshal(dst.CardDetails) + if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct + dst.CardDetails = nil + } else { + match++ + } + } else { + dst.CardDetails = nil + } + + // try to unmarshal data into CellulantDetails + err = json.Unmarshal(data, &dst.CellulantDetails) + if err == nil { + jsonCellulantDetails, _ := json.Marshal(dst.CellulantDetails) + if string(jsonCellulantDetails) == "{}" || !dst.CellulantDetails.isValidType() { // empty struct + dst.CellulantDetails = nil + } else { + match++ + } + } else { + dst.CellulantDetails = nil + } + + // try to unmarshal data into DokuDetails + err = json.Unmarshal(data, &dst.DokuDetails) + if err == nil { + jsonDokuDetails, _ := json.Marshal(dst.DokuDetails) + if string(jsonDokuDetails) == "{}" || !dst.DokuDetails.isValidType() { // empty struct + dst.DokuDetails = nil + } else { + match++ + } + } else { + dst.DokuDetails = nil + } + + // try to unmarshal data into DotpayDetails + err = json.Unmarshal(data, &dst.DotpayDetails) + if err == nil { + jsonDotpayDetails, _ := json.Marshal(dst.DotpayDetails) + if string(jsonDotpayDetails) == "{}" || !dst.DotpayDetails.isValidType() { // empty struct + dst.DotpayDetails = nil + } else { + match++ + } + } else { + dst.DotpayDetails = nil + } + + // try to unmarshal data into DragonpayDetails + err = json.Unmarshal(data, &dst.DragonpayDetails) + if err == nil { + jsonDragonpayDetails, _ := json.Marshal(dst.DragonpayDetails) + if string(jsonDragonpayDetails) == "{}" || !dst.DragonpayDetails.isValidType() { // empty struct + dst.DragonpayDetails = nil + } else { + match++ + } + } else { + dst.DragonpayDetails = nil + } + + // try to unmarshal data into EcontextVoucherDetails + err = json.Unmarshal(data, &dst.EcontextVoucherDetails) + if err == nil { + jsonEcontextVoucherDetails, _ := json.Marshal(dst.EcontextVoucherDetails) + if string(jsonEcontextVoucherDetails) == "{}" || !dst.EcontextVoucherDetails.isValidType() { // empty struct + dst.EcontextVoucherDetails = nil + } else { + match++ + } + } else { + dst.EcontextVoucherDetails = nil + } + + // try to unmarshal data into GenericIssuerPaymentMethodDetails + err = json.Unmarshal(data, &dst.GenericIssuerPaymentMethodDetails) + if err == nil { + jsonGenericIssuerPaymentMethodDetails, _ := json.Marshal(dst.GenericIssuerPaymentMethodDetails) + if string(jsonGenericIssuerPaymentMethodDetails) == "{}" || !dst.GenericIssuerPaymentMethodDetails.isValidType() { // empty struct + dst.GenericIssuerPaymentMethodDetails = nil + } else { + match++ + } + } else { + dst.GenericIssuerPaymentMethodDetails = nil + } + + // try to unmarshal data into GiropayDetails + err = json.Unmarshal(data, &dst.GiropayDetails) + if err == nil { + jsonGiropayDetails, _ := json.Marshal(dst.GiropayDetails) + if string(jsonGiropayDetails) == "{}" || !dst.GiropayDetails.isValidType() { // empty struct + dst.GiropayDetails = nil + } else { + match++ + } + } else { + dst.GiropayDetails = nil + } + + // try to unmarshal data into GooglePayDetails + err = json.Unmarshal(data, &dst.GooglePayDetails) + if err == nil { + jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) + if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct + dst.GooglePayDetails = nil + } else { + match++ + } + } else { + dst.GooglePayDetails = nil + } + + // try to unmarshal data into IdealDetails + err = json.Unmarshal(data, &dst.IdealDetails) + if err == nil { + jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) + if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct + dst.IdealDetails = nil + } else { + match++ + } + } else { + dst.IdealDetails = nil + } + + // try to unmarshal data into KlarnaDetails + err = json.Unmarshal(data, &dst.KlarnaDetails) + if err == nil { + jsonKlarnaDetails, _ := json.Marshal(dst.KlarnaDetails) + if string(jsonKlarnaDetails) == "{}" || !dst.KlarnaDetails.isValidType() { // empty struct + dst.KlarnaDetails = nil + } else { + match++ + } + } else { + dst.KlarnaDetails = nil + } + + // try to unmarshal data into MasterpassDetails + err = json.Unmarshal(data, &dst.MasterpassDetails) + if err == nil { + jsonMasterpassDetails, _ := json.Marshal(dst.MasterpassDetails) + if string(jsonMasterpassDetails) == "{}" || !dst.MasterpassDetails.isValidType() { // empty struct + dst.MasterpassDetails = nil + } else { + match++ + } + } else { + dst.MasterpassDetails = nil + } + + // try to unmarshal data into MbwayDetails + err = json.Unmarshal(data, &dst.MbwayDetails) + if err == nil { + jsonMbwayDetails, _ := json.Marshal(dst.MbwayDetails) + if string(jsonMbwayDetails) == "{}" || !dst.MbwayDetails.isValidType() { // empty struct + dst.MbwayDetails = nil + } else { + match++ + } + } else { + dst.MbwayDetails = nil + } + + // try to unmarshal data into MobilePayDetails + err = json.Unmarshal(data, &dst.MobilePayDetails) + if err == nil { + jsonMobilePayDetails, _ := json.Marshal(dst.MobilePayDetails) + if string(jsonMobilePayDetails) == "{}" || !dst.MobilePayDetails.isValidType() { // empty struct + dst.MobilePayDetails = nil + } else { + match++ + } + } else { + dst.MobilePayDetails = nil + } + + // try to unmarshal data into MolPayDetails + err = json.Unmarshal(data, &dst.MolPayDetails) + if err == nil { + jsonMolPayDetails, _ := json.Marshal(dst.MolPayDetails) + if string(jsonMolPayDetails) == "{}" || !dst.MolPayDetails.isValidType() { // empty struct + dst.MolPayDetails = nil + } else { + match++ + } + } else { + dst.MolPayDetails = nil + } + + // try to unmarshal data into OpenInvoiceDetails + err = json.Unmarshal(data, &dst.OpenInvoiceDetails) + if err == nil { + jsonOpenInvoiceDetails, _ := json.Marshal(dst.OpenInvoiceDetails) + if string(jsonOpenInvoiceDetails) == "{}" || !dst.OpenInvoiceDetails.isValidType() { // empty struct + dst.OpenInvoiceDetails = nil + } else { + match++ + } + } else { + dst.OpenInvoiceDetails = nil + } + + // try to unmarshal data into PayPalDetails + err = json.Unmarshal(data, &dst.PayPalDetails) + if err == nil { + jsonPayPalDetails, _ := json.Marshal(dst.PayPalDetails) + if string(jsonPayPalDetails) == "{}" || !dst.PayPalDetails.isValidType() { // empty struct + dst.PayPalDetails = nil + } else { + match++ + } + } else { + dst.PayPalDetails = nil + } + + // try to unmarshal data into PayUUpiDetails + err = json.Unmarshal(data, &dst.PayUUpiDetails) + if err == nil { + jsonPayUUpiDetails, _ := json.Marshal(dst.PayUUpiDetails) + if string(jsonPayUUpiDetails) == "{}" || !dst.PayUUpiDetails.isValidType() { // empty struct + dst.PayUUpiDetails = nil + } else { + match++ + } + } else { + dst.PayUUpiDetails = nil + } + + // try to unmarshal data into PayWithGoogleDetails + err = json.Unmarshal(data, &dst.PayWithGoogleDetails) + if err == nil { + jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) + if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct + dst.PayWithGoogleDetails = nil + } else { + match++ + } + } else { + dst.PayWithGoogleDetails = nil + } + + // try to unmarshal data into PaymentDetails + err = json.Unmarshal(data, &dst.PaymentDetails) + if err == nil { + jsonPaymentDetails, _ := json.Marshal(dst.PaymentDetails) + if string(jsonPaymentDetails) == "{}" || !dst.PaymentDetails.isValidType() { // empty struct + dst.PaymentDetails = nil + } else { + match++ + } + } else { + dst.PaymentDetails = nil + } + + // try to unmarshal data into RatepayDetails + err = json.Unmarshal(data, &dst.RatepayDetails) + if err == nil { + jsonRatepayDetails, _ := json.Marshal(dst.RatepayDetails) + if string(jsonRatepayDetails) == "{}" || !dst.RatepayDetails.isValidType() { // empty struct + dst.RatepayDetails = nil + } else { + match++ + } + } else { + dst.RatepayDetails = nil + } + + // try to unmarshal data into SamsungPayDetails + err = json.Unmarshal(data, &dst.SamsungPayDetails) + if err == nil { + jsonSamsungPayDetails, _ := json.Marshal(dst.SamsungPayDetails) + if string(jsonSamsungPayDetails) == "{}" || !dst.SamsungPayDetails.isValidType() { // empty struct + dst.SamsungPayDetails = nil + } else { + match++ + } + } else { + dst.SamsungPayDetails = nil + } + + // try to unmarshal data into SepaDirectDebitDetails + err = json.Unmarshal(data, &dst.SepaDirectDebitDetails) + if err == nil { + jsonSepaDirectDebitDetails, _ := json.Marshal(dst.SepaDirectDebitDetails) + if string(jsonSepaDirectDebitDetails) == "{}" || !dst.SepaDirectDebitDetails.isValidType() { // empty struct + dst.SepaDirectDebitDetails = nil + } else { + match++ + } + } else { + dst.SepaDirectDebitDetails = nil + } + + // try to unmarshal data into StoredPaymentMethodDetails + err = json.Unmarshal(data, &dst.StoredPaymentMethodDetails) + if err == nil { + jsonStoredPaymentMethodDetails, _ := json.Marshal(dst.StoredPaymentMethodDetails) + if string(jsonStoredPaymentMethodDetails) == "{}" || !dst.StoredPaymentMethodDetails.isValidType() { // empty struct + dst.StoredPaymentMethodDetails = nil + } else { + match++ + } + } else { + dst.StoredPaymentMethodDetails = nil + } + + // try to unmarshal data into UpiCollectDetails + err = json.Unmarshal(data, &dst.UpiCollectDetails) + if err == nil { + jsonUpiCollectDetails, _ := json.Marshal(dst.UpiCollectDetails) + if string(jsonUpiCollectDetails) == "{}" || !dst.UpiCollectDetails.isValidType() { // empty struct + dst.UpiCollectDetails = nil + } else { + match++ + } + } else { + dst.UpiCollectDetails = nil + } + + // try to unmarshal data into UpiIntentDetails + err = json.Unmarshal(data, &dst.UpiIntentDetails) + if err == nil { + jsonUpiIntentDetails, _ := json.Marshal(dst.UpiIntentDetails) + if string(jsonUpiIntentDetails) == "{}" || !dst.UpiIntentDetails.isValidType() { // empty struct + dst.UpiIntentDetails = nil + } else { + match++ + } + } else { + dst.UpiIntentDetails = nil + } + + // try to unmarshal data into VippsDetails + err = json.Unmarshal(data, &dst.VippsDetails) + if err == nil { + jsonVippsDetails, _ := json.Marshal(dst.VippsDetails) + if string(jsonVippsDetails) == "{}" || !dst.VippsDetails.isValidType() { // empty struct + dst.VippsDetails = nil + } else { + match++ + } + } else { + dst.VippsDetails = nil + } + + // try to unmarshal data into VisaCheckoutDetails + err = json.Unmarshal(data, &dst.VisaCheckoutDetails) + if err == nil { + jsonVisaCheckoutDetails, _ := json.Marshal(dst.VisaCheckoutDetails) + if string(jsonVisaCheckoutDetails) == "{}" || !dst.VisaCheckoutDetails.isValidType() { // empty struct + dst.VisaCheckoutDetails = nil + } else { + match++ + } + } else { + dst.VisaCheckoutDetails = nil + } + + // try to unmarshal data into WeChatPayDetails + err = json.Unmarshal(data, &dst.WeChatPayDetails) + if err == nil { + jsonWeChatPayDetails, _ := json.Marshal(dst.WeChatPayDetails) + if string(jsonWeChatPayDetails) == "{}" || !dst.WeChatPayDetails.isValidType() { // empty struct + dst.WeChatPayDetails = nil + } else { + match++ + } + } else { + dst.WeChatPayDetails = nil + } + + // try to unmarshal data into WeChatPayMiniProgramDetails + err = json.Unmarshal(data, &dst.WeChatPayMiniProgramDetails) + if err == nil { + jsonWeChatPayMiniProgramDetails, _ := json.Marshal(dst.WeChatPayMiniProgramDetails) + if string(jsonWeChatPayMiniProgramDetails) == "{}" || !dst.WeChatPayMiniProgramDetails.isValidType() { // empty struct + dst.WeChatPayMiniProgramDetails = nil + } else { + match++ + } + } else { + dst.WeChatPayMiniProgramDetails = nil + } + + // try to unmarshal data into ZipDetails + err = json.Unmarshal(data, &dst.ZipDetails) + if err == nil { + jsonZipDetails, _ := json.Marshal(dst.ZipDetails) + if string(jsonZipDetails) == "{}" || !dst.ZipDetails.isValidType() { // empty struct + dst.ZipDetails = nil + } else { + match++ + } + } else { + dst.ZipDetails = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AchDetails = nil + dst.AfterpayDetails = nil + dst.AmazonPayDetails = nil + dst.AndroidPayDetails = nil + dst.ApplePayDetails = nil + dst.BacsDirectDebitDetails = nil + dst.BillDeskDetails = nil + dst.BlikDetails = nil + dst.CardDetails = nil + dst.CellulantDetails = nil + dst.DokuDetails = nil + dst.DotpayDetails = nil + dst.DragonpayDetails = nil + dst.EcontextVoucherDetails = nil + dst.GenericIssuerPaymentMethodDetails = nil + dst.GiropayDetails = nil + dst.GooglePayDetails = nil + dst.IdealDetails = nil + dst.KlarnaDetails = nil + dst.MasterpassDetails = nil + dst.MbwayDetails = nil + dst.MobilePayDetails = nil + dst.MolPayDetails = nil + dst.OpenInvoiceDetails = nil + dst.PayPalDetails = nil + dst.PayUUpiDetails = nil + dst.PayWithGoogleDetails = nil + dst.PaymentDetails = nil + dst.RatepayDetails = nil + dst.SamsungPayDetails = nil + dst.SepaDirectDebitDetails = nil + dst.StoredPaymentMethodDetails = nil + dst.UpiCollectDetails = nil + dst.UpiIntentDetails = nil + dst.VippsDetails = nil + dst.VisaCheckoutDetails = nil + dst.WeChatPayDetails = nil + dst.WeChatPayMiniProgramDetails = nil + dst.ZipDetails = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CheckoutDonationPaymentRequestPaymentMethod)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CheckoutDonationPaymentRequestPaymentMethod)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CheckoutDonationPaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { + if src.AchDetails != nil { + return json.Marshal(&src.AchDetails) + } + + if src.AfterpayDetails != nil { + return json.Marshal(&src.AfterpayDetails) + } + + if src.AmazonPayDetails != nil { + return json.Marshal(&src.AmazonPayDetails) + } + + if src.AndroidPayDetails != nil { + return json.Marshal(&src.AndroidPayDetails) + } + + if src.ApplePayDetails != nil { + return json.Marshal(&src.ApplePayDetails) + } + + if src.BacsDirectDebitDetails != nil { + return json.Marshal(&src.BacsDirectDebitDetails) + } + + if src.BillDeskDetails != nil { + return json.Marshal(&src.BillDeskDetails) + } + + if src.BlikDetails != nil { + return json.Marshal(&src.BlikDetails) + } + + if src.CardDetails != nil { + return json.Marshal(&src.CardDetails) + } + + if src.CellulantDetails != nil { + return json.Marshal(&src.CellulantDetails) + } + + if src.DokuDetails != nil { + return json.Marshal(&src.DokuDetails) + } + + if src.DotpayDetails != nil { + return json.Marshal(&src.DotpayDetails) + } + + if src.DragonpayDetails != nil { + return json.Marshal(&src.DragonpayDetails) + } + + if src.EcontextVoucherDetails != nil { + return json.Marshal(&src.EcontextVoucherDetails) + } + + if src.GenericIssuerPaymentMethodDetails != nil { + return json.Marshal(&src.GenericIssuerPaymentMethodDetails) + } + + if src.GiropayDetails != nil { + return json.Marshal(&src.GiropayDetails) + } + + if src.GooglePayDetails != nil { + return json.Marshal(&src.GooglePayDetails) + } + + if src.IdealDetails != nil { + return json.Marshal(&src.IdealDetails) + } + + if src.KlarnaDetails != nil { + return json.Marshal(&src.KlarnaDetails) + } + + if src.MasterpassDetails != nil { + return json.Marshal(&src.MasterpassDetails) + } + + if src.MbwayDetails != nil { + return json.Marshal(&src.MbwayDetails) + } + + if src.MobilePayDetails != nil { + return json.Marshal(&src.MobilePayDetails) + } + + if src.MolPayDetails != nil { + return json.Marshal(&src.MolPayDetails) + } + + if src.OpenInvoiceDetails != nil { + return json.Marshal(&src.OpenInvoiceDetails) + } + + if src.PayPalDetails != nil { + return json.Marshal(&src.PayPalDetails) + } + + if src.PayUUpiDetails != nil { + return json.Marshal(&src.PayUUpiDetails) + } + + if src.PayWithGoogleDetails != nil { + return json.Marshal(&src.PayWithGoogleDetails) + } + + if src.PaymentDetails != nil { + return json.Marshal(&src.PaymentDetails) + } + + if src.RatepayDetails != nil { + return json.Marshal(&src.RatepayDetails) + } + + if src.SamsungPayDetails != nil { + return json.Marshal(&src.SamsungPayDetails) + } + + if src.SepaDirectDebitDetails != nil { + return json.Marshal(&src.SepaDirectDebitDetails) + } + + if src.StoredPaymentMethodDetails != nil { + return json.Marshal(&src.StoredPaymentMethodDetails) + } + + if src.UpiCollectDetails != nil { + return json.Marshal(&src.UpiCollectDetails) + } + + if src.UpiIntentDetails != nil { + return json.Marshal(&src.UpiIntentDetails) + } + + if src.VippsDetails != nil { + return json.Marshal(&src.VippsDetails) + } + + if src.VisaCheckoutDetails != nil { + return json.Marshal(&src.VisaCheckoutDetails) + } + + if src.WeChatPayDetails != nil { + return json.Marshal(&src.WeChatPayDetails) + } + + if src.WeChatPayMiniProgramDetails != nil { + return json.Marshal(&src.WeChatPayMiniProgramDetails) + } + + if src.ZipDetails != nil { + return json.Marshal(&src.ZipDetails) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CheckoutDonationPaymentRequestPaymentMethod) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.AchDetails != nil { + return obj.AchDetails + } + + if obj.AfterpayDetails != nil { + return obj.AfterpayDetails + } + + if obj.AmazonPayDetails != nil { + return obj.AmazonPayDetails + } + + if obj.AndroidPayDetails != nil { + return obj.AndroidPayDetails + } + + if obj.ApplePayDetails != nil { + return obj.ApplePayDetails + } + + if obj.BacsDirectDebitDetails != nil { + return obj.BacsDirectDebitDetails + } + + if obj.BillDeskDetails != nil { + return obj.BillDeskDetails + } + + if obj.BlikDetails != nil { + return obj.BlikDetails + } + + if obj.CardDetails != nil { + return obj.CardDetails + } + + if obj.CellulantDetails != nil { + return obj.CellulantDetails + } + + if obj.DokuDetails != nil { + return obj.DokuDetails + } + + if obj.DotpayDetails != nil { + return obj.DotpayDetails + } + + if obj.DragonpayDetails != nil { + return obj.DragonpayDetails + } + + if obj.EcontextVoucherDetails != nil { + return obj.EcontextVoucherDetails + } + + if obj.GenericIssuerPaymentMethodDetails != nil { + return obj.GenericIssuerPaymentMethodDetails + } + + if obj.GiropayDetails != nil { + return obj.GiropayDetails + } + + if obj.GooglePayDetails != nil { + return obj.GooglePayDetails + } + + if obj.IdealDetails != nil { + return obj.IdealDetails + } + + if obj.KlarnaDetails != nil { + return obj.KlarnaDetails + } + + if obj.MasterpassDetails != nil { + return obj.MasterpassDetails + } + + if obj.MbwayDetails != nil { + return obj.MbwayDetails + } + + if obj.MobilePayDetails != nil { + return obj.MobilePayDetails + } + + if obj.MolPayDetails != nil { + return obj.MolPayDetails + } + + if obj.OpenInvoiceDetails != nil { + return obj.OpenInvoiceDetails + } + + if obj.PayPalDetails != nil { + return obj.PayPalDetails + } + + if obj.PayUUpiDetails != nil { + return obj.PayUUpiDetails + } + + if obj.PayWithGoogleDetails != nil { + return obj.PayWithGoogleDetails + } + + if obj.PaymentDetails != nil { + return obj.PaymentDetails + } + + if obj.RatepayDetails != nil { + return obj.RatepayDetails + } + + if obj.SamsungPayDetails != nil { + return obj.SamsungPayDetails + } + + if obj.SepaDirectDebitDetails != nil { + return obj.SepaDirectDebitDetails + } + + if obj.StoredPaymentMethodDetails != nil { + return obj.StoredPaymentMethodDetails + } + + if obj.UpiCollectDetails != nil { + return obj.UpiCollectDetails + } + + if obj.UpiIntentDetails != nil { + return obj.UpiIntentDetails + } + + if obj.VippsDetails != nil { + return obj.VippsDetails + } + + if obj.VisaCheckoutDetails != nil { + return obj.VisaCheckoutDetails + } + + if obj.WeChatPayDetails != nil { + return obj.WeChatPayDetails + } + + if obj.WeChatPayMiniProgramDetails != nil { + return obj.WeChatPayMiniProgramDetails + } + + if obj.ZipDetails != nil { + return obj.ZipDetails + } + + // all schemas are nil + return nil +} + +type NullableCheckoutDonationPaymentRequestPaymentMethod struct { + value *CheckoutDonationPaymentRequestPaymentMethod + isSet bool +} + +func (v NullableCheckoutDonationPaymentRequestPaymentMethod) Get() *CheckoutDonationPaymentRequestPaymentMethod { + return v.value +} + +func (v *NullableCheckoutDonationPaymentRequestPaymentMethod) Set(val *CheckoutDonationPaymentRequestPaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullableCheckoutDonationPaymentRequestPaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckoutDonationPaymentRequestPaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckoutDonationPaymentRequestPaymentMethod(val *CheckoutDonationPaymentRequestPaymentMethod) *NullableCheckoutDonationPaymentRequestPaymentMethod { + return &NullableCheckoutDonationPaymentRequestPaymentMethod{value: val, isSet: true} +} + +func (v NullableCheckoutDonationPaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckoutDonationPaymentRequestPaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/checkout/model_checkout_native_redirect_action.go b/src/checkout/model_checkout_native_redirect_action.go index a09ae47b2..50ccf5f8f 100644 --- a/src/checkout/model_checkout_native_redirect_action.go +++ b/src/checkout/model_checkout_native_redirect_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutNativeRedirectAction type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *CheckoutNativeRedirectAction) SetUrl(v string) { } func (o CheckoutNativeRedirectAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -300,12 +299,14 @@ func (v *NullableCheckoutNativeRedirectAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutNativeRedirectAction) isValidType() bool { - var allowedEnumValues = []string{"nativeRedirect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nativeRedirect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_order_response.go b/src/checkout/model_checkout_order_response.go index 818f43301..ea5c42450 100644 --- a/src/checkout/model_checkout_order_response.go +++ b/src/checkout/model_checkout_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutOrderResponse type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type CheckoutOrderResponse struct { // The `pspReference` that belongs to the order. PspReference string `json:"pspReference"` // The merchant reference for the order. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` RemainingAmount *Amount `json:"remainingAmount,omitempty"` } @@ -234,7 +233,7 @@ func (o *CheckoutOrderResponse) SetRemainingAmount(v Amount) { } func (o CheckoutOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -297,3 +296,6 @@ func (v *NullableCheckoutOrderResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_payment_request.go b/src/checkout/model_checkout_payment_request.go new file mode 100644 index 000000000..d7dabb076 --- /dev/null +++ b/src/checkout/model_checkout_payment_request.go @@ -0,0 +1,2496 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the CheckoutPaymentRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CheckoutPaymentRequest{} + +// CheckoutPaymentRequest struct for CheckoutPaymentRequest +type CheckoutPaymentRequest struct { + AccountInfo *AccountInfo2 `json:"accountInfo,omitempty"` + AdditionalAmount *Amount2 `json:"additionalAmount,omitempty"` + // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount *Amount2 `json:"amount,omitempty"` + ApplicationInfo *ApplicationInfo2 `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *Address2 `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo2 `json:"browserInfo,omitempty"` + // The delay between the authorisation and scheduled auto-capture, specified in hours. + CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` + // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + Channel *string `json:"channel,omitempty"` + // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + Company *Company `json:"company,omitempty"` + // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + // Deprecated + ConversionId *string `json:"conversionId,omitempty"` + // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + CountryCode *string `json:"countryCode,omitempty"` + // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote2 `json:"dccQuote,omitempty"` + DeliveryAddress *Address2 `json:"deliveryAddress,omitempty"` + // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + DeliveryDate *time.Time `json:"deliveryDate,omitempty"` + // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` + // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + EnableOneClick *bool `json:"enableOneClick,omitempty"` + // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + EnablePayOut *bool `json:"enablePayOut,omitempty"` + // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + EnableRecurring *bool `json:"enableRecurring,omitempty"` + // The type of the entity the payment is processed for. + EntityType *string `json:"entityType,omitempty"` + // An integer value that is added to the normal fraud score. The value can be either positive or negative. + FraudOffset *int32 `json:"fraudOffset,omitempty"` + // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + IndustryUsage *string `json:"industryUsage,omitempty"` + Installments *Installments2 `json:"installments,omitempty"` + // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + LineItems []LineItem `json:"lineItems,omitempty"` + // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` + // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + Mcc *string `json:"mcc,omitempty"` + // The merchant account identifier, with which you want to process the transaction. + MerchantAccount *string `json:"merchantAccount,omitempty"` + // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator2 `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Order *EncryptedOrderData `json:"order,omitempty"` + // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + OrderReference *string `json:"orderReference,omitempty"` + // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + Origin *string `json:"origin,omitempty"` + PaymentMethod *CheckoutDonationPaymentRequestPaymentMethod `json:"paymentMethod,omitempty"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + // Date after which no further authorisations shall be performed. Only for 3D Secure 2. + RecurringExpiry *string `json:"recurringExpiry,omitempty"` + // Minimum number of days between authorisations. Only for 3D Secure 2. + RecurringFrequency *string `json:"recurringFrequency,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` + // Specifies the redirect method (GET or POST) when redirecting back from the issuer. + RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` + // Specifies the redirect method (GET or POST) when redirecting to the issuer. + RedirectToIssuerMethod *string `json:"redirectToIssuerMethod,omitempty"` + // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + Reference *string `json:"reference,omitempty"` + // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + ReturnUrl *string `json:"returnUrl,omitempty"` + RiskData *RiskData `json:"riskData,omitempty"` + // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + SessionValidity *string `json:"sessionValidity,omitempty"` + // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + ShopperEmail *string `json:"shopperEmail,omitempty"` + // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + ShopperIP *string `json:"shopperIP,omitempty"` + // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + // The combination of a language code and a country code to specify the language to be used in the payment. + ShopperLocale *string `json:"shopperLocale,omitempty"` + ShopperName *Name2 `json:"shopperName,omitempty"` + // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + ShopperReference *string `json:"shopperReference,omitempty"` + // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + ShopperStatement *string `json:"shopperStatement,omitempty"` + // The shopper's social security number. + SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + Splits []Split2 `json:"splits,omitempty"` + // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + Store *string `json:"store,omitempty"` + // When true and `shopperReference` is provided, the payment details will be stored. + StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` + // The shopper's telephone number. + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,omitempty"` + // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + // Deprecated + ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` + // Set to true if the payment should be routed to a trusted MID. + TrustedShopper *bool `json:"trustedShopper,omitempty"` +} + +// NewCheckoutPaymentRequest instantiates a new CheckoutPaymentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckoutPaymentRequest() *CheckoutPaymentRequest { + this := CheckoutPaymentRequest{} + var threeDSAuthenticationOnly bool = false + this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly + return &this +} + +// NewCheckoutPaymentRequestWithDefaults instantiates a new CheckoutPaymentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckoutPaymentRequestWithDefaults() *CheckoutPaymentRequest { + this := CheckoutPaymentRequest{} + var threeDSAuthenticationOnly bool = false + this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly + return &this +} + +// GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetAccountInfo() AccountInfo2 { + if o == nil || common.IsNil(o.AccountInfo) { + var ret AccountInfo2 + return ret + } + return *o.AccountInfo +} + +// GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetAccountInfoOk() (*AccountInfo2, bool) { + if o == nil || common.IsNil(o.AccountInfo) { + return nil, false + } + return o.AccountInfo, true +} + +// HasAccountInfo returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasAccountInfo() bool { + if o != nil && !common.IsNil(o.AccountInfo) { + return true + } + + return false +} + +// SetAccountInfo gets a reference to the given AccountInfo2 and assigns it to the AccountInfo field. +func (o *CheckoutPaymentRequest) SetAccountInfo(v AccountInfo2) { + o.AccountInfo = &v +} + +// GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetAdditionalAmount() Amount2 { + if o == nil || common.IsNil(o.AdditionalAmount) { + var ret Amount2 + return ret + } + return *o.AdditionalAmount +} + +// GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetAdditionalAmountOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.AdditionalAmount) { + return nil, false + } + return o.AdditionalAmount, true +} + +// HasAdditionalAmount returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasAdditionalAmount() bool { + if o != nil && !common.IsNil(o.AdditionalAmount) { + return true + } + + return false +} + +// SetAdditionalAmount gets a reference to the given Amount2 and assigns it to the AdditionalAmount field. +func (o *CheckoutPaymentRequest) SetAdditionalAmount(v Amount2) { + o.AdditionalAmount = &v +} + +// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetAdditionalData() map[string]string { + if o == nil || common.IsNil(o.AdditionalData) { + var ret map[string]string + return ret + } + return *o.AdditionalData +} + +// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetAdditionalDataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.AdditionalData) { + return nil, false + } + return o.AdditionalData, true +} + +// HasAdditionalData returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasAdditionalData() bool { + if o != nil && !common.IsNil(o.AdditionalData) { + return true + } + + return false +} + +// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. +func (o *CheckoutPaymentRequest) SetAdditionalData(v map[string]string) { + o.AdditionalData = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetAmount() Amount2 { + if o == nil || common.IsNil(o.Amount) { + var ret Amount2 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetAmountOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given Amount2 and assigns it to the Amount field. +func (o *CheckoutPaymentRequest) SetAmount(v Amount2) { + o.Amount = &v +} + +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetApplicationInfo() ApplicationInfo2 { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo2 + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo2 and assigns it to the ApplicationInfo field. +func (o *CheckoutPaymentRequest) SetApplicationInfo(v ApplicationInfo2) { + o.ApplicationInfo = &v +} + +// GetAuthenticationData returns the AuthenticationData field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetAuthenticationData() AuthenticationData { + if o == nil || common.IsNil(o.AuthenticationData) { + var ret AuthenticationData + return ret + } + return *o.AuthenticationData +} + +// GetAuthenticationDataOk returns a tuple with the AuthenticationData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetAuthenticationDataOk() (*AuthenticationData, bool) { + if o == nil || common.IsNil(o.AuthenticationData) { + return nil, false + } + return o.AuthenticationData, true +} + +// HasAuthenticationData returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasAuthenticationData() bool { + if o != nil && !common.IsNil(o.AuthenticationData) { + return true + } + + return false +} + +// SetAuthenticationData gets a reference to the given AuthenticationData and assigns it to the AuthenticationData field. +func (o *CheckoutPaymentRequest) SetAuthenticationData(v AuthenticationData) { + o.AuthenticationData = &v +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetBillingAddress() Address2 { + if o == nil || common.IsNil(o.BillingAddress) { + var ret Address2 + return ret + } + return *o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetBillingAddressOk() (*Address2, bool) { + if o == nil || common.IsNil(o.BillingAddress) { + return nil, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasBillingAddress() bool { + if o != nil && !common.IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given Address2 and assigns it to the BillingAddress field. +func (o *CheckoutPaymentRequest) SetBillingAddress(v Address2) { + o.BillingAddress = &v +} + +// GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetBrowserInfo() BrowserInfo2 { + if o == nil || common.IsNil(o.BrowserInfo) { + var ret BrowserInfo2 + return ret + } + return *o.BrowserInfo +} + +// GetBrowserInfoOk returns a tuple with the BrowserInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetBrowserInfoOk() (*BrowserInfo2, bool) { + if o == nil || common.IsNil(o.BrowserInfo) { + return nil, false + } + return o.BrowserInfo, true +} + +// HasBrowserInfo returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasBrowserInfo() bool { + if o != nil && !common.IsNil(o.BrowserInfo) { + return true + } + + return false +} + +// SetBrowserInfo gets a reference to the given BrowserInfo2 and assigns it to the BrowserInfo field. +func (o *CheckoutPaymentRequest) SetBrowserInfo(v BrowserInfo2) { + o.BrowserInfo = &v +} + +// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetCaptureDelayHours() int32 { + if o == nil || common.IsNil(o.CaptureDelayHours) { + var ret int32 + return ret + } + return *o.CaptureDelayHours +} + +// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetCaptureDelayHoursOk() (*int32, bool) { + if o == nil || common.IsNil(o.CaptureDelayHours) { + return nil, false + } + return o.CaptureDelayHours, true +} + +// HasCaptureDelayHours returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasCaptureDelayHours() bool { + if o != nil && !common.IsNil(o.CaptureDelayHours) { + return true + } + + return false +} + +// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. +func (o *CheckoutPaymentRequest) SetCaptureDelayHours(v int32) { + o.CaptureDelayHours = &v +} + +// GetChannel returns the Channel field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetChannel() string { + if o == nil || common.IsNil(o.Channel) { + var ret string + return ret + } + return *o.Channel +} + +// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetChannelOk() (*string, bool) { + if o == nil || common.IsNil(o.Channel) { + return nil, false + } + return o.Channel, true +} + +// HasChannel returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasChannel() bool { + if o != nil && !common.IsNil(o.Channel) { + return true + } + + return false +} + +// SetChannel gets a reference to the given string and assigns it to the Channel field. +func (o *CheckoutPaymentRequest) SetChannel(v string) { + o.Channel = &v +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *CheckoutPaymentRequest) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetCompany returns the Company field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetCompany() Company { + if o == nil || common.IsNil(o.Company) { + var ret Company + return ret + } + return *o.Company +} + +// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetCompanyOk() (*Company, bool) { + if o == nil || common.IsNil(o.Company) { + return nil, false + } + return o.Company, true +} + +// HasCompany returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasCompany() bool { + if o != nil && !common.IsNil(o.Company) { + return true + } + + return false +} + +// SetCompany gets a reference to the given Company and assigns it to the Company field. +func (o *CheckoutPaymentRequest) SetCompany(v Company) { + o.Company = &v +} + +// GetConversionId returns the ConversionId field value if set, zero value otherwise. +// Deprecated +func (o *CheckoutPaymentRequest) GetConversionId() string { + if o == nil || common.IsNil(o.ConversionId) { + var ret string + return ret + } + return *o.ConversionId +} + +// GetConversionIdOk returns a tuple with the ConversionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CheckoutPaymentRequest) GetConversionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.ConversionId) { + return nil, false + } + return o.ConversionId, true +} + +// HasConversionId returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasConversionId() bool { + if o != nil && !common.IsNil(o.ConversionId) { + return true + } + + return false +} + +// SetConversionId gets a reference to the given string and assigns it to the ConversionId field. +// Deprecated +func (o *CheckoutPaymentRequest) SetConversionId(v string) { + o.ConversionId = &v +} + +// GetCountryCode returns the CountryCode field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetCountryCode() string { + if o == nil || common.IsNil(o.CountryCode) { + var ret string + return ret + } + return *o.CountryCode +} + +// GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.CountryCode) { + return nil, false + } + return o.CountryCode, true +} + +// HasCountryCode returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasCountryCode() bool { + if o != nil && !common.IsNil(o.CountryCode) { + return true + } + + return false +} + +// SetCountryCode gets a reference to the given string and assigns it to the CountryCode field. +func (o *CheckoutPaymentRequest) SetCountryCode(v string) { + o.CountryCode = &v +} + +// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetDateOfBirth() time.Time { + if o == nil || common.IsNil(o.DateOfBirth) { + var ret time.Time + return ret + } + return *o.DateOfBirth +} + +// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetDateOfBirthOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DateOfBirth) { + return nil, false + } + return o.DateOfBirth, true +} + +// HasDateOfBirth returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasDateOfBirth() bool { + if o != nil && !common.IsNil(o.DateOfBirth) { + return true + } + + return false +} + +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *CheckoutPaymentRequest) SetDateOfBirth(v time.Time) { + o.DateOfBirth = &v +} + +// GetDccQuote returns the DccQuote field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetDccQuote() ForexQuote2 { + if o == nil || common.IsNil(o.DccQuote) { + var ret ForexQuote2 + return ret + } + return *o.DccQuote +} + +// GetDccQuoteOk returns a tuple with the DccQuote field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetDccQuoteOk() (*ForexQuote2, bool) { + if o == nil || common.IsNil(o.DccQuote) { + return nil, false + } + return o.DccQuote, true +} + +// HasDccQuote returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasDccQuote() bool { + if o != nil && !common.IsNil(o.DccQuote) { + return true + } + + return false +} + +// SetDccQuote gets a reference to the given ForexQuote2 and assigns it to the DccQuote field. +func (o *CheckoutPaymentRequest) SetDccQuote(v ForexQuote2) { + o.DccQuote = &v +} + +// GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetDeliveryAddress() Address2 { + if o == nil || common.IsNil(o.DeliveryAddress) { + var ret Address2 + return ret + } + return *o.DeliveryAddress +} + +// GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetDeliveryAddressOk() (*Address2, bool) { + if o == nil || common.IsNil(o.DeliveryAddress) { + return nil, false + } + return o.DeliveryAddress, true +} + +// HasDeliveryAddress returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasDeliveryAddress() bool { + if o != nil && !common.IsNil(o.DeliveryAddress) { + return true + } + + return false +} + +// SetDeliveryAddress gets a reference to the given Address2 and assigns it to the DeliveryAddress field. +func (o *CheckoutPaymentRequest) SetDeliveryAddress(v Address2) { + o.DeliveryAddress = &v +} + +// GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetDeliveryDate() time.Time { + if o == nil || common.IsNil(o.DeliveryDate) { + var ret time.Time + return ret + } + return *o.DeliveryDate +} + +// GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DeliveryDate) { + return nil, false + } + return o.DeliveryDate, true +} + +// HasDeliveryDate returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasDeliveryDate() bool { + if o != nil && !common.IsNil(o.DeliveryDate) { + return true + } + + return false +} + +// SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. +func (o *CheckoutPaymentRequest) SetDeliveryDate(v time.Time) { + o.DeliveryDate = &v +} + +// GetDeviceFingerprint returns the DeviceFingerprint field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetDeviceFingerprint() string { + if o == nil || common.IsNil(o.DeviceFingerprint) { + var ret string + return ret + } + return *o.DeviceFingerprint +} + +// GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetDeviceFingerprintOk() (*string, bool) { + if o == nil || common.IsNil(o.DeviceFingerprint) { + return nil, false + } + return o.DeviceFingerprint, true +} + +// HasDeviceFingerprint returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasDeviceFingerprint() bool { + if o != nil && !common.IsNil(o.DeviceFingerprint) { + return true + } + + return false +} + +// SetDeviceFingerprint gets a reference to the given string and assigns it to the DeviceFingerprint field. +func (o *CheckoutPaymentRequest) SetDeviceFingerprint(v string) { + o.DeviceFingerprint = &v +} + +// GetEnableOneClick returns the EnableOneClick field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetEnableOneClick() bool { + if o == nil || common.IsNil(o.EnableOneClick) { + var ret bool + return ret + } + return *o.EnableOneClick +} + +// GetEnableOneClickOk returns a tuple with the EnableOneClick field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetEnableOneClickOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnableOneClick) { + return nil, false + } + return o.EnableOneClick, true +} + +// HasEnableOneClick returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasEnableOneClick() bool { + if o != nil && !common.IsNil(o.EnableOneClick) { + return true + } + + return false +} + +// SetEnableOneClick gets a reference to the given bool and assigns it to the EnableOneClick field. +func (o *CheckoutPaymentRequest) SetEnableOneClick(v bool) { + o.EnableOneClick = &v +} + +// GetEnablePayOut returns the EnablePayOut field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetEnablePayOut() bool { + if o == nil || common.IsNil(o.EnablePayOut) { + var ret bool + return ret + } + return *o.EnablePayOut +} + +// GetEnablePayOutOk returns a tuple with the EnablePayOut field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetEnablePayOutOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnablePayOut) { + return nil, false + } + return o.EnablePayOut, true +} + +// HasEnablePayOut returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasEnablePayOut() bool { + if o != nil && !common.IsNil(o.EnablePayOut) { + return true + } + + return false +} + +// SetEnablePayOut gets a reference to the given bool and assigns it to the EnablePayOut field. +func (o *CheckoutPaymentRequest) SetEnablePayOut(v bool) { + o.EnablePayOut = &v +} + +// GetEnableRecurring returns the EnableRecurring field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetEnableRecurring() bool { + if o == nil || common.IsNil(o.EnableRecurring) { + var ret bool + return ret + } + return *o.EnableRecurring +} + +// GetEnableRecurringOk returns a tuple with the EnableRecurring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetEnableRecurringOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnableRecurring) { + return nil, false + } + return o.EnableRecurring, true +} + +// HasEnableRecurring returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasEnableRecurring() bool { + if o != nil && !common.IsNil(o.EnableRecurring) { + return true + } + + return false +} + +// SetEnableRecurring gets a reference to the given bool and assigns it to the EnableRecurring field. +func (o *CheckoutPaymentRequest) SetEnableRecurring(v bool) { + o.EnableRecurring = &v +} + +// GetEntityType returns the EntityType field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetEntityType() string { + if o == nil || common.IsNil(o.EntityType) { + var ret string + return ret + } + return *o.EntityType +} + +// GetEntityTypeOk returns a tuple with the EntityType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetEntityTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.EntityType) { + return nil, false + } + return o.EntityType, true +} + +// HasEntityType returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasEntityType() bool { + if o != nil && !common.IsNil(o.EntityType) { + return true + } + + return false +} + +// SetEntityType gets a reference to the given string and assigns it to the EntityType field. +func (o *CheckoutPaymentRequest) SetEntityType(v string) { + o.EntityType = &v +} + +// GetFraudOffset returns the FraudOffset field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetFraudOffset() int32 { + if o == nil || common.IsNil(o.FraudOffset) { + var ret int32 + return ret + } + return *o.FraudOffset +} + +// GetFraudOffsetOk returns a tuple with the FraudOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetFraudOffsetOk() (*int32, bool) { + if o == nil || common.IsNil(o.FraudOffset) { + return nil, false + } + return o.FraudOffset, true +} + +// HasFraudOffset returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasFraudOffset() bool { + if o != nil && !common.IsNil(o.FraudOffset) { + return true + } + + return false +} + +// SetFraudOffset gets a reference to the given int32 and assigns it to the FraudOffset field. +func (o *CheckoutPaymentRequest) SetFraudOffset(v int32) { + o.FraudOffset = &v +} + +// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetIndustryUsage() string { + if o == nil || common.IsNil(o.IndustryUsage) { + var ret string + return ret + } + return *o.IndustryUsage +} + +// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetIndustryUsageOk() (*string, bool) { + if o == nil || common.IsNil(o.IndustryUsage) { + return nil, false + } + return o.IndustryUsage, true +} + +// HasIndustryUsage returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasIndustryUsage() bool { + if o != nil && !common.IsNil(o.IndustryUsage) { + return true + } + + return false +} + +// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. +func (o *CheckoutPaymentRequest) SetIndustryUsage(v string) { + o.IndustryUsage = &v +} + +// GetInstallments returns the Installments field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetInstallments() Installments2 { + if o == nil || common.IsNil(o.Installments) { + var ret Installments2 + return ret + } + return *o.Installments +} + +// GetInstallmentsOk returns a tuple with the Installments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetInstallmentsOk() (*Installments2, bool) { + if o == nil || common.IsNil(o.Installments) { + return nil, false + } + return o.Installments, true +} + +// HasInstallments returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasInstallments() bool { + if o != nil && !common.IsNil(o.Installments) { + return true + } + + return false +} + +// SetInstallments gets a reference to the given Installments2 and assigns it to the Installments field. +func (o *CheckoutPaymentRequest) SetInstallments(v Installments2) { + o.Installments = &v +} + +// GetLineItems returns the LineItems field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetLineItems() []LineItem { + if o == nil || common.IsNil(o.LineItems) { + var ret []LineItem + return ret + } + return o.LineItems +} + +// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetLineItemsOk() ([]LineItem, bool) { + if o == nil || common.IsNil(o.LineItems) { + return nil, false + } + return o.LineItems, true +} + +// HasLineItems returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasLineItems() bool { + if o != nil && !common.IsNil(o.LineItems) { + return true + } + + return false +} + +// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. +func (o *CheckoutPaymentRequest) SetLineItems(v []LineItem) { + o.LineItems = v +} + +// GetLocalizedShopperStatement returns the LocalizedShopperStatement field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetLocalizedShopperStatement() map[string]string { + if o == nil || common.IsNil(o.LocalizedShopperStatement) { + var ret map[string]string + return ret + } + return *o.LocalizedShopperStatement +} + +// GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.LocalizedShopperStatement) { + return nil, false + } + return o.LocalizedShopperStatement, true +} + +// HasLocalizedShopperStatement returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasLocalizedShopperStatement() bool { + if o != nil && !common.IsNil(o.LocalizedShopperStatement) { + return true + } + + return false +} + +// SetLocalizedShopperStatement gets a reference to the given map[string]string and assigns it to the LocalizedShopperStatement field. +func (o *CheckoutPaymentRequest) SetLocalizedShopperStatement(v map[string]string) { + o.LocalizedShopperStatement = &v +} + +// GetMandate returns the Mandate field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMandate() Mandate { + if o == nil || common.IsNil(o.Mandate) { + var ret Mandate + return ret + } + return *o.Mandate +} + +// GetMandateOk returns a tuple with the Mandate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMandateOk() (*Mandate, bool) { + if o == nil || common.IsNil(o.Mandate) { + return nil, false + } + return o.Mandate, true +} + +// HasMandate returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMandate() bool { + if o != nil && !common.IsNil(o.Mandate) { + return true + } + + return false +} + +// SetMandate gets a reference to the given Mandate and assigns it to the Mandate field. +func (o *CheckoutPaymentRequest) SetMandate(v Mandate) { + o.Mandate = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMcc() string { + if o == nil || common.IsNil(o.Mcc) { + var ret string + return ret + } + return *o.Mcc +} + +// GetMccOk returns a tuple with the Mcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMccOk() (*string, bool) { + if o == nil || common.IsNil(o.Mcc) { + return nil, false + } + return o.Mcc, true +} + +// HasMcc returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMcc() bool { + if o != nil && !common.IsNil(o.Mcc) { + return true + } + + return false +} + +// SetMcc gets a reference to the given string and assigns it to the Mcc field. +func (o *CheckoutPaymentRequest) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantAccount returns the MerchantAccount field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMerchantAccount() string { + if o == nil || common.IsNil(o.MerchantAccount) { + var ret string + return ret + } + return *o.MerchantAccount +} + +// GetMerchantAccountOk returns a tuple with the MerchantAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMerchantAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantAccount) { + return nil, false + } + return o.MerchantAccount, true +} + +// HasMerchantAccount returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMerchantAccount() bool { + if o != nil && !common.IsNil(o.MerchantAccount) { + return true + } + + return false +} + +// SetMerchantAccount gets a reference to the given string and assigns it to the MerchantAccount field. +func (o *CheckoutPaymentRequest) SetMerchantAccount(v string) { + o.MerchantAccount = &v +} + +// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMerchantOrderReference() string { + if o == nil || common.IsNil(o.MerchantOrderReference) { + var ret string + return ret + } + return *o.MerchantOrderReference +} + +// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMerchantOrderReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantOrderReference) { + return nil, false + } + return o.MerchantOrderReference, true +} + +// HasMerchantOrderReference returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMerchantOrderReference() bool { + if o != nil && !common.IsNil(o.MerchantOrderReference) { + return true + } + + return false +} + +// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. +func (o *CheckoutPaymentRequest) SetMerchantOrderReference(v string) { + o.MerchantOrderReference = &v +} + +// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator2 { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { + var ret MerchantRiskIndicator2 + return ret + } + return *o.MerchantRiskIndicator +} + +// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator2, bool) { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { + return nil, false + } + return o.MerchantRiskIndicator, true +} + +// HasMerchantRiskIndicator returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMerchantRiskIndicator() bool { + if o != nil && !common.IsNil(o.MerchantRiskIndicator) { + return true + } + + return false +} + +// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator2 and assigns it to the MerchantRiskIndicator field. +func (o *CheckoutPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator2) { + o.MerchantRiskIndicator = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *CheckoutPaymentRequest) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetMpiData returns the MpiData field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetMpiData() ThreeDSecureData { + if o == nil || common.IsNil(o.MpiData) { + var ret ThreeDSecureData + return ret + } + return *o.MpiData +} + +// GetMpiDataOk returns a tuple with the MpiData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool) { + if o == nil || common.IsNil(o.MpiData) { + return nil, false + } + return o.MpiData, true +} + +// HasMpiData returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasMpiData() bool { + if o != nil && !common.IsNil(o.MpiData) { + return true + } + + return false +} + +// SetMpiData gets a reference to the given ThreeDSecureData and assigns it to the MpiData field. +func (o *CheckoutPaymentRequest) SetMpiData(v ThreeDSecureData) { + o.MpiData = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetOrder() EncryptedOrderData { + if o == nil || common.IsNil(o.Order) { + var ret EncryptedOrderData + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetOrderOk() (*EncryptedOrderData, bool) { + if o == nil || common.IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasOrder() bool { + if o != nil && !common.IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given EncryptedOrderData and assigns it to the Order field. +func (o *CheckoutPaymentRequest) SetOrder(v EncryptedOrderData) { + o.Order = &v +} + +// GetOrderReference returns the OrderReference field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetOrderReference() string { + if o == nil || common.IsNil(o.OrderReference) { + var ret string + return ret + } + return *o.OrderReference +} + +// GetOrderReferenceOk returns a tuple with the OrderReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetOrderReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.OrderReference) { + return nil, false + } + return o.OrderReference, true +} + +// HasOrderReference returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasOrderReference() bool { + if o != nil && !common.IsNil(o.OrderReference) { + return true + } + + return false +} + +// SetOrderReference gets a reference to the given string and assigns it to the OrderReference field. +func (o *CheckoutPaymentRequest) SetOrderReference(v string) { + o.OrderReference = &v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetOrigin() string { + if o == nil || common.IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetOriginOk() (*string, bool) { + if o == nil || common.IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasOrigin() bool { + if o != nil && !common.IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *CheckoutPaymentRequest) SetOrigin(v string) { + o.Origin = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetPaymentMethod() CheckoutDonationPaymentRequestPaymentMethod { + if o == nil || common.IsNil(o.PaymentMethod) { + var ret CheckoutDonationPaymentRequestPaymentMethod + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetPaymentMethodOk() (*CheckoutDonationPaymentRequestPaymentMethod, bool) { + if o == nil || common.IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasPaymentMethod() bool { + if o != nil && !common.IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given CheckoutDonationPaymentRequestPaymentMethod and assigns it to the PaymentMethod field. +func (o *CheckoutPaymentRequest) SetPaymentMethod(v CheckoutDonationPaymentRequestPaymentMethod) { + o.PaymentMethod = &v +} + +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + var ret PlatformChargebackLogic + return ret + } + return *o.PlatformChargebackLogic +} + +// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + return nil, false + } + return o.PlatformChargebackLogic, true +} + +// HasPlatformChargebackLogic returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasPlatformChargebackLogic() bool { + if o != nil && !common.IsNil(o.PlatformChargebackLogic) { + return true + } + + return false +} + +// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. +func (o *CheckoutPaymentRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + +// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRecurringExpiry() string { + if o == nil || common.IsNil(o.RecurringExpiry) { + var ret string + return ret + } + return *o.RecurringExpiry +} + +// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRecurringExpiryOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringExpiry) { + return nil, false + } + return o.RecurringExpiry, true +} + +// HasRecurringExpiry returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRecurringExpiry() bool { + if o != nil && !common.IsNil(o.RecurringExpiry) { + return true + } + + return false +} + +// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. +func (o *CheckoutPaymentRequest) SetRecurringExpiry(v string) { + o.RecurringExpiry = &v +} + +// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRecurringFrequency() string { + if o == nil || common.IsNil(o.RecurringFrequency) { + var ret string + return ret + } + return *o.RecurringFrequency +} + +// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRecurringFrequencyOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringFrequency) { + return nil, false + } + return o.RecurringFrequency, true +} + +// HasRecurringFrequency returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRecurringFrequency() bool { + if o != nil && !common.IsNil(o.RecurringFrequency) { + return true + } + + return false +} + +// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. +func (o *CheckoutPaymentRequest) SetRecurringFrequency(v string) { + o.RecurringFrequency = &v +} + +// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRecurringProcessingModel() string { + if o == nil || common.IsNil(o.RecurringProcessingModel) { + var ret string + return ret + } + return *o.RecurringProcessingModel +} + +// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRecurringProcessingModelOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringProcessingModel) { + return nil, false + } + return o.RecurringProcessingModel, true +} + +// HasRecurringProcessingModel returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRecurringProcessingModel() bool { + if o != nil && !common.IsNil(o.RecurringProcessingModel) { + return true + } + + return false +} + +// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. +func (o *CheckoutPaymentRequest) SetRecurringProcessingModel(v string) { + o.RecurringProcessingModel = &v +} + +// GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRedirectFromIssuerMethod() string { + if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { + var ret string + return ret + } + return *o.RedirectFromIssuerMethod +} + +// GetRedirectFromIssuerMethodOk returns a tuple with the RedirectFromIssuerMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRedirectFromIssuerMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { + return nil, false + } + return o.RedirectFromIssuerMethod, true +} + +// HasRedirectFromIssuerMethod returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRedirectFromIssuerMethod() bool { + if o != nil && !common.IsNil(o.RedirectFromIssuerMethod) { + return true + } + + return false +} + +// SetRedirectFromIssuerMethod gets a reference to the given string and assigns it to the RedirectFromIssuerMethod field. +func (o *CheckoutPaymentRequest) SetRedirectFromIssuerMethod(v string) { + o.RedirectFromIssuerMethod = &v +} + +// GetRedirectToIssuerMethod returns the RedirectToIssuerMethod field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRedirectToIssuerMethod() string { + if o == nil || common.IsNil(o.RedirectToIssuerMethod) { + var ret string + return ret + } + return *o.RedirectToIssuerMethod +} + +// GetRedirectToIssuerMethodOk returns a tuple with the RedirectToIssuerMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRedirectToIssuerMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.RedirectToIssuerMethod) { + return nil, false + } + return o.RedirectToIssuerMethod, true +} + +// HasRedirectToIssuerMethod returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRedirectToIssuerMethod() bool { + if o != nil && !common.IsNil(o.RedirectToIssuerMethod) { + return true + } + + return false +} + +// SetRedirectToIssuerMethod gets a reference to the given string and assigns it to the RedirectToIssuerMethod field. +func (o *CheckoutPaymentRequest) SetRedirectToIssuerMethod(v string) { + o.RedirectToIssuerMethod = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *CheckoutPaymentRequest) SetReference(v string) { + o.Reference = &v +} + +// GetReturnUrl returns the ReturnUrl field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetReturnUrl() string { + if o == nil || common.IsNil(o.ReturnUrl) { + var ret string + return ret + } + return *o.ReturnUrl +} + +// GetReturnUrlOk returns a tuple with the ReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetReturnUrlOk() (*string, bool) { + if o == nil || common.IsNil(o.ReturnUrl) { + return nil, false + } + return o.ReturnUrl, true +} + +// HasReturnUrl returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasReturnUrl() bool { + if o != nil && !common.IsNil(o.ReturnUrl) { + return true + } + + return false +} + +// SetReturnUrl gets a reference to the given string and assigns it to the ReturnUrl field. +func (o *CheckoutPaymentRequest) SetReturnUrl(v string) { + o.ReturnUrl = &v +} + +// GetRiskData returns the RiskData field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetRiskData() RiskData { + if o == nil || common.IsNil(o.RiskData) { + var ret RiskData + return ret + } + return *o.RiskData +} + +// GetRiskDataOk returns a tuple with the RiskData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetRiskDataOk() (*RiskData, bool) { + if o == nil || common.IsNil(o.RiskData) { + return nil, false + } + return o.RiskData, true +} + +// HasRiskData returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasRiskData() bool { + if o != nil && !common.IsNil(o.RiskData) { + return true + } + + return false +} + +// SetRiskData gets a reference to the given RiskData and assigns it to the RiskData field. +func (o *CheckoutPaymentRequest) SetRiskData(v RiskData) { + o.RiskData = &v +} + +// GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetSessionValidity() string { + if o == nil || common.IsNil(o.SessionValidity) { + var ret string + return ret + } + return *o.SessionValidity +} + +// GetSessionValidityOk returns a tuple with the SessionValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetSessionValidityOk() (*string, bool) { + if o == nil || common.IsNil(o.SessionValidity) { + return nil, false + } + return o.SessionValidity, true +} + +// HasSessionValidity returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasSessionValidity() bool { + if o != nil && !common.IsNil(o.SessionValidity) { + return true + } + + return false +} + +// SetSessionValidity gets a reference to the given string and assigns it to the SessionValidity field. +func (o *CheckoutPaymentRequest) SetSessionValidity(v string) { + o.SessionValidity = &v +} + +// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperEmail() string { + if o == nil || common.IsNil(o.ShopperEmail) { + var ret string + return ret + } + return *o.ShopperEmail +} + +// GetShopperEmailOk returns a tuple with the ShopperEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperEmail) { + return nil, false + } + return o.ShopperEmail, true +} + +// HasShopperEmail returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperEmail() bool { + if o != nil && !common.IsNil(o.ShopperEmail) { + return true + } + + return false +} + +// SetShopperEmail gets a reference to the given string and assigns it to the ShopperEmail field. +func (o *CheckoutPaymentRequest) SetShopperEmail(v string) { + o.ShopperEmail = &v +} + +// GetShopperIP returns the ShopperIP field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperIP() string { + if o == nil || common.IsNil(o.ShopperIP) { + var ret string + return ret + } + return *o.ShopperIP +} + +// GetShopperIPOk returns a tuple with the ShopperIP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperIPOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperIP) { + return nil, false + } + return o.ShopperIP, true +} + +// HasShopperIP returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperIP() bool { + if o != nil && !common.IsNil(o.ShopperIP) { + return true + } + + return false +} + +// SetShopperIP gets a reference to the given string and assigns it to the ShopperIP field. +func (o *CheckoutPaymentRequest) SetShopperIP(v string) { + o.ShopperIP = &v +} + +// GetShopperInteraction returns the ShopperInteraction field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperInteraction() string { + if o == nil || common.IsNil(o.ShopperInteraction) { + var ret string + return ret + } + return *o.ShopperInteraction +} + +// GetShopperInteractionOk returns a tuple with the ShopperInteraction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperInteractionOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperInteraction) { + return nil, false + } + return o.ShopperInteraction, true +} + +// HasShopperInteraction returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperInteraction() bool { + if o != nil && !common.IsNil(o.ShopperInteraction) { + return true + } + + return false +} + +// SetShopperInteraction gets a reference to the given string and assigns it to the ShopperInteraction field. +func (o *CheckoutPaymentRequest) SetShopperInteraction(v string) { + o.ShopperInteraction = &v +} + +// GetShopperLocale returns the ShopperLocale field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperLocale() string { + if o == nil || common.IsNil(o.ShopperLocale) { + var ret string + return ret + } + return *o.ShopperLocale +} + +// GetShopperLocaleOk returns a tuple with the ShopperLocale field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperLocaleOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperLocale) { + return nil, false + } + return o.ShopperLocale, true +} + +// HasShopperLocale returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperLocale() bool { + if o != nil && !common.IsNil(o.ShopperLocale) { + return true + } + + return false +} + +// SetShopperLocale gets a reference to the given string and assigns it to the ShopperLocale field. +func (o *CheckoutPaymentRequest) SetShopperLocale(v string) { + o.ShopperLocale = &v +} + +// GetShopperName returns the ShopperName field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperName() Name2 { + if o == nil || common.IsNil(o.ShopperName) { + var ret Name2 + return ret + } + return *o.ShopperName +} + +// GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperNameOk() (*Name2, bool) { + if o == nil || common.IsNil(o.ShopperName) { + return nil, false + } + return o.ShopperName, true +} + +// HasShopperName returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperName() bool { + if o != nil && !common.IsNil(o.ShopperName) { + return true + } + + return false +} + +// SetShopperName gets a reference to the given Name2 and assigns it to the ShopperName field. +func (o *CheckoutPaymentRequest) SetShopperName(v Name2) { + o.ShopperName = &v +} + +// GetShopperReference returns the ShopperReference field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperReference() string { + if o == nil || common.IsNil(o.ShopperReference) { + var ret string + return ret + } + return *o.ShopperReference +} + +// GetShopperReferenceOk returns a tuple with the ShopperReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperReference) { + return nil, false + } + return o.ShopperReference, true +} + +// HasShopperReference returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperReference() bool { + if o != nil && !common.IsNil(o.ShopperReference) { + return true + } + + return false +} + +// SetShopperReference gets a reference to the given string and assigns it to the ShopperReference field. +func (o *CheckoutPaymentRequest) SetShopperReference(v string) { + o.ShopperReference = &v +} + +// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetShopperStatement() string { + if o == nil || common.IsNil(o.ShopperStatement) { + var ret string + return ret + } + return *o.ShopperStatement +} + +// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetShopperStatementOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperStatement) { + return nil, false + } + return o.ShopperStatement, true +} + +// HasShopperStatement returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasShopperStatement() bool { + if o != nil && !common.IsNil(o.ShopperStatement) { + return true + } + + return false +} + +// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. +func (o *CheckoutPaymentRequest) SetShopperStatement(v string) { + o.ShopperStatement = &v +} + +// GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetSocialSecurityNumber() string { + if o == nil || common.IsNil(o.SocialSecurityNumber) { + var ret string + return ret + } + return *o.SocialSecurityNumber +} + +// GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetSocialSecurityNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.SocialSecurityNumber) { + return nil, false + } + return o.SocialSecurityNumber, true +} + +// HasSocialSecurityNumber returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasSocialSecurityNumber() bool { + if o != nil && !common.IsNil(o.SocialSecurityNumber) { + return true + } + + return false +} + +// SetSocialSecurityNumber gets a reference to the given string and assigns it to the SocialSecurityNumber field. +func (o *CheckoutPaymentRequest) SetSocialSecurityNumber(v string) { + o.SocialSecurityNumber = &v +} + +// GetSplits returns the Splits field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetSplits() []Split2 { + if o == nil || common.IsNil(o.Splits) { + var ret []Split2 + return ret + } + return o.Splits +} + +// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetSplitsOk() ([]Split2, bool) { + if o == nil || common.IsNil(o.Splits) { + return nil, false + } + return o.Splits, true +} + +// HasSplits returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasSplits() bool { + if o != nil && !common.IsNil(o.Splits) { + return true + } + + return false +} + +// SetSplits gets a reference to the given []Split2 and assigns it to the Splits field. +func (o *CheckoutPaymentRequest) SetSplits(v []Split2) { + o.Splits = v +} + +// GetStore returns the Store field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetStore() string { + if o == nil || common.IsNil(o.Store) { + var ret string + return ret + } + return *o.Store +} + +// GetStoreOk returns a tuple with the Store field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetStoreOk() (*string, bool) { + if o == nil || common.IsNil(o.Store) { + return nil, false + } + return o.Store, true +} + +// HasStore returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasStore() bool { + if o != nil && !common.IsNil(o.Store) { + return true + } + + return false +} + +// SetStore gets a reference to the given string and assigns it to the Store field. +func (o *CheckoutPaymentRequest) SetStore(v string) { + o.Store = &v +} + +// GetStorePaymentMethod returns the StorePaymentMethod field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetStorePaymentMethod() bool { + if o == nil || common.IsNil(o.StorePaymentMethod) { + var ret bool + return ret + } + return *o.StorePaymentMethod +} + +// GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetStorePaymentMethodOk() (*bool, bool) { + if o == nil || common.IsNil(o.StorePaymentMethod) { + return nil, false + } + return o.StorePaymentMethod, true +} + +// HasStorePaymentMethod returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasStorePaymentMethod() bool { + if o != nil && !common.IsNil(o.StorePaymentMethod) { + return true + } + + return false +} + +// SetStorePaymentMethod gets a reference to the given bool and assigns it to the StorePaymentMethod field. +func (o *CheckoutPaymentRequest) SetStorePaymentMethod(v bool) { + o.StorePaymentMethod = &v +} + +// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetTelephoneNumber() string { + if o == nil || common.IsNil(o.TelephoneNumber) { + var ret string + return ret + } + return *o.TelephoneNumber +} + +// GetTelephoneNumberOk returns a tuple with the TelephoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetTelephoneNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TelephoneNumber) { + return nil, false + } + return o.TelephoneNumber, true +} + +// HasTelephoneNumber returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasTelephoneNumber() bool { + if o != nil && !common.IsNil(o.TelephoneNumber) { + return true + } + + return false +} + +// SetTelephoneNumber gets a reference to the given string and assigns it to the TelephoneNumber field. +func (o *CheckoutPaymentRequest) SetTelephoneNumber(v string) { + o.TelephoneNumber = &v +} + +// GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { + if o == nil || common.IsNil(o.ThreeDS2RequestData) { + var ret ThreeDS2RequestData2 + return ret + } + return *o.ThreeDS2RequestData +} + +// GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { + if o == nil || common.IsNil(o.ThreeDS2RequestData) { + return nil, false + } + return o.ThreeDS2RequestData, true +} + +// HasThreeDS2RequestData returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasThreeDS2RequestData() bool { + if o != nil && !common.IsNil(o.ThreeDS2RequestData) { + return true + } + + return false +} + +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. +func (o *CheckoutPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { + o.ThreeDS2RequestData = &v +} + +// GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field value if set, zero value otherwise. +// Deprecated +func (o *CheckoutPaymentRequest) GetThreeDSAuthenticationOnly() bool { + if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { + var ret bool + return ret + } + return *o.ThreeDSAuthenticationOnly +} + +// GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CheckoutPaymentRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool) { + if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { + return nil, false + } + return o.ThreeDSAuthenticationOnly, true +} + +// HasThreeDSAuthenticationOnly returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasThreeDSAuthenticationOnly() bool { + if o != nil && !common.IsNil(o.ThreeDSAuthenticationOnly) { + return true + } + + return false +} + +// SetThreeDSAuthenticationOnly gets a reference to the given bool and assigns it to the ThreeDSAuthenticationOnly field. +// Deprecated +func (o *CheckoutPaymentRequest) SetThreeDSAuthenticationOnly(v bool) { + o.ThreeDSAuthenticationOnly = &v +} + +// GetTrustedShopper returns the TrustedShopper field value if set, zero value otherwise. +func (o *CheckoutPaymentRequest) GetTrustedShopper() bool { + if o == nil || common.IsNil(o.TrustedShopper) { + var ret bool + return ret + } + return *o.TrustedShopper +} + +// GetTrustedShopperOk returns a tuple with the TrustedShopper field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutPaymentRequest) GetTrustedShopperOk() (*bool, bool) { + if o == nil || common.IsNil(o.TrustedShopper) { + return nil, false + } + return o.TrustedShopper, true +} + +// HasTrustedShopper returns a boolean if a field has been set. +func (o *CheckoutPaymentRequest) HasTrustedShopper() bool { + if o != nil && !common.IsNil(o.TrustedShopper) { + return true + } + + return false +} + +// SetTrustedShopper gets a reference to the given bool and assigns it to the TrustedShopper field. +func (o *CheckoutPaymentRequest) SetTrustedShopper(v bool) { + o.TrustedShopper = &v +} + +func (o CheckoutPaymentRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CheckoutPaymentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountInfo) { + toSerialize["accountInfo"] = o.AccountInfo + } + if !common.IsNil(o.AdditionalAmount) { + toSerialize["additionalAmount"] = o.AdditionalAmount + } + if !common.IsNil(o.AdditionalData) { + toSerialize["additionalData"] = o.AdditionalData + } + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } + if !common.IsNil(o.AuthenticationData) { + toSerialize["authenticationData"] = o.AuthenticationData + } + if !common.IsNil(o.BillingAddress) { + toSerialize["billingAddress"] = o.BillingAddress + } + if !common.IsNil(o.BrowserInfo) { + toSerialize["browserInfo"] = o.BrowserInfo + } + if !common.IsNil(o.CaptureDelayHours) { + toSerialize["captureDelayHours"] = o.CaptureDelayHours + } + if !common.IsNil(o.Channel) { + toSerialize["channel"] = o.Channel + } + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.Company) { + toSerialize["company"] = o.Company + } + if !common.IsNil(o.ConversionId) { + toSerialize["conversionId"] = o.ConversionId + } + if !common.IsNil(o.CountryCode) { + toSerialize["countryCode"] = o.CountryCode + } + if !common.IsNil(o.DateOfBirth) { + toSerialize["dateOfBirth"] = o.DateOfBirth + } + if !common.IsNil(o.DccQuote) { + toSerialize["dccQuote"] = o.DccQuote + } + if !common.IsNil(o.DeliveryAddress) { + toSerialize["deliveryAddress"] = o.DeliveryAddress + } + if !common.IsNil(o.DeliveryDate) { + toSerialize["deliveryDate"] = o.DeliveryDate + } + if !common.IsNil(o.DeviceFingerprint) { + toSerialize["deviceFingerprint"] = o.DeviceFingerprint + } + if !common.IsNil(o.EnableOneClick) { + toSerialize["enableOneClick"] = o.EnableOneClick + } + if !common.IsNil(o.EnablePayOut) { + toSerialize["enablePayOut"] = o.EnablePayOut + } + if !common.IsNil(o.EnableRecurring) { + toSerialize["enableRecurring"] = o.EnableRecurring + } + if !common.IsNil(o.EntityType) { + toSerialize["entityType"] = o.EntityType + } + if !common.IsNil(o.FraudOffset) { + toSerialize["fraudOffset"] = o.FraudOffset + } + if !common.IsNil(o.IndustryUsage) { + toSerialize["industryUsage"] = o.IndustryUsage + } + if !common.IsNil(o.Installments) { + toSerialize["installments"] = o.Installments + } + if !common.IsNil(o.LineItems) { + toSerialize["lineItems"] = o.LineItems + } + if !common.IsNil(o.LocalizedShopperStatement) { + toSerialize["localizedShopperStatement"] = o.LocalizedShopperStatement + } + if !common.IsNil(o.Mandate) { + toSerialize["mandate"] = o.Mandate + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantAccount) { + toSerialize["merchantAccount"] = o.MerchantAccount + } + if !common.IsNil(o.MerchantOrderReference) { + toSerialize["merchantOrderReference"] = o.MerchantOrderReference + } + if !common.IsNil(o.MerchantRiskIndicator) { + toSerialize["merchantRiskIndicator"] = o.MerchantRiskIndicator + } + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !common.IsNil(o.MpiData) { + toSerialize["mpiData"] = o.MpiData + } + if !common.IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !common.IsNil(o.OrderReference) { + toSerialize["orderReference"] = o.OrderReference + } + if !common.IsNil(o.Origin) { + toSerialize["origin"] = o.Origin + } + if !common.IsNil(o.PaymentMethod) { + toSerialize["paymentMethod"] = o.PaymentMethod + } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } + if !common.IsNil(o.RecurringExpiry) { + toSerialize["recurringExpiry"] = o.RecurringExpiry + } + if !common.IsNil(o.RecurringFrequency) { + toSerialize["recurringFrequency"] = o.RecurringFrequency + } + if !common.IsNil(o.RecurringProcessingModel) { + toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel + } + if !common.IsNil(o.RedirectFromIssuerMethod) { + toSerialize["redirectFromIssuerMethod"] = o.RedirectFromIssuerMethod + } + if !common.IsNil(o.RedirectToIssuerMethod) { + toSerialize["redirectToIssuerMethod"] = o.RedirectToIssuerMethod + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.ReturnUrl) { + toSerialize["returnUrl"] = o.ReturnUrl + } + if !common.IsNil(o.RiskData) { + toSerialize["riskData"] = o.RiskData + } + if !common.IsNil(o.SessionValidity) { + toSerialize["sessionValidity"] = o.SessionValidity + } + if !common.IsNil(o.ShopperEmail) { + toSerialize["shopperEmail"] = o.ShopperEmail + } + if !common.IsNil(o.ShopperIP) { + toSerialize["shopperIP"] = o.ShopperIP + } + if !common.IsNil(o.ShopperInteraction) { + toSerialize["shopperInteraction"] = o.ShopperInteraction + } + if !common.IsNil(o.ShopperLocale) { + toSerialize["shopperLocale"] = o.ShopperLocale + } + if !common.IsNil(o.ShopperName) { + toSerialize["shopperName"] = o.ShopperName + } + if !common.IsNil(o.ShopperReference) { + toSerialize["shopperReference"] = o.ShopperReference + } + if !common.IsNil(o.ShopperStatement) { + toSerialize["shopperStatement"] = o.ShopperStatement + } + if !common.IsNil(o.SocialSecurityNumber) { + toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber + } + if !common.IsNil(o.Splits) { + toSerialize["splits"] = o.Splits + } + if !common.IsNil(o.Store) { + toSerialize["store"] = o.Store + } + if !common.IsNil(o.StorePaymentMethod) { + toSerialize["storePaymentMethod"] = o.StorePaymentMethod + } + if !common.IsNil(o.TelephoneNumber) { + toSerialize["telephoneNumber"] = o.TelephoneNumber + } + if !common.IsNil(o.ThreeDS2RequestData) { + toSerialize["threeDS2RequestData"] = o.ThreeDS2RequestData + } + if !common.IsNil(o.ThreeDSAuthenticationOnly) { + toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly + } + if !common.IsNil(o.TrustedShopper) { + toSerialize["trustedShopper"] = o.TrustedShopper + } + return toSerialize, nil +} + +type NullableCheckoutPaymentRequest struct { + value *CheckoutPaymentRequest + isSet bool +} + +func (v NullableCheckoutPaymentRequest) Get() *CheckoutPaymentRequest { + return v.value +} + +func (v *NullableCheckoutPaymentRequest) Set(val *CheckoutPaymentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCheckoutPaymentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckoutPaymentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckoutPaymentRequest(val *CheckoutPaymentRequest) *NullableCheckoutPaymentRequest { + return &NullableCheckoutPaymentRequest{value: val, isSet: true} +} + +func (v NullableCheckoutPaymentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckoutPaymentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CheckoutPaymentRequest) isValidChannel() bool { + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false +} +func (o *CheckoutPaymentRequest) isValidEntityType() bool { + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false +} +func (o *CheckoutPaymentRequest) isValidIndustryUsage() bool { + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false +} +func (o *CheckoutPaymentRequest) isValidRecurringProcessingModel() bool { + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false +} +func (o *CheckoutPaymentRequest) isValidShopperInteraction() bool { + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_checkout_qr_code_action.go b/src/checkout/model_checkout_qr_code_action.go index d95e1fbee..dcc8bb7b4 100644 --- a/src/checkout/model_checkout_qr_code_action.go +++ b/src/checkout/model_checkout_qr_code_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutQrCodeAction type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *CheckoutQrCodeAction) SetUrl(v string) { } func (o CheckoutQrCodeAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -300,12 +299,14 @@ func (v *NullableCheckoutQrCodeAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutQrCodeAction) isValidType() bool { - var allowedEnumValues = []string{"qrCode"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "qrCode" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_redirect_action.go b/src/checkout/model_checkout_redirect_action.go index e9386228b..e100278c5 100644 --- a/src/checkout/model_checkout_redirect_action.go +++ b/src/checkout/model_checkout_redirect_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutRedirectAction type satisfies the MappedNullable interface at compile time @@ -202,7 +201,7 @@ func (o *CheckoutRedirectAction) SetUrl(v string) { } func (o CheckoutRedirectAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,12 +262,14 @@ func (v *NullableCheckoutRedirectAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutRedirectAction) isValidType() bool { - var allowedEnumValues = []string{"redirect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "redirect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_sdk_action.go b/src/checkout/model_checkout_sdk_action.go index b86c0ce12..b5d37667d 100644 --- a/src/checkout/model_checkout_sdk_action.go +++ b/src/checkout/model_checkout_sdk_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutSDKAction type satisfies the MappedNullable interface at compile time @@ -202,7 +201,7 @@ func (o *CheckoutSDKAction) SetUrl(v string) { } func (o CheckoutSDKAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,12 +262,14 @@ func (v *NullableCheckoutSDKAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutSDKAction) isValidType() bool { - var allowedEnumValues = []string{"sdk", "wechatpaySDK"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sdk", "wechatpaySDK" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_session_installment_option.go b/src/checkout/model_checkout_session_installment_option.go index 1b9ddccc9..a75c9ded9 100644 --- a/src/checkout/model_checkout_session_installment_option.go +++ b/src/checkout/model_checkout_session_installment_option.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutSessionInstallmentOption type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CheckoutSessionInstallmentOption) SetValues(v []int32) { } func (o CheckoutSessionInstallmentOption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCheckoutSessionInstallmentOption) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_three_ds2_action.go b/src/checkout/model_checkout_three_ds2_action.go index 2440b2c61..d08480e27 100644 --- a/src/checkout/model_checkout_three_ds2_action.go +++ b/src/checkout/model_checkout_three_ds2_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutThreeDS2Action type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *CheckoutThreeDS2Action) SetUrl(v string) { } func (o CheckoutThreeDS2Action) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -337,12 +336,14 @@ func (v *NullableCheckoutThreeDS2Action) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutThreeDS2Action) isValidType() bool { - var allowedEnumValues = []string{"threeDS2"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "threeDS2" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_utility_request.go b/src/checkout/model_checkout_utility_request.go index 761e3171e..704aab461 100644 --- a/src/checkout/model_checkout_utility_request.go +++ b/src/checkout/model_checkout_utility_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutUtilityRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *CheckoutUtilityRequest) SetOriginDomains(v []string) { } func (o CheckoutUtilityRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableCheckoutUtilityRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_utility_response.go b/src/checkout/model_checkout_utility_response.go index 561bfeece..c1d07d295 100644 --- a/src/checkout/model_checkout_utility_response.go +++ b/src/checkout/model_checkout_utility_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutUtilityResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CheckoutUtilityResponse) SetOriginKeys(v map[string]string) { } func (o CheckoutUtilityResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCheckoutUtilityResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_voucher_action.go b/src/checkout/model_checkout_voucher_action.go index 42f41bf4c..d3841d2cc 100644 --- a/src/checkout/model_checkout_voucher_action.go +++ b/src/checkout/model_checkout_voucher_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CheckoutVoucherAction type satisfies the MappedNullable interface at compile time @@ -28,7 +27,7 @@ type CheckoutVoucherAction struct { // An entity number of Multibanco. Entity *string `json:"entity,omitempty"` // The date time of the voucher expiry. - ExpiresAt *string `json:"expiresAt,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` InitialAmount *Amount `json:"initialAmount,omitempty"` // The URL to the detailed instructions to make payment using the voucher. InstructionsUrl *string `json:"instructionsUrl,omitempty"` @@ -50,7 +49,7 @@ type CheckoutVoucherAction struct { ShopperEmail *string `json:"shopperEmail,omitempty"` // The shopper name. ShopperName *string `json:"shopperName,omitempty"` - Surcharge *Amount `json:"surcharge,omitempty"` + Surcharge *Amount `json:"surcharge,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` // **voucher** Type string `json:"type"` @@ -709,7 +708,7 @@ func (o *CheckoutVoucherAction) SetUrl(v string) { } func (o CheckoutVoucherAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -815,12 +814,14 @@ func (v *NullableCheckoutVoucherAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutVoucherAction) isValidType() bool { - var allowedEnumValues = []string{"voucher"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "voucher" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_common_field.go b/src/checkout/model_common_field.go index f28587ad5..ea2045e42 100644 --- a/src/checkout/model_common_field.go +++ b/src/checkout/model_common_field.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CommonField type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CommonField) SetVersion(v string) { } func (o CommonField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommonField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_company.go b/src/checkout/model_company.go index 82a51ea3e..790eb111f 100644 --- a/src/checkout/model_company.go +++ b/src/checkout/model_company.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Company type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *Company) SetType(v string) { } func (o Company) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableCompany) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_configuration.go b/src/checkout/model_configuration.go index b550a5f08..4b7ca05f3 100644 --- a/src/checkout/model_configuration.go +++ b/src/checkout/model_configuration.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Configuration type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &Configuration{} type Configuration struct { Avs *Avs `json:"avs,omitempty"` // Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED - CardHolderName *string `json:"cardHolderName,omitempty"` - Installments *InstallmentsNumber `json:"installments,omitempty"` - ShopperInput *ShopperInput `json:"shopperInput,omitempty"` + CardHolderName *string `json:"cardHolderName,omitempty"` + Installments *InstallmentsNumber `json:"installments,omitempty"` + ShopperInput *ShopperInput `json:"shopperInput,omitempty"` } // NewConfiguration instantiates a new Configuration object @@ -172,7 +171,7 @@ func (o *Configuration) SetShopperInput(v ShopperInput) { } func (o Configuration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,12 +231,14 @@ func (v *NullableConfiguration) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Configuration) isValidCardHolderName() bool { - var allowedEnumValues = []string{"NONE", "OPTIONAL", "REQUIRED"} - for _, allowed := range allowedEnumValues { - if o.GetCardHolderName() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NONE", "OPTIONAL", "REQUIRED" } + for _, allowed := range allowedEnumValues { + if o.GetCardHolderName() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_apple_pay_session_request.go b/src/checkout/model_create_apple_pay_session_request.go index a086444db..2b6d0dae7 100644 --- a/src/checkout/model_create_apple_pay_session_request.go +++ b/src/checkout/model_create_apple_pay_session_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateApplePaySessionRequest type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *CreateApplePaySessionRequest) SetMerchantIdentifier(v string) { } func (o CreateApplePaySessionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableCreateApplePaySessionRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index 282f80bb2..74b9f79e4 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCheckoutSessionRequest type satisfies the MappedNullable interface at compile time @@ -20,30 +19,30 @@ var _ common.MappedNullable = &CreateCheckoutSessionRequest{} // CreateCheckoutSessionRequest struct for CreateCheckoutSessionRequest type CreateCheckoutSessionRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo2 `json:"accountInfo,omitempty"` + AdditionalAmount *Amount2 `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount2 `json:"amount"` + ApplicationInfo *ApplicationInfo2 `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *Address2 `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - Channel *string `json:"channel,omitempty"` + Channel *string `json:"channel,omitempty"` Company *Company `json:"company,omitempty"` // The shopper's two-letter country code. CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address2 `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. @@ -51,28 +50,28 @@ type CreateCheckoutSessionRequest struct { // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. EnableRecurring *bool `json:"enableRecurring,omitempty"` // The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - ExpiresAt *time.Time `json:"expiresAt,omitempty"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. InstallmentOptions *map[string]CheckoutSessionInstallmentOption `json:"installmentOptions,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -81,8 +80,8 @@ type CreateCheckoutSessionRequest struct { // The reference to uniquely identify a payment. Reference string `json:"reference"` // The URL to return to when a redirect payment is completed. - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). @@ -91,7 +90,7 @@ type CreateCheckoutSessionRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name2 `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -100,8 +99,8 @@ type CreateCheckoutSessionRequest struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - Splits []Split `json:"splits,omitempty"` + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + Splits []Split2 `json:"splits,omitempty"` // The ecommerce or point-of-sale store that is processing the payment. Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. @@ -121,7 +120,7 @@ type CreateCheckoutSessionRequest struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, reference string, returnUrl string) *CreateCheckoutSessionRequest { +func NewCreateCheckoutSessionRequest(amount Amount2, merchantAccount string, reference string, returnUrl string) *CreateCheckoutSessionRequest { this := CreateCheckoutSessionRequest{} this.Amount = amount this.MerchantAccount = merchantAccount @@ -147,9 +146,9 @@ func NewCreateCheckoutSessionRequestWithDefaults() *CreateCheckoutSessionRequest } // GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetAccountInfo() AccountInfo { +func (o *CreateCheckoutSessionRequest) GetAccountInfo() AccountInfo2 { if o == nil || common.IsNil(o.AccountInfo) { - var ret AccountInfo + var ret AccountInfo2 return ret } return *o.AccountInfo @@ -157,7 +156,7 @@ func (o *CreateCheckoutSessionRequest) GetAccountInfo() AccountInfo { // GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetAccountInfoOk() (*AccountInfo, bool) { +func (o *CreateCheckoutSessionRequest) GetAccountInfoOk() (*AccountInfo2, bool) { if o == nil || common.IsNil(o.AccountInfo) { return nil, false } @@ -173,15 +172,15 @@ func (o *CreateCheckoutSessionRequest) HasAccountInfo() bool { return false } -// SetAccountInfo gets a reference to the given AccountInfo and assigns it to the AccountInfo field. -func (o *CreateCheckoutSessionRequest) SetAccountInfo(v AccountInfo) { +// SetAccountInfo gets a reference to the given AccountInfo2 and assigns it to the AccountInfo field. +func (o *CreateCheckoutSessionRequest) SetAccountInfo(v AccountInfo2) { o.AccountInfo = &v } // GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetAdditionalAmount() Amount { +func (o *CreateCheckoutSessionRequest) GetAdditionalAmount() Amount2 { if o == nil || common.IsNil(o.AdditionalAmount) { - var ret Amount + var ret Amount2 return ret } return *o.AdditionalAmount @@ -189,7 +188,7 @@ func (o *CreateCheckoutSessionRequest) GetAdditionalAmount() Amount { // GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetAdditionalAmountOk() (*Amount, bool) { +func (o *CreateCheckoutSessionRequest) GetAdditionalAmountOk() (*Amount2, bool) { if o == nil || common.IsNil(o.AdditionalAmount) { return nil, false } @@ -205,8 +204,8 @@ func (o *CreateCheckoutSessionRequest) HasAdditionalAmount() bool { return false } -// SetAdditionalAmount gets a reference to the given Amount and assigns it to the AdditionalAmount field. -func (o *CreateCheckoutSessionRequest) SetAdditionalAmount(v Amount) { +// SetAdditionalAmount gets a reference to the given Amount2 and assigns it to the AdditionalAmount field. +func (o *CreateCheckoutSessionRequest) SetAdditionalAmount(v Amount2) { o.AdditionalAmount = &v } @@ -275,9 +274,9 @@ func (o *CreateCheckoutSessionRequest) SetAllowedPaymentMethods(v []string) { } // GetAmount returns the Amount field value -func (o *CreateCheckoutSessionRequest) GetAmount() Amount { +func (o *CreateCheckoutSessionRequest) GetAmount() Amount2 { if o == nil { - var ret Amount + var ret Amount2 return ret } @@ -286,7 +285,7 @@ func (o *CreateCheckoutSessionRequest) GetAmount() Amount { // GetAmountOk returns a tuple with the Amount field value // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetAmountOk() (*Amount, bool) { +func (o *CreateCheckoutSessionRequest) GetAmountOk() (*Amount2, bool) { if o == nil { return nil, false } @@ -294,14 +293,14 @@ func (o *CreateCheckoutSessionRequest) GetAmountOk() (*Amount, bool) { } // SetAmount sets field value -func (o *CreateCheckoutSessionRequest) SetAmount(v Amount) { +func (o *CreateCheckoutSessionRequest) SetAmount(v Amount2) { o.Amount = v } // GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetApplicationInfo() ApplicationInfo { +func (o *CreateCheckoutSessionRequest) GetApplicationInfo() ApplicationInfo2 { if o == nil || common.IsNil(o.ApplicationInfo) { - var ret ApplicationInfo + var ret ApplicationInfo2 return ret } return *o.ApplicationInfo @@ -309,7 +308,7 @@ func (o *CreateCheckoutSessionRequest) GetApplicationInfo() ApplicationInfo { // GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { +func (o *CreateCheckoutSessionRequest) GetApplicationInfoOk() (*ApplicationInfo2, bool) { if o == nil || common.IsNil(o.ApplicationInfo) { return nil, false } @@ -325,8 +324,8 @@ func (o *CreateCheckoutSessionRequest) HasApplicationInfo() bool { return false } -// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. -func (o *CreateCheckoutSessionRequest) SetApplicationInfo(v ApplicationInfo) { +// SetApplicationInfo gets a reference to the given ApplicationInfo2 and assigns it to the ApplicationInfo field. +func (o *CreateCheckoutSessionRequest) SetApplicationInfo(v ApplicationInfo2) { o.ApplicationInfo = &v } @@ -363,9 +362,9 @@ func (o *CreateCheckoutSessionRequest) SetAuthenticationData(v AuthenticationDat } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address { +func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address2 { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret Address2 return ret } return *o.BillingAddress @@ -373,7 +372,7 @@ func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*Address2, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -389,8 +388,8 @@ func (o *CreateCheckoutSessionRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CreateCheckoutSessionRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given Address2 and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionRequest) SetBillingAddress(v Address2) { o.BillingAddress = &v } @@ -619,9 +618,9 @@ func (o *CreateCheckoutSessionRequest) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address { +func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address2 { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret Address2 return ret } return *o.DeliveryAddress @@ -629,7 +628,7 @@ func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*Address2, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -645,8 +644,8 @@ func (o *CreateCheckoutSessionRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given Address2 and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v Address2) { o.DeliveryAddress = &v } @@ -1459,9 +1458,9 @@ func (o *CreateCheckoutSessionRequest) SetShopperLocale(v string) { } // GetShopperName returns the ShopperName field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetShopperName() Name { +func (o *CreateCheckoutSessionRequest) GetShopperName() Name2 { if o == nil || common.IsNil(o.ShopperName) { - var ret Name + var ret Name2 return ret } return *o.ShopperName @@ -1469,7 +1468,7 @@ func (o *CreateCheckoutSessionRequest) GetShopperName() Name { // GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetShopperNameOk() (*Name, bool) { +func (o *CreateCheckoutSessionRequest) GetShopperNameOk() (*Name2, bool) { if o == nil || common.IsNil(o.ShopperName) { return nil, false } @@ -1485,8 +1484,8 @@ func (o *CreateCheckoutSessionRequest) HasShopperName() bool { return false } -// SetShopperName gets a reference to the given Name and assigns it to the ShopperName field. -func (o *CreateCheckoutSessionRequest) SetShopperName(v Name) { +// SetShopperName gets a reference to the given Name2 and assigns it to the ShopperName field. +func (o *CreateCheckoutSessionRequest) SetShopperName(v Name2) { o.ShopperName = &v } @@ -1619,9 +1618,9 @@ func (o *CreateCheckoutSessionRequest) SetSplitCardFundingSources(v bool) { } // GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetSplits() []Split { +func (o *CreateCheckoutSessionRequest) GetSplits() []Split2 { if o == nil || common.IsNil(o.Splits) { - var ret []Split + var ret []Split2 return ret } return o.Splits @@ -1629,7 +1628,7 @@ func (o *CreateCheckoutSessionRequest) GetSplits() []Split { // GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetSplitsOk() ([]Split, bool) { +func (o *CreateCheckoutSessionRequest) GetSplitsOk() ([]Split2, bool) { if o == nil || common.IsNil(o.Splits) { return nil, false } @@ -1645,8 +1644,8 @@ func (o *CreateCheckoutSessionRequest) HasSplits() bool { return false } -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreateCheckoutSessionRequest) SetSplits(v []Split) { +// SetSplits gets a reference to the given []Split2 and assigns it to the Splits field. +func (o *CreateCheckoutSessionRequest) SetSplits(v []Split2) { o.Splits = v } @@ -1846,7 +1845,7 @@ func (o *CreateCheckoutSessionRequest) SetTrustedShopper(v bool) { } func (o CreateCheckoutSessionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2048,39 +2047,41 @@ func (v *NullableCreateCheckoutSessionRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateCheckoutSessionRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index 3d6645b10..863bc6d38 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCheckoutSessionResponse type satisfies the MappedNullable interface at compile time @@ -20,30 +19,30 @@ var _ common.MappedNullable = &CreateCheckoutSessionResponse{} // CreateCheckoutSessionResponse struct for CreateCheckoutSessionResponse type CreateCheckoutSessionResponse struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo2 `json:"accountInfo,omitempty"` + AdditionalAmount *Amount2 `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount2 `json:"amount"` + ApplicationInfo *ApplicationInfo2 `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *Address2 `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - Channel *string `json:"channel,omitempty"` + Channel *string `json:"channel,omitempty"` Company *Company `json:"company,omitempty"` // The shopper's two-letter country code. CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address2 `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. @@ -51,8 +50,8 @@ type CreateCheckoutSessionResponse struct { // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. EnableRecurring *bool `json:"enableRecurring,omitempty"` // The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - ExpiresAt time.Time `json:"expiresAt"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + ExpiresAt time.Time `json:"expiresAt"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // A unique identifier of the session. Id string `json:"id"` @@ -60,23 +59,23 @@ type CreateCheckoutSessionResponse struct { InstallmentOptions *map[string]CheckoutSessionInstallmentOption `json:"installmentOptions,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - Mode *string `json:"mode,omitempty"` + Mode *string `json:"mode,omitempty"` MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -85,8 +84,8 @@ type CreateCheckoutSessionResponse struct { // The reference to uniquely identify a payment. Reference string `json:"reference"` // The URL to return to when a redirect payment is completed. - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The payment session data you need to pass to your front end. SessionData *string `json:"sessionData,omitempty"` // The shopper's email address. @@ -97,7 +96,7 @@ type CreateCheckoutSessionResponse struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name2 `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -106,8 +105,8 @@ type CreateCheckoutSessionResponse struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - Splits []Split `json:"splits,omitempty"` + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + Splits []Split2 `json:"splits,omitempty"` // The ecommerce or point-of-sale store that is processing the payment. Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. @@ -127,7 +126,7 @@ type CreateCheckoutSessionResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateCheckoutSessionResponse(amount Amount, expiresAt time.Time, id string, merchantAccount string, reference string, returnUrl string) *CreateCheckoutSessionResponse { +func NewCreateCheckoutSessionResponse(amount Amount2, expiresAt time.Time, id string, merchantAccount string, reference string, returnUrl string) *CreateCheckoutSessionResponse { this := CreateCheckoutSessionResponse{} this.Amount = amount this.ExpiresAt = expiresAt @@ -159,9 +158,9 @@ func NewCreateCheckoutSessionResponseWithDefaults() *CreateCheckoutSessionRespon } // GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetAccountInfo() AccountInfo { +func (o *CreateCheckoutSessionResponse) GetAccountInfo() AccountInfo2 { if o == nil || common.IsNil(o.AccountInfo) { - var ret AccountInfo + var ret AccountInfo2 return ret } return *o.AccountInfo @@ -169,7 +168,7 @@ func (o *CreateCheckoutSessionResponse) GetAccountInfo() AccountInfo { // GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetAccountInfoOk() (*AccountInfo, bool) { +func (o *CreateCheckoutSessionResponse) GetAccountInfoOk() (*AccountInfo2, bool) { if o == nil || common.IsNil(o.AccountInfo) { return nil, false } @@ -185,15 +184,15 @@ func (o *CreateCheckoutSessionResponse) HasAccountInfo() bool { return false } -// SetAccountInfo gets a reference to the given AccountInfo and assigns it to the AccountInfo field. -func (o *CreateCheckoutSessionResponse) SetAccountInfo(v AccountInfo) { +// SetAccountInfo gets a reference to the given AccountInfo2 and assigns it to the AccountInfo field. +func (o *CreateCheckoutSessionResponse) SetAccountInfo(v AccountInfo2) { o.AccountInfo = &v } // GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetAdditionalAmount() Amount { +func (o *CreateCheckoutSessionResponse) GetAdditionalAmount() Amount2 { if o == nil || common.IsNil(o.AdditionalAmount) { - var ret Amount + var ret Amount2 return ret } return *o.AdditionalAmount @@ -201,7 +200,7 @@ func (o *CreateCheckoutSessionResponse) GetAdditionalAmount() Amount { // GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetAdditionalAmountOk() (*Amount, bool) { +func (o *CreateCheckoutSessionResponse) GetAdditionalAmountOk() (*Amount2, bool) { if o == nil || common.IsNil(o.AdditionalAmount) { return nil, false } @@ -217,8 +216,8 @@ func (o *CreateCheckoutSessionResponse) HasAdditionalAmount() bool { return false } -// SetAdditionalAmount gets a reference to the given Amount and assigns it to the AdditionalAmount field. -func (o *CreateCheckoutSessionResponse) SetAdditionalAmount(v Amount) { +// SetAdditionalAmount gets a reference to the given Amount2 and assigns it to the AdditionalAmount field. +func (o *CreateCheckoutSessionResponse) SetAdditionalAmount(v Amount2) { o.AdditionalAmount = &v } @@ -287,9 +286,9 @@ func (o *CreateCheckoutSessionResponse) SetAllowedPaymentMethods(v []string) { } // GetAmount returns the Amount field value -func (o *CreateCheckoutSessionResponse) GetAmount() Amount { +func (o *CreateCheckoutSessionResponse) GetAmount() Amount2 { if o == nil { - var ret Amount + var ret Amount2 return ret } @@ -298,7 +297,7 @@ func (o *CreateCheckoutSessionResponse) GetAmount() Amount { // GetAmountOk returns a tuple with the Amount field value // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetAmountOk() (*Amount, bool) { +func (o *CreateCheckoutSessionResponse) GetAmountOk() (*Amount2, bool) { if o == nil { return nil, false } @@ -306,14 +305,14 @@ func (o *CreateCheckoutSessionResponse) GetAmountOk() (*Amount, bool) { } // SetAmount sets field value -func (o *CreateCheckoutSessionResponse) SetAmount(v Amount) { +func (o *CreateCheckoutSessionResponse) SetAmount(v Amount2) { o.Amount = v } // GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetApplicationInfo() ApplicationInfo { +func (o *CreateCheckoutSessionResponse) GetApplicationInfo() ApplicationInfo2 { if o == nil || common.IsNil(o.ApplicationInfo) { - var ret ApplicationInfo + var ret ApplicationInfo2 return ret } return *o.ApplicationInfo @@ -321,7 +320,7 @@ func (o *CreateCheckoutSessionResponse) GetApplicationInfo() ApplicationInfo { // GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetApplicationInfoOk() (*ApplicationInfo, bool) { +func (o *CreateCheckoutSessionResponse) GetApplicationInfoOk() (*ApplicationInfo2, bool) { if o == nil || common.IsNil(o.ApplicationInfo) { return nil, false } @@ -337,8 +336,8 @@ func (o *CreateCheckoutSessionResponse) HasApplicationInfo() bool { return false } -// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. -func (o *CreateCheckoutSessionResponse) SetApplicationInfo(v ApplicationInfo) { +// SetApplicationInfo gets a reference to the given ApplicationInfo2 and assigns it to the ApplicationInfo field. +func (o *CreateCheckoutSessionResponse) SetApplicationInfo(v ApplicationInfo2) { o.ApplicationInfo = &v } @@ -375,9 +374,9 @@ func (o *CreateCheckoutSessionResponse) SetAuthenticationData(v AuthenticationDa } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address { +func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address2 { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret Address2 return ret } return *o.BillingAddress @@ -385,7 +384,7 @@ func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*Address2, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -401,8 +400,8 @@ func (o *CreateCheckoutSessionResponse) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CreateCheckoutSessionResponse) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given Address2 and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionResponse) SetBillingAddress(v Address2) { o.BillingAddress = &v } @@ -631,9 +630,9 @@ func (o *CreateCheckoutSessionResponse) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address { +func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address2 { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret Address2 return ret } return *o.DeliveryAddress @@ -641,7 +640,7 @@ func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*Address2, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -657,8 +656,8 @@ func (o *CreateCheckoutSessionResponse) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given Address2 and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v Address2) { o.DeliveryAddress = &v } @@ -1551,9 +1550,9 @@ func (o *CreateCheckoutSessionResponse) SetShopperLocale(v string) { } // GetShopperName returns the ShopperName field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetShopperName() Name { +func (o *CreateCheckoutSessionResponse) GetShopperName() Name2 { if o == nil || common.IsNil(o.ShopperName) { - var ret Name + var ret Name2 return ret } return *o.ShopperName @@ -1561,7 +1560,7 @@ func (o *CreateCheckoutSessionResponse) GetShopperName() Name { // GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetShopperNameOk() (*Name, bool) { +func (o *CreateCheckoutSessionResponse) GetShopperNameOk() (*Name2, bool) { if o == nil || common.IsNil(o.ShopperName) { return nil, false } @@ -1577,8 +1576,8 @@ func (o *CreateCheckoutSessionResponse) HasShopperName() bool { return false } -// SetShopperName gets a reference to the given Name and assigns it to the ShopperName field. -func (o *CreateCheckoutSessionResponse) SetShopperName(v Name) { +// SetShopperName gets a reference to the given Name2 and assigns it to the ShopperName field. +func (o *CreateCheckoutSessionResponse) SetShopperName(v Name2) { o.ShopperName = &v } @@ -1711,9 +1710,9 @@ func (o *CreateCheckoutSessionResponse) SetSplitCardFundingSources(v bool) { } // GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetSplits() []Split { +func (o *CreateCheckoutSessionResponse) GetSplits() []Split2 { if o == nil || common.IsNil(o.Splits) { - var ret []Split + var ret []Split2 return ret } return o.Splits @@ -1721,7 +1720,7 @@ func (o *CreateCheckoutSessionResponse) GetSplits() []Split { // GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetSplitsOk() ([]Split, bool) { +func (o *CreateCheckoutSessionResponse) GetSplitsOk() ([]Split2, bool) { if o == nil || common.IsNil(o.Splits) { return nil, false } @@ -1737,8 +1736,8 @@ func (o *CreateCheckoutSessionResponse) HasSplits() bool { return false } -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreateCheckoutSessionResponse) SetSplits(v []Split) { +// SetSplits gets a reference to the given []Split2 and assigns it to the Splits field. +func (o *CreateCheckoutSessionResponse) SetSplits(v []Split2) { o.Splits = v } @@ -1938,7 +1937,7 @@ func (o *CreateCheckoutSessionResponse) SetTrustedShopper(v bool) { } func (o CreateCheckoutSessionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2009,7 +2008,7 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FundRecipient) { toSerialize["fundRecipient"] = o.FundRecipient } - // skip: id is readOnly + toSerialize["id"] = o.Id if !common.IsNil(o.InstallmentOptions) { toSerialize["installmentOptions"] = o.InstallmentOptions } @@ -2145,48 +2144,50 @@ func (v *NullableCreateCheckoutSessionResponse) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *CreateCheckoutSessionResponse) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidMode() bool { - var allowedEnumValues = []string{"embedded", "hosted"} - for _, allowed := range allowedEnumValues { - if o.GetMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "embedded", "hosted" } + for _, allowed := range allowedEnumValues { + if o.GetMode() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_payment_amount_update_request.go b/src/checkout/model_create_payment_amount_update_request.go index c7befc20f..6796a34a4 100644 --- a/src/checkout/model_create_payment_amount_update_request.go +++ b/src/checkout/model_create_payment_amount_update_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentAmountUpdateRequest type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *CreatePaymentAmountUpdateRequest) SetSplits(v []Split) { } func (o CreatePaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,12 +252,14 @@ func (v *NullableCreatePaymentAmountUpdateRequest) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *CreatePaymentAmountUpdateRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_payment_cancel_request.go b/src/checkout/model_create_payment_cancel_request.go index 48ce1ca9b..5ec5e8416 100644 --- a/src/checkout/model_create_payment_cancel_request.go +++ b/src/checkout/model_create_payment_cancel_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentCancelRequest type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *CreatePaymentCancelRequest) SetReference(v string) { } func (o CreatePaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableCreatePaymentCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_create_payment_capture_request.go b/src/checkout/model_create_payment_capture_request.go index 8bac4ec56..a2b4b8651 100644 --- a/src/checkout/model_create_payment_capture_request.go +++ b/src/checkout/model_create_payment_capture_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentCaptureRequest type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *CreatePaymentCaptureRequest) SetSplits(v []Split) { } func (o CreatePaymentCaptureRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -252,3 +251,6 @@ func (v *NullableCreatePaymentCaptureRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_create_payment_link_request.go b/src/checkout/model_create_payment_link_request.go index 61e19230e..385ae9b10 100644 --- a/src/checkout/model_create_payment_link_request.go +++ b/src/checkout/model_create_payment_link_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentLinkRequest type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &CreatePaymentLinkRequest{} // CreatePaymentLinkRequest struct for CreatePaymentLinkRequest type CreatePaymentLinkRequest struct { // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -34,11 +33,11 @@ type CreatePaymentLinkRequest struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.This value is represented in Zulu format which is utilized for API v70 and lower. ExpiresAt *string `json:"expiresAt,omitempty"` // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. InstallmentOptions *map[string]InstallmentOption `json:"installmentOptions,omitempty"` @@ -54,22 +53,22 @@ type CreatePaymentLinkRequest struct { MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // A reference that is used to uniquely identify the payment in future communications about the payment status. Reference string `json:"reference"` - // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. RequiredShopperFields []string `json:"requiredShopperFields,omitempty"` // Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. ReturnUrl *string `json:"returnUrl,omitempty"` // Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - Reusable *bool `json:"reusable,omitempty"` + Reusable *bool `json:"reusable,omitempty"` RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -80,11 +79,11 @@ type CreatePaymentLinkRequest struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` - // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. StorePaymentMethodMode *string `json:"storePaymentMethodMode,omitempty"` // The shopper's telephone number. TelephoneNumber *string `json:"telephoneNumber,omitempty"` @@ -1313,7 +1312,7 @@ func (o *CreatePaymentLinkRequest) SetThemeId(v string) { } func (o CreatePaymentLinkRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1469,21 +1468,23 @@ func (v *NullableCreatePaymentLinkRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreatePaymentLinkRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CreatePaymentLinkRequest) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_payment_refund_request.go b/src/checkout/model_create_payment_refund_request.go index 33f35cc12..30a518ffc 100644 --- a/src/checkout/model_create_payment_refund_request.go +++ b/src/checkout/model_create_payment_refund_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentRefundRequest type satisfies the MappedNullable interface at compile time @@ -228,7 +227,7 @@ func (o *CreatePaymentRefundRequest) SetSplits(v []Split) { } func (o CreatePaymentRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -290,12 +289,14 @@ func (v *NullableCreatePaymentRefundRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreatePaymentRefundRequest) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER" } + for _, allowed := range allowedEnumValues { + if o.GetMerchantRefundReason() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_payment_reversal_request.go b/src/checkout/model_create_payment_reversal_request.go index d01fef6ce..7d5ae1317 100644 --- a/src/checkout/model_create_payment_reversal_request.go +++ b/src/checkout/model_create_payment_reversal_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePaymentReversalRequest type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *CreatePaymentReversalRequest) SetReference(v string) { } func (o CreatePaymentReversalRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableCreatePaymentReversalRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_create_standalone_payment_cancel_request.go b/src/checkout/model_create_standalone_payment_cancel_request.go index ec3f229ff..098b03a67 100644 --- a/src/checkout/model_create_standalone_payment_cancel_request.go +++ b/src/checkout/model_create_standalone_payment_cancel_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateStandalonePaymentCancelRequest type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *CreateStandalonePaymentCancelRequest) SetReference(v string) { } func (o CreateStandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableCreateStandalonePaymentCancelRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_details_request.go b/src/checkout/model_details_request.go index e14bcb875..54274166a 100644 --- a/src/checkout/model_details_request.go +++ b/src/checkout/model_details_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DetailsRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &DetailsRequest{} // DetailsRequest struct for DetailsRequest type DetailsRequest struct { AuthenticationData *DetailsRequestAuthenticationData `json:"authenticationData,omitempty"` - Details PaymentCompletionDetails `json:"details"` - // The `paymentData` value from the `/payments` response. Required if the `/payments` response returns this value. + Details PaymentCompletionDetails `json:"details"` + // The `paymentData` value from the `/payments` response. Required if the `/payments` response returns this value. PaymentData *string `json:"paymentData,omitempty"` // Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. // Deprecated @@ -170,7 +169,7 @@ func (o *DetailsRequest) SetThreeDSAuthenticationOnly(v bool) { } func (o DetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -227,3 +226,6 @@ func (v *NullableDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_details_request_authentication_data.go b/src/checkout/model_details_request_authentication_data.go index ad2d07488..9f81f1433 100644 --- a/src/checkout/model_details_request_authentication_data.go +++ b/src/checkout/model_details_request_authentication_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DetailsRequestAuthenticationData type satisfies the MappedNullable interface at compile time @@ -77,7 +76,7 @@ func (o *DetailsRequestAuthenticationData) SetAuthenticationOnly(v bool) { } func (o DetailsRequestAuthenticationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -127,3 +126,6 @@ func (v *NullableDetailsRequestAuthenticationData) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_device_render_options.go b/src/checkout/model_device_render_options.go index b3837c5ce..e0fe3294b 100644 --- a/src/checkout/model_device_render_options.go +++ b/src/checkout/model_device_render_options.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DeviceRenderOptions type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *DeviceRenderOptions) SetSdkUiType(v []string) { } func (o DeviceRenderOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableDeviceRenderOptions) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DeviceRenderOptions) isValidSdkInterface() bool { - var allowedEnumValues = []string{"native", "html", "both"} - for _, allowed := range allowedEnumValues { - if o.GetSdkInterface() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "native", "html", "both" } + for _, allowed := range allowedEnumValues { + if o.GetSdkInterface() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_doku_details.go b/src/checkout/model_doku_details.go index 21a7a8504..e309777cd 100644 --- a/src/checkout/model_doku_details.go +++ b/src/checkout/model_doku_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DokuDetails type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *DokuDetails) SetType(v string) { } func (o DokuDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullableDokuDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DokuDetails) isValidType() bool { - var allowedEnumValues = []string{"doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_donation_response.go b/src/checkout/model_donation_response.go index 148d8ccff..686fe98ce 100644 --- a/src/checkout/model_donation_response.go +++ b/src/checkout/model_donation_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DonationResponse type satisfies the MappedNullable interface at compile time @@ -25,8 +24,8 @@ type DonationResponse struct { // Your unique resource identifier. Id *string `json:"id,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount *string `json:"merchantAccount,omitempty"` - Payment *PaymentResponse `json:"payment,omitempty"` + MerchantAccount *string `json:"merchantAccount,omitempty"` + Payment *PaymentResponse `json:"payment,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` // The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** @@ -275,7 +274,7 @@ func (o *DonationResponse) SetStatus(v string) { } func (o DonationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,12 +343,14 @@ func (v *NullableDonationResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DonationResponse) isValidStatus() bool { - var allowedEnumValues = []string{"completed", "pending", "refused"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "completed", "pending", "refused" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_dotpay_details.go b/src/checkout/model_dotpay_details.go index 500ff5180..474deace6 100644 --- a/src/checkout/model_dotpay_details.go +++ b/src/checkout/model_dotpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DotpayDetails type satisfies the MappedNullable interface at compile time @@ -138,7 +137,7 @@ func (o *DotpayDetails) SetType(v string) { } func (o DotpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -193,12 +192,14 @@ func (v *NullableDotpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DotpayDetails) isValidType() bool { - var allowedEnumValues = []string{"dotpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dotpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_dragonpay_details.go b/src/checkout/model_dragonpay_details.go index 922575310..5c35ea6ab 100644 --- a/src/checkout/model_dragonpay_details.go +++ b/src/checkout/model_dragonpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DragonpayDetails type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *DragonpayDetails) SetType(v string) { } func (o DragonpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -217,12 +216,14 @@ func (v *NullableDragonpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DragonpayDetails) isValidType() bool { - var allowedEnumValues = []string{"dragonpay_ebanking", "dragonpay_otc_banking", "dragonpay_otc_non_banking", "dragonpay_otc_philippines"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dragonpay_ebanking", "dragonpay_otc_banking", "dragonpay_otc_non_banking", "dragonpay_otc_philippines" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_econtext_voucher_details.go b/src/checkout/model_econtext_voucher_details.go index 7df576f24..e826f3e83 100644 --- a/src/checkout/model_econtext_voucher_details.go +++ b/src/checkout/model_econtext_voucher_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the EcontextVoucherDetails type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *EcontextVoucherDetails) SetType(v string) { } func (o EcontextVoucherDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -264,12 +263,14 @@ func (v *NullableEcontextVoucherDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *EcontextVoucherDetails) isValidType() bool { - var allowedEnumValues = []string{"econtext_seveneleven", "econtext_stores"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "econtext_seveneleven", "econtext_stores" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_encrypted_order_data.go b/src/checkout/model_encrypted_order_data.go index 797bd39db..458809c6f 100644 --- a/src/checkout/model_encrypted_order_data.go +++ b/src/checkout/model_encrypted_order_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the EncryptedOrderData type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *EncryptedOrderData) SetPspReference(v string) { } func (o EncryptedOrderData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableEncryptedOrderData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_external_platform.go b/src/checkout/model_external_platform.go index dc686cc9d..98a3f32e5 100644 --- a/src/checkout/model_external_platform.go +++ b/src/checkout/model_external_platform.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ExternalPlatform type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ExternalPlatform) SetVersion(v string) { } func (o ExternalPlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableExternalPlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_forex_quote.go b/src/checkout/model_forex_quote.go index 928e7067a..4f3bbf8c8 100644 --- a/src/checkout/model_forex_quote.go +++ b/src/checkout/model_forex_quote.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ForexQuote type satisfies the MappedNullable interface at compile time @@ -24,14 +23,14 @@ type ForexQuote struct { Account *string `json:"account,omitempty"` // The account type. AccountType *string `json:"accountType,omitempty"` - BaseAmount *Amount `json:"baseAmount,omitempty"` + BaseAmount *Amount `json:"baseAmount,omitempty"` // The base points. - BasePoints int32 `json:"basePoints"` - Buy *Amount `json:"buy,omitempty"` - Interbank *Amount `json:"interbank,omitempty"` + BasePoints int32 `json:"basePoints"` + Buy *Amount `json:"buy,omitempty"` + Interbank *Amount `json:"interbank,omitempty"` // The reference assigned to the forex quote request. Reference *string `json:"reference,omitempty"` - Sell *Amount `json:"sell,omitempty"` + Sell *Amount `json:"sell,omitempty"` // The signature to validate the integrity. Signature *string `json:"signature,omitempty"` // The source of the forex quote. @@ -430,7 +429,7 @@ func (o *ForexQuote) SetValidTill(v time.Time) { } func (o ForexQuote) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -509,3 +508,6 @@ func (v *NullableForexQuote) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_forex_quote_2.go b/src/checkout/model_forex_quote_2.go new file mode 100644 index 000000000..b30d2da75 --- /dev/null +++ b/src/checkout/model_forex_quote_2.go @@ -0,0 +1,531 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the ForexQuote2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ForexQuote2{} + +// ForexQuote2 struct for ForexQuote2 +type ForexQuote2 struct { + // The account name. + Account *string `json:"account,omitempty"` + // The account type. + AccountType *string `json:"accountType,omitempty"` + BaseAmount *Amount2 `json:"baseAmount,omitempty"` + // The base points. + BasePoints *int32 `json:"basePoints,omitempty"` + Buy *Amount2 `json:"buy,omitempty"` + Interbank *Amount2 `json:"interbank,omitempty"` + // The reference assigned to the forex quote request. + Reference *string `json:"reference,omitempty"` + Sell *Amount2 `json:"sell,omitempty"` + // The signature to validate the integrity. + Signature *string `json:"signature,omitempty"` + // The source of the forex quote. + Source *string `json:"source,omitempty"` + // The type of forex. + Type *string `json:"type,omitempty"` + // The date until which the forex quote is valid. + ValidTill *time.Time `json:"validTill,omitempty"` +} + +// NewForexQuote2 instantiates a new ForexQuote2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewForexQuote2() *ForexQuote2 { + this := ForexQuote2{} + return &this +} + +// NewForexQuote2WithDefaults instantiates a new ForexQuote2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewForexQuote2WithDefaults() *ForexQuote2 { + this := ForexQuote2{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *ForexQuote2) GetAccount() string { + if o == nil || common.IsNil(o.Account) { + var ret string + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *ForexQuote2) HasAccount() bool { + if o != nil && !common.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given string and assigns it to the Account field. +func (o *ForexQuote2) SetAccount(v string) { + o.Account = &v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *ForexQuote2) GetAccountType() string { + if o == nil || common.IsNil(o.AccountType) { + var ret string + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *ForexQuote2) HasAccountType() bool { + if o != nil && !common.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given string and assigns it to the AccountType field. +func (o *ForexQuote2) SetAccountType(v string) { + o.AccountType = &v +} + +// GetBaseAmount returns the BaseAmount field value if set, zero value otherwise. +func (o *ForexQuote2) GetBaseAmount() Amount2 { + if o == nil || common.IsNil(o.BaseAmount) { + var ret Amount2 + return ret + } + return *o.BaseAmount +} + +// GetBaseAmountOk returns a tuple with the BaseAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetBaseAmountOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.BaseAmount) { + return nil, false + } + return o.BaseAmount, true +} + +// HasBaseAmount returns a boolean if a field has been set. +func (o *ForexQuote2) HasBaseAmount() bool { + if o != nil && !common.IsNil(o.BaseAmount) { + return true + } + + return false +} + +// SetBaseAmount gets a reference to the given Amount2 and assigns it to the BaseAmount field. +func (o *ForexQuote2) SetBaseAmount(v Amount2) { + o.BaseAmount = &v +} + +// GetBasePoints returns the BasePoints field value if set, zero value otherwise. +func (o *ForexQuote2) GetBasePoints() int32 { + if o == nil || common.IsNil(o.BasePoints) { + var ret int32 + return ret + } + return *o.BasePoints +} + +// GetBasePointsOk returns a tuple with the BasePoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetBasePointsOk() (*int32, bool) { + if o == nil || common.IsNil(o.BasePoints) { + return nil, false + } + return o.BasePoints, true +} + +// HasBasePoints returns a boolean if a field has been set. +func (o *ForexQuote2) HasBasePoints() bool { + if o != nil && !common.IsNil(o.BasePoints) { + return true + } + + return false +} + +// SetBasePoints gets a reference to the given int32 and assigns it to the BasePoints field. +func (o *ForexQuote2) SetBasePoints(v int32) { + o.BasePoints = &v +} + +// GetBuy returns the Buy field value if set, zero value otherwise. +func (o *ForexQuote2) GetBuy() Amount2 { + if o == nil || common.IsNil(o.Buy) { + var ret Amount2 + return ret + } + return *o.Buy +} + +// GetBuyOk returns a tuple with the Buy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetBuyOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.Buy) { + return nil, false + } + return o.Buy, true +} + +// HasBuy returns a boolean if a field has been set. +func (o *ForexQuote2) HasBuy() bool { + if o != nil && !common.IsNil(o.Buy) { + return true + } + + return false +} + +// SetBuy gets a reference to the given Amount2 and assigns it to the Buy field. +func (o *ForexQuote2) SetBuy(v Amount2) { + o.Buy = &v +} + +// GetInterbank returns the Interbank field value if set, zero value otherwise. +func (o *ForexQuote2) GetInterbank() Amount2 { + if o == nil || common.IsNil(o.Interbank) { + var ret Amount2 + return ret + } + return *o.Interbank +} + +// GetInterbankOk returns a tuple with the Interbank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetInterbankOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.Interbank) { + return nil, false + } + return o.Interbank, true +} + +// HasInterbank returns a boolean if a field has been set. +func (o *ForexQuote2) HasInterbank() bool { + if o != nil && !common.IsNil(o.Interbank) { + return true + } + + return false +} + +// SetInterbank gets a reference to the given Amount2 and assigns it to the Interbank field. +func (o *ForexQuote2) SetInterbank(v Amount2) { + o.Interbank = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *ForexQuote2) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *ForexQuote2) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *ForexQuote2) SetReference(v string) { + o.Reference = &v +} + +// GetSell returns the Sell field value if set, zero value otherwise. +func (o *ForexQuote2) GetSell() Amount2 { + if o == nil || common.IsNil(o.Sell) { + var ret Amount2 + return ret + } + return *o.Sell +} + +// GetSellOk returns a tuple with the Sell field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetSellOk() (*Amount2, bool) { + if o == nil || common.IsNil(o.Sell) { + return nil, false + } + return o.Sell, true +} + +// HasSell returns a boolean if a field has been set. +func (o *ForexQuote2) HasSell() bool { + if o != nil && !common.IsNil(o.Sell) { + return true + } + + return false +} + +// SetSell gets a reference to the given Amount2 and assigns it to the Sell field. +func (o *ForexQuote2) SetSell(v Amount2) { + o.Sell = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *ForexQuote2) GetSignature() string { + if o == nil || common.IsNil(o.Signature) { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetSignatureOk() (*string, bool) { + if o == nil || common.IsNil(o.Signature) { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *ForexQuote2) HasSignature() bool { + if o != nil && !common.IsNil(o.Signature) { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *ForexQuote2) SetSignature(v string) { + o.Signature = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *ForexQuote2) GetSource() string { + if o == nil || common.IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *ForexQuote2) HasSource() bool { + if o != nil && !common.IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *ForexQuote2) SetSource(v string) { + o.Source = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ForexQuote2) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ForexQuote2) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ForexQuote2) SetType(v string) { + o.Type = &v +} + +// GetValidTill returns the ValidTill field value if set, zero value otherwise. +func (o *ForexQuote2) GetValidTill() time.Time { + if o == nil || common.IsNil(o.ValidTill) { + var ret time.Time + return ret + } + return *o.ValidTill +} + +// GetValidTillOk returns a tuple with the ValidTill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ForexQuote2) GetValidTillOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.ValidTill) { + return nil, false + } + return o.ValidTill, true +} + +// HasValidTill returns a boolean if a field has been set. +func (o *ForexQuote2) HasValidTill() bool { + if o != nil && !common.IsNil(o.ValidTill) { + return true + } + + return false +} + +// SetValidTill gets a reference to the given time.Time and assigns it to the ValidTill field. +func (o *ForexQuote2) SetValidTill(v time.Time) { + o.ValidTill = &v +} + +func (o ForexQuote2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ForexQuote2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + if !common.IsNil(o.AccountType) { + toSerialize["accountType"] = o.AccountType + } + if !common.IsNil(o.BaseAmount) { + toSerialize["baseAmount"] = o.BaseAmount + } + if !common.IsNil(o.BasePoints) { + toSerialize["basePoints"] = o.BasePoints + } + if !common.IsNil(o.Buy) { + toSerialize["buy"] = o.Buy + } + if !common.IsNil(o.Interbank) { + toSerialize["interbank"] = o.Interbank + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Sell) { + toSerialize["sell"] = o.Sell + } + if !common.IsNil(o.Signature) { + toSerialize["signature"] = o.Signature + } + if !common.IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !common.IsNil(o.ValidTill) { + toSerialize["validTill"] = o.ValidTill + } + return toSerialize, nil +} + +type NullableForexQuote2 struct { + value *ForexQuote2 + isSet bool +} + +func (v NullableForexQuote2) Get() *ForexQuote2 { + return v.value +} + +func (v *NullableForexQuote2) Set(val *ForexQuote2) { + v.value = val + v.isSet = true +} + +func (v NullableForexQuote2) IsSet() bool { + return v.isSet +} + +func (v *NullableForexQuote2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableForexQuote2(val *ForexQuote2) *NullableForexQuote2 { + return &NullableForexQuote2{value: val, isSet: true} +} + +func (v NullableForexQuote2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableForexQuote2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_fraud_check_result.go b/src/checkout/model_fraud_check_result.go index 870f2dba3..17d17fda2 100644 --- a/src/checkout/model_fraud_check_result.go +++ b/src/checkout/model_fraud_check_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fraud_result.go b/src/checkout/model_fraud_result.go index 42b267bd5..135bf0869 100644 --- a/src/checkout/model_fraud_result.go +++ b/src/checkout/model_fraud_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResult) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fund_origin.go b/src/checkout/model_fund_origin.go index 8189dea7f..8c17835ab 100644 --- a/src/checkout/model_fund_origin.go +++ b/src/checkout/model_fund_origin.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FundOrigin type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &FundOrigin{} // FundOrigin struct for FundOrigin type FundOrigin struct { BillingAddress *Address `json:"billingAddress,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` } // NewFundOrigin instantiates a new FundOrigin object @@ -105,7 +104,7 @@ func (o *FundOrigin) SetShopperName(v Name) { } func (o FundOrigin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableFundOrigin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fund_recipient.go b/src/checkout/model_fund_recipient.go index 585c4c7e3..8de84aaec 100644 --- a/src/checkout/model_fund_recipient.go +++ b/src/checkout/model_fund_recipient.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FundRecipient type satisfies the MappedNullable interface at compile time @@ -19,16 +18,16 @@ var _ common.MappedNullable = &FundRecipient{} // FundRecipient struct for FundRecipient type FundRecipient struct { - BillingAddress *Address `json:"billingAddress,omitempty"` - PaymentMethod *CardDetails `json:"paymentMethod,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + PaymentMethod *CardDetails `json:"paymentMethod,omitempty"` // the email address of the person ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. - StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` - SubMerchant *SubMerchant `json:"subMerchant,omitempty"` + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + SubMerchant *SubMerchant `json:"subMerchant,omitempty"` // the telephone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` // indicates where the money is going @@ -375,7 +374,7 @@ func (o *FundRecipient) SetWalletOwnerTaxId(v string) { } func (o FundRecipient) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -452,3 +451,6 @@ func (v *NullableFundRecipient) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_generic_issuer_payment_method_details.go b/src/checkout/model_generic_issuer_payment_method_details.go index 399287627..51a22ecf5 100644 --- a/src/checkout/model_generic_issuer_payment_method_details.go +++ b/src/checkout/model_generic_issuer_payment_method_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GenericIssuerPaymentMethodDetails type satisfies the MappedNullable interface at compile time @@ -199,7 +198,7 @@ func (o *GenericIssuerPaymentMethodDetails) SetType(v string) { } func (o GenericIssuerPaymentMethodDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -258,12 +257,14 @@ func (v *NullableGenericIssuerPaymentMethodDetails) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *GenericIssuerPaymentMethodDetails) isValidType() bool { - var allowedEnumValues = []string{"onlineBanking_PL", "eps", "onlineBanking_SK", "onlineBanking_CZ"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "onlineBanking_PL", "eps", "onlineBanking_SK", "onlineBanking_CZ" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_giropay_details.go b/src/checkout/model_giropay_details.go index 5703634f5..29df678e7 100644 --- a/src/checkout/model_giropay_details.go +++ b/src/checkout/model_giropay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GiropayDetails type satisfies the MappedNullable interface at compile time @@ -183,7 +182,7 @@ func (o *GiropayDetails) SetType(v string) { } func (o GiropayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -243,12 +242,14 @@ func (v *NullableGiropayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GiropayDetails) isValidType() bool { - var allowedEnumValues = []string{"giropay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "giropay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_google_pay_details.go b/src/checkout/model_google_pay_details.go index ec869d4cf..68a3ac25a 100644 --- a/src/checkout/model_google_pay_details.go +++ b/src/checkout/model_google_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GooglePayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *GooglePayDetails) SetType(v string) { } func (o GooglePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableGooglePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GooglePayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *GooglePayDetails) isValidType() bool { - var allowedEnumValues = []string{"googlepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "googlepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_ideal_details.go b/src/checkout/model_ideal_details.go index 06a12aa90..ac98b69a4 100644 --- a/src/checkout/model_ideal_details.go +++ b/src/checkout/model_ideal_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IdealDetails type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *IdealDetails) SetType(v string) { } func (o IdealDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableIdealDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IdealDetails) isValidType() bool { - var allowedEnumValues = []string{"ideal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ideal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_input_detail.go b/src/checkout/model_input_detail.go index eff60e755..6996284db 100644 --- a/src/checkout/model_input_detail.go +++ b/src/checkout/model_input_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InputDetail type satisfies the MappedNullable interface at compile time @@ -349,7 +348,7 @@ func (o *InputDetail) SetValue(v string) { } func (o InputDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -423,3 +422,6 @@ func (v *NullableInputDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_installment_option.go b/src/checkout/model_installment_option.go index 6318cf790..1b5491eb1 100644 --- a/src/checkout/model_installment_option.go +++ b/src/checkout/model_installment_option.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InstallmentOption type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *InstallmentOption) SetValues(v []int32) { } func (o InstallmentOption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableInstallmentOption) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_installments.go b/src/checkout/model_installments.go index 350cf12cd..00f7c590d 100644 --- a/src/checkout/model_installments.go +++ b/src/checkout/model_installments.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Installments type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Installments{} // Installments struct for Installments type Installments struct { - // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** Plan *string `json:"plan,omitempty"` // Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. Value int32 `json:"value"` @@ -100,7 +99,7 @@ func (o *Installments) SetValue(v int32) { } func (o Installments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableInstallments) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Installments) isValidPlan() bool { - var allowedEnumValues = []string{"regular", "revolving"} - for _, allowed := range allowedEnumValues { - if o.GetPlan() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "regular", "revolving" } + for _, allowed := range allowedEnumValues { + if o.GetPlan() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_installments_2.go b/src/checkout/model_installments_2.go new file mode 100644 index 000000000..433375b34 --- /dev/null +++ b/src/checkout/model_installments_2.go @@ -0,0 +1,173 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Installments2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Installments2{} + +// Installments2 struct for Installments2 +type Installments2 struct { + // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + Plan *string `json:"plan,omitempty"` + // Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. + Value *int32 `json:"value,omitempty"` +} + +// NewInstallments2 instantiates a new Installments2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstallments2() *Installments2 { + this := Installments2{} + return &this +} + +// NewInstallments2WithDefaults instantiates a new Installments2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstallments2WithDefaults() *Installments2 { + this := Installments2{} + return &this +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *Installments2) GetPlan() string { + if o == nil || common.IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Installments2) GetPlanOk() (*string, bool) { + if o == nil || common.IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *Installments2) HasPlan() bool { + if o != nil && !common.IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *Installments2) SetPlan(v string) { + o.Plan = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *Installments2) GetValue() int32 { + if o == nil || common.IsNil(o.Value) { + var ret int32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Installments2) GetValueOk() (*int32, bool) { + if o == nil || common.IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *Installments2) HasValue() bool { + if o != nil && !common.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given int32 and assigns it to the Value field. +func (o *Installments2) SetValue(v int32) { + o.Value = &v +} + +func (o Installments2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Installments2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !common.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableInstallments2 struct { + value *Installments2 + isSet bool +} + +func (v NullableInstallments2) Get() *Installments2 { + return v.value +} + +func (v *NullableInstallments2) Set(val *Installments2) { + v.value = val + v.isSet = true +} + +func (v NullableInstallments2) IsSet() bool { + return v.isSet +} + +func (v *NullableInstallments2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstallments2(val *Installments2) *NullableInstallments2 { + return &NullableInstallments2{value: val, isSet: true} +} + +func (v NullableInstallments2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstallments2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Installments2) isValidPlan() bool { + var allowedEnumValues = []string{ "regular", "revolving" } + for _, allowed := range allowedEnumValues { + if o.GetPlan() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_installments_number.go b/src/checkout/model_installments_number.go index 56271f80c..027d1aa24 100644 --- a/src/checkout/model_installments_number.go +++ b/src/checkout/model_installments_number.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InstallmentsNumber type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *InstallmentsNumber) SetMaxNumberOfInstallments(v int32) { } func (o InstallmentsNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableInstallmentsNumber) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_item.go b/src/checkout/model_item.go index 9d2c741be..94694a3c0 100644 --- a/src/checkout/model_item.go +++ b/src/checkout/model_item.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Item type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Item) SetName(v string) { } func (o Item) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_klarna_details.go b/src/checkout/model_klarna_details.go index 82f0c4623..913f64b5f 100644 --- a/src/checkout/model_klarna_details.go +++ b/src/checkout/model_klarna_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the KlarnaDetails type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *KlarnaDetails) SetType(v string) { } func (o KlarnaDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -343,12 +342,14 @@ func (v *NullableKlarnaDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *KlarnaDetails) isValidType() bool { - var allowedEnumValues = []string{"klarna", "klarnapayments", "klarnapayments_account", "klarnapayments_b2b", "klarna_paynow", "klarna_account", "klarna_b2b"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "klarna", "klarnapayments", "klarnapayments_account", "klarnapayments_b2b", "klarna_paynow", "klarna_account", "klarna_b2b" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_line_item.go b/src/checkout/model_line_item.go index 1d789cdb4..b94cc7142 100644 --- a/src/checkout/model_line_item.go +++ b/src/checkout/model_line_item.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LineItem type satisfies the MappedNullable interface at compile time @@ -617,7 +616,7 @@ func (o *LineItem) SetUpc(v string) { } func (o LineItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableLineItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_list_stored_payment_methods_response.go b/src/checkout/model_list_stored_payment_methods_response.go index 963c16aff..16fedf014 100644 --- a/src/checkout/model_list_stored_payment_methods_response.go +++ b/src/checkout/model_list_stored_payment_methods_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListStoredPaymentMethodsResponse type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ListStoredPaymentMethodsResponse) SetStoredPaymentMethods(v []StoredPay } func (o ListStoredPaymentMethodsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableListStoredPaymentMethodsResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_mandate.go b/src/checkout/model_mandate.go index a6e9f80dd..e1f9ea6a2 100644 --- a/src/checkout/model_mandate.go +++ b/src/checkout/model_mandate.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Mandate type satisfies the MappedNullable interface at compile time @@ -20,17 +19,17 @@ var _ common.MappedNullable = &Mandate{} // Mandate struct for Mandate type Mandate struct { // The billing amount (in minor units) of the recurring transactions. - Amount string `json:"amount"` - // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + Amount *string `json:"amount,omitempty"` + // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. AmountRule *string `json:"amountRule,omitempty"` - // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. BillingAttemptsRule *string `json:"billingAttemptsRule,omitempty"` // The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. BillingDay *string `json:"billingDay,omitempty"` // End date of the billing plan, in YYYY-MM-DD format. - EndsAt string `json:"endsAt"` + EndsAt *string `json:"endsAt,omitempty"` // The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. - Frequency string `json:"frequency"` + Frequency *string `json:"frequency,omitempty"` // The message shown by UPI to the shopper on the approval screen. Remarks *string `json:"remarks,omitempty"` // Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. @@ -41,11 +40,8 @@ type Mandate struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewMandate(amount string, endsAt string, frequency string) *Mandate { +func NewMandate() *Mandate { this := Mandate{} - this.Amount = amount - this.EndsAt = endsAt - this.Frequency = frequency return &this } @@ -57,28 +53,36 @@ func NewMandateWithDefaults() *Mandate { return &this } -// GetAmount returns the Amount field value +// GetAmount returns the Amount field value if set, zero value otherwise. func (o *Mandate) GetAmount() string { - if o == nil { + if o == nil || common.IsNil(o.Amount) { var ret string return ret } - - return o.Amount + return *o.Amount } -// GetAmountOk returns a tuple with the Amount field value +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Mandate) GetAmountOk() (*string, bool) { - if o == nil { + if o == nil || common.IsNil(o.Amount) { return nil, false } - return &o.Amount, true + return o.Amount, true } -// SetAmount sets field value +// HasAmount returns a boolean if a field has been set. +func (o *Mandate) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given string and assigns it to the Amount field. func (o *Mandate) SetAmount(v string) { - o.Amount = v + o.Amount = &v } // GetAmountRule returns the AmountRule field value if set, zero value otherwise. @@ -177,52 +181,68 @@ func (o *Mandate) SetBillingDay(v string) { o.BillingDay = &v } -// GetEndsAt returns the EndsAt field value +// GetEndsAt returns the EndsAt field value if set, zero value otherwise. func (o *Mandate) GetEndsAt() string { - if o == nil { + if o == nil || common.IsNil(o.EndsAt) { var ret string return ret } - - return o.EndsAt + return *o.EndsAt } -// GetEndsAtOk returns a tuple with the EndsAt field value +// GetEndsAtOk returns a tuple with the EndsAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Mandate) GetEndsAtOk() (*string, bool) { - if o == nil { + if o == nil || common.IsNil(o.EndsAt) { return nil, false } - return &o.EndsAt, true + return o.EndsAt, true } -// SetEndsAt sets field value +// HasEndsAt returns a boolean if a field has been set. +func (o *Mandate) HasEndsAt() bool { + if o != nil && !common.IsNil(o.EndsAt) { + return true + } + + return false +} + +// SetEndsAt gets a reference to the given string and assigns it to the EndsAt field. func (o *Mandate) SetEndsAt(v string) { - o.EndsAt = v + o.EndsAt = &v } -// GetFrequency returns the Frequency field value +// GetFrequency returns the Frequency field value if set, zero value otherwise. func (o *Mandate) GetFrequency() string { - if o == nil { + if o == nil || common.IsNil(o.Frequency) { var ret string return ret } - - return o.Frequency + return *o.Frequency } -// GetFrequencyOk returns a tuple with the Frequency field value +// GetFrequencyOk returns a tuple with the Frequency field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Mandate) GetFrequencyOk() (*string, bool) { - if o == nil { + if o == nil || common.IsNil(o.Frequency) { return nil, false } - return &o.Frequency, true + return o.Frequency, true } -// SetFrequency sets field value +// HasFrequency returns a boolean if a field has been set. +func (o *Mandate) HasFrequency() bool { + if o != nil && !common.IsNil(o.Frequency) { + return true + } + + return false +} + +// SetFrequency gets a reference to the given string and assigns it to the Frequency field. func (o *Mandate) SetFrequency(v string) { - o.Frequency = v + o.Frequency = &v } // GetRemarks returns the Remarks field value if set, zero value otherwise. @@ -290,7 +310,7 @@ func (o *Mandate) SetStartsAt(v string) { } func (o Mandate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,7 +319,9 @@ func (o Mandate) MarshalJSON() ([]byte, error) { func (o Mandate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } if !common.IsNil(o.AmountRule) { toSerialize["amountRule"] = o.AmountRule } @@ -309,8 +331,12 @@ func (o Mandate) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BillingDay) { toSerialize["billingDay"] = o.BillingDay } - toSerialize["endsAt"] = o.EndsAt - toSerialize["frequency"] = o.Frequency + if !common.IsNil(o.EndsAt) { + toSerialize["endsAt"] = o.EndsAt + } + if !common.IsNil(o.Frequency) { + toSerialize["frequency"] = o.Frequency + } if !common.IsNil(o.Remarks) { toSerialize["remarks"] = o.Remarks } @@ -356,30 +382,32 @@ func (v *NullableMandate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Mandate) isValidAmountRule() bool { - var allowedEnumValues = []string{"max", "exact"} - for _, allowed := range allowedEnumValues { - if o.GetAmountRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "max", "exact" } + for _, allowed := range allowedEnumValues { + if o.GetAmountRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidBillingAttemptsRule() bool { - var allowedEnumValues = []string{"on", "before", "after"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAttemptsRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "on", "before", "after" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAttemptsRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidFrequency() bool { - var allowedEnumValues = []string{"adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly"} - for _, allowed := range allowedEnumValues { - if o.GetFrequency() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly" } + for _, allowed := range allowedEnumValues { + if o.GetFrequency() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mandate_2.go b/src/checkout/model_mandate_2.go new file mode 100644 index 000000000..bc40a2b7e --- /dev/null +++ b/src/checkout/model_mandate_2.go @@ -0,0 +1,386 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Mandate2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Mandate2{} + +// Mandate2 struct for Mandate2 +type Mandate2 struct { + // The billing amount (in minor units) of the recurring transactions. + Amount string `json:"amount"` + // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + AmountRule *string `json:"amountRule,omitempty"` + // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + BillingAttemptsRule *string `json:"billingAttemptsRule,omitempty"` + // The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. + BillingDay *string `json:"billingDay,omitempty"` + // End date of the billing plan, in YYYY-MM-DD format. + EndsAt string `json:"endsAt"` + // The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + Frequency string `json:"frequency"` + // The message shown by UPI to the shopper on the approval screen. + Remarks *string `json:"remarks,omitempty"` + // Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. + StartsAt *string `json:"startsAt,omitempty"` +} + +// NewMandate2 instantiates a new Mandate2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMandate2(amount string, endsAt string, frequency string) *Mandate2 { + this := Mandate2{} + this.Amount = amount + this.EndsAt = endsAt + this.Frequency = frequency + return &this +} + +// NewMandate2WithDefaults instantiates a new Mandate2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMandate2WithDefaults() *Mandate2 { + this := Mandate2{} + return &this +} + +// GetAmount returns the Amount field value +func (o *Mandate2) GetAmount() string { + if o == nil { + var ret string + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *Mandate2) GetAmountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *Mandate2) SetAmount(v string) { + o.Amount = v +} + +// GetAmountRule returns the AmountRule field value if set, zero value otherwise. +func (o *Mandate2) GetAmountRule() string { + if o == nil || common.IsNil(o.AmountRule) { + var ret string + return ret + } + return *o.AmountRule +} + +// GetAmountRuleOk returns a tuple with the AmountRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mandate2) GetAmountRuleOk() (*string, bool) { + if o == nil || common.IsNil(o.AmountRule) { + return nil, false + } + return o.AmountRule, true +} + +// HasAmountRule returns a boolean if a field has been set. +func (o *Mandate2) HasAmountRule() bool { + if o != nil && !common.IsNil(o.AmountRule) { + return true + } + + return false +} + +// SetAmountRule gets a reference to the given string and assigns it to the AmountRule field. +func (o *Mandate2) SetAmountRule(v string) { + o.AmountRule = &v +} + +// GetBillingAttemptsRule returns the BillingAttemptsRule field value if set, zero value otherwise. +func (o *Mandate2) GetBillingAttemptsRule() string { + if o == nil || common.IsNil(o.BillingAttemptsRule) { + var ret string + return ret + } + return *o.BillingAttemptsRule +} + +// GetBillingAttemptsRuleOk returns a tuple with the BillingAttemptsRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mandate2) GetBillingAttemptsRuleOk() (*string, bool) { + if o == nil || common.IsNil(o.BillingAttemptsRule) { + return nil, false + } + return o.BillingAttemptsRule, true +} + +// HasBillingAttemptsRule returns a boolean if a field has been set. +func (o *Mandate2) HasBillingAttemptsRule() bool { + if o != nil && !common.IsNil(o.BillingAttemptsRule) { + return true + } + + return false +} + +// SetBillingAttemptsRule gets a reference to the given string and assigns it to the BillingAttemptsRule field. +func (o *Mandate2) SetBillingAttemptsRule(v string) { + o.BillingAttemptsRule = &v +} + +// GetBillingDay returns the BillingDay field value if set, zero value otherwise. +func (o *Mandate2) GetBillingDay() string { + if o == nil || common.IsNil(o.BillingDay) { + var ret string + return ret + } + return *o.BillingDay +} + +// GetBillingDayOk returns a tuple with the BillingDay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mandate2) GetBillingDayOk() (*string, bool) { + if o == nil || common.IsNil(o.BillingDay) { + return nil, false + } + return o.BillingDay, true +} + +// HasBillingDay returns a boolean if a field has been set. +func (o *Mandate2) HasBillingDay() bool { + if o != nil && !common.IsNil(o.BillingDay) { + return true + } + + return false +} + +// SetBillingDay gets a reference to the given string and assigns it to the BillingDay field. +func (o *Mandate2) SetBillingDay(v string) { + o.BillingDay = &v +} + +// GetEndsAt returns the EndsAt field value +func (o *Mandate2) GetEndsAt() string { + if o == nil { + var ret string + return ret + } + + return o.EndsAt +} + +// GetEndsAtOk returns a tuple with the EndsAt field value +// and a boolean to check if the value has been set. +func (o *Mandate2) GetEndsAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndsAt, true +} + +// SetEndsAt sets field value +func (o *Mandate2) SetEndsAt(v string) { + o.EndsAt = v +} + +// GetFrequency returns the Frequency field value +func (o *Mandate2) GetFrequency() string { + if o == nil { + var ret string + return ret + } + + return o.Frequency +} + +// GetFrequencyOk returns a tuple with the Frequency field value +// and a boolean to check if the value has been set. +func (o *Mandate2) GetFrequencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Frequency, true +} + +// SetFrequency sets field value +func (o *Mandate2) SetFrequency(v string) { + o.Frequency = v +} + +// GetRemarks returns the Remarks field value if set, zero value otherwise. +func (o *Mandate2) GetRemarks() string { + if o == nil || common.IsNil(o.Remarks) { + var ret string + return ret + } + return *o.Remarks +} + +// GetRemarksOk returns a tuple with the Remarks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mandate2) GetRemarksOk() (*string, bool) { + if o == nil || common.IsNil(o.Remarks) { + return nil, false + } + return o.Remarks, true +} + +// HasRemarks returns a boolean if a field has been set. +func (o *Mandate2) HasRemarks() bool { + if o != nil && !common.IsNil(o.Remarks) { + return true + } + + return false +} + +// SetRemarks gets a reference to the given string and assigns it to the Remarks field. +func (o *Mandate2) SetRemarks(v string) { + o.Remarks = &v +} + +// GetStartsAt returns the StartsAt field value if set, zero value otherwise. +func (o *Mandate2) GetStartsAt() string { + if o == nil || common.IsNil(o.StartsAt) { + var ret string + return ret + } + return *o.StartsAt +} + +// GetStartsAtOk returns a tuple with the StartsAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mandate2) GetStartsAtOk() (*string, bool) { + if o == nil || common.IsNil(o.StartsAt) { + return nil, false + } + return o.StartsAt, true +} + +// HasStartsAt returns a boolean if a field has been set. +func (o *Mandate2) HasStartsAt() bool { + if o != nil && !common.IsNil(o.StartsAt) { + return true + } + + return false +} + +// SetStartsAt gets a reference to the given string and assigns it to the StartsAt field. +func (o *Mandate2) SetStartsAt(v string) { + o.StartsAt = &v +} + +func (o Mandate2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Mandate2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["amount"] = o.Amount + if !common.IsNil(o.AmountRule) { + toSerialize["amountRule"] = o.AmountRule + } + if !common.IsNil(o.BillingAttemptsRule) { + toSerialize["billingAttemptsRule"] = o.BillingAttemptsRule + } + if !common.IsNil(o.BillingDay) { + toSerialize["billingDay"] = o.BillingDay + } + toSerialize["endsAt"] = o.EndsAt + toSerialize["frequency"] = o.Frequency + if !common.IsNil(o.Remarks) { + toSerialize["remarks"] = o.Remarks + } + if !common.IsNil(o.StartsAt) { + toSerialize["startsAt"] = o.StartsAt + } + return toSerialize, nil +} + +type NullableMandate2 struct { + value *Mandate2 + isSet bool +} + +func (v NullableMandate2) Get() *Mandate2 { + return v.value +} + +func (v *NullableMandate2) Set(val *Mandate2) { + v.value = val + v.isSet = true +} + +func (v NullableMandate2) IsSet() bool { + return v.isSet +} + +func (v *NullableMandate2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMandate2(val *Mandate2) *NullableMandate2 { + return &NullableMandate2{value: val, isSet: true} +} + +func (v NullableMandate2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMandate2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Mandate2) isValidAmountRule() bool { + var allowedEnumValues = []string{ "max", "exact" } + for _, allowed := range allowedEnumValues { + if o.GetAmountRule() == allowed { + return true + } + } + return false +} +func (o *Mandate2) isValidBillingAttemptsRule() bool { + var allowedEnumValues = []string{ "on", "before", "after" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAttemptsRule() == allowed { + return true + } + } + return false +} +func (o *Mandate2) isValidFrequency() bool { + var allowedEnumValues = []string{ "adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly" } + for _, allowed := range allowedEnumValues { + if o.GetFrequency() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_masterpass_details.go b/src/checkout/model_masterpass_details.go index abe8d89e0..9bac64384 100644 --- a/src/checkout/model_masterpass_details.go +++ b/src/checkout/model_masterpass_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MasterpassDetails type satisfies the MappedNullable interface at compile time @@ -172,7 +171,7 @@ func (o *MasterpassDetails) SetType(v string) { } func (o MasterpassDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,21 +229,23 @@ func (v *NullableMasterpassDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MasterpassDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *MasterpassDetails) isValidType() bool { - var allowedEnumValues = []string{"masterpass"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "masterpass" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mbway_details.go b/src/checkout/model_mbway_details.go index 491247fb7..dfc74290a 100644 --- a/src/checkout/model_mbway_details.go +++ b/src/checkout/model_mbway_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MbwayDetails type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &MbwayDetails{} type MbwayDetails struct { // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - // + // ShopperEmail string `json:"shopperEmail"` - // + // TelephoneNumber string `json:"telephoneNumber"` // **mbway** Type *string `json:"type,omitempty"` @@ -165,7 +164,7 @@ func (o *MbwayDetails) SetType(v string) { } func (o MbwayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,12 +220,14 @@ func (v *NullableMbwayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MbwayDetails) isValidType() bool { - var allowedEnumValues = []string{"mbway"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "mbway" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_merchant_device.go b/src/checkout/model_merchant_device.go index 9ad8c7e25..6a6cfc83f 100644 --- a/src/checkout/model_merchant_device.go +++ b/src/checkout/model_merchant_device.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDevice) SetReference(v string) { } func (o MerchantDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_merchant_risk_indicator.go b/src/checkout/model_merchant_risk_indicator.go index 2e637a2be..ee067a40c 100644 --- a/src/checkout/model_merchant_risk_indicator.go +++ b/src/checkout/model_merchant_risk_indicator.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantRiskIndicator type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type MerchantRiskIndicator struct { DeliveryEmailAddress *string `json:"deliveryEmailAddress,omitempty"` // The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` DeliveryTimeframe *string `json:"deliveryTimeframe,omitempty"` - GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` + GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` // For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. GiftCardCount *int32 `json:"giftCardCount,omitempty"` // For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. @@ -519,7 +518,7 @@ func (o *MerchantRiskIndicator) SetShipIndicator(v string) { } func (o MerchantRiskIndicator) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -609,21 +608,23 @@ func (v *NullableMerchantRiskIndicator) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MerchantRiskIndicator) isValidDeliveryAddressIndicator() bool { - var allowedEnumValues = []string{"shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressIndicator() == allowed { + return true + } + } + return false } func (o *MerchantRiskIndicator) isValidDeliveryTimeframe() bool { - var allowedEnumValues = []string{"electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryTimeframe() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryTimeframe() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_merchant_risk_indicator_2.go b/src/checkout/model_merchant_risk_indicator_2.go new file mode 100644 index 000000000..37a576756 --- /dev/null +++ b/src/checkout/model_merchant_risk_indicator_2.go @@ -0,0 +1,630 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the MerchantRiskIndicator2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &MerchantRiskIndicator2{} + +// MerchantRiskIndicator2 struct for MerchantRiskIndicator2 +type MerchantRiskIndicator2 struct { + // Whether the chosen delivery address is identical to the billing address. + AddressMatch *bool `json:"addressMatch,omitempty"` + // Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + DeliveryAddressIndicator *string `json:"deliveryAddressIndicator,omitempty"` + // The delivery email address (for digital goods). + // Deprecated + DeliveryEmail *string `json:"deliveryEmail,omitempty"` + // For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. + DeliveryEmailAddress *string `json:"deliveryEmailAddress,omitempty"` + // The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + DeliveryTimeframe *string `json:"deliveryTimeframe,omitempty"` + GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` + // For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + GiftCardCount *int32 `json:"giftCardCount,omitempty"` + // For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. + GiftCardCurr *string `json:"giftCardCurr,omitempty"` + // For pre-order purchases, the expected date this product will be available to the shopper. + PreOrderDate *time.Time `json:"preOrderDate,omitempty"` + // Indicator for whether this transaction is for pre-ordering a product. + PreOrderPurchase *bool `json:"preOrderPurchase,omitempty"` + // Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. + PreOrderPurchaseInd *string `json:"preOrderPurchaseInd,omitempty"` + // Indicator for whether the shopper has already purchased the same items in the past. + ReorderItems *bool `json:"reorderItems,omitempty"` + // Indicates whether the cardholder is reordering previously purchased merchandise. + ReorderItemsInd *string `json:"reorderItemsInd,omitempty"` + // Indicates shipping method chosen for the transaction. + ShipIndicator *string `json:"shipIndicator,omitempty"` +} + +// NewMerchantRiskIndicator2 instantiates a new MerchantRiskIndicator2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMerchantRiskIndicator2() *MerchantRiskIndicator2 { + this := MerchantRiskIndicator2{} + return &this +} + +// NewMerchantRiskIndicator2WithDefaults instantiates a new MerchantRiskIndicator2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMerchantRiskIndicator2WithDefaults() *MerchantRiskIndicator2 { + this := MerchantRiskIndicator2{} + return &this +} + +// GetAddressMatch returns the AddressMatch field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetAddressMatch() bool { + if o == nil || common.IsNil(o.AddressMatch) { + var ret bool + return ret + } + return *o.AddressMatch +} + +// GetAddressMatchOk returns a tuple with the AddressMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetAddressMatchOk() (*bool, bool) { + if o == nil || common.IsNil(o.AddressMatch) { + return nil, false + } + return o.AddressMatch, true +} + +// HasAddressMatch returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasAddressMatch() bool { + if o != nil && !common.IsNil(o.AddressMatch) { + return true + } + + return false +} + +// SetAddressMatch gets a reference to the given bool and assigns it to the AddressMatch field. +func (o *MerchantRiskIndicator2) SetAddressMatch(v bool) { + o.AddressMatch = &v +} + +// GetDeliveryAddressIndicator returns the DeliveryAddressIndicator field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetDeliveryAddressIndicator() string { + if o == nil || common.IsNil(o.DeliveryAddressIndicator) { + var ret string + return ret + } + return *o.DeliveryAddressIndicator +} + +// GetDeliveryAddressIndicatorOk returns a tuple with the DeliveryAddressIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetDeliveryAddressIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.DeliveryAddressIndicator) { + return nil, false + } + return o.DeliveryAddressIndicator, true +} + +// HasDeliveryAddressIndicator returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasDeliveryAddressIndicator() bool { + if o != nil && !common.IsNil(o.DeliveryAddressIndicator) { + return true + } + + return false +} + +// SetDeliveryAddressIndicator gets a reference to the given string and assigns it to the DeliveryAddressIndicator field. +func (o *MerchantRiskIndicator2) SetDeliveryAddressIndicator(v string) { + o.DeliveryAddressIndicator = &v +} + +// GetDeliveryEmail returns the DeliveryEmail field value if set, zero value otherwise. +// Deprecated +func (o *MerchantRiskIndicator2) GetDeliveryEmail() string { + if o == nil || common.IsNil(o.DeliveryEmail) { + var ret string + return ret + } + return *o.DeliveryEmail +} + +// GetDeliveryEmailOk returns a tuple with the DeliveryEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *MerchantRiskIndicator2) GetDeliveryEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.DeliveryEmail) { + return nil, false + } + return o.DeliveryEmail, true +} + +// HasDeliveryEmail returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasDeliveryEmail() bool { + if o != nil && !common.IsNil(o.DeliveryEmail) { + return true + } + + return false +} + +// SetDeliveryEmail gets a reference to the given string and assigns it to the DeliveryEmail field. +// Deprecated +func (o *MerchantRiskIndicator2) SetDeliveryEmail(v string) { + o.DeliveryEmail = &v +} + +// GetDeliveryEmailAddress returns the DeliveryEmailAddress field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetDeliveryEmailAddress() string { + if o == nil || common.IsNil(o.DeliveryEmailAddress) { + var ret string + return ret + } + return *o.DeliveryEmailAddress +} + +// GetDeliveryEmailAddressOk returns a tuple with the DeliveryEmailAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetDeliveryEmailAddressOk() (*string, bool) { + if o == nil || common.IsNil(o.DeliveryEmailAddress) { + return nil, false + } + return o.DeliveryEmailAddress, true +} + +// HasDeliveryEmailAddress returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasDeliveryEmailAddress() bool { + if o != nil && !common.IsNil(o.DeliveryEmailAddress) { + return true + } + + return false +} + +// SetDeliveryEmailAddress gets a reference to the given string and assigns it to the DeliveryEmailAddress field. +func (o *MerchantRiskIndicator2) SetDeliveryEmailAddress(v string) { + o.DeliveryEmailAddress = &v +} + +// GetDeliveryTimeframe returns the DeliveryTimeframe field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetDeliveryTimeframe() string { + if o == nil || common.IsNil(o.DeliveryTimeframe) { + var ret string + return ret + } + return *o.DeliveryTimeframe +} + +// GetDeliveryTimeframeOk returns a tuple with the DeliveryTimeframe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetDeliveryTimeframeOk() (*string, bool) { + if o == nil || common.IsNil(o.DeliveryTimeframe) { + return nil, false + } + return o.DeliveryTimeframe, true +} + +// HasDeliveryTimeframe returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasDeliveryTimeframe() bool { + if o != nil && !common.IsNil(o.DeliveryTimeframe) { + return true + } + + return false +} + +// SetDeliveryTimeframe gets a reference to the given string and assigns it to the DeliveryTimeframe field. +func (o *MerchantRiskIndicator2) SetDeliveryTimeframe(v string) { + o.DeliveryTimeframe = &v +} + +// GetGiftCardAmount returns the GiftCardAmount field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetGiftCardAmount() Amount { + if o == nil || common.IsNil(o.GiftCardAmount) { + var ret Amount + return ret + } + return *o.GiftCardAmount +} + +// GetGiftCardAmountOk returns a tuple with the GiftCardAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetGiftCardAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.GiftCardAmount) { + return nil, false + } + return o.GiftCardAmount, true +} + +// HasGiftCardAmount returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasGiftCardAmount() bool { + if o != nil && !common.IsNil(o.GiftCardAmount) { + return true + } + + return false +} + +// SetGiftCardAmount gets a reference to the given Amount and assigns it to the GiftCardAmount field. +func (o *MerchantRiskIndicator2) SetGiftCardAmount(v Amount) { + o.GiftCardAmount = &v +} + +// GetGiftCardCount returns the GiftCardCount field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetGiftCardCount() int32 { + if o == nil || common.IsNil(o.GiftCardCount) { + var ret int32 + return ret + } + return *o.GiftCardCount +} + +// GetGiftCardCountOk returns a tuple with the GiftCardCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetGiftCardCountOk() (*int32, bool) { + if o == nil || common.IsNil(o.GiftCardCount) { + return nil, false + } + return o.GiftCardCount, true +} + +// HasGiftCardCount returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasGiftCardCount() bool { + if o != nil && !common.IsNil(o.GiftCardCount) { + return true + } + + return false +} + +// SetGiftCardCount gets a reference to the given int32 and assigns it to the GiftCardCount field. +func (o *MerchantRiskIndicator2) SetGiftCardCount(v int32) { + o.GiftCardCount = &v +} + +// GetGiftCardCurr returns the GiftCardCurr field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetGiftCardCurr() string { + if o == nil || common.IsNil(o.GiftCardCurr) { + var ret string + return ret + } + return *o.GiftCardCurr +} + +// GetGiftCardCurrOk returns a tuple with the GiftCardCurr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetGiftCardCurrOk() (*string, bool) { + if o == nil || common.IsNil(o.GiftCardCurr) { + return nil, false + } + return o.GiftCardCurr, true +} + +// HasGiftCardCurr returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasGiftCardCurr() bool { + if o != nil && !common.IsNil(o.GiftCardCurr) { + return true + } + + return false +} + +// SetGiftCardCurr gets a reference to the given string and assigns it to the GiftCardCurr field. +func (o *MerchantRiskIndicator2) SetGiftCardCurr(v string) { + o.GiftCardCurr = &v +} + +// GetPreOrderDate returns the PreOrderDate field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetPreOrderDate() time.Time { + if o == nil || common.IsNil(o.PreOrderDate) { + var ret time.Time + return ret + } + return *o.PreOrderDate +} + +// GetPreOrderDateOk returns a tuple with the PreOrderDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetPreOrderDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.PreOrderDate) { + return nil, false + } + return o.PreOrderDate, true +} + +// HasPreOrderDate returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasPreOrderDate() bool { + if o != nil && !common.IsNil(o.PreOrderDate) { + return true + } + + return false +} + +// SetPreOrderDate gets a reference to the given time.Time and assigns it to the PreOrderDate field. +func (o *MerchantRiskIndicator2) SetPreOrderDate(v time.Time) { + o.PreOrderDate = &v +} + +// GetPreOrderPurchase returns the PreOrderPurchase field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetPreOrderPurchase() bool { + if o == nil || common.IsNil(o.PreOrderPurchase) { + var ret bool + return ret + } + return *o.PreOrderPurchase +} + +// GetPreOrderPurchaseOk returns a tuple with the PreOrderPurchase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetPreOrderPurchaseOk() (*bool, bool) { + if o == nil || common.IsNil(o.PreOrderPurchase) { + return nil, false + } + return o.PreOrderPurchase, true +} + +// HasPreOrderPurchase returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasPreOrderPurchase() bool { + if o != nil && !common.IsNil(o.PreOrderPurchase) { + return true + } + + return false +} + +// SetPreOrderPurchase gets a reference to the given bool and assigns it to the PreOrderPurchase field. +func (o *MerchantRiskIndicator2) SetPreOrderPurchase(v bool) { + o.PreOrderPurchase = &v +} + +// GetPreOrderPurchaseInd returns the PreOrderPurchaseInd field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetPreOrderPurchaseInd() string { + if o == nil || common.IsNil(o.PreOrderPurchaseInd) { + var ret string + return ret + } + return *o.PreOrderPurchaseInd +} + +// GetPreOrderPurchaseIndOk returns a tuple with the PreOrderPurchaseInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetPreOrderPurchaseIndOk() (*string, bool) { + if o == nil || common.IsNil(o.PreOrderPurchaseInd) { + return nil, false + } + return o.PreOrderPurchaseInd, true +} + +// HasPreOrderPurchaseInd returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasPreOrderPurchaseInd() bool { + if o != nil && !common.IsNil(o.PreOrderPurchaseInd) { + return true + } + + return false +} + +// SetPreOrderPurchaseInd gets a reference to the given string and assigns it to the PreOrderPurchaseInd field. +func (o *MerchantRiskIndicator2) SetPreOrderPurchaseInd(v string) { + o.PreOrderPurchaseInd = &v +} + +// GetReorderItems returns the ReorderItems field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetReorderItems() bool { + if o == nil || common.IsNil(o.ReorderItems) { + var ret bool + return ret + } + return *o.ReorderItems +} + +// GetReorderItemsOk returns a tuple with the ReorderItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetReorderItemsOk() (*bool, bool) { + if o == nil || common.IsNil(o.ReorderItems) { + return nil, false + } + return o.ReorderItems, true +} + +// HasReorderItems returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasReorderItems() bool { + if o != nil && !common.IsNil(o.ReorderItems) { + return true + } + + return false +} + +// SetReorderItems gets a reference to the given bool and assigns it to the ReorderItems field. +func (o *MerchantRiskIndicator2) SetReorderItems(v bool) { + o.ReorderItems = &v +} + +// GetReorderItemsInd returns the ReorderItemsInd field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetReorderItemsInd() string { + if o == nil || common.IsNil(o.ReorderItemsInd) { + var ret string + return ret + } + return *o.ReorderItemsInd +} + +// GetReorderItemsIndOk returns a tuple with the ReorderItemsInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetReorderItemsIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ReorderItemsInd) { + return nil, false + } + return o.ReorderItemsInd, true +} + +// HasReorderItemsInd returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasReorderItemsInd() bool { + if o != nil && !common.IsNil(o.ReorderItemsInd) { + return true + } + + return false +} + +// SetReorderItemsInd gets a reference to the given string and assigns it to the ReorderItemsInd field. +func (o *MerchantRiskIndicator2) SetReorderItemsInd(v string) { + o.ReorderItemsInd = &v +} + +// GetShipIndicator returns the ShipIndicator field value if set, zero value otherwise. +func (o *MerchantRiskIndicator2) GetShipIndicator() string { + if o == nil || common.IsNil(o.ShipIndicator) { + var ret string + return ret + } + return *o.ShipIndicator +} + +// GetShipIndicatorOk returns a tuple with the ShipIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantRiskIndicator2) GetShipIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.ShipIndicator) { + return nil, false + } + return o.ShipIndicator, true +} + +// HasShipIndicator returns a boolean if a field has been set. +func (o *MerchantRiskIndicator2) HasShipIndicator() bool { + if o != nil && !common.IsNil(o.ShipIndicator) { + return true + } + + return false +} + +// SetShipIndicator gets a reference to the given string and assigns it to the ShipIndicator field. +func (o *MerchantRiskIndicator2) SetShipIndicator(v string) { + o.ShipIndicator = &v +} + +func (o MerchantRiskIndicator2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MerchantRiskIndicator2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AddressMatch) { + toSerialize["addressMatch"] = o.AddressMatch + } + if !common.IsNil(o.DeliveryAddressIndicator) { + toSerialize["deliveryAddressIndicator"] = o.DeliveryAddressIndicator + } + if !common.IsNil(o.DeliveryEmail) { + toSerialize["deliveryEmail"] = o.DeliveryEmail + } + if !common.IsNil(o.DeliveryEmailAddress) { + toSerialize["deliveryEmailAddress"] = o.DeliveryEmailAddress + } + if !common.IsNil(o.DeliveryTimeframe) { + toSerialize["deliveryTimeframe"] = o.DeliveryTimeframe + } + if !common.IsNil(o.GiftCardAmount) { + toSerialize["giftCardAmount"] = o.GiftCardAmount + } + if !common.IsNil(o.GiftCardCount) { + toSerialize["giftCardCount"] = o.GiftCardCount + } + if !common.IsNil(o.GiftCardCurr) { + toSerialize["giftCardCurr"] = o.GiftCardCurr + } + if !common.IsNil(o.PreOrderDate) { + toSerialize["preOrderDate"] = o.PreOrderDate + } + if !common.IsNil(o.PreOrderPurchase) { + toSerialize["preOrderPurchase"] = o.PreOrderPurchase + } + if !common.IsNil(o.PreOrderPurchaseInd) { + toSerialize["preOrderPurchaseInd"] = o.PreOrderPurchaseInd + } + if !common.IsNil(o.ReorderItems) { + toSerialize["reorderItems"] = o.ReorderItems + } + if !common.IsNil(o.ReorderItemsInd) { + toSerialize["reorderItemsInd"] = o.ReorderItemsInd + } + if !common.IsNil(o.ShipIndicator) { + toSerialize["shipIndicator"] = o.ShipIndicator + } + return toSerialize, nil +} + +type NullableMerchantRiskIndicator2 struct { + value *MerchantRiskIndicator2 + isSet bool +} + +func (v NullableMerchantRiskIndicator2) Get() *MerchantRiskIndicator2 { + return v.value +} + +func (v *NullableMerchantRiskIndicator2) Set(val *MerchantRiskIndicator2) { + v.value = val + v.isSet = true +} + +func (v NullableMerchantRiskIndicator2) IsSet() bool { + return v.isSet +} + +func (v *NullableMerchantRiskIndicator2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMerchantRiskIndicator2(val *MerchantRiskIndicator2) *NullableMerchantRiskIndicator2 { + return &NullableMerchantRiskIndicator2{value: val, isSet: true} +} + +func (v NullableMerchantRiskIndicator2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMerchantRiskIndicator2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *MerchantRiskIndicator2) isValidDeliveryAddressIndicator() bool { + var allowedEnumValues = []string{ "shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressIndicator() == allowed { + return true + } + } + return false +} +func (o *MerchantRiskIndicator2) isValidDeliveryTimeframe() bool { + var allowedEnumValues = []string{ "electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryTimeframe() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_mobile_pay_details.go b/src/checkout/model_mobile_pay_details.go index a69ac422a..d4116f012 100644 --- a/src/checkout/model_mobile_pay_details.go +++ b/src/checkout/model_mobile_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MobilePayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *MobilePayDetails) SetType(v string) { } func (o MobilePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableMobilePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MobilePayDetails) isValidType() bool { - var allowedEnumValues = []string{"mobilepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "mobilepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mol_pay_details.go b/src/checkout/model_mol_pay_details.go index 9af73595f..e39c207c2 100644 --- a/src/checkout/model_mol_pay_details.go +++ b/src/checkout/model_mol_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MolPayDetails type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *MolPayDetails) SetType(v string) { } func (o MolPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableMolPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MolPayDetails) isValidType() bool { - var allowedEnumValues = []string{"molpay_ebanking_fpx_MY", "molpay_ebanking_TH"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "molpay_ebanking_fpx_MY", "molpay_ebanking_TH" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_name.go b/src/checkout/model_name.go index 1b1a34de8..4b46ef238 100644 --- a/src/checkout/model_name.go +++ b/src/checkout/model_name.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_name_2.go b/src/checkout/model_name_2.go new file mode 100644 index 000000000..dea5c982e --- /dev/null +++ b/src/checkout/model_name_2.go @@ -0,0 +1,164 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Name2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Name2{} + +// Name2 struct for Name2 +type Name2 struct { + // The first name. + FirstName *string `json:"firstName,omitempty"` + // The last name. + LastName *string `json:"lastName,omitempty"` +} + +// NewName2 instantiates a new Name2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewName2() *Name2 { + this := Name2{} + return &this +} + +// NewName2WithDefaults instantiates a new Name2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewName2WithDefaults() *Name2 { + this := Name2{} + return &this +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *Name2) GetFirstName() string { + if o == nil || common.IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name2) GetFirstNameOk() (*string, bool) { + if o == nil || common.IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *Name2) HasFirstName() bool { + if o != nil && !common.IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *Name2) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *Name2) GetLastName() string { + if o == nil || common.IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name2) GetLastNameOk() (*string, bool) { + if o == nil || common.IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *Name2) HasLastName() bool { + if o != nil && !common.IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *Name2) SetLastName(v string) { + o.LastName = &v +} + +func (o Name2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Name2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.FirstName) { + toSerialize["firstName"] = o.FirstName + } + if !common.IsNil(o.LastName) { + toSerialize["lastName"] = o.LastName + } + return toSerialize, nil +} + +type NullableName2 struct { + value *Name2 + isSet bool +} + +func (v NullableName2) Get() *Name2 { + return v.value +} + +func (v *NullableName2) Set(val *Name2) { + v.value = val + v.isSet = true +} + +func (v NullableName2) IsSet() bool { + return v.isSet +} + +func (v *NullableName2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableName2(val *Name2) *NullableName2 { + return &NullableName2{value: val, isSet: true} +} + +func (v NullableName2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableName2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/checkout/model_open_invoice_details.go b/src/checkout/model_open_invoice_details.go index 74fcf71ca..b2314abfd 100644 --- a/src/checkout/model_open_invoice_details.go +++ b/src/checkout/model_open_invoice_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OpenInvoiceDetails type satisfies the MappedNullable interface at compile time @@ -285,7 +284,7 @@ func (o *OpenInvoiceDetails) SetType(v string) { } func (o OpenInvoiceDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -354,12 +353,14 @@ func (v *NullableOpenInvoiceDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *OpenInvoiceDetails) isValidType() bool { - var allowedEnumValues = []string{"openinvoice", "afterpay_directdebit", "atome_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "openinvoice", "afterpay_directdebit", "atome_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_pal_details.go b/src/checkout/model_pay_pal_details.go index 79debca03..49bc72375 100644 --- a/src/checkout/model_pay_pal_details.go +++ b/src/checkout/model_pay_pal_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayPalDetails type satisfies the MappedNullable interface at compile time @@ -23,8 +22,12 @@ type PayPalDetails struct { CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` // The unique ID associated with the order. OrderID *string `json:"orderID,omitempty"` + // IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED + PayeePreferred *string `json:"payeePreferred,omitempty"` // The unique ID associated with the payer. PayerID *string `json:"payerID,omitempty"` + // PAYPAL or PAYPAL_CREDIT + PayerSelected *string `json:"payerSelected,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. // Deprecated RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` @@ -120,6 +123,38 @@ func (o *PayPalDetails) SetOrderID(v string) { o.OrderID = &v } +// GetPayeePreferred returns the PayeePreferred field value if set, zero value otherwise. +func (o *PayPalDetails) GetPayeePreferred() string { + if o == nil || common.IsNil(o.PayeePreferred) { + var ret string + return ret + } + return *o.PayeePreferred +} + +// GetPayeePreferredOk returns a tuple with the PayeePreferred field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPalDetails) GetPayeePreferredOk() (*string, bool) { + if o == nil || common.IsNil(o.PayeePreferred) { + return nil, false + } + return o.PayeePreferred, true +} + +// HasPayeePreferred returns a boolean if a field has been set. +func (o *PayPalDetails) HasPayeePreferred() bool { + if o != nil && !common.IsNil(o.PayeePreferred) { + return true + } + + return false +} + +// SetPayeePreferred gets a reference to the given string and assigns it to the PayeePreferred field. +func (o *PayPalDetails) SetPayeePreferred(v string) { + o.PayeePreferred = &v +} + // GetPayerID returns the PayerID field value if set, zero value otherwise. func (o *PayPalDetails) GetPayerID() string { if o == nil || common.IsNil(o.PayerID) { @@ -152,6 +187,38 @@ func (o *PayPalDetails) SetPayerID(v string) { o.PayerID = &v } +// GetPayerSelected returns the PayerSelected field value if set, zero value otherwise. +func (o *PayPalDetails) GetPayerSelected() string { + if o == nil || common.IsNil(o.PayerSelected) { + var ret string + return ret + } + return *o.PayerSelected +} + +// GetPayerSelectedOk returns a tuple with the PayerSelected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPalDetails) GetPayerSelectedOk() (*string, bool) { + if o == nil || common.IsNil(o.PayerSelected) { + return nil, false + } + return o.PayerSelected, true +} + +// HasPayerSelected returns a boolean if a field has been set. +func (o *PayPalDetails) HasPayerSelected() bool { + if o != nil && !common.IsNil(o.PayerSelected) { + return true + } + + return false +} + +// SetPayerSelected gets a reference to the given string and assigns it to the PayerSelected field. +func (o *PayPalDetails) SetPayerSelected(v string) { + o.PayerSelected = &v +} + // GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. // Deprecated func (o *PayPalDetails) GetRecurringDetailReference() string { @@ -276,7 +343,7 @@ func (o *PayPalDetails) SetType(v string) { } func (o PayPalDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -291,9 +358,15 @@ func (o PayPalDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.OrderID) { toSerialize["orderID"] = o.OrderID } + if !common.IsNil(o.PayeePreferred) { + toSerialize["payeePreferred"] = o.PayeePreferred + } if !common.IsNil(o.PayerID) { toSerialize["payerID"] = o.PayerID } + if !common.IsNil(o.PayerSelected) { + toSerialize["payerSelected"] = o.PayerSelected + } if !common.IsNil(o.RecurringDetailReference) { toSerialize["recurringDetailReference"] = o.RecurringDetailReference } @@ -343,21 +416,23 @@ func (v *NullablePayPalDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayPalDetails) isValidSubtype() bool { - var allowedEnumValues = []string{"redirect", "sdk"} - for _, allowed := range allowedEnumValues { - if o.GetSubtype() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "redirect", "sdk" } + for _, allowed := range allowedEnumValues { + if o.GetSubtype() == allowed { + return true + } + } + return false } func (o *PayPalDetails) isValidType() bool { - var allowedEnumValues = []string{"paypal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paypal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_u_upi_details.go b/src/checkout/model_pay_u_upi_details.go index 4a03be137..956ee4282 100644 --- a/src/checkout/model_pay_u_upi_details.go +++ b/src/checkout/model_pay_u_upi_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayUUpiDetails type satisfies the MappedNullable interface at compile time @@ -242,7 +241,7 @@ func (o *PayUUpiDetails) SetVirtualPaymentAddress(v string) { } func (o PayUUpiDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -306,12 +305,14 @@ func (v *NullablePayUUpiDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayUUpiDetails) isValidType() bool { - var allowedEnumValues = []string{"payu_IN_upi"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "payu_IN_upi" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_with_google_details.go b/src/checkout/model_pay_with_google_details.go index 8d8b7d6a3..d4bd06ebd 100644 --- a/src/checkout/model_pay_with_google_details.go +++ b/src/checkout/model_pay_with_google_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayWithGoogleDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *PayWithGoogleDetails) SetType(v string) { } func (o PayWithGoogleDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullablePayWithGoogleDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayWithGoogleDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *PayWithGoogleDetails) isValidType() bool { - var allowedEnumValues = []string{"paywithgoogle"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paywithgoogle" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_amount_update_resource.go b/src/checkout/model_payment_amount_update_resource.go index a50501779..d7aecfc60 100644 --- a/src/checkout/model_payment_amount_update_resource.go +++ b/src/checkout/model_payment_amount_update_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentAmountUpdateResource type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type PaymentAmountUpdateResource struct { IndustryUsage *string `json:"industryUsage,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the amount update request. PspReference string `json:"pspReference"` @@ -268,7 +267,7 @@ func (o *PaymentAmountUpdateResource) SetStatus(v string) { } func (o PaymentAmountUpdateResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -328,21 +327,23 @@ func (v *NullablePaymentAmountUpdateResource) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentAmountUpdateResource) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } func (o *PaymentAmountUpdateResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_cancel_resource.go b/src/checkout/model_payment_cancel_resource.go index e57c8598f..550de6826 100644 --- a/src/checkout/model_payment_cancel_resource.go +++ b/src/checkout/model_payment_cancel_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentCancelResource type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PaymentCancelResource{} type PaymentCancelResource struct { // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the cancel request. PspReference string `json:"pspReference"` @@ -181,7 +180,7 @@ func (o *PaymentCancelResource) SetStatus(v string) { } func (o PaymentCancelResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullablePaymentCancelResource) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentCancelResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_capture_resource.go b/src/checkout/model_payment_capture_resource.go index 91f3a88d5..40a8c7aae 100644 --- a/src/checkout/model_payment_capture_resource.go +++ b/src/checkout/model_payment_capture_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentCaptureResource type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type PaymentCaptureResource struct { LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the capture request. PspReference string `json:"pspReference"` @@ -275,7 +274,7 @@ func (o *PaymentCaptureResource) SetStatus(v string) { } func (o PaymentCaptureResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -337,12 +336,14 @@ func (v *NullablePaymentCaptureResource) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentCaptureResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_completion_details.go b/src/checkout/model_payment_completion_details.go index 8572ba719..2e495262b 100644 --- a/src/checkout/model_payment_completion_details.go +++ b/src/checkout/model_payment_completion_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentCompletionDetails type satisfies the MappedNullable interface at compile time @@ -617,7 +616,7 @@ func (o *PaymentCompletionDetails) SetThreeds2Fingerprint(v string) { } func (o PaymentCompletionDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullablePaymentCompletionDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 1509cb1fe..c9cd10d5f 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentDetails type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PaymentDetails) SetType(v string) { } func (o PaymentDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentDetails) isValidType() bool { - var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "walley", "walley_b2b", "pix", "bizum", "alma", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "dana", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "poli", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "dana", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "poli", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_details_response.go b/src/checkout/model_payment_details_response.go index b333d6719..b5cfb2345 100644 --- a/src/checkout/model_payment_details_response.go +++ b/src/checkout/model_payment_details_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentDetailsResponse type satisfies the MappedNullable interface at compile time @@ -21,14 +20,14 @@ var _ common.MappedNullable = &PaymentDetailsResponse{} type PaymentDetailsResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // Donation Token containing payment details for Adyen Giving. - DonationToken *string `json:"donationToken,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DonationToken *string `json:"donationToken,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The reference used during the /payments request. - MerchantReference *string `json:"merchantReference,omitempty"` - Order *CheckoutOrderResponse `json:"order,omitempty"` - PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` + MerchantReference *string `json:"merchantReference,omitempty"` + Order *CheckoutOrderResponse `json:"order,omitempty"` + PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -38,9 +37,9 @@ type PaymentDetailsResponse struct { // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` // The shopperLocale. - ShopperLocale *string `json:"shopperLocale,omitempty"` + ShopperLocale *string `json:"shopperLocale,omitempty"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. ThreeDSPaymentData *string `json:"threeDSPaymentData,omitempty"` } @@ -543,7 +542,7 @@ func (o *PaymentDetailsResponse) SetThreeDSPaymentData(v string) { } func (o PaymentDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -636,12 +635,14 @@ func (v *NullablePaymentDetailsResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentDetailsResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_link_response.go b/src/checkout/model_payment_link_response.go index 53199b66c..9869bbc4c 100644 --- a/src/checkout/model_payment_link_response.go +++ b/src/checkout/model_payment_link_response.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentLinkResponse type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &PaymentLinkResponse{} // PaymentLinkResponse struct for PaymentLinkResponse type PaymentLinkResponse struct { // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -34,11 +33,11 @@ type PaymentLinkResponse struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.This value is represented in Zulu format which is utilized for API v70 and lower. ExpiresAt *string `json:"expiresAt,omitempty"` // A unique identifier of the payment link. Id string `json:"id"` @@ -56,22 +55,22 @@ type PaymentLinkResponse struct { MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // A reference that is used to uniquely identify the payment in future communications about the payment status. Reference string `json:"reference"` - // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. RequiredShopperFields []string `json:"requiredShopperFields,omitempty"` // Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. ReturnUrl *string `json:"returnUrl,omitempty"` // Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - Reusable *bool `json:"reusable,omitempty"` + Reusable *bool `json:"reusable,omitempty"` RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -82,13 +81,13 @@ type PaymentLinkResponse struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` // Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. Status string `json:"status"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` - // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. StorePaymentMethodMode *string `json:"storePaymentMethodMode,omitempty"` // The shopper's telephone number. TelephoneNumber *string `json:"telephoneNumber,omitempty"` @@ -1428,7 +1427,7 @@ func (o *PaymentLinkResponse) SetUrl(v string) { } func (o PaymentLinkResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1471,7 +1470,7 @@ func (o PaymentLinkResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ExpiresAt) { toSerialize["expiresAt"] = o.ExpiresAt } - // skip: id is readOnly + toSerialize["id"] = o.Id if !common.IsNil(o.InstallmentOptions) { toSerialize["installmentOptions"] = o.InstallmentOptions } @@ -1550,7 +1549,7 @@ func (o PaymentLinkResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.UpdatedAt) { toSerialize["updatedAt"] = o.UpdatedAt } - // skip: url is readOnly + toSerialize["url"] = o.Url return toSerialize, nil } @@ -1590,30 +1589,32 @@ func (v *NullablePaymentLinkResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentLinkResponse) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentLinkResponse) isValidStatus() bool { - var allowedEnumValues = []string{"active", "completed", "expired", "paid", "paymentPending"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "completed", "expired", "paid", "paymentPending" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentLinkResponse) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_method.go b/src/checkout/model_payment_method.go index 5ec15175d..880a9e9b1 100644 --- a/src/checkout/model_payment_method.go +++ b/src/checkout/model_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethod type satisfies the MappedNullable interface at compile time @@ -26,8 +25,8 @@ type PaymentMethod struct { // The configuration of the payment method. Configuration *map[string]string `json:"configuration,omitempty"` // The funding source of the payment method. - FundingSource *string `json:"fundingSource,omitempty"` - Group *PaymentMethodGroup `json:"group,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Group *PaymentMethodGroup `json:"group,omitempty"` // All input details to be provided to complete the payment with this payment method. // Deprecated InputDetails []InputDetail `json:"inputDetails,omitempty"` @@ -348,7 +347,7 @@ func (o *PaymentMethod) SetType(v string) { } func (o PaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -423,12 +422,14 @@ func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethod) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_method_group.go b/src/checkout/model_payment_method_group.go index 08b3c6468..bf9be7c3a 100644 --- a/src/checkout/model_payment_method_group.go +++ b/src/checkout/model_payment_method_group.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodGroup type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PaymentMethodGroup) SetType(v string) { } func (o PaymentMethodGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullablePaymentMethodGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_method_issuer.go b/src/checkout/model_payment_method_issuer.go index 014462178..b73ebdea8 100644 --- a/src/checkout/model_payment_method_issuer.go +++ b/src/checkout/model_payment_method_issuer.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodIssuer type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *PaymentMethodIssuer) SetName(v string) { } func (o PaymentMethodIssuer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -183,3 +182,6 @@ func (v *NullablePaymentMethodIssuer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_methods_request.go b/src/checkout/model_payment_methods_request.go index 2259128b1..8f514bbae 100644 --- a/src/checkout/model_payment_methods_request.go +++ b/src/checkout/model_payment_methods_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodsRequest type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type PaymentMethodsRequest struct { AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web @@ -31,8 +30,8 @@ type PaymentMethodsRequest struct { // The shopper's country code. CountryCode *string `json:"countryCode,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - Order *EncryptedOrderData `json:"order,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Order *EncryptedOrderData `json:"order,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -442,7 +441,7 @@ func (o *PaymentMethodsRequest) SetStore(v string) { } func (o PaymentMethodsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -524,12 +523,14 @@ func (v *NullablePaymentMethodsRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodsRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_methods_response.go b/src/checkout/model_payment_methods_response.go index 18e332a44..62727793f 100644 --- a/src/checkout/model_payment_methods_response.go +++ b/src/checkout/model_payment_methods_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodsResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PaymentMethodsResponse) SetStoredPaymentMethods(v []StoredPaymentMethod } func (o PaymentMethodsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePaymentMethodsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_refund_resource.go b/src/checkout/model_payment_refund_resource.go index 48b5b5377..d3356c286 100644 --- a/src/checkout/model_payment_refund_resource.go +++ b/src/checkout/model_payment_refund_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentRefundResource type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type PaymentRefundResource struct { MerchantAccount string `json:"merchantAccount"` // Your reason for the refund request. MerchantRefundReason *string `json:"merchantRefundReason,omitempty"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the refund request. PspReference string `json:"pspReference"` @@ -309,7 +308,7 @@ func (o *PaymentRefundResource) SetStatus(v string) { } func (o PaymentRefundResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -374,21 +373,23 @@ func (v *NullablePaymentRefundResource) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRefundResource) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER" } + for _, allowed := range allowedEnumValues { + if o.GetMerchantRefundReason() == allowed { + return true + } + } + return false } func (o *PaymentRefundResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_response.go b/src/checkout/model_payment_response.go index 4b2daf2d6..4f87aac77 100644 --- a/src/checkout/model_payment_response.go +++ b/src/checkout/model_payment_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentResponse type satisfies the MappedNullable interface at compile time @@ -22,14 +21,14 @@ type PaymentResponse struct { Action *PaymentResponseAction `json:"action,omitempty"` // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // Donation Token containing payment details for Adyen Giving. - DonationToken *string `json:"donationToken,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DonationToken *string `json:"donationToken,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - MerchantReference *string `json:"merchantReference,omitempty"` - Order *CheckoutOrderResponse `json:"order,omitempty"` - PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` + MerchantReference *string `json:"merchantReference,omitempty"` + Order *CheckoutOrderResponse `json:"order,omitempty"` + PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -37,9 +36,9 @@ type PaymentResponse struct { // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - ResultCode *string `json:"resultCode,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. ThreeDSPaymentData *string `json:"threeDSPaymentData,omitempty"` } @@ -542,7 +541,7 @@ func (o *PaymentResponse) SetThreeDSPaymentData(v string) { } func (o PaymentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -635,12 +634,14 @@ func (v *NullablePaymentResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_response_action.go b/src/checkout/model_payment_response_action.go index 8f3f16605..0d7a04776 100644 --- a/src/checkout/model_payment_response_action.go +++ b/src/checkout/model_payment_response_action.go @@ -10,18 +10,19 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // PaymentResponseAction - Action to be taken for completing the payment. type PaymentResponseAction struct { - CheckoutAwaitAction *CheckoutAwaitAction + CheckoutAwaitAction *CheckoutAwaitAction CheckoutNativeRedirectAction *CheckoutNativeRedirectAction - CheckoutQrCodeAction *CheckoutQrCodeAction - CheckoutRedirectAction *CheckoutRedirectAction - CheckoutSDKAction *CheckoutSDKAction - CheckoutThreeDS2Action *CheckoutThreeDS2Action - CheckoutVoucherAction *CheckoutVoucherAction + CheckoutQrCodeAction *CheckoutQrCodeAction + CheckoutRedirectAction *CheckoutRedirectAction + CheckoutSDKAction *CheckoutSDKAction + CheckoutThreeDS2Action *CheckoutThreeDS2Action + CheckoutVoucherAction *CheckoutVoucherAction } // CheckoutAwaitActionAsPaymentResponseAction is a convenience function that returns CheckoutAwaitAction wrapped in PaymentResponseAction @@ -73,6 +74,7 @@ func CheckoutVoucherActionAsPaymentResponseAction(v *CheckoutVoucherAction) Paym } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { var err error @@ -83,7 +85,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutAwaitAction, _ := json.Marshal(dst.CheckoutAwaitAction) if string(jsonCheckoutAwaitAction) == "{}" || !dst.CheckoutAwaitAction.isValidType() { // empty struct dst.CheckoutAwaitAction = nil - } else { + } else { match++ } } else { @@ -96,7 +98,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutNativeRedirectAction, _ := json.Marshal(dst.CheckoutNativeRedirectAction) if string(jsonCheckoutNativeRedirectAction) == "{}" || !dst.CheckoutNativeRedirectAction.isValidType() { // empty struct dst.CheckoutNativeRedirectAction = nil - } else { + } else { match++ } } else { @@ -109,7 +111,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutQrCodeAction, _ := json.Marshal(dst.CheckoutQrCodeAction) if string(jsonCheckoutQrCodeAction) == "{}" || !dst.CheckoutQrCodeAction.isValidType() { // empty struct dst.CheckoutQrCodeAction = nil - } else { + } else { match++ } } else { @@ -122,7 +124,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutRedirectAction, _ := json.Marshal(dst.CheckoutRedirectAction) if string(jsonCheckoutRedirectAction) == "{}" || !dst.CheckoutRedirectAction.isValidType() { // empty struct dst.CheckoutRedirectAction = nil - } else { + } else { match++ } } else { @@ -135,7 +137,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutSDKAction, _ := json.Marshal(dst.CheckoutSDKAction) if string(jsonCheckoutSDKAction) == "{}" || !dst.CheckoutSDKAction.isValidType() { // empty struct dst.CheckoutSDKAction = nil - } else { + } else { match++ } } else { @@ -148,7 +150,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutThreeDS2Action, _ := json.Marshal(dst.CheckoutThreeDS2Action) if string(jsonCheckoutThreeDS2Action) == "{}" || !dst.CheckoutThreeDS2Action.isValidType() { // empty struct dst.CheckoutThreeDS2Action = nil - } else { + } else { match++ } } else { @@ -161,7 +163,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutVoucherAction, _ := json.Marshal(dst.CheckoutVoucherAction) if string(jsonCheckoutVoucherAction) == "{}" || !dst.CheckoutVoucherAction.isValidType() { // empty struct dst.CheckoutVoucherAction = nil - } else { + } else { match++ } } else { @@ -220,7 +222,7 @@ func (src PaymentResponseAction) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *PaymentResponseAction) GetActualInstance() interface{} { +func (obj *PaymentResponseAction) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -291,3 +293,5 @@ func (v *NullablePaymentResponseAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/checkout/model_payment_reversal_resource.go b/src/checkout/model_payment_reversal_resource.go index 8c9616ef1..9e1f0ddcf 100644 --- a/src/checkout/model_payment_reversal_resource.go +++ b/src/checkout/model_payment_reversal_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentReversalResource type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PaymentReversalResource{} type PaymentReversalResource struct { // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the reversal request. PspReference string `json:"pspReference"` @@ -181,7 +180,7 @@ func (o *PaymentReversalResource) SetStatus(v string) { } func (o PaymentReversalResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullablePaymentReversalResource) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentReversalResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_setup_request.go b/src/checkout/model_payment_setup_request.go index bad324c51..acbd64fba 100644 --- a/src/checkout/model_payment_setup_request.go +++ b/src/checkout/model_payment_setup_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentSetupRequest type satisfies the MappedNullable interface at compile time @@ -24,10 +23,10 @@ type PaymentSetupRequest struct { // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -35,18 +34,18 @@ type PaymentSetupRequest struct { // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web Channel *string `json:"channel,omitempty"` // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Company *Company `json:"company,omitempty"` - Configuration *Configuration `json:"configuration,omitempty"` + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + Company *Company `json:"company,omitempty"` + Configuration *Configuration `json:"configuration,omitempty"` // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. // Deprecated ConversionId *string `json:"conversionId,omitempty"` // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE CountryCode string `json:"countryCode"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. @@ -58,26 +57,26 @@ type PaymentSetupRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate2 `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. - Origin *string `json:"origin,omitempty"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + Origin *string `json:"origin,omitempty"` + PlatformChargebackLogic *PlatformChargebackLogic2 `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. @@ -85,8 +84,8 @@ type PaymentSetupRequest struct { // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The version of the SDK you are using (for Web SDK integrations only). SdkVersion *string `json:"sdkVersion,omitempty"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 @@ -99,7 +98,7 @@ type PaymentSetupRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -969,9 +968,9 @@ func (o *PaymentSetupRequest) SetLocalizedShopperStatement(v map[string]string) } // GetMandate returns the Mandate field value if set, zero value otherwise. -func (o *PaymentSetupRequest) GetMandate() Mandate { +func (o *PaymentSetupRequest) GetMandate() Mandate2 { if o == nil || common.IsNil(o.Mandate) { - var ret Mandate + var ret Mandate2 return ret } return *o.Mandate @@ -979,7 +978,7 @@ func (o *PaymentSetupRequest) GetMandate() Mandate { // GetMandateOk returns a tuple with the Mandate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentSetupRequest) GetMandateOk() (*Mandate, bool) { +func (o *PaymentSetupRequest) GetMandateOk() (*Mandate2, bool) { if o == nil || common.IsNil(o.Mandate) { return nil, false } @@ -995,8 +994,8 @@ func (o *PaymentSetupRequest) HasMandate() bool { return false } -// SetMandate gets a reference to the given Mandate and assigns it to the Mandate field. -func (o *PaymentSetupRequest) SetMandate(v Mandate) { +// SetMandate gets a reference to the given Mandate2 and assigns it to the Mandate field. +func (o *PaymentSetupRequest) SetMandate(v Mandate2) { o.Mandate = &v } @@ -1185,9 +1184,9 @@ func (o *PaymentSetupRequest) SetOrigin(v string) { } // GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. -func (o *PaymentSetupRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { +func (o *PaymentSetupRequest) GetPlatformChargebackLogic() PlatformChargebackLogic2 { if o == nil || common.IsNil(o.PlatformChargebackLogic) { - var ret PlatformChargebackLogic + var ret PlatformChargebackLogic2 return ret } return *o.PlatformChargebackLogic @@ -1195,7 +1194,7 @@ func (o *PaymentSetupRequest) GetPlatformChargebackLogic() PlatformChargebackLog // GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentSetupRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { +func (o *PaymentSetupRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic2, bool) { if o == nil || common.IsNil(o.PlatformChargebackLogic) { return nil, false } @@ -1211,8 +1210,8 @@ func (o *PaymentSetupRequest) HasPlatformChargebackLogic() bool { return false } -// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. -func (o *PaymentSetupRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { +// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic2 and assigns it to the PlatformChargebackLogic field. +func (o *PaymentSetupRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic2) { o.PlatformChargebackLogic = &v } @@ -1908,7 +1907,7 @@ func (o *PaymentSetupRequest) SetTrustedShopper(v bool) { } func (o PaymentSetupRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2114,30 +2113,32 @@ func (v *NullablePaymentSetupRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentSetupRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *PaymentSetupRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } func (o *PaymentSetupRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_setup_response.go b/src/checkout/model_payment_setup_response.go index f3183fc41..0baf6277d 100644 --- a/src/checkout/model_payment_setup_response.go +++ b/src/checkout/model_payment_setup_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentSetupResponse type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *PaymentSetupResponse) SetRecurringDetails(v []RecurringDetail) { } func (o PaymentSetupResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -164,3 +163,6 @@ func (v *NullablePaymentSetupResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_verification_request.go b/src/checkout/model_payment_verification_request.go index 631f24e7d..9e6309d69 100644 --- a/src/checkout/model_payment_verification_request.go +++ b/src/checkout/model_payment_verification_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentVerificationRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *PaymentVerificationRequest) SetPayload(v string) { } func (o PaymentVerificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullablePaymentVerificationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 348ea2f74..bd9c696ef 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentVerificationResponse type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &PaymentVerificationResponse{} type PaymentVerificationResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // A unique value that you provided in the initial `/paymentSession` request as a `reference` field. - MerchantReference string `json:"merchantReference"` - Order *CheckoutOrderResponse `json:"order,omitempty"` + MerchantReference string `json:"merchantReference"` + Order *CheckoutOrderResponse `json:"order,omitempty"` // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -32,7 +31,7 @@ type PaymentVerificationResponse struct { // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - ResultCode *string `json:"resultCode,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` ServiceError *ServiceError2 `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. ShopperLocale string `json:"shopperLocale"` @@ -362,7 +361,7 @@ func (o *PaymentVerificationResponse) SetShopperLocale(v string) { } func (o PaymentVerificationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -436,12 +435,14 @@ func (v *NullablePaymentVerificationResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentVerificationResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_phone.go b/src/checkout/model_phone.go index 490406f6e..611f436f2 100644 --- a/src/checkout/model_phone.go +++ b/src/checkout/model_phone.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Phone) SetSubscriber(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_platform_chargeback_logic.go b/src/checkout/model_platform_chargeback_logic.go index 204ad64da..8eba2d420 100644 --- a/src/checkout/model_platform_chargeback_logic.go +++ b/src/checkout/model_platform_chargeback_logic.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PlatformChargebackLogic type satisfies the MappedNullable interface at compile time @@ -19,9 +18,12 @@ var _ common.MappedNullable = &PlatformChargebackLogic{} // PlatformChargebackLogic struct for PlatformChargebackLogic type PlatformChargebackLogic struct { - Behavior *string `json:"behavior,omitempty"` + // The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + Behavior *string `json:"behavior,omitempty"` + // The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. CostAllocationAccount *string `json:"costAllocationAccount,omitempty"` - TargetAccount *string `json:"targetAccount,omitempty"` + // The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. + TargetAccount *string `json:"targetAccount,omitempty"` } // NewPlatformChargebackLogic instantiates a new PlatformChargebackLogic object @@ -138,7 +140,7 @@ func (o *PlatformChargebackLogic) SetTargetAccount(v string) { } func (o PlatformChargebackLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,12 +197,14 @@ func (v *NullablePlatformChargebackLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PlatformChargebackLogic) isValidBehavior() bool { - var allowedEnumValues = []string{"deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetBehavior() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetBehavior() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_platform_chargeback_logic_2.go b/src/checkout/model_platform_chargeback_logic_2.go new file mode 100644 index 000000000..05d73a145 --- /dev/null +++ b/src/checkout/model_platform_chargeback_logic_2.go @@ -0,0 +1,210 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the PlatformChargebackLogic2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PlatformChargebackLogic2{} + +// PlatformChargebackLogic2 struct for PlatformChargebackLogic2 +type PlatformChargebackLogic2 struct { + // The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + Behavior *string `json:"behavior,omitempty"` + // The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. + CostAllocationAccount *string `json:"costAllocationAccount,omitempty"` + // The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. + TargetAccount *string `json:"targetAccount,omitempty"` +} + +// NewPlatformChargebackLogic2 instantiates a new PlatformChargebackLogic2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlatformChargebackLogic2() *PlatformChargebackLogic2 { + this := PlatformChargebackLogic2{} + return &this +} + +// NewPlatformChargebackLogic2WithDefaults instantiates a new PlatformChargebackLogic2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlatformChargebackLogic2WithDefaults() *PlatformChargebackLogic2 { + this := PlatformChargebackLogic2{} + return &this +} + +// GetBehavior returns the Behavior field value if set, zero value otherwise. +func (o *PlatformChargebackLogic2) GetBehavior() string { + if o == nil || common.IsNil(o.Behavior) { + var ret string + return ret + } + return *o.Behavior +} + +// GetBehaviorOk returns a tuple with the Behavior field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformChargebackLogic2) GetBehaviorOk() (*string, bool) { + if o == nil || common.IsNil(o.Behavior) { + return nil, false + } + return o.Behavior, true +} + +// HasBehavior returns a boolean if a field has been set. +func (o *PlatformChargebackLogic2) HasBehavior() bool { + if o != nil && !common.IsNil(o.Behavior) { + return true + } + + return false +} + +// SetBehavior gets a reference to the given string and assigns it to the Behavior field. +func (o *PlatformChargebackLogic2) SetBehavior(v string) { + o.Behavior = &v +} + +// GetCostAllocationAccount returns the CostAllocationAccount field value if set, zero value otherwise. +func (o *PlatformChargebackLogic2) GetCostAllocationAccount() string { + if o == nil || common.IsNil(o.CostAllocationAccount) { + var ret string + return ret + } + return *o.CostAllocationAccount +} + +// GetCostAllocationAccountOk returns a tuple with the CostAllocationAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformChargebackLogic2) GetCostAllocationAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.CostAllocationAccount) { + return nil, false + } + return o.CostAllocationAccount, true +} + +// HasCostAllocationAccount returns a boolean if a field has been set. +func (o *PlatformChargebackLogic2) HasCostAllocationAccount() bool { + if o != nil && !common.IsNil(o.CostAllocationAccount) { + return true + } + + return false +} + +// SetCostAllocationAccount gets a reference to the given string and assigns it to the CostAllocationAccount field. +func (o *PlatformChargebackLogic2) SetCostAllocationAccount(v string) { + o.CostAllocationAccount = &v +} + +// GetTargetAccount returns the TargetAccount field value if set, zero value otherwise. +func (o *PlatformChargebackLogic2) GetTargetAccount() string { + if o == nil || common.IsNil(o.TargetAccount) { + var ret string + return ret + } + return *o.TargetAccount +} + +// GetTargetAccountOk returns a tuple with the TargetAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformChargebackLogic2) GetTargetAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.TargetAccount) { + return nil, false + } + return o.TargetAccount, true +} + +// HasTargetAccount returns a boolean if a field has been set. +func (o *PlatformChargebackLogic2) HasTargetAccount() bool { + if o != nil && !common.IsNil(o.TargetAccount) { + return true + } + + return false +} + +// SetTargetAccount gets a reference to the given string and assigns it to the TargetAccount field. +func (o *PlatformChargebackLogic2) SetTargetAccount(v string) { + o.TargetAccount = &v +} + +func (o PlatformChargebackLogic2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlatformChargebackLogic2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Behavior) { + toSerialize["behavior"] = o.Behavior + } + if !common.IsNil(o.CostAllocationAccount) { + toSerialize["costAllocationAccount"] = o.CostAllocationAccount + } + if !common.IsNil(o.TargetAccount) { + toSerialize["targetAccount"] = o.TargetAccount + } + return toSerialize, nil +} + +type NullablePlatformChargebackLogic2 struct { + value *PlatformChargebackLogic2 + isSet bool +} + +func (v NullablePlatformChargebackLogic2) Get() *PlatformChargebackLogic2 { + return v.value +} + +func (v *NullablePlatformChargebackLogic2) Set(val *PlatformChargebackLogic2) { + v.value = val + v.isSet = true +} + +func (v NullablePlatformChargebackLogic2) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatformChargebackLogic2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatformChargebackLogic2(val *PlatformChargebackLogic2) *NullablePlatformChargebackLogic2 { + return &NullablePlatformChargebackLogic2{value: val, isSet: true} +} + +func (v NullablePlatformChargebackLogic2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatformChargebackLogic2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PlatformChargebackLogic2) isValidBehavior() bool { + var allowedEnumValues = []string{ "deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetBehavior() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_ratepay_details.go b/src/checkout/model_ratepay_details.go index 39c074bd7..b7608de77 100644 --- a/src/checkout/model_ratepay_details.go +++ b/src/checkout/model_ratepay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RatepayDetails type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *RatepayDetails) SetType(v string) { } func (o RatepayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -343,12 +342,14 @@ func (v *NullableRatepayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *RatepayDetails) isValidType() bool { - var allowedEnumValues = []string{"ratepay", "ratepay_directdebit"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ratepay", "ratepay_directdebit" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_recurring.go b/src/checkout/model_recurring.go index 45c55334f..b18a3d410 100644 --- a/src/checkout/model_recurring.go +++ b/src/checkout/model_recurring.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_recurring_detail.go b/src/checkout/model_recurring_detail.go index b4b17ecd8..e518a115f 100644 --- a/src/checkout/model_recurring_detail.go +++ b/src/checkout/model_recurring_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RecurringDetail type satisfies the MappedNullable interface at compile time @@ -26,8 +25,8 @@ type RecurringDetail struct { // The configuration of the payment method. Configuration *map[string]string `json:"configuration,omitempty"` // The funding source of the payment method. - FundingSource *string `json:"fundingSource,omitempty"` - Group *PaymentMethodGroup `json:"group,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Group *PaymentMethodGroup `json:"group,omitempty"` // All input details to be provided to complete the payment with this payment method. // Deprecated InputDetails []InputDetail `json:"inputDetails,omitempty"` @@ -36,8 +35,8 @@ type RecurringDetail struct { // The displayable name of this payment method. Name *string `json:"name,omitempty"` // The reference that uniquely identifies the recurring detail. - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` - StoredDetails *StoredDetails `json:"storedDetails,omitempty"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + StoredDetails *StoredDetails `json:"storedDetails,omitempty"` // The unique payment method code. Type *string `json:"type,omitempty"` } @@ -415,7 +414,7 @@ func (o *RecurringDetail) SetType(v string) { } func (o RecurringDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -496,12 +495,14 @@ func (v *NullableRecurringDetail) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *RecurringDetail) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_response_additional_data3_d_secure.go b/src/checkout/model_response_additional_data3_d_secure.go index 0d410425f..fc82ab448 100644 --- a/src/checkout/model_response_additional_data3_d_secure.go +++ b/src/checkout/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_billing_address.go b/src/checkout/model_response_additional_data_billing_address.go index 6a47224a7..6dc1e2383 100644 --- a/src/checkout/model_response_additional_data_billing_address.go +++ b/src/checkout/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_card.go b/src/checkout/model_response_additional_data_card.go index 46d96bb86..afee60207 100644 --- a/src/checkout/model_response_additional_data_card.go +++ b/src/checkout/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_common.go b/src/checkout/model_response_additional_data_common.go index 0183fa216..1fe67dd00 100644 --- a/src/checkout/model_response_additional_data_common.go +++ b/src/checkout/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_response_additional_data_installments.go b/src/checkout/model_response_additional_data_installments.go index a24ae9941..914968e0e 100644 --- a/src/checkout/model_response_additional_data_installments.go +++ b/src/checkout/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_network_tokens.go b/src/checkout/model_response_additional_data_network_tokens.go index 75626f751..7ad3e3b6c 100644 --- a/src/checkout/model_response_additional_data_network_tokens.go +++ b/src/checkout/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_opi.go b/src/checkout/model_response_additional_data_opi.go index 2d40e9307..5c0a51a3e 100644 --- a/src/checkout/model_response_additional_data_opi.go +++ b/src/checkout/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_sepa.go b/src/checkout/model_response_additional_data_sepa.go index 55d2b32de..30b382403 100644 --- a/src/checkout/model_response_additional_data_sepa.go +++ b/src/checkout/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_payment_method.go b/src/checkout/model_response_payment_method.go index cd802c4cb..6457b643f 100644 --- a/src/checkout/model_response_payment_method.go +++ b/src/checkout/model_response_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponsePaymentMethod type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ResponsePaymentMethod) SetType(v string) { } func (o ResponsePaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableResponsePaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_risk_data.go b/src/checkout/model_risk_data.go index b76589823..d22fb6608 100644 --- a/src/checkout/model_risk_data.go +++ b/src/checkout/model_risk_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RiskData type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *RiskData) SetProfileReference(v string) { } func (o RiskData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableRiskData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_samsung_pay_details.go b/src/checkout/model_samsung_pay_details.go index edb961659..fdfa141d6 100644 --- a/src/checkout/model_samsung_pay_details.go +++ b/src/checkout/model_samsung_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SamsungPayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *SamsungPayDetails) SetType(v string) { } func (o SamsungPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableSamsungPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SamsungPayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *SamsungPayDetails) isValidType() bool { - var allowedEnumValues = []string{"samsungpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "samsungpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_sdk_ephem_pub_key.go b/src/checkout/model_sdk_ephem_pub_key.go index 6f2f56adc..1feb5e2b6 100644 --- a/src/checkout/model_sdk_ephem_pub_key.go +++ b/src/checkout/model_sdk_ephem_pub_key.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SDKEphemPubKey type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *SDKEphemPubKey) SetY(v string) { } func (o SDKEphemPubKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSDKEphemPubKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sepa_direct_debit_details.go b/src/checkout/model_sepa_direct_debit_details.go index 5d95b64f3..862fa08a8 100644 --- a/src/checkout/model_sepa_direct_debit_details.go +++ b/src/checkout/model_sepa_direct_debit_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SepaDirectDebitDetails type satisfies the MappedNullable interface at compile time @@ -237,7 +236,7 @@ func (o *SepaDirectDebitDetails) SetType(v string) { } func (o SepaDirectDebitDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,12 +298,14 @@ func (v *NullableSepaDirectDebitDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SepaDirectDebitDetails) isValidType() bool { - var allowedEnumValues = []string{"sepadirectdebit", "sepadirectdebit_amazonpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sepadirectdebit", "sepadirectdebit_amazonpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_service_error.go b/src/checkout/model_service_error.go index 2628af97a..80d797b2b 100644 --- a/src/checkout/model_service_error.go +++ b/src/checkout/model_service_error.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_service_error_2.go b/src/checkout/model_service_error_2.go index 5a12cb414..128ee6fae 100644 --- a/src/checkout/model_service_error_2.go +++ b/src/checkout/model_service_error_2.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError2 type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &ServiceError2{} // ServiceError2 struct for ServiceError2 type ServiceError2 struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message *string `json:"message,omitempty"` + ErrorCode *string `json:"errorCode,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message *string `json:"message,omitempty"` PspReference *string `json:"pspReference,omitempty"` } @@ -171,7 +170,7 @@ func (o *ServiceError2) SetPspReference(v string) { } func (o ServiceError2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,3 +229,6 @@ func (v *NullableServiceError2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_shopper_input.go b/src/checkout/model_shopper_input.go index e80a1ce8b..08828c7fb 100644 --- a/src/checkout/model_shopper_input.go +++ b/src/checkout/model_shopper_input.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ShopperInput type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInput) SetPersonalDetails(v string) { } func (o ShopperInput) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,30 +197,32 @@ func (v *NullableShopperInput) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ShopperInput) isValidBillingAddress() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAddress() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAddress() == allowed { + return true + } + } + return false } func (o *ShopperInput) isValidDeliveryAddress() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddress() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddress() == allowed { + return true + } + } + return false } func (o *ShopperInput) isValidPersonalDetails() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetPersonalDetails() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetPersonalDetails() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_shopper_interaction_device.go b/src/checkout/model_shopper_interaction_device.go index bcd10f72a..6ae33555d 100644 --- a/src/checkout/model_shopper_interaction_device.go +++ b/src/checkout/model_shopper_interaction_device.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ShopperInteractionDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInteractionDevice) SetOsVersion(v string) { } func (o ShopperInteractionDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableShopperInteractionDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index 7e29feb1c..8e7c4af7d 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Split type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` + // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + Account *string `json:"account,omitempty"` + Amount SplitAmount `json:"amount"` // A description of this split. Description *string `json:"description,omitempty"` // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. @@ -194,7 +193,7 @@ func (o *Split) SetType(v string) { } func (o Split) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,12 +252,14 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_split_2.go b/src/checkout/model_split_2.go new file mode 100644 index 000000000..7c206aaa2 --- /dev/null +++ b/src/checkout/model_split_2.go @@ -0,0 +1,274 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Split2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Split2{} + +// Split2 struct for Split2 +type Split2 struct { + // The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + Account *string `json:"account,omitempty"` + Amount *SplitAmount `json:"amount,omitempty"` + // Your description for the split item. + Description *string `json:"description,omitempty"` + // Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. + Reference *string `json:"reference,omitempty"` + // The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. + Type string `json:"type"` +} + +// NewSplit2 instantiates a new Split2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSplit2(type_ string) *Split2 { + this := Split2{} + this.Type = type_ + return &this +} + +// NewSplit2WithDefaults instantiates a new Split2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSplit2WithDefaults() *Split2 { + this := Split2{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *Split2) GetAccount() string { + if o == nil || common.IsNil(o.Account) { + var ret string + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Split2) GetAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *Split2) HasAccount() bool { + if o != nil && !common.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given string and assigns it to the Account field. +func (o *Split2) SetAccount(v string) { + o.Account = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *Split2) GetAmount() SplitAmount { + if o == nil || common.IsNil(o.Amount) { + var ret SplitAmount + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Split2) GetAmountOk() (*SplitAmount, bool) { + if o == nil || common.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Split2) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given SplitAmount and assigns it to the Amount field. +func (o *Split2) SetAmount(v SplitAmount) { + o.Amount = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Split2) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Split2) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Split2) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Split2) SetDescription(v string) { + o.Description = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *Split2) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Split2) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *Split2) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *Split2) SetReference(v string) { + o.Reference = &v +} + +// GetType returns the Type field value +func (o *Split2) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Split2) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Split2) SetType(v string) { + o.Type = v +} + +func (o Split2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Split2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableSplit2 struct { + value *Split2 + isSet bool +} + +func (v NullableSplit2) Get() *Split2 { + return v.value +} + +func (v *NullableSplit2) Set(val *Split2) { + v.value = val + v.isSet = true +} + +func (v NullableSplit2) IsSet() bool { + return v.isSet +} + +func (v *NullableSplit2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSplit2(val *Split2) *NullableSplit2 { + return &NullableSplit2{value: val, isSet: true} +} + +func (v NullableSplit2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSplit2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Split2) isValidType() bool { + var allowedEnumValues = []string{ "BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_split_amount.go b/src/checkout/model_split_amount.go index a88ed9f29..0da1ce698 100644 --- a/src/checkout/model_split_amount.go +++ b/src/checkout/model_split_amount.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitAmount type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *SplitAmount) SetValue(v int64) { } func (o SplitAmount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableSplitAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_standalone_payment_cancel_resource.go b/src/checkout/model_standalone_payment_cancel_resource.go index 2602a94bd..4aeb5ff59 100644 --- a/src/checkout/model_standalone_payment_cancel_resource.go +++ b/src/checkout/model_standalone_payment_cancel_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StandalonePaymentCancelResource type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *StandalonePaymentCancelResource) SetStatus(v string) { } func (o StandalonePaymentCancelResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullableStandalonePaymentCancelResource) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StandalonePaymentCancelResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_stored_details.go b/src/checkout/model_stored_details.go index 51ec86446..1b4ff05a5 100644 --- a/src/checkout/model_stored_details.go +++ b/src/checkout/model_stored_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredDetails type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &StoredDetails{} // StoredDetails struct for StoredDetails type StoredDetails struct { Bank *BankAccount `json:"bank,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // The email associated with stored payment details. EmailAddress *string `json:"emailAddress,omitempty"` } @@ -139,7 +138,7 @@ func (o *StoredDetails) SetEmailAddress(v string) { } func (o StoredDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,3 +194,6 @@ func (v *NullableStoredDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_stored_payment_method.go b/src/checkout/model_stored_payment_method.go index e902d36af..8bd745f15 100644 --- a/src/checkout/model_stored_payment_method.go +++ b/src/checkout/model_stored_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredPaymentMethod type satisfies the MappedNullable interface at compile time @@ -515,7 +514,7 @@ func (o *StoredPaymentMethod) SetType(v string) { } func (o StoredPaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -604,3 +603,6 @@ func (v *NullableStoredPaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_stored_payment_method_details.go b/src/checkout/model_stored_payment_method_details.go index 5b70e5053..92fa22327 100644 --- a/src/checkout/model_stored_payment_method_details.go +++ b/src/checkout/model_stored_payment_method_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredPaymentMethodDetails type satisfies the MappedNullable interface at compile time @@ -179,7 +178,7 @@ func (o *StoredPaymentMethodDetails) SetType(v string) { } func (o StoredPaymentMethodDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,12 +238,14 @@ func (v *NullableStoredPaymentMethodDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredPaymentMethodDetails) isValidType() bool { - var allowedEnumValues = []string{"bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "kakaopay", "truemoney", "twint_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "kakaopay", "truemoney" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_stored_payment_method_resource.go b/src/checkout/model_stored_payment_method_resource.go index 7e9f2707a..577d85a1e 100644 --- a/src/checkout/model_stored_payment_method_resource.go +++ b/src/checkout/model_stored_payment_method_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredPaymentMethodResource type satisfies the MappedNullable interface at compile time @@ -617,7 +616,7 @@ func (o *StoredPaymentMethodResource) SetType(v string) { } func (o StoredPaymentMethodResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableStoredPaymentMethodResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sub_input_detail.go b/src/checkout/model_sub_input_detail.go index f5c35164a..312633d8d 100644 --- a/src/checkout/model_sub_input_detail.go +++ b/src/checkout/model_sub_input_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SubInputDetail type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *SubInputDetail) SetValue(v string) { } func (o SubInputDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableSubInputDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sub_merchant.go b/src/checkout/model_sub_merchant.go index 00c96cdcf..b2b57b131 100644 --- a/src/checkout/model_sub_merchant.go +++ b/src/checkout/model_sub_merchant.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SubMerchant type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *SubMerchant) SetTaxId(v string) { } func (o SubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_three_d_secure_data.go b/src/checkout/model_three_d_secure_data.go index 817083a0e..033ac9f5b 100644 --- a/src/checkout/model_three_d_secure_data.go +++ b/src/checkout/model_three_d_secure_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSecureData type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ThreeDSecureData) SetXid(v string) { } func (o ThreeDSecureData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -531,30 +530,32 @@ func (v *NullableThreeDSecureData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSecureData) isValidAuthenticationResponse() bool { - var allowedEnumValues = []string{"Y", "N", "U", "A"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N", "U", "A" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationResponse() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidDirectoryResponse() bool { - var allowedEnumValues = []string{"A", "C", "D", "I", "N", "R", "U", "Y"} - for _, allowed := range allowedEnumValues { - if o.GetDirectoryResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "A", "C", "D", "I", "N", "R", "U", "Y" } + for _, allowed := range allowedEnumValues { + if o.GetDirectoryResponse() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds2_request_data.go b/src/checkout/model_three_ds2_request_data.go index dec46ff98..eda1cd2be 100644 --- a/src/checkout/model_three_ds2_request_data.go +++ b/src/checkout/model_three_ds2_request_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2RequestData type satisfies the MappedNullable interface at compile time @@ -31,20 +30,20 @@ type ThreeDS2RequestData struct { // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` - // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` // Deprecated ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The environment of the shopper. Allowed values: * `app` * `browser` - DeviceChannel string `json:"deviceChannel"` + DeviceChannel string `json:"deviceChannel"` DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` - HomePhone *Phone `json:"homePhone,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. Mcc *string `json:"mcc,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. MerchantName *string `json:"merchantName,omitempty"` // The `messageVersion` value indicating the 3D Secure 2 protocol version. MessageVersion *string `json:"messageVersion,omitempty"` - MobilePhone *Phone `json:"mobilePhone,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. NotificationURL *string `json:"notificationURL,omitempty"` // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. @@ -60,7 +59,7 @@ type ThreeDS2RequestData struct { // The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. SdkAppID *string `json:"sdkAppID,omitempty"` // The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - SdkEncData *string `json:"sdkEncData,omitempty"` + SdkEncData *string `json:"sdkEncData,omitempty"` SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` @@ -73,14 +72,14 @@ type ThreeDS2RequestData struct { // Completion indicator for the device fingerprinting. ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` // Indicates the type of Authentication request. - ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` @@ -90,7 +89,7 @@ type ThreeDS2RequestData struct { TransactionType *string `json:"transactionType,omitempty"` // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. WhiteListStatus *string `json:"whiteListStatus,omitempty"` - WorkPhone *Phone `json:"workPhone,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` } // NewThreeDS2RequestData instantiates a new ThreeDS2RequestData object @@ -1370,7 +1369,7 @@ func (o *ThreeDS2RequestData) SetWorkPhone(v Phone) { } func (o ThreeDS2RequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1533,57 +1532,59 @@ func (v *NullableThreeDS2RequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2RequestData) isValidAcctType() bool { - var allowedEnumValues = []string{"01", "02", "03"} - for _, allowed := range allowedEnumValues { - if o.GetAcctType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidAddrMatch() bool { - var allowedEnumValues = []string{"Y", "N"} - for _, allowed := range allowedEnumValues { - if o.GetAddrMatch() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransType() bool { - var allowedEnumValues = []string{"01", "03", "10", "11", "28"} - for _, allowed := range allowedEnumValues { - if o.GetTransType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransactionType() bool { - var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} - for _, allowed := range allowedEnumValues { - if o.GetTransactionType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds2_request_data_2.go b/src/checkout/model_three_ds2_request_data_2.go new file mode 100644 index 000000000..10e286124 --- /dev/null +++ b/src/checkout/model_three_ds2_request_data_2.go @@ -0,0 +1,1488 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the ThreeDS2RequestData2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ThreeDS2RequestData2{} + +// ThreeDS2RequestData2 struct for ThreeDS2RequestData2 +type ThreeDS2RequestData2 struct { + AcctInfo *AcctInfo `json:"acctInfo,omitempty"` + // Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + AcctType *string `json:"acctType,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + AcquirerBIN *string `json:"acquirerBIN,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + AcquirerMerchantID *string `json:"acquirerMerchantID,omitempty"` + // Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + AddrMatch *string `json:"addrMatch,omitempty"` + // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + // Deprecated + AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Deprecated + ChallengeIndicator *string `json:"challengeIndicator,omitempty"` + DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` + // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + Mcc *string `json:"mcc,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + MerchantName *string `json:"merchantName,omitempty"` + // The `messageVersion` value indicating the 3D Secure 2 protocol version. + MessageVersion *string `json:"messageVersion,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` + // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + NotificationURL *string `json:"notificationURL,omitempty"` + // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + PayTokenInd *bool `json:"payTokenInd,omitempty"` + // Indicates the type of payment for which an authentication is requested (message extension) + PaymentAuthenticationUseCase *string `json:"paymentAuthenticationUseCase,omitempty"` + // Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + PurchaseInstalData *string `json:"purchaseInstalData,omitempty"` + // Date after which no further authorisations shall be performed. Format: YYYYMMDD + RecurringExpiry *string `json:"recurringExpiry,omitempty"` + // Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + RecurringFrequency *string `json:"recurringFrequency,omitempty"` + // The `sdkAppID` value as received from the 3D Secure 2 SDK. + SdkAppID *string `json:"sdkAppID,omitempty"` + SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` + // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. + SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` + // The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. + SdkReferenceNumber *string `json:"sdkReferenceNumber,omitempty"` + // The `sdkTransID` value as received from the 3D Secure 2 SDK. + SdkTransID *string `json:"sdkTransID,omitempty"` + // Completion indicator for the device fingerprinting. + ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` + // Indicates the type of Authentication request. + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` + // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` + // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` + // Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + TransType *string `json:"transType,omitempty"` + // Identify the type of the transaction being authenticated. + TransactionType *string `json:"transactionType,omitempty"` + // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + WhiteListStatus *string `json:"whiteListStatus,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` +} + +// NewThreeDS2RequestData2 instantiates a new ThreeDS2RequestData2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewThreeDS2RequestData2() *ThreeDS2RequestData2 { + this := ThreeDS2RequestData2{} + var authenticationOnly bool = false + this.AuthenticationOnly = &authenticationOnly + var messageVersion string = "2.1.0" + this.MessageVersion = &messageVersion + var sdkMaxTimeout int32 = 60 + this.SdkMaxTimeout = &sdkMaxTimeout + return &this +} + +// NewThreeDS2RequestData2WithDefaults instantiates a new ThreeDS2RequestData2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewThreeDS2RequestData2WithDefaults() *ThreeDS2RequestData2 { + this := ThreeDS2RequestData2{} + var authenticationOnly bool = false + this.AuthenticationOnly = &authenticationOnly + var messageVersion string = "2.1.0" + this.MessageVersion = &messageVersion + var sdkMaxTimeout int32 = 60 + this.SdkMaxTimeout = &sdkMaxTimeout + return &this +} + +// GetAcctInfo returns the AcctInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetAcctInfo() AcctInfo { + if o == nil || common.IsNil(o.AcctInfo) { + var ret AcctInfo + return ret + } + return *o.AcctInfo +} + +// GetAcctInfoOk returns a tuple with the AcctInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetAcctInfoOk() (*AcctInfo, bool) { + if o == nil || common.IsNil(o.AcctInfo) { + return nil, false + } + return o.AcctInfo, true +} + +// HasAcctInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAcctInfo() bool { + if o != nil && !common.IsNil(o.AcctInfo) { + return true + } + + return false +} + +// SetAcctInfo gets a reference to the given AcctInfo and assigns it to the AcctInfo field. +func (o *ThreeDS2RequestData2) SetAcctInfo(v AcctInfo) { + o.AcctInfo = &v +} + +// GetAcctType returns the AcctType field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetAcctType() string { + if o == nil || common.IsNil(o.AcctType) { + var ret string + return ret + } + return *o.AcctType +} + +// GetAcctTypeOk returns a tuple with the AcctType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetAcctTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AcctType) { + return nil, false + } + return o.AcctType, true +} + +// HasAcctType returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAcctType() bool { + if o != nil && !common.IsNil(o.AcctType) { + return true + } + + return false +} + +// SetAcctType gets a reference to the given string and assigns it to the AcctType field. +func (o *ThreeDS2RequestData2) SetAcctType(v string) { + o.AcctType = &v +} + +// GetAcquirerBIN returns the AcquirerBIN field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetAcquirerBIN() string { + if o == nil || common.IsNil(o.AcquirerBIN) { + var ret string + return ret + } + return *o.AcquirerBIN +} + +// GetAcquirerBINOk returns a tuple with the AcquirerBIN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetAcquirerBINOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerBIN) { + return nil, false + } + return o.AcquirerBIN, true +} + +// HasAcquirerBIN returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAcquirerBIN() bool { + if o != nil && !common.IsNil(o.AcquirerBIN) { + return true + } + + return false +} + +// SetAcquirerBIN gets a reference to the given string and assigns it to the AcquirerBIN field. +func (o *ThreeDS2RequestData2) SetAcquirerBIN(v string) { + o.AcquirerBIN = &v +} + +// GetAcquirerMerchantID returns the AcquirerMerchantID field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetAcquirerMerchantID() string { + if o == nil || common.IsNil(o.AcquirerMerchantID) { + var ret string + return ret + } + return *o.AcquirerMerchantID +} + +// GetAcquirerMerchantIDOk returns a tuple with the AcquirerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetAcquirerMerchantIDOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerMerchantID) { + return nil, false + } + return o.AcquirerMerchantID, true +} + +// HasAcquirerMerchantID returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAcquirerMerchantID() bool { + if o != nil && !common.IsNil(o.AcquirerMerchantID) { + return true + } + + return false +} + +// SetAcquirerMerchantID gets a reference to the given string and assigns it to the AcquirerMerchantID field. +func (o *ThreeDS2RequestData2) SetAcquirerMerchantID(v string) { + o.AcquirerMerchantID = &v +} + +// GetAddrMatch returns the AddrMatch field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetAddrMatch() string { + if o == nil || common.IsNil(o.AddrMatch) { + var ret string + return ret + } + return *o.AddrMatch +} + +// GetAddrMatchOk returns a tuple with the AddrMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetAddrMatchOk() (*string, bool) { + if o == nil || common.IsNil(o.AddrMatch) { + return nil, false + } + return o.AddrMatch, true +} + +// HasAddrMatch returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAddrMatch() bool { + if o != nil && !common.IsNil(o.AddrMatch) { + return true + } + + return false +} + +// SetAddrMatch gets a reference to the given string and assigns it to the AddrMatch field. +func (o *ThreeDS2RequestData2) SetAddrMatch(v string) { + o.AddrMatch = &v +} + +// GetAuthenticationOnly returns the AuthenticationOnly field value if set, zero value otherwise. +// Deprecated +func (o *ThreeDS2RequestData2) GetAuthenticationOnly() bool { + if o == nil || common.IsNil(o.AuthenticationOnly) { + var ret bool + return ret + } + return *o.AuthenticationOnly +} + +// GetAuthenticationOnlyOk returns a tuple with the AuthenticationOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ThreeDS2RequestData2) GetAuthenticationOnlyOk() (*bool, bool) { + if o == nil || common.IsNil(o.AuthenticationOnly) { + return nil, false + } + return o.AuthenticationOnly, true +} + +// HasAuthenticationOnly returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasAuthenticationOnly() bool { + if o != nil && !common.IsNil(o.AuthenticationOnly) { + return true + } + + return false +} + +// SetAuthenticationOnly gets a reference to the given bool and assigns it to the AuthenticationOnly field. +// Deprecated +func (o *ThreeDS2RequestData2) SetAuthenticationOnly(v bool) { + o.AuthenticationOnly = &v +} + +// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. +// Deprecated +func (o *ThreeDS2RequestData2) GetChallengeIndicator() string { + if o == nil || common.IsNil(o.ChallengeIndicator) { + var ret string + return ret + } + return *o.ChallengeIndicator +} + +// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ThreeDS2RequestData2) GetChallengeIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.ChallengeIndicator) { + return nil, false + } + return o.ChallengeIndicator, true +} + +// HasChallengeIndicator returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasChallengeIndicator() bool { + if o != nil && !common.IsNil(o.ChallengeIndicator) { + return true + } + + return false +} + +// SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. +// Deprecated +func (o *ThreeDS2RequestData2) SetChallengeIndicator(v string) { + o.ChallengeIndicator = &v +} + +// GetDeviceRenderOptions returns the DeviceRenderOptions field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetDeviceRenderOptions() DeviceRenderOptions { + if o == nil || common.IsNil(o.DeviceRenderOptions) { + var ret DeviceRenderOptions + return ret + } + return *o.DeviceRenderOptions +} + +// GetDeviceRenderOptionsOk returns a tuple with the DeviceRenderOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, bool) { + if o == nil || common.IsNil(o.DeviceRenderOptions) { + return nil, false + } + return o.DeviceRenderOptions, true +} + +// HasDeviceRenderOptions returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasDeviceRenderOptions() bool { + if o != nil && !common.IsNil(o.DeviceRenderOptions) { + return true + } + + return false +} + +// SetDeviceRenderOptions gets a reference to the given DeviceRenderOptions and assigns it to the DeviceRenderOptions field. +func (o *ThreeDS2RequestData2) SetDeviceRenderOptions(v DeviceRenderOptions) { + o.DeviceRenderOptions = &v +} + +// GetHomePhone returns the HomePhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetHomePhone() Phone { + if o == nil || common.IsNil(o.HomePhone) { + var ret Phone + return ret + } + return *o.HomePhone +} + +// GetHomePhoneOk returns a tuple with the HomePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetHomePhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.HomePhone) { + return nil, false + } + return o.HomePhone, true +} + +// HasHomePhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasHomePhone() bool { + if o != nil && !common.IsNil(o.HomePhone) { + return true + } + + return false +} + +// SetHomePhone gets a reference to the given Phone and assigns it to the HomePhone field. +func (o *ThreeDS2RequestData2) SetHomePhone(v Phone) { + o.HomePhone = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetMcc() string { + if o == nil || common.IsNil(o.Mcc) { + var ret string + return ret + } + return *o.Mcc +} + +// GetMccOk returns a tuple with the Mcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetMccOk() (*string, bool) { + if o == nil || common.IsNil(o.Mcc) { + return nil, false + } + return o.Mcc, true +} + +// HasMcc returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasMcc() bool { + if o != nil && !common.IsNil(o.Mcc) { + return true + } + + return false +} + +// SetMcc gets a reference to the given string and assigns it to the Mcc field. +func (o *ThreeDS2RequestData2) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantName returns the MerchantName field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetMerchantName() string { + if o == nil || common.IsNil(o.MerchantName) { + var ret string + return ret + } + return *o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetMerchantNameOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantName) { + return nil, false + } + return o.MerchantName, true +} + +// HasMerchantName returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasMerchantName() bool { + if o != nil && !common.IsNil(o.MerchantName) { + return true + } + + return false +} + +// SetMerchantName gets a reference to the given string and assigns it to the MerchantName field. +func (o *ThreeDS2RequestData2) SetMerchantName(v string) { + o.MerchantName = &v +} + +// GetMessageVersion returns the MessageVersion field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetMessageVersion() string { + if o == nil || common.IsNil(o.MessageVersion) { + var ret string + return ret + } + return *o.MessageVersion +} + +// GetMessageVersionOk returns a tuple with the MessageVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetMessageVersionOk() (*string, bool) { + if o == nil || common.IsNil(o.MessageVersion) { + return nil, false + } + return o.MessageVersion, true +} + +// HasMessageVersion returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasMessageVersion() bool { + if o != nil && !common.IsNil(o.MessageVersion) { + return true + } + + return false +} + +// SetMessageVersion gets a reference to the given string and assigns it to the MessageVersion field. +func (o *ThreeDS2RequestData2) SetMessageVersion(v string) { + o.MessageVersion = &v +} + +// GetMobilePhone returns the MobilePhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetMobilePhone() Phone { + if o == nil || common.IsNil(o.MobilePhone) { + var ret Phone + return ret + } + return *o.MobilePhone +} + +// GetMobilePhoneOk returns a tuple with the MobilePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetMobilePhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.MobilePhone) { + return nil, false + } + return o.MobilePhone, true +} + +// HasMobilePhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasMobilePhone() bool { + if o != nil && !common.IsNil(o.MobilePhone) { + return true + } + + return false +} + +// SetMobilePhone gets a reference to the given Phone and assigns it to the MobilePhone field. +func (o *ThreeDS2RequestData2) SetMobilePhone(v Phone) { + o.MobilePhone = &v +} + +// GetNotificationURL returns the NotificationURL field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetNotificationURL() string { + if o == nil || common.IsNil(o.NotificationURL) { + var ret string + return ret + } + return *o.NotificationURL +} + +// GetNotificationURLOk returns a tuple with the NotificationURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetNotificationURLOk() (*string, bool) { + if o == nil || common.IsNil(o.NotificationURL) { + return nil, false + } + return o.NotificationURL, true +} + +// HasNotificationURL returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasNotificationURL() bool { + if o != nil && !common.IsNil(o.NotificationURL) { + return true + } + + return false +} + +// SetNotificationURL gets a reference to the given string and assigns it to the NotificationURL field. +func (o *ThreeDS2RequestData2) SetNotificationURL(v string) { + o.NotificationURL = &v +} + +// GetPayTokenInd returns the PayTokenInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetPayTokenInd() bool { + if o == nil || common.IsNil(o.PayTokenInd) { + var ret bool + return ret + } + return *o.PayTokenInd +} + +// GetPayTokenIndOk returns a tuple with the PayTokenInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetPayTokenIndOk() (*bool, bool) { + if o == nil || common.IsNil(o.PayTokenInd) { + return nil, false + } + return o.PayTokenInd, true +} + +// HasPayTokenInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasPayTokenInd() bool { + if o != nil && !common.IsNil(o.PayTokenInd) { + return true + } + + return false +} + +// SetPayTokenInd gets a reference to the given bool and assigns it to the PayTokenInd field. +func (o *ThreeDS2RequestData2) SetPayTokenInd(v bool) { + o.PayTokenInd = &v +} + +// GetPaymentAuthenticationUseCase returns the PaymentAuthenticationUseCase field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCase() string { + if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { + var ret string + return ret + } + return *o.PaymentAuthenticationUseCase +} + +// GetPaymentAuthenticationUseCaseOk returns a tuple with the PaymentAuthenticationUseCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCaseOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { + return nil, false + } + return o.PaymentAuthenticationUseCase, true +} + +// HasPaymentAuthenticationUseCase returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasPaymentAuthenticationUseCase() bool { + if o != nil && !common.IsNil(o.PaymentAuthenticationUseCase) { + return true + } + + return false +} + +// SetPaymentAuthenticationUseCase gets a reference to the given string and assigns it to the PaymentAuthenticationUseCase field. +func (o *ThreeDS2RequestData2) SetPaymentAuthenticationUseCase(v string) { + o.PaymentAuthenticationUseCase = &v +} + +// GetPurchaseInstalData returns the PurchaseInstalData field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetPurchaseInstalData() string { + if o == nil || common.IsNil(o.PurchaseInstalData) { + var ret string + return ret + } + return *o.PurchaseInstalData +} + +// GetPurchaseInstalDataOk returns a tuple with the PurchaseInstalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetPurchaseInstalDataOk() (*string, bool) { + if o == nil || common.IsNil(o.PurchaseInstalData) { + return nil, false + } + return o.PurchaseInstalData, true +} + +// HasPurchaseInstalData returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasPurchaseInstalData() bool { + if o != nil && !common.IsNil(o.PurchaseInstalData) { + return true + } + + return false +} + +// SetPurchaseInstalData gets a reference to the given string and assigns it to the PurchaseInstalData field. +func (o *ThreeDS2RequestData2) SetPurchaseInstalData(v string) { + o.PurchaseInstalData = &v +} + +// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetRecurringExpiry() string { + if o == nil || common.IsNil(o.RecurringExpiry) { + var ret string + return ret + } + return *o.RecurringExpiry +} + +// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetRecurringExpiryOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringExpiry) { + return nil, false + } + return o.RecurringExpiry, true +} + +// HasRecurringExpiry returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasRecurringExpiry() bool { + if o != nil && !common.IsNil(o.RecurringExpiry) { + return true + } + + return false +} + +// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. +func (o *ThreeDS2RequestData2) SetRecurringExpiry(v string) { + o.RecurringExpiry = &v +} + +// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetRecurringFrequency() string { + if o == nil || common.IsNil(o.RecurringFrequency) { + var ret string + return ret + } + return *o.RecurringFrequency +} + +// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetRecurringFrequencyOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringFrequency) { + return nil, false + } + return o.RecurringFrequency, true +} + +// HasRecurringFrequency returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasRecurringFrequency() bool { + if o != nil && !common.IsNil(o.RecurringFrequency) { + return true + } + + return false +} + +// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. +func (o *ThreeDS2RequestData2) SetRecurringFrequency(v string) { + o.RecurringFrequency = &v +} + +// GetSdkAppID returns the SdkAppID field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetSdkAppID() string { + if o == nil || common.IsNil(o.SdkAppID) { + var ret string + return ret + } + return *o.SdkAppID +} + +// GetSdkAppIDOk returns a tuple with the SdkAppID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetSdkAppIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkAppID) { + return nil, false + } + return o.SdkAppID, true +} + +// HasSdkAppID returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasSdkAppID() bool { + if o != nil && !common.IsNil(o.SdkAppID) { + return true + } + + return false +} + +// SetSdkAppID gets a reference to the given string and assigns it to the SdkAppID field. +func (o *ThreeDS2RequestData2) SetSdkAppID(v string) { + o.SdkAppID = &v +} + +// GetSdkEphemPubKey returns the SdkEphemPubKey field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetSdkEphemPubKey() SDKEphemPubKey { + if o == nil || common.IsNil(o.SdkEphemPubKey) { + var ret SDKEphemPubKey + return ret + } + return *o.SdkEphemPubKey +} + +// GetSdkEphemPubKeyOk returns a tuple with the SdkEphemPubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool) { + if o == nil || common.IsNil(o.SdkEphemPubKey) { + return nil, false + } + return o.SdkEphemPubKey, true +} + +// HasSdkEphemPubKey returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasSdkEphemPubKey() bool { + if o != nil && !common.IsNil(o.SdkEphemPubKey) { + return true + } + + return false +} + +// SetSdkEphemPubKey gets a reference to the given SDKEphemPubKey and assigns it to the SdkEphemPubKey field. +func (o *ThreeDS2RequestData2) SetSdkEphemPubKey(v SDKEphemPubKey) { + o.SdkEphemPubKey = &v +} + +// GetSdkMaxTimeout returns the SdkMaxTimeout field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetSdkMaxTimeout() int32 { + if o == nil || common.IsNil(o.SdkMaxTimeout) { + var ret int32 + return ret + } + return *o.SdkMaxTimeout +} + +// GetSdkMaxTimeoutOk returns a tuple with the SdkMaxTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetSdkMaxTimeoutOk() (*int32, bool) { + if o == nil || common.IsNil(o.SdkMaxTimeout) { + return nil, false + } + return o.SdkMaxTimeout, true +} + +// HasSdkMaxTimeout returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasSdkMaxTimeout() bool { + if o != nil && !common.IsNil(o.SdkMaxTimeout) { + return true + } + + return false +} + +// SetSdkMaxTimeout gets a reference to the given int32 and assigns it to the SdkMaxTimeout field. +func (o *ThreeDS2RequestData2) SetSdkMaxTimeout(v int32) { + o.SdkMaxTimeout = &v +} + +// GetSdkReferenceNumber returns the SdkReferenceNumber field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetSdkReferenceNumber() string { + if o == nil || common.IsNil(o.SdkReferenceNumber) { + var ret string + return ret + } + return *o.SdkReferenceNumber +} + +// GetSdkReferenceNumberOk returns a tuple with the SdkReferenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetSdkReferenceNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkReferenceNumber) { + return nil, false + } + return o.SdkReferenceNumber, true +} + +// HasSdkReferenceNumber returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasSdkReferenceNumber() bool { + if o != nil && !common.IsNil(o.SdkReferenceNumber) { + return true + } + + return false +} + +// SetSdkReferenceNumber gets a reference to the given string and assigns it to the SdkReferenceNumber field. +func (o *ThreeDS2RequestData2) SetSdkReferenceNumber(v string) { + o.SdkReferenceNumber = &v +} + +// GetSdkTransID returns the SdkTransID field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetSdkTransID() string { + if o == nil || common.IsNil(o.SdkTransID) { + var ret string + return ret + } + return *o.SdkTransID +} + +// GetSdkTransIDOk returns a tuple with the SdkTransID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetSdkTransIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkTransID) { + return nil, false + } + return o.SdkTransID, true +} + +// HasSdkTransID returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasSdkTransID() bool { + if o != nil && !common.IsNil(o.SdkTransID) { + return true + } + + return false +} + +// SetSdkTransID gets a reference to the given string and assigns it to the SdkTransID field. +func (o *ThreeDS2RequestData2) SetSdkTransID(v string) { + o.SdkTransID = &v +} + +// GetThreeDSCompInd returns the ThreeDSCompInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSCompInd() string { + if o == nil || common.IsNil(o.ThreeDSCompInd) { + var ret string + return ret + } + return *o.ThreeDSCompInd +} + +// GetThreeDSCompIndOk returns a tuple with the ThreeDSCompInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSCompIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSCompInd) { + return nil, false + } + return o.ThreeDSCompInd, true +} + +// HasThreeDSCompInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSCompInd() bool { + if o != nil && !common.IsNil(o.ThreeDSCompInd) { + return true + } + + return false +} + +// SetThreeDSCompInd gets a reference to the given string and assigns it to the ThreeDSCompInd field. +func (o *ThreeDS2RequestData2) SetThreeDSCompInd(v string) { + o.ThreeDSCompInd = &v +} + +// GetThreeDSRequestorAuthenticationInd returns the ThreeDSRequestorAuthenticationInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorAuthenticationInd +} + +// GetThreeDSRequestorAuthenticationIndOk returns a tuple with the ThreeDSRequestorAuthenticationInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + return nil, false + } + return o.ThreeDSRequestorAuthenticationInd, true +} + +// HasThreeDSRequestorAuthenticationInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + return true + } + + return false +} + +// SetThreeDSRequestorAuthenticationInd gets a reference to the given string and assigns it to the ThreeDSRequestorAuthenticationInd field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInd(v string) { + o.ThreeDSRequestorAuthenticationInd = &v +} + +// GetThreeDSRequestorAuthenticationInfo returns the ThreeDSRequestorAuthenticationInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfo() ThreeDSRequestorAuthenticationInfo { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + var ret ThreeDSRequestorAuthenticationInfo + return ret + } + return *o.ThreeDSRequestorAuthenticationInfo +} + +// GetThreeDSRequestorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorAuthenticationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfoOk() (*ThreeDSRequestorAuthenticationInfo, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + return nil, false + } + return o.ThreeDSRequestorAuthenticationInfo, true +} + +// HasThreeDSRequestorAuthenticationInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInfo() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + return true + } + + return false +} + +// SetThreeDSRequestorAuthenticationInfo gets a reference to the given ThreeDSRequestorAuthenticationInfo and assigns it to the ThreeDSRequestorAuthenticationInfo field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInfo(v ThreeDSRequestorAuthenticationInfo) { + o.ThreeDSRequestorAuthenticationInfo = &v +} + +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorChallengeInd +} + +// GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + return nil, false + } + return o.ThreeDSRequestorChallengeInd, true +} + +// HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorChallengeInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { + return true + } + + return false +} + +// SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + +// GetThreeDSRequestorID returns the ThreeDSRequestorID field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorID() string { + if o == nil || common.IsNil(o.ThreeDSRequestorID) { + var ret string + return ret + } + return *o.ThreeDSRequestorID +} + +// GetThreeDSRequestorIDOk returns a tuple with the ThreeDSRequestorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorIDOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorID) { + return nil, false + } + return o.ThreeDSRequestorID, true +} + +// HasThreeDSRequestorID returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorID() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorID) { + return true + } + + return false +} + +// SetThreeDSRequestorID gets a reference to the given string and assigns it to the ThreeDSRequestorID field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorID(v string) { + o.ThreeDSRequestorID = &v +} + +// GetThreeDSRequestorName returns the ThreeDSRequestorName field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorName() string { + if o == nil || common.IsNil(o.ThreeDSRequestorName) { + var ret string + return ret + } + return *o.ThreeDSRequestorName +} + +// GetThreeDSRequestorNameOk returns a tuple with the ThreeDSRequestorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorNameOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorName) { + return nil, false + } + return o.ThreeDSRequestorName, true +} + +// HasThreeDSRequestorName returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorName() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorName) { + return true + } + + return false +} + +// SetThreeDSRequestorName gets a reference to the given string and assigns it to the ThreeDSRequestorName field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorName(v string) { + o.ThreeDSRequestorName = &v +} + +// GetThreeDSRequestorPriorAuthenticationInfo returns the ThreeDSRequestorPriorAuthenticationInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfo() ThreeDSRequestorPriorAuthenticationInfo { + if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + var ret ThreeDSRequestorPriorAuthenticationInfo + return ret + } + return *o.ThreeDSRequestorPriorAuthenticationInfo +} + +// GetThreeDSRequestorPriorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorPriorAuthenticationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfoOk() (*ThreeDSRequestorPriorAuthenticationInfo, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + return nil, false + } + return o.ThreeDSRequestorPriorAuthenticationInfo, true +} + +// HasThreeDSRequestorPriorAuthenticationInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorPriorAuthenticationInfo() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + return true + } + + return false +} + +// SetThreeDSRequestorPriorAuthenticationInfo gets a reference to the given ThreeDSRequestorPriorAuthenticationInfo and assigns it to the ThreeDSRequestorPriorAuthenticationInfo field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorPriorAuthenticationInfo(v ThreeDSRequestorPriorAuthenticationInfo) { + o.ThreeDSRequestorPriorAuthenticationInfo = &v +} + +// GetThreeDSRequestorURL returns the ThreeDSRequestorURL field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorURL() string { + if o == nil || common.IsNil(o.ThreeDSRequestorURL) { + var ret string + return ret + } + return *o.ThreeDSRequestorURL +} + +// GetThreeDSRequestorURLOk returns a tuple with the ThreeDSRequestorURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetThreeDSRequestorURLOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorURL) { + return nil, false + } + return o.ThreeDSRequestorURL, true +} + +// HasThreeDSRequestorURL returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasThreeDSRequestorURL() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorURL) { + return true + } + + return false +} + +// SetThreeDSRequestorURL gets a reference to the given string and assigns it to the ThreeDSRequestorURL field. +func (o *ThreeDS2RequestData2) SetThreeDSRequestorURL(v string) { + o.ThreeDSRequestorURL = &v +} + +// GetTransType returns the TransType field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetTransType() string { + if o == nil || common.IsNil(o.TransType) { + var ret string + return ret + } + return *o.TransType +} + +// GetTransTypeOk returns a tuple with the TransType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetTransTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.TransType) { + return nil, false + } + return o.TransType, true +} + +// HasTransType returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasTransType() bool { + if o != nil && !common.IsNil(o.TransType) { + return true + } + + return false +} + +// SetTransType gets a reference to the given string and assigns it to the TransType field. +func (o *ThreeDS2RequestData2) SetTransType(v string) { + o.TransType = &v +} + +// GetTransactionType returns the TransactionType field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetTransactionType() string { + if o == nil || common.IsNil(o.TransactionType) { + var ret string + return ret + } + return *o.TransactionType +} + +// GetTransactionTypeOk returns a tuple with the TransactionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetTransactionTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.TransactionType) { + return nil, false + } + return o.TransactionType, true +} + +// HasTransactionType returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasTransactionType() bool { + if o != nil && !common.IsNil(o.TransactionType) { + return true + } + + return false +} + +// SetTransactionType gets a reference to the given string and assigns it to the TransactionType field. +func (o *ThreeDS2RequestData2) SetTransactionType(v string) { + o.TransactionType = &v +} + +// GetWhiteListStatus returns the WhiteListStatus field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetWhiteListStatus() string { + if o == nil || common.IsNil(o.WhiteListStatus) { + var ret string + return ret + } + return *o.WhiteListStatus +} + +// GetWhiteListStatusOk returns a tuple with the WhiteListStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetWhiteListStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.WhiteListStatus) { + return nil, false + } + return o.WhiteListStatus, true +} + +// HasWhiteListStatus returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasWhiteListStatus() bool { + if o != nil && !common.IsNil(o.WhiteListStatus) { + return true + } + + return false +} + +// SetWhiteListStatus gets a reference to the given string and assigns it to the WhiteListStatus field. +func (o *ThreeDS2RequestData2) SetWhiteListStatus(v string) { + o.WhiteListStatus = &v +} + +// GetWorkPhone returns the WorkPhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestData2) GetWorkPhone() Phone { + if o == nil || common.IsNil(o.WorkPhone) { + var ret Phone + return ret + } + return *o.WorkPhone +} + +// GetWorkPhoneOk returns a tuple with the WorkPhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestData2) GetWorkPhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.WorkPhone) { + return nil, false + } + return o.WorkPhone, true +} + +// HasWorkPhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestData2) HasWorkPhone() bool { + if o != nil && !common.IsNil(o.WorkPhone) { + return true + } + + return false +} + +// SetWorkPhone gets a reference to the given Phone and assigns it to the WorkPhone field. +func (o *ThreeDS2RequestData2) SetWorkPhone(v Phone) { + o.WorkPhone = &v +} + +func (o ThreeDS2RequestData2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ThreeDS2RequestData2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcctInfo) { + toSerialize["acctInfo"] = o.AcctInfo + } + if !common.IsNil(o.AcctType) { + toSerialize["acctType"] = o.AcctType + } + if !common.IsNil(o.AcquirerBIN) { + toSerialize["acquirerBIN"] = o.AcquirerBIN + } + if !common.IsNil(o.AcquirerMerchantID) { + toSerialize["acquirerMerchantID"] = o.AcquirerMerchantID + } + if !common.IsNil(o.AddrMatch) { + toSerialize["addrMatch"] = o.AddrMatch + } + if !common.IsNil(o.AuthenticationOnly) { + toSerialize["authenticationOnly"] = o.AuthenticationOnly + } + if !common.IsNil(o.ChallengeIndicator) { + toSerialize["challengeIndicator"] = o.ChallengeIndicator + } + if !common.IsNil(o.DeviceRenderOptions) { + toSerialize["deviceRenderOptions"] = o.DeviceRenderOptions + } + if !common.IsNil(o.HomePhone) { + toSerialize["homePhone"] = o.HomePhone + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantName) { + toSerialize["merchantName"] = o.MerchantName + } + if !common.IsNil(o.MessageVersion) { + toSerialize["messageVersion"] = o.MessageVersion + } + if !common.IsNil(o.MobilePhone) { + toSerialize["mobilePhone"] = o.MobilePhone + } + if !common.IsNil(o.NotificationURL) { + toSerialize["notificationURL"] = o.NotificationURL + } + if !common.IsNil(o.PayTokenInd) { + toSerialize["payTokenInd"] = o.PayTokenInd + } + if !common.IsNil(o.PaymentAuthenticationUseCase) { + toSerialize["paymentAuthenticationUseCase"] = o.PaymentAuthenticationUseCase + } + if !common.IsNil(o.PurchaseInstalData) { + toSerialize["purchaseInstalData"] = o.PurchaseInstalData + } + if !common.IsNil(o.RecurringExpiry) { + toSerialize["recurringExpiry"] = o.RecurringExpiry + } + if !common.IsNil(o.RecurringFrequency) { + toSerialize["recurringFrequency"] = o.RecurringFrequency + } + if !common.IsNil(o.SdkAppID) { + toSerialize["sdkAppID"] = o.SdkAppID + } + if !common.IsNil(o.SdkEphemPubKey) { + toSerialize["sdkEphemPubKey"] = o.SdkEphemPubKey + } + if !common.IsNil(o.SdkMaxTimeout) { + toSerialize["sdkMaxTimeout"] = o.SdkMaxTimeout + } + if !common.IsNil(o.SdkReferenceNumber) { + toSerialize["sdkReferenceNumber"] = o.SdkReferenceNumber + } + if !common.IsNil(o.SdkTransID) { + toSerialize["sdkTransID"] = o.SdkTransID + } + if !common.IsNil(o.ThreeDSCompInd) { + toSerialize["threeDSCompInd"] = o.ThreeDSCompInd + } + if !common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + toSerialize["threeDSRequestorAuthenticationInd"] = o.ThreeDSRequestorAuthenticationInd + } + if !common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + toSerialize["threeDSRequestorAuthenticationInfo"] = o.ThreeDSRequestorAuthenticationInfo + } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } + if !common.IsNil(o.ThreeDSRequestorID) { + toSerialize["threeDSRequestorID"] = o.ThreeDSRequestorID + } + if !common.IsNil(o.ThreeDSRequestorName) { + toSerialize["threeDSRequestorName"] = o.ThreeDSRequestorName + } + if !common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + toSerialize["threeDSRequestorPriorAuthenticationInfo"] = o.ThreeDSRequestorPriorAuthenticationInfo + } + if !common.IsNil(o.ThreeDSRequestorURL) { + toSerialize["threeDSRequestorURL"] = o.ThreeDSRequestorURL + } + if !common.IsNil(o.TransType) { + toSerialize["transType"] = o.TransType + } + if !common.IsNil(o.TransactionType) { + toSerialize["transactionType"] = o.TransactionType + } + if !common.IsNil(o.WhiteListStatus) { + toSerialize["whiteListStatus"] = o.WhiteListStatus + } + if !common.IsNil(o.WorkPhone) { + toSerialize["workPhone"] = o.WorkPhone + } + return toSerialize, nil +} + +type NullableThreeDS2RequestData2 struct { + value *ThreeDS2RequestData2 + isSet bool +} + +func (v NullableThreeDS2RequestData2) Get() *ThreeDS2RequestData2 { + return v.value +} + +func (v *NullableThreeDS2RequestData2) Set(val *ThreeDS2RequestData2) { + v.value = val + v.isSet = true +} + +func (v NullableThreeDS2RequestData2) IsSet() bool { + return v.isSet +} + +func (v *NullableThreeDS2RequestData2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableThreeDS2RequestData2(val *ThreeDS2RequestData2) *NullableThreeDS2RequestData2 { + return &NullableThreeDS2RequestData2{value: val, isSet: true} +} + +func (v NullableThreeDS2RequestData2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableThreeDS2RequestData2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *ThreeDS2RequestData2) isValidAcctType() bool { + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false +} +func (o *ThreeDS2RequestData2) isValidAddrMatch() bool { + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false +} +func (o *ThreeDS2RequestData2) isValidChallengeIndicator() bool { + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false +} +func (o *ThreeDS2RequestData2) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false +} +func (o *ThreeDS2RequestData2) isValidTransType() bool { + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false +} +func (o *ThreeDS2RequestData2) isValidTransactionType() bool { + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false +} + diff --git a/src/checkout/model_three_ds2_response_data.go b/src/checkout/model_three_ds2_response_data.go index 4762196ad..7432d8883 100644 --- a/src/checkout/model_three_ds2_response_data.go +++ b/src/checkout/model_three_ds2_response_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2ResponseData type satisfies the MappedNullable interface at compile time @@ -20,24 +19,24 @@ var _ common.MappedNullable = &ThreeDS2ResponseData{} // ThreeDS2ResponseData struct for ThreeDS2ResponseData type ThreeDS2ResponseData struct { AcsChallengeMandated *string `json:"acsChallengeMandated,omitempty"` - AcsOperatorID *string `json:"acsOperatorID,omitempty"` - AcsReferenceNumber *string `json:"acsReferenceNumber,omitempty"` - AcsSignedContent *string `json:"acsSignedContent,omitempty"` - AcsTransID *string `json:"acsTransID,omitempty"` - AcsURL *string `json:"acsURL,omitempty"` - AuthenticationType *string `json:"authenticationType,omitempty"` - CardHolderInfo *string `json:"cardHolderInfo,omitempty"` - CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` - DsReferenceNumber *string `json:"dsReferenceNumber,omitempty"` - DsTransID *string `json:"dsTransID,omitempty"` - ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` - MessageVersion *string `json:"messageVersion,omitempty"` - RiskScore *string `json:"riskScore,omitempty"` - SdkEphemPubKey *string `json:"sdkEphemPubKey,omitempty"` + AcsOperatorID *string `json:"acsOperatorID,omitempty"` + AcsReferenceNumber *string `json:"acsReferenceNumber,omitempty"` + AcsSignedContent *string `json:"acsSignedContent,omitempty"` + AcsTransID *string `json:"acsTransID,omitempty"` + AcsURL *string `json:"acsURL,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + CardHolderInfo *string `json:"cardHolderInfo,omitempty"` + CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` + ChallengeIndicator *string `json:"challengeIndicator,omitempty"` + DsReferenceNumber *string `json:"dsReferenceNumber,omitempty"` + DsTransID *string `json:"dsTransID,omitempty"` + ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` + MessageVersion *string `json:"messageVersion,omitempty"` + RiskScore *string `json:"riskScore,omitempty"` + SdkEphemPubKey *string `json:"sdkEphemPubKey,omitempty"` ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` - TransStatus *string `json:"transStatus,omitempty"` - TransStatusReason *string `json:"transStatusReason,omitempty"` + TransStatus *string `json:"transStatus,omitempty"` + TransStatusReason *string `json:"transStatusReason,omitempty"` } // NewThreeDS2ResponseData instantiates a new ThreeDS2ResponseData object @@ -666,7 +665,7 @@ func (o *ThreeDS2ResponseData) SetTransStatusReason(v string) { } func (o ThreeDS2ResponseData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -770,3 +769,6 @@ func (v *NullableThreeDS2ResponseData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_three_ds2_result.go b/src/checkout/model_three_ds2_result.go index 44a3c84aa..c167691c8 100644 --- a/src/checkout/model_three_ds2_result.go +++ b/src/checkout/model_three_ds2_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2Result type satisfies the MappedNullable interface at compile time @@ -25,13 +24,13 @@ type ThreeDS2Result struct { CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` // Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). ChallengeCancel *string `json:"challengeCancel,omitempty"` - // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The `dsTransID` value as defined in the 3D Secure 2 specification. DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. Eci *string `json:"eci,omitempty"` - // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` // The `messageVersion` value as defined in the 3D Secure 2 specification. MessageVersion *string `json:"messageVersion,omitempty"` @@ -515,7 +514,7 @@ func (o *ThreeDS2Result) SetWhiteListStatus(v string) { } func (o ThreeDS2Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -605,30 +604,32 @@ func (v *NullableThreeDS2Result) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2Result) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} - for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis" } + for _, allowed := range allowedEnumValues { + if o.GetExemptionIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_request_data.go b/src/checkout/model_three_ds_request_data.go index f4c66e239..7ec9b4ec4 100644 --- a/src/checkout/model_three_ds_request_data.go +++ b/src/checkout/model_three_ds_request_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSRequestData type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestData) SetThreeDSVersion(v string) { } func (o ThreeDSRequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,39 +234,41 @@ func (v *NullableThreeDSRequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestData) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidDataOnly() bool { - var allowedEnumValues = []string{"false", "true"} - for _, allowed := range allowedEnumValues { - if o.GetDataOnly() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "false", "true" } + for _, allowed := range allowedEnumValues { + if o.GetDataOnly() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidNativeThreeDS() bool { - var allowedEnumValues = []string{"preferred"} - for _, allowed := range allowedEnumValues { - if o.GetNativeThreeDS() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "preferred" } + for _, allowed := range allowedEnumValues { + if o.GetNativeThreeDS() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidThreeDSVersion() bool { - var allowedEnumValues = []string{"2.1.0", "2.2.0"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "2.1.0", "2.2.0" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSVersion() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_requestor_authentication_info.go b/src/checkout/model_three_ds_requestor_authentication_info.go index d4c3e3fd5..785f7289d 100644 --- a/src/checkout/model_three_ds_requestor_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_authentication_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSRequestorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ThreeDSRequestorAuthenticationInfo) SetThreeDSReqAuthTimestamp(v string } func (o ThreeDSRequestorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableThreeDSRequestorAuthenticationInfo) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorAuthenticationInfo) isValidThreeDSReqAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_requestor_prior_authentication_info.go b/src/checkout/model_three_ds_requestor_prior_authentication_info.go index c9edb9dd3..f26efdad2 100644 --- a/src/checkout/model_three_ds_requestor_prior_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_prior_authentication_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSRequestorPriorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestorPriorAuthenticationInfo) SetThreeDSReqPriorRef(v string } func (o ThreeDSRequestorPriorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableThreeDSRequestorPriorAuthenticationInfo) UnmarshalJSON(src []by return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorPriorAuthenticationInfo) isValidThreeDSReqPriorAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqPriorAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqPriorAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_update_payment_link_request.go b/src/checkout/model_update_payment_link_request.go index daec784d1..85bb119eb 100644 --- a/src/checkout/model_update_payment_link_request.go +++ b/src/checkout/model_update_payment_link_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdatePaymentLinkRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *UpdatePaymentLinkRequest) SetStatus(v string) { } func (o UpdatePaymentLinkRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -115,12 +114,14 @@ func (v *NullableUpdatePaymentLinkRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdatePaymentLinkRequest) isValidStatus() bool { - var allowedEnumValues = []string{"expired"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "expired" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_upi_collect_details.go b/src/checkout/model_upi_collect_details.go index 31d85d2dc..41bfb0f0a 100644 --- a/src/checkout/model_upi_collect_details.go +++ b/src/checkout/model_upi_collect_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpiCollectDetails type satisfies the MappedNullable interface at compile time @@ -269,7 +268,7 @@ func (o *UpiCollectDetails) SetVirtualPaymentAddress(v string) { } func (o UpiCollectDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -334,12 +333,14 @@ func (v *NullableUpiCollectDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpiCollectDetails) isValidType() bool { - var allowedEnumValues = []string{"upi_collect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "upi_collect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_upi_intent_details.go b/src/checkout/model_upi_intent_details.go index 60b1971c6..99d1ad417 100644 --- a/src/checkout/model_upi_intent_details.go +++ b/src/checkout/model_upi_intent_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpiIntentDetails type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *UpiIntentDetails) SetType(v string) { } func (o UpiIntentDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -269,12 +268,14 @@ func (v *NullableUpiIntentDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpiIntentDetails) isValidType() bool { - var allowedEnumValues = []string{"upi_intent"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "upi_intent" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_vipps_details.go b/src/checkout/model_vipps_details.go index dc563c57d..986ee6e7a 100644 --- a/src/checkout/model_vipps_details.go +++ b/src/checkout/model_vipps_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VippsDetails type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type VippsDetails struct { RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` - // + // TelephoneNumber string `json:"telephoneNumber"` // **vipps** Type *string `json:"type,omitempty"` @@ -210,7 +209,7 @@ func (o *VippsDetails) SetType(v string) { } func (o VippsDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableVippsDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VippsDetails) isValidType() bool { - var allowedEnumValues = []string{"vipps"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "vipps" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_visa_checkout_details.go b/src/checkout/model_visa_checkout_details.go index fb20537e6..32f62c1ac 100644 --- a/src/checkout/model_visa_checkout_details.go +++ b/src/checkout/model_visa_checkout_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VisaCheckoutDetails type satisfies the MappedNullable interface at compile time @@ -172,7 +171,7 @@ func (o *VisaCheckoutDetails) SetVisaCheckoutCallId(v string) { } func (o VisaCheckoutDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,21 +229,23 @@ func (v *NullableVisaCheckoutDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VisaCheckoutDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *VisaCheckoutDetails) isValidType() bool { - var allowedEnumValues = []string{"visacheckout"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "visacheckout" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_we_chat_pay_details.go b/src/checkout/model_we_chat_pay_details.go index 3aa151c1f..61551736a 100644 --- a/src/checkout/model_we_chat_pay_details.go +++ b/src/checkout/model_we_chat_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WeChatPayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *WeChatPayDetails) SetType(v string) { } func (o WeChatPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableWeChatPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WeChatPayDetails) isValidType() bool { - var allowedEnumValues = []string{"wechatpay", "wechatpay_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "wechatpay", "wechatpay_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_we_chat_pay_mini_program_details.go b/src/checkout/model_we_chat_pay_mini_program_details.go index 7962ee246..1187c8dbc 100644 --- a/src/checkout/model_we_chat_pay_mini_program_details.go +++ b/src/checkout/model_we_chat_pay_mini_program_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WeChatPayMiniProgramDetails type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type WeChatPayMiniProgramDetails struct { AppId *string `json:"appId,omitempty"` // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Openid *string `json:"openid,omitempty"` + Openid *string `json:"openid,omitempty"` // **wechatpayMiniProgram** Type *string `json:"type,omitempty"` } @@ -177,7 +176,7 @@ func (o *WeChatPayMiniProgramDetails) SetType(v string) { } func (o WeChatPayMiniProgramDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -237,12 +236,14 @@ func (v *NullableWeChatPayMiniProgramDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WeChatPayMiniProgramDetails) isValidType() bool { - var allowedEnumValues = []string{"wechatpayMiniProgram"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "wechatpayMiniProgram" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_zip_details.go b/src/checkout/model_zip_details.go index 31f7c2328..2dc1e1e36 100644 --- a/src/checkout/model_zip_details.go +++ b/src/checkout/model_zip_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ZipDetails type satisfies the MappedNullable interface at compile time @@ -217,7 +216,7 @@ func (o *ZipDetails) SetType(v string) { } func (o ZipDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -280,12 +279,14 @@ func (v *NullableZipDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ZipDetails) isValidType() bool { - var allowedEnumValues = []string{"zip", "zip_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "zip", "zip_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/api_business_lines.go b/src/legalentity/api_business_lines.go index b410019f4..864d126dc 100644 --- a/src/legalentity/api_business_lines.go +++ b/src/legalentity/api_business_lines.go @@ -10,19 +10,17 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // BusinessLinesApi BusinessLinesApi service type BusinessLinesApi common.Service type BusinessLinesApiCreateBusinessLineConfig struct { - ctx context.Context + ctx context.Context businessLineInfo *BusinessLineInfo } @@ -31,13 +29,18 @@ func (r BusinessLinesApiCreateBusinessLineConfig) BusinessLineInfo(businessLineI return r } + /* CreateBusinessLine Create a business line -Creates a business line. +Creates a business line. This resource contains information about your user's line of business, including their industry and their source of funds. Adyen uses this information to verify your users as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. +>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BusinessLinesApiCreateBusinessLineConfig */ @@ -49,24 +52,80 @@ func (a *BusinessLinesApi) CreateBusinessLineConfig(ctx context.Context) Busines /* Create a business line -Creates a business line. This resource contains information about your user's line of business, including their industry and their source of funds. Adyen uses this information to verify your users as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. - * @param req BusinessLineInfo - reference of BusinessLineInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Creates a business line. This resource contains information about your user's line of business, including their industry and their source of funds. Adyen uses this information to verify your users as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. >If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + * @param req BusinessLineInfo - reference of BusinessLineInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BusinessLine */ func (a *BusinessLinesApi) CreateBusinessLine(r BusinessLinesApiCreateBusinessLineConfig) (BusinessLine, *_nethttp.Response, error) { - res := &BusinessLine{} + var serviceError common.RestServiceError + res := &BusinessLine{} path := "/businessLines" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.businessLineInfo, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.businessLineInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type BusinessLinesApiDeleteBusinessLineConfig struct { ctx context.Context - id string + id string } + /* DeleteBusinessLine Delete a business line @@ -81,7 +140,7 @@ Deletes a business line. func (a *BusinessLinesApi) DeleteBusinessLineConfig(ctx context.Context, id string) BusinessLinesApiDeleteBusinessLineConfig { return BusinessLinesApiDeleteBusinessLineConfig{ ctx: ctx, - id: id, + id: id, } } @@ -89,22 +148,77 @@ func (a *BusinessLinesApi) DeleteBusinessLineConfig(ctx context.Context, id stri Delete a business line Deletes a business line. >If you delete a business line linked to a [payment method](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api), it can affect your merchant account's ability to use the [payment method](https://docs.adyen.com/api-explorer/Management/latest/post/merchants/_merchantId_/paymentMethodSettings). The business line is removed from all linked merchant accounts. * @param id The unique identifier of the business line to be deleted. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ func (a *BusinessLinesApi) DeleteBusinessLine(r BusinessLinesApiDeleteBusinessLineConfig) (*_nethttp.Response, error) { - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodDelete, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type BusinessLinesApiGetBusinessLineConfig struct { ctx context.Context - id string + id string } + /* GetBusinessLine Get a business line @@ -117,7 +231,7 @@ Returns the detail of a business line. func (a *BusinessLinesApi) GetBusinessLineConfig(ctx context.Context, id string) BusinessLinesApiGetBusinessLineConfig { return BusinessLinesApiGetBusinessLineConfig{ ctx: ctx, - id: id, + id: id, } } @@ -125,21 +239,76 @@ func (a *BusinessLinesApi) GetBusinessLineConfig(ctx context.Context, id string) Get a business line Returns the detail of a business line. * @param id The unique identifier of the business line. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BusinessLine */ func (a *BusinessLinesApi) GetBusinessLine(r BusinessLinesApiGetBusinessLineConfig) (BusinessLine, *_nethttp.Response, error) { - res := &BusinessLine{} + var serviceError common.RestServiceError + res := &BusinessLine{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type BusinessLinesApiUpdateBusinessLineConfig struct { - ctx context.Context - id string + ctx context.Context + id string businessLineInfoUpdate *BusinessLineInfoUpdate } @@ -148,6 +317,7 @@ func (r BusinessLinesApiUpdateBusinessLineConfig) BusinessLineInfoUpdate(busines return r } + /* UpdateBusinessLine Update a business line @@ -160,7 +330,7 @@ Updates a business line. func (a *BusinessLinesApi) UpdateBusinessLineConfig(ctx context.Context, id string) BusinessLinesApiUpdateBusinessLineConfig { return BusinessLinesApiUpdateBusinessLineConfig{ ctx: ctx, - id: id, + id: id, } } @@ -168,15 +338,70 @@ func (a *BusinessLinesApi) UpdateBusinessLineConfig(ctx context.Context, id stri Update a business line Updates a business line. * @param id The unique identifier of the business line. - * @param req BusinessLineInfoUpdate - reference of BusinessLineInfoUpdate). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req BusinessLineInfoUpdate - reference of BusinessLineInfoUpdate). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BusinessLine */ func (a *BusinessLinesApi) UpdateBusinessLine(r BusinessLinesApiUpdateBusinessLineConfig) (BusinessLine, *_nethttp.Response, error) { - res := &BusinessLine{} + var serviceError common.RestServiceError + res := &BusinessLine{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPatch, r.businessLineInfoUpdate, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.businessLineInfoUpdate, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_documents.go b/src/legalentity/api_documents.go index e454bfa3a..dee5db041 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -10,12 +10,10 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // DocumentsApi DocumentsApi service @@ -23,9 +21,10 @@ type DocumentsApi common.Service type DocumentsApiDeleteDocumentConfig struct { ctx context.Context - id string + id string } + /* DeleteDocument Delete a document @@ -38,7 +37,7 @@ Deletes a document. func (a *DocumentsApi) DeleteDocumentConfig(ctx context.Context, id string) DocumentsApiDeleteDocumentConfig { return DocumentsApiDeleteDocumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -46,23 +45,79 @@ func (a *DocumentsApi) DeleteDocumentConfig(ctx context.Context, id string) Docu Delete a document Deletes a document. * @param id The unique identifier of the document to be deleted. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]interface{} */ func (a *DocumentsApi) DeleteDocument(r DocumentsApiDeleteDocumentConfig) (map[string]interface{}, *_nethttp.Response, error) { - res := &map[string]interface{}{} + var serviceError common.RestServiceError + res := &map[string]interface{}{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodDelete, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type DocumentsApiGetDocumentConfig struct { ctx context.Context - id string + id string } + /* GetDocument Get a document @@ -75,7 +130,7 @@ Returns a document. func (a *DocumentsApi) GetDocumentConfig(ctx context.Context, id string) DocumentsApiGetDocumentConfig { return DocumentsApiGetDocumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -83,21 +138,76 @@ func (a *DocumentsApi) GetDocumentConfig(ctx context.Context, id string) Documen Get a document Returns a document. * @param id The unique identifier of the document. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Document */ func (a *DocumentsApi) GetDocument(r DocumentsApiGetDocumentConfig) (Document, *_nethttp.Response, error) { - res := &Document{} + var serviceError common.RestServiceError + res := &Document{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type DocumentsApiUpdateDocumentConfig struct { - ctx context.Context - id string + ctx context.Context + id string document *Document } @@ -106,6 +216,7 @@ func (r DocumentsApiUpdateDocumentConfig) Document(document Document) DocumentsA return r } + /* UpdateDocument Update a document @@ -118,7 +229,7 @@ Updates a document. func (a *DocumentsApi) UpdateDocumentConfig(ctx context.Context, id string) DocumentsApiUpdateDocumentConfig { return DocumentsApiUpdateDocumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -126,21 +237,76 @@ func (a *DocumentsApi) UpdateDocumentConfig(ctx context.Context, id string) Docu Update a document Updates a document. * @param id The unique identifier of the document to be updated. - * @param req Document - reference of Document). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req Document - reference of Document). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Document */ func (a *DocumentsApi) UpdateDocument(r DocumentsApiUpdateDocumentConfig) (Document, *_nethttp.Response, error) { - res := &Document{} + var serviceError common.RestServiceError + res := &Document{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPatch, r.document, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.document, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type DocumentsApiUploadDocumentForVerificationChecksConfig struct { - ctx context.Context + ctx context.Context document *Document } @@ -149,6 +315,7 @@ func (r DocumentsApiUploadDocumentForVerificationChecksConfig) Document(document return r } + /* UploadDocumentForVerificationChecks Upload a document for verification checks @@ -156,7 +323,7 @@ Uploads a document for verification checks. Adyen uses the information from the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities) to run automated verification checks. If these checks fail, you will be notified to provide additional documents. - You should only upload documents when Adyen requests additional information for the legal entity. + You should only upload documents when Adyen requests additional information for the legal entity. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return DocumentsApiUploadDocumentForVerificationChecksConfig @@ -169,15 +336,70 @@ func (a *DocumentsApi) UploadDocumentForVerificationChecksConfig(ctx context.Con /* Upload a document for verification checks -Uploads a document for verification checks. Adyen uses the information from the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities) to run automated verification checks. If these checks fail, you will be notified to provide additional documents. You should only upload documents when Adyen requests additional information for the legal entity. - * @param req Document - reference of Document). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Uploads a document for verification checks. Adyen uses the information from the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities) to run automated verification checks. If these checks fail, you will be notified to provide additional documents. You should only upload documents when Adyen requests additional information for the legal entity. + * @param req Document - reference of Document). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Document */ func (a *DocumentsApi) UploadDocumentForVerificationChecks(r DocumentsApiUploadDocumentForVerificationChecksConfig) (Document, *_nethttp.Response, error) { - res := &Document{} + var serviceError common.RestServiceError + res := &Document{} path := "/documents" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.document, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.document, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_hosted_onboarding.go b/src/legalentity/api_hosted_onboarding.go index 6482f2d8e..b0a808bc4 100644 --- a/src/legalentity/api_hosted_onboarding.go +++ b/src/legalentity/api_hosted_onboarding.go @@ -10,20 +10,18 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // HostedOnboardingApi HostedOnboardingApi service type HostedOnboardingApi common.Service type HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig struct { - ctx context.Context - id string + ctx context.Context + id string onboardingLinkInfo *OnboardingLinkInfo } @@ -32,11 +30,16 @@ func (r HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig) OnboardingL return r } + /* GetLinkToAdyenhostedOnboardingPage Get a link to an Adyen-hosted onboarding page Returns a link to an Adyen-hosted onboarding page where you need to redirect your user. +>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the legal entity @return HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig @@ -44,36 +47,94 @@ Returns a link to an Adyen-hosted onboarding page where you need to redirect you func (a *HostedOnboardingApi) GetLinkToAdyenhostedOnboardingPageConfig(ctx context.Context, id string) HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig { return HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig{ ctx: ctx, - id: id, + id: id, } } /* Get a link to an Adyen-hosted onboarding page -Returns a link to an Adyen-hosted onboarding page where you need to redirect your user. +Returns a link to an Adyen-hosted onboarding page where you need to redirect your user. >If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. * @param id The unique identifier of the legal entity - * @param req OnboardingLinkInfo - reference of OnboardingLinkInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req OnboardingLinkInfo - reference of OnboardingLinkInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return OnboardingLink */ func (a *HostedOnboardingApi) GetLinkToAdyenhostedOnboardingPage(r HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageConfig) (OnboardingLink, *_nethttp.Response, error) { - res := &OnboardingLink{} + var serviceError common.RestServiceError + res := &OnboardingLink{} path := "/legalEntities/{id}/onboardingLinks" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.onboardingLinkInfo, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.onboardingLinkInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type HostedOnboardingApiGetOnboardingLinkThemeConfig struct { ctx context.Context - id string + id string } + /* GetOnboardingLinkTheme Get an onboarding link theme -Returns the details of the theme identified in the path. +Returns the details of the theme identified in the path.>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param id The unique identifier of the theme @@ -82,35 +143,95 @@ Returns the details of the theme identified in the path. func (a *HostedOnboardingApi) GetOnboardingLinkThemeConfig(ctx context.Context, id string) HostedOnboardingApiGetOnboardingLinkThemeConfig { return HostedOnboardingApiGetOnboardingLinkThemeConfig{ ctx: ctx, - id: id, + id: id, } } /* Get an onboarding link theme -Returns the details of the theme identified in the path. +Returns the details of the theme identified in the path.>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. * @param id The unique identifier of the theme - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return OnboardingTheme */ func (a *HostedOnboardingApi) GetOnboardingLinkTheme(r HostedOnboardingApiGetOnboardingLinkThemeConfig) (OnboardingTheme, *_nethttp.Response, error) { - res := &OnboardingTheme{} + var serviceError common.RestServiceError + res := &OnboardingTheme{} path := "/themes/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type HostedOnboardingApiListHostedOnboardingPageThemesConfig struct { ctx context.Context } + /* ListHostedOnboardingPageThemes Get a list of hosted onboarding page themes Returns a list of hosted onboarding page themes. +>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return HostedOnboardingApiListHostedOnboardingPageThemesConfig */ @@ -122,14 +243,69 @@ func (a *HostedOnboardingApi) ListHostedOnboardingPageThemesConfig(ctx context.C /* Get a list of hosted onboarding page themes -Returns a list of hosted onboarding page themes. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Returns a list of hosted onboarding page themes. >If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return OnboardingThemes */ func (a *HostedOnboardingApi) ListHostedOnboardingPageThemes(r HostedOnboardingApiListHostedOnboardingPageThemesConfig) (OnboardingThemes, *_nethttp.Response, error) { - res := &OnboardingThemes{} + var serviceError common.RestServiceError + res := &OnboardingThemes{} path := "/themes" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index 685b05d5f..a0aa1ccea 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -10,12 +10,10 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // LegalEntitiesApi LegalEntitiesApi service @@ -23,9 +21,10 @@ type LegalEntitiesApi common.Service type LegalEntitiesApiCheckLegalEntitysVerificationErrorsConfig struct { ctx context.Context - id string + id string } + /* CheckLegalEntitysVerificationErrors Check a legal entity's verification errors @@ -38,7 +37,7 @@ Returns the verification errors for a legal entity and its supporting entities. func (a *LegalEntitiesApi) CheckLegalEntitysVerificationErrorsConfig(ctx context.Context, id string) LegalEntitiesApiCheckLegalEntitysVerificationErrorsConfig { return LegalEntitiesApiCheckLegalEntitysVerificationErrorsConfig{ ctx: ctx, - id: id, + id: id, } } @@ -46,20 +45,75 @@ func (a *LegalEntitiesApi) CheckLegalEntitysVerificationErrorsConfig(ctx context Check a legal entity's verification errors Returns the verification errors for a legal entity and its supporting entities. * @param id The unique identifier of the legal entity. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return VerificationErrors */ func (a *LegalEntitiesApi) CheckLegalEntitysVerificationErrors(r LegalEntitiesApiCheckLegalEntitysVerificationErrorsConfig) (VerificationErrors, *_nethttp.Response, error) { - res := &VerificationErrors{} + var serviceError common.RestServiceError + res := &VerificationErrors{} path := "/legalEntities/{id}/checkVerificationErrors" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type LegalEntitiesApiCreateLegalEntityConfig struct { - ctx context.Context + ctx context.Context legalEntityInfoRequiredType *LegalEntityInfoRequiredType } @@ -68,12 +122,15 @@ func (r LegalEntitiesApiCreateLegalEntityConfig) LegalEntityInfoRequiredType(leg return r } + /* CreateLegalEntity Create a legal entity -Creates a legal entity. +Creates a legal entity. + +This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. -This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. +>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. @@ -88,24 +145,80 @@ func (a *LegalEntitiesApi) CreateLegalEntityConfig(ctx context.Context) LegalEnt /* Create a legal entity -Creates a legal entity. This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. - * @param req LegalEntityInfoRequiredType - reference of LegalEntityInfoRequiredType). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Creates a legal entity. This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. >If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. + * @param req LegalEntityInfoRequiredType - reference of LegalEntityInfoRequiredType). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return LegalEntity */ func (a *LegalEntitiesApi) CreateLegalEntity(r LegalEntitiesApiCreateLegalEntityConfig) (LegalEntity, *_nethttp.Response, error) { - res := &LegalEntity{} + var serviceError common.RestServiceError + res := &LegalEntity{} path := "/legalEntities" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.legalEntityInfoRequiredType, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.legalEntityInfoRequiredType, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityConfig struct { ctx context.Context - id string + id string } + /* GetAllBusinessLinesUnderLegalEntity Get all business lines under a legal entity @@ -118,7 +231,7 @@ Returns the business lines owned by a legal entity. func (a *LegalEntitiesApi) GetAllBusinessLinesUnderLegalEntityConfig(ctx context.Context, id string) LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityConfig { return LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityConfig{ ctx: ctx, - id: id, + id: id, } } @@ -126,23 +239,79 @@ func (a *LegalEntitiesApi) GetAllBusinessLinesUnderLegalEntityConfig(ctx context Get all business lines under a legal entity Returns the business lines owned by a legal entity. * @param id The unique identifier of the legal entity. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return BusinessLines */ func (a *LegalEntitiesApi) GetAllBusinessLinesUnderLegalEntity(r LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityConfig) (BusinessLines, *_nethttp.Response, error) { - res := &BusinessLines{} + var serviceError common.RestServiceError + res := &BusinessLines{} path := "/legalEntities/{id}/businessLines" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type LegalEntitiesApiGetLegalEntityConfig struct { ctx context.Context - id string + id string } + /* GetLegalEntity Get a legal entity @@ -155,7 +324,7 @@ Returns a legal entity. func (a *LegalEntitiesApi) GetLegalEntityConfig(ctx context.Context, id string) LegalEntitiesApiGetLegalEntityConfig { return LegalEntitiesApiGetLegalEntityConfig{ ctx: ctx, - id: id, + id: id, } } @@ -163,21 +332,76 @@ func (a *LegalEntitiesApi) GetLegalEntityConfig(ctx context.Context, id string) Get a legal entity Returns a legal entity. * @param id The unique identifier of the legal entity. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return LegalEntity */ func (a *LegalEntitiesApi) GetLegalEntity(r LegalEntitiesApiGetLegalEntityConfig) (LegalEntity, *_nethttp.Response, error) { - res := &LegalEntity{} + var serviceError common.RestServiceError + res := &LegalEntity{} path := "/legalEntities/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type LegalEntitiesApiUpdateLegalEntityConfig struct { - ctx context.Context - id string + ctx context.Context + id string legalEntityInfo *LegalEntityInfo } @@ -186,6 +410,7 @@ func (r LegalEntitiesApiUpdateLegalEntityConfig) LegalEntityInfo(legalEntityInfo return r } + /* UpdateLegalEntity Update a legal entity @@ -200,7 +425,7 @@ Updates a legal entity. func (a *LegalEntitiesApi) UpdateLegalEntityConfig(ctx context.Context, id string) LegalEntitiesApiUpdateLegalEntityConfig { return LegalEntitiesApiUpdateLegalEntityConfig{ ctx: ctx, - id: id, + id: id, } } @@ -208,15 +433,70 @@ func (a *LegalEntitiesApi) UpdateLegalEntityConfig(ctx context.Context, id strin Update a legal entity Updates a legal entity. >To change the legal entity type, include only the new `type` in your request. To update the `entityAssociations` array, you need to replace the entire array. For example, if the array has 3 entries and you want to remove 1 entry, you need to PATCH the resource with the remaining 2 entries. * @param id The unique identifier of the legal entity. - * @param req LegalEntityInfo - reference of LegalEntityInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req LegalEntityInfo - reference of LegalEntityInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return LegalEntity */ func (a *LegalEntitiesApi) UpdateLegalEntity(r LegalEntitiesApiUpdateLegalEntityConfig) (LegalEntity, *_nethttp.Response, error) { - res := &LegalEntity{} + var serviceError common.RestServiceError + res := &LegalEntity{} path := "/legalEntities/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPatch, r.legalEntityInfo, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.legalEntityInfo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index bdcfb22dc..cf5ebfebb 100644 --- a/src/legalentity/api_pci_questionnaires.go +++ b/src/legalentity/api_pci_questionnaires.go @@ -10,20 +10,18 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PCIQuestionnairesApi PCIQuestionnairesApi service type PCIQuestionnairesApi common.Service type PCIQuestionnairesApiGeneratePciQuestionnaireConfig struct { - ctx context.Context - id string + ctx context.Context + id string generatePciDescriptionRequest *GeneratePciDescriptionRequest } @@ -32,6 +30,7 @@ func (r PCIQuestionnairesApiGeneratePciQuestionnaireConfig) GeneratePciDescripti return r } + /* GeneratePciQuestionnaire Generate PCI questionnaire @@ -44,7 +43,7 @@ Generates the required PCI questionnaire based on the user's [salesChannel](http func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireConfig(ctx context.Context, id string) PCIQuestionnairesApiGeneratePciQuestionnaireConfig { return PCIQuestionnairesApiGeneratePciQuestionnaireConfig{ ctx: ctx, - id: id, + id: id, } } @@ -52,25 +51,81 @@ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireConfig(ctx context.Contex Generate PCI questionnaire Generates the required PCI questionnaire based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). If multiple questionnaires are required, this request creates a single consodilated document to be signed. * @param id The legal entity ID of the individual who will sign the PCI questionnaire. - * @param req GeneratePciDescriptionRequest - reference of GeneratePciDescriptionRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req GeneratePciDescriptionRequest - reference of GeneratePciDescriptionRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GeneratePciDescriptionResponse */ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaire(r PCIQuestionnairesApiGeneratePciQuestionnaireConfig) (GeneratePciDescriptionResponse, *_nethttp.Response, error) { - res := &GeneratePciDescriptionResponse{} + var serviceError common.RestServiceError + res := &GeneratePciDescriptionResponse{} path := "/legalEntities/{id}/pciQuestionnaires/generatePciTemplates" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.generatePciDescriptionRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.generatePciDescriptionRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PCIQuestionnairesApiGetPciQuestionnaireConfig struct { - ctx context.Context - id string + ctx context.Context + id string pciid string } + /* GetPciQuestionnaire Get PCI questionnaire @@ -83,8 +138,8 @@ Returns the signed PCI questionnaire. */ func (a *PCIQuestionnairesApi) GetPciQuestionnaireConfig(ctx context.Context, id string, pciid string) PCIQuestionnairesApiGetPciQuestionnaireConfig { return PCIQuestionnairesApiGetPciQuestionnaireConfig{ - ctx: ctx, - id: id, + ctx: ctx, + id: id, pciid: pciid, } } @@ -94,24 +149,80 @@ Get PCI questionnaire Returns the signed PCI questionnaire. * @param id The legal entity ID of the individual who signed the PCI questionnaire. * @param pciid The unique identifier of the signed PCI questionnaire. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetPciQuestionnaireResponse */ func (a *PCIQuestionnairesApi) GetPciQuestionnaire(r PCIQuestionnairesApiGetPciQuestionnaireConfig) (GetPciQuestionnaireResponse, *_nethttp.Response, error) { - res := &GetPciQuestionnaireResponse{} + var serviceError common.RestServiceError + res := &GetPciQuestionnaireResponse{} path := "/legalEntities/{id}/pciQuestionnaires/{pciid}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - path = strings.Replace(path, "{"+"pciid"+"}", url.PathEscape(common.ParameterValueToString(r.pciid, "pciid")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + path = strings.Replace(path, "{"+"pciid"+"}", url.PathEscape(common.ParameterValueToString(r.pciid, "pciid")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PCIQuestionnairesApiGetPciQuestionnaireDetailsConfig struct { ctx context.Context - id string + id string } + /* GetPciQuestionnaireDetails Get PCI questionnaire details @@ -124,7 +235,7 @@ Get a list of signed PCI questionnaires. func (a *PCIQuestionnairesApi) GetPciQuestionnaireDetailsConfig(ctx context.Context, id string) PCIQuestionnairesApiGetPciQuestionnaireDetailsConfig { return PCIQuestionnairesApiGetPciQuestionnaireDetailsConfig{ ctx: ctx, - id: id, + id: id, } } @@ -132,21 +243,76 @@ func (a *PCIQuestionnairesApi) GetPciQuestionnaireDetailsConfig(ctx context.Cont Get PCI questionnaire details Get a list of signed PCI questionnaires. * @param id The unique identifier of the legal entity to get PCI questionnaire information. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetPciQuestionnaireInfosResponse */ func (a *PCIQuestionnairesApi) GetPciQuestionnaireDetails(r PCIQuestionnairesApiGetPciQuestionnaireDetailsConfig) (GetPciQuestionnaireInfosResponse, *_nethttp.Response, error) { - res := &GetPciQuestionnaireInfosResponse{} + var serviceError common.RestServiceError + res := &GetPciQuestionnaireInfosResponse{} path := "/legalEntities/{id}/pciQuestionnaires" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PCIQuestionnairesApiSignPciQuestionnaireConfig struct { - ctx context.Context - id string + ctx context.Context + id string pciSigningRequest *PciSigningRequest } @@ -155,6 +321,7 @@ func (r PCIQuestionnairesApiSignPciQuestionnaireConfig) PciSigningRequest(pciSig return r } + /* SignPciQuestionnaire Sign PCI questionnaire @@ -167,7 +334,7 @@ Signs the required PCI questionnaire. func (a *PCIQuestionnairesApi) SignPciQuestionnaireConfig(ctx context.Context, id string) PCIQuestionnairesApiSignPciQuestionnaireConfig { return PCIQuestionnairesApiSignPciQuestionnaireConfig{ ctx: ctx, - id: id, + id: id, } } @@ -175,15 +342,70 @@ func (a *PCIQuestionnairesApi) SignPciQuestionnaireConfig(ctx context.Context, i Sign PCI questionnaire Signs the required PCI questionnaire. * @param id The legal entity ID of the individual who signed the PCI questionnaire. - * @param req PciSigningRequest - reference of PciSigningRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req PciSigningRequest - reference of PciSigningRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PciSigningResponse */ func (a *PCIQuestionnairesApi) SignPciQuestionnaire(r PCIQuestionnairesApiSignPciQuestionnaireConfig) (PciSigningResponse, *_nethttp.Response, error) { - res := &PciSigningResponse{} + var serviceError common.RestServiceError + res := &PciSigningResponse{} path := "/legalEntities/{id}/pciQuestionnaires/signPciTemplates" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.pciSigningRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.pciSigningRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index 7011c3f19..e6c938b4f 100644 --- a/src/legalentity/api_terms_of_service.go +++ b/src/legalentity/api_terms_of_service.go @@ -10,21 +10,19 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TermsOfServiceApi TermsOfServiceApi service type TermsOfServiceApi common.Service type TermsOfServiceApiAcceptTermsOfServiceConfig struct { - ctx context.Context - id string - termsofservicedocumentid string + ctx context.Context + id string + termsofservicedocumentid string acceptTermsOfServiceRequest *AcceptTermsOfServiceRequest } @@ -33,6 +31,7 @@ func (r TermsOfServiceApiAcceptTermsOfServiceConfig) AcceptTermsOfServiceRequest return r } + /* AcceptTermsOfService Accept Terms of Service @@ -45,8 +44,8 @@ Accepts Terms of Service. */ func (a *TermsOfServiceApi) AcceptTermsOfServiceConfig(ctx context.Context, id string, termsofservicedocumentid string) TermsOfServiceApiAcceptTermsOfServiceConfig { return TermsOfServiceApiAcceptTermsOfServiceConfig{ - ctx: ctx, - id: id, + ctx: ctx, + id: id, termsofservicedocumentid: termsofservicedocumentid, } } @@ -56,23 +55,78 @@ Accept Terms of Service Accepts Terms of Service. * @param id The unique identifier of the legal entity. * @param termsofservicedocumentid The unique identifier of the Terms of Service document. - * @param req AcceptTermsOfServiceRequest - reference of AcceptTermsOfServiceRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req AcceptTermsOfServiceRequest - reference of AcceptTermsOfServiceRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AcceptTermsOfServiceResponse */ func (a *TermsOfServiceApi) AcceptTermsOfService(r TermsOfServiceApiAcceptTermsOfServiceConfig) (AcceptTermsOfServiceResponse, *_nethttp.Response, error) { - res := &AcceptTermsOfServiceResponse{} + var serviceError common.RestServiceError + res := &AcceptTermsOfServiceResponse{} path := "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - path = strings.Replace(path, "{"+"termsofservicedocumentid"+"}", url.PathEscape(common.ParameterValueToString(r.termsofservicedocumentid, "termsofservicedocumentid")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPatch, r.acceptTermsOfServiceRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + path = strings.Replace(path, "{"+"termsofservicedocumentid"+"}", url.PathEscape(common.ParameterValueToString(r.termsofservicedocumentid, "termsofservicedocumentid")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.acceptTermsOfServiceRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TermsOfServiceApiGetTermsOfServiceDocumentConfig struct { - ctx context.Context - id string + ctx context.Context + id string getTermsOfServiceDocumentRequest *GetTermsOfServiceDocumentRequest } @@ -81,6 +135,7 @@ func (r TermsOfServiceApiGetTermsOfServiceDocumentConfig) GetTermsOfServiceDocum return r } + /* GetTermsOfServiceDocument Get Terms of Service document @@ -93,7 +148,7 @@ Returns the Terms of Service document for a legal entity. func (a *TermsOfServiceApi) GetTermsOfServiceDocumentConfig(ctx context.Context, id string) TermsOfServiceApiGetTermsOfServiceDocumentConfig { return TermsOfServiceApiGetTermsOfServiceDocumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -101,24 +156,80 @@ func (a *TermsOfServiceApi) GetTermsOfServiceDocumentConfig(ctx context.Context, Get Terms of Service document Returns the Terms of Service document for a legal entity. * @param id The unique identifier of the legal entity. - * @param req GetTermsOfServiceDocumentRequest - reference of GetTermsOfServiceDocumentRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req GetTermsOfServiceDocumentRequest - reference of GetTermsOfServiceDocumentRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetTermsOfServiceDocumentResponse */ func (a *TermsOfServiceApi) GetTermsOfServiceDocument(r TermsOfServiceApiGetTermsOfServiceDocumentConfig) (GetTermsOfServiceDocumentResponse, *_nethttp.Response, error) { - res := &GetTermsOfServiceDocumentResponse{} + var serviceError common.RestServiceError + res := &GetTermsOfServiceDocumentResponse{} path := "/legalEntities/{id}/termsOfService" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.getTermsOfServiceDocumentRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.getTermsOfServiceDocumentRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityConfig struct { ctx context.Context - id string + id string } + /* GetTermsOfServiceInformationForLegalEntity Get Terms of Service information for a legal entity @@ -131,7 +242,7 @@ Returns Terms of Service information for a legal entity. func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntityConfig(ctx context.Context, id string) TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityConfig { return TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityConfig{ ctx: ctx, - id: id, + id: id, } } @@ -139,14 +250,69 @@ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntityConfig(ctx Get Terms of Service information for a legal entity Returns Terms of Service information for a legal entity. * @param id The unique identifier of the legal entity. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetTermsOfServiceAcceptanceInfosResponse */ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntity(r TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityConfig) (GetTermsOfServiceAcceptanceInfosResponse, *_nethttp.Response, error) { - res := &GetTermsOfServiceAcceptanceInfosResponse{} + var serviceError common.RestServiceError + res := &GetTermsOfServiceAcceptanceInfosResponse{} path := "/legalEntities/{id}/termsOfServiceAcceptanceInfos" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index a4edb6cc7..f9474cd92 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -10,19 +10,17 @@ package legalentity import ( "context" - _context "context" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TransferInstrumentsApi TransferInstrumentsApi service type TransferInstrumentsApi common.Service type TransferInstrumentsApiCreateTransferInstrumentConfig struct { - ctx context.Context + ctx context.Context transferInstrumentInfo *TransferInstrumentInfo } @@ -31,10 +29,11 @@ func (r TransferInstrumentsApiCreateTransferInstrumentConfig) TransferInstrument return r } + /* CreateTransferInstrument Create a transfer instrument -Creates a transfer instrument. +Creates a transfer instrument. A transfer instrument is a bank account that a legal entity owns. Adyen performs verification checks on the transfer instrument as required by payment industry regulations. We inform you of the verification results through webhooks or API responses. @@ -52,23 +51,79 @@ func (a *TransferInstrumentsApi) CreateTransferInstrumentConfig(ctx context.Cont /* Create a transfer instrument Creates a transfer instrument. A transfer instrument is a bank account that a legal entity owns. Adyen performs verification checks on the transfer instrument as required by payment industry regulations. We inform you of the verification results through webhooks or API responses. When the transfer instrument passes the verification checks, you can start sending funds from the balance platform to the transfer instrument (such as payouts). - * @param req TransferInstrumentInfo - reference of TransferInstrumentInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req TransferInstrumentInfo - reference of TransferInstrumentInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransferInstrument */ func (a *TransferInstrumentsApi) CreateTransferInstrument(r TransferInstrumentsApiCreateTransferInstrumentConfig) (TransferInstrument, *_nethttp.Response, error) { - res := &TransferInstrument{} + var serviceError common.RestServiceError + res := &TransferInstrument{} path := "/transferInstruments" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.transferInstrumentInfo, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.transferInstrumentInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TransferInstrumentsApiDeleteTransferInstrumentConfig struct { ctx context.Context - id string + id string } + /* DeleteTransferInstrument Delete a transfer instrument @@ -81,7 +136,7 @@ Deletes a transfer instrument. func (a *TransferInstrumentsApi) DeleteTransferInstrumentConfig(ctx context.Context, id string) TransferInstrumentsApiDeleteTransferInstrumentConfig { return TransferInstrumentsApiDeleteTransferInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -89,22 +144,77 @@ func (a *TransferInstrumentsApi) DeleteTransferInstrumentConfig(ctx context.Cont Delete a transfer instrument Deletes a transfer instrument. * @param id The unique identifier of the transfer instrument to be deleted. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ func (a *TransferInstrumentsApi) DeleteTransferInstrument(r TransferInstrumentsApiDeleteTransferInstrumentConfig) (*_nethttp.Response, error) { - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodDelete, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type TransferInstrumentsApiGetTransferInstrumentConfig struct { ctx context.Context - id string + id string } + /* GetTransferInstrument Get a transfer instrument @@ -117,7 +227,7 @@ Returns the details of a transfer instrument. func (a *TransferInstrumentsApi) GetTransferInstrumentConfig(ctx context.Context, id string) TransferInstrumentsApiGetTransferInstrumentConfig { return TransferInstrumentsApiGetTransferInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -125,21 +235,76 @@ func (a *TransferInstrumentsApi) GetTransferInstrumentConfig(ctx context.Context Get a transfer instrument Returns the details of a transfer instrument. * @param id The unique identifier of the transfer instrument. - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransferInstrument */ func (a *TransferInstrumentsApi) GetTransferInstrument(r TransferInstrumentsApiGetTransferInstrumentConfig) (TransferInstrument, *_nethttp.Response, error) { - res := &TransferInstrument{} + var serviceError common.RestServiceError + res := &TransferInstrument{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodGet, nil, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TransferInstrumentsApiUpdateTransferInstrumentConfig struct { - ctx context.Context - id string + ctx context.Context + id string transferInstrumentInfo *TransferInstrumentInfo } @@ -148,6 +313,7 @@ func (r TransferInstrumentsApiUpdateTransferInstrumentConfig) TransferInstrument return r } + /* UpdateTransferInstrument Update a transfer instrument @@ -160,7 +326,7 @@ Updates a transfer instrument. func (a *TransferInstrumentsApi) UpdateTransferInstrumentConfig(ctx context.Context, id string) TransferInstrumentsApiUpdateTransferInstrumentConfig { return TransferInstrumentsApiUpdateTransferInstrumentConfig{ ctx: ctx, - id: id, + id: id, } } @@ -168,15 +334,70 @@ func (a *TransferInstrumentsApi) UpdateTransferInstrumentConfig(ctx context.Cont Update a transfer instrument Updates a transfer instrument. * @param id The unique identifier of the transfer instrument. - * @param req TransferInstrumentInfo - reference of TransferInstrumentInfo). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req TransferInstrumentInfo - reference of TransferInstrumentInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TransferInstrument */ func (a *TransferInstrumentsApi) UpdateTransferInstrument(r TransferInstrumentsApiUpdateTransferInstrumentConfig) (TransferInstrument, *_nethttp.Response, error) { - res := &TransferInstrument{} + var serviceError common.RestServiceError + res := &TransferInstrument{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPatch, r.transferInstrumentInfo, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.transferInstrumentInfo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/legalentity/client.go b/src/legalentity/client.go index 258ecc12b..92ace6b09 100644 --- a/src/legalentity/client.go +++ b/src/legalentity/client.go @@ -34,8 +34,7 @@ type APIClient struct { TransferInstrumentsApi *TransferInstrumentsApi } -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. +// NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} c.common.Client = client diff --git a/src/legalentity/docs/AcceptTermsOfServiceRequest.md b/src/legalentity/docs/AcceptTermsOfServiceRequest.md index fc4f58e21..e174b0777 100644 --- a/src/legalentity/docs/AcceptTermsOfServiceRequest.md +++ b/src/legalentity/docs/AcceptTermsOfServiceRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AcceptedBy** | Pointer to **string** | The unique identifier of the user accepting the Terms of Service. | [optional] +**AcceptedBy** | **string** | The unique identifier of the user accepting the Terms of Service. | **IpAddress** | Pointer to **string** | The IP address of the user accepting the Terms of Service. | [optional] ## Methods ### NewAcceptTermsOfServiceRequest -`func NewAcceptTermsOfServiceRequest() *AcceptTermsOfServiceRequest` +`func NewAcceptTermsOfServiceRequest(acceptedBy string, ) *AcceptTermsOfServiceRequest` NewAcceptTermsOfServiceRequest instantiates a new AcceptTermsOfServiceRequest object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetAcceptedBy sets AcceptedBy field to given value. -### HasAcceptedBy - -`func (o *AcceptTermsOfServiceRequest) HasAcceptedBy() bool` - -HasAcceptedBy returns a boolean if a field has been set. ### GetIpAddress diff --git a/src/legalentity/docs/Address.md b/src/legalentity/docs/Address.md index 58585f769..409eb466e 100644 --- a/src/legalentity/docs/Address.md +++ b/src/legalentity/docs/Address.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **City** | Pointer to **string** | The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`. | [optional] **Country** | **string** | The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. | **PostalCode** | Pointer to **string** | Postal code. Required if `stateOrProvince` and/or `city` is provided. | [optional] -**StateOrProvince** | Pointer to **string** | The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. | [optional] +**StateOrProvince** | Pointer to **string** | The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. | [optional] **Street** | Pointer to **string** | The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided. | [optional] **Street2** | Pointer to **string** | The apartment, unit, or suite number. | [optional] diff --git a/src/legalentity/docs/BankAccountInfo.md b/src/legalentity/docs/BankAccountInfo.md index 1bc46d7be..6fef840ef 100644 --- a/src/legalentity/docs/BankAccountInfo.md +++ b/src/legalentity/docs/BankAccountInfo.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **AccountIdentification** | Pointer to [**BankAccountInfoAccountIdentification**](BankAccountInfoAccountIdentification.md) | | [optional] **AccountType** | Pointer to **string** | The type of bank account. | [optional] **CountryCode** | Pointer to **string** | The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the bank account is registered. For example, **NL**. | [optional] +**TrustedSource** | Pointer to **bool** | Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). | [optional] [readonly] ## Methods @@ -102,6 +103,31 @@ SetCountryCode sets CountryCode field to given value. HasCountryCode returns a boolean if a field has been set. +### GetTrustedSource + +`func (o *BankAccountInfo) GetTrustedSource() bool` + +GetTrustedSource returns the TrustedSource field if non-nil, zero value otherwise. + +### GetTrustedSourceOk + +`func (o *BankAccountInfo) GetTrustedSourceOk() (*bool, bool)` + +GetTrustedSourceOk returns a tuple with the TrustedSource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrustedSource + +`func (o *BankAccountInfo) SetTrustedSource(v bool)` + +SetTrustedSource sets TrustedSource field to given value. + +### HasTrustedSource + +`func (o *BankAccountInfo) HasTrustedSource() bool` + +HasTrustedSource returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/src/legalentity/docs/BusinessLine.md b/src/legalentity/docs/BusinessLine.md index 6f37b278b..c67bb2067 100644 --- a/src/legalentity/docs/BusinessLine.md +++ b/src/legalentity/docs/BusinessLine.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Capability** | Pointer to **string** | The capability for which you are creating the business line. For example, **receivePayments**. | [optional] +**Capability** | Pointer to **string** | The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** | [optional] **Id** | **string** | The unique identifier of the business line. | [readonly] **IndustryCode** | **string** | A code that represents the industry of the legal entity. For example, **4431A** for computer software stores. | **LegalEntityId** | **string** | Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. | **Problems** | Pointer to [**[]CapabilityProblem**](CapabilityProblem.md) | List of the verification errors from capabilities for this supporting entity. | [optional] **SalesChannels** | Pointer to **[]string** | A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. | [optional] -**Service** | **string** | The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** | +**Service** | **string** | The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** | **SourceOfFunds** | Pointer to [**SourceOfFunds**](SourceOfFunds.md) | | [optional] **WebData** | Pointer to [**[]WebData**](WebData.md) | List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. | [optional] **WebDataExemption** | Pointer to [**WebDataExemption**](WebDataExemption.md) | | [optional] diff --git a/src/legalentity/docs/BusinessLineInfo.md b/src/legalentity/docs/BusinessLineInfo.md index e2fa773e8..faca80350 100644 --- a/src/legalentity/docs/BusinessLineInfo.md +++ b/src/legalentity/docs/BusinessLineInfo.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Capability** | Pointer to **string** | The capability for which you are creating the business line. For example, **receivePayments**. | [optional] +**Capability** | Pointer to **string** | The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** | [optional] **IndustryCode** | **string** | A code that represents the industry of the legal entity. For example, **4431A** for computer software stores. | **LegalEntityId** | **string** | Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. | **SalesChannels** | Pointer to **[]string** | A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. | [optional] -**Service** | **string** | The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** | +**Service** | **string** | The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** | **SourceOfFunds** | Pointer to [**SourceOfFunds**](SourceOfFunds.md) | | [optional] **WebData** | Pointer to [**[]WebData**](WebData.md) | List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. | [optional] **WebDataExemption** | Pointer to [**WebDataExemption**](WebDataExemption.md) | | [optional] diff --git a/src/legalentity/docs/BusinessLineInfoUpdate.md b/src/legalentity/docs/BusinessLineInfoUpdate.md index 13d7ec874..c163872ef 100644 --- a/src/legalentity/docs/BusinessLineInfoUpdate.md +++ b/src/legalentity/docs/BusinessLineInfoUpdate.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **IndustryCode** | Pointer to **string** | A code that represents the industry of your legal entity. For example, **4431A** for computer software stores. | [optional] **LegalEntityId** | Pointer to **string** | Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. | [optional] **SalesChannels** | Pointer to **[]string** | A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. | [optional] -**Service** | **string** | The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** | +**Service** | **string** | The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** | **SourceOfFunds** | Pointer to [**SourceOfFunds**](SourceOfFunds.md) | | [optional] **WebData** | Pointer to [**[]WebData**](WebData.md) | List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. | [optional] **WebDataExemption** | Pointer to [**WebDataExemption**](WebDataExemption.md) | | [optional] diff --git a/src/legalentity/docs/Document.md b/src/legalentity/docs/Document.md index 24f24cf8e..7a704472d 100644 --- a/src/legalentity/docs/Document.md +++ b/src/legalentity/docs/Document.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **ModificationDate** | Pointer to **time.Time** | The modification date of the document. | [optional] [readonly] **Number** | Pointer to **string** | The number in the document. | [optional] **Owner** | [**OwnerEntity**](OwnerEntity.md) | | -**Type** | **string** | Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). | +**Type** | **string** | Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). | ## Methods diff --git a/src/legalentity/docs/DocumentPage.md b/src/legalentity/docs/DocumentPage.md new file mode 100644 index 000000000..df76e0f17 --- /dev/null +++ b/src/legalentity/docs/DocumentPage.md @@ -0,0 +1,108 @@ +# DocumentPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PageName** | Pointer to **string** | | [optional] +**PageNumber** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] + +## Methods + +### NewDocumentPage + +`func NewDocumentPage() *DocumentPage` + +NewDocumentPage instantiates a new DocumentPage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDocumentPageWithDefaults + +`func NewDocumentPageWithDefaults() *DocumentPage` + +NewDocumentPageWithDefaults instantiates a new DocumentPage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPageName + +`func (o *DocumentPage) GetPageName() string` + +GetPageName returns the PageName field if non-nil, zero value otherwise. + +### GetPageNameOk + +`func (o *DocumentPage) GetPageNameOk() (*string, bool)` + +GetPageNameOk returns a tuple with the PageName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageName + +`func (o *DocumentPage) SetPageName(v string)` + +SetPageName sets PageName field to given value. + +### HasPageName + +`func (o *DocumentPage) HasPageName() bool` + +HasPageName returns a boolean if a field has been set. + +### GetPageNumber + +`func (o *DocumentPage) GetPageNumber() int32` + +GetPageNumber returns the PageNumber field if non-nil, zero value otherwise. + +### GetPageNumberOk + +`func (o *DocumentPage) GetPageNumberOk() (*int32, bool)` + +GetPageNumberOk returns a tuple with the PageNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageNumber + +`func (o *DocumentPage) SetPageNumber(v int32)` + +SetPageNumber sets PageNumber field to given value. + +### HasPageNumber + +`func (o *DocumentPage) HasPageNumber() bool` + +HasPageNumber returns a boolean if a field has been set. + +### GetType + +`func (o *DocumentPage) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DocumentPage) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DocumentPage) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *DocumentPage) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/legalentity/docs/DocumentReference.md b/src/legalentity/docs/DocumentReference.md index 82b92cc74..341203aad 100644 --- a/src/legalentity/docs/DocumentReference.md +++ b/src/legalentity/docs/DocumentReference.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **FileName** | Pointer to **string** | Document name. | [optional] **Id** | Pointer to **string** | The unique identifier of the resource. | [optional] **ModificationDate** | Pointer to **time.Time** | The modification date of the document. | [optional] +**Pages** | Pointer to [**[]DocumentPage**](DocumentPage.md) | List of document pages | [optional] **Type** | Pointer to **string** | Type of document, used when providing an ID number or uploading a document. | [optional] ## Methods @@ -155,6 +156,31 @@ SetModificationDate sets ModificationDate field to given value. HasModificationDate returns a boolean if a field has been set. +### GetPages + +`func (o *DocumentReference) GetPages() []DocumentPage` + +GetPages returns the Pages field if non-nil, zero value otherwise. + +### GetPagesOk + +`func (o *DocumentReference) GetPagesOk() (*[]DocumentPage, bool)` + +GetPagesOk returns a tuple with the Pages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPages + +`func (o *DocumentReference) SetPages(v []DocumentPage)` + +SetPages sets Pages field to given value. + +### HasPages + +`func (o *DocumentReference) HasPages() bool` + +HasPages returns a boolean if a field has been set. + ### GetType `func (o *DocumentReference) GetType() string` diff --git a/src/legalentity/docs/IdentificationData.md b/src/legalentity/docs/IdentificationData.md index 1418d61b2..4382ef64f 100644 --- a/src/legalentity/docs/IdentificationData.md +++ b/src/legalentity/docs/IdentificationData.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **IssuerState** | Pointer to **string** | The state or province where the document was issued (AU only). | [optional] **NationalIdExempt** | Pointer to **bool** | Applies only to individuals in the US. Set to **true** if the individual does not have an SSN. To verify their identity, Adyen will require them to upload an ID document. | [optional] **Number** | Pointer to **string** | The number in the document. | [optional] -**Type** | **string** | Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). | +**Type** | **string** | Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). | ## Methods diff --git a/src/legalentity/docs/LegalEntity.md b/src/legalentity/docs/LegalEntity.md index 409ea3401..f86ed1794 100644 --- a/src/legalentity/docs/LegalEntity.md +++ b/src/legalentity/docs/LegalEntity.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **SoleProprietorship** | Pointer to [**SoleProprietorship**](SoleProprietorship.md) | | [optional] **TransferInstruments** | Pointer to [**[]TransferInstrumentReference**](TransferInstrumentReference.md) | List of transfer instruments that the legal entity owns. | [optional] [readonly] **Type** | Pointer to **string** | The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. | [optional] +**VerificationDeadlines** | Pointer to [**[]VerificationDeadline**](VerificationDeadline.md) | List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. | [optional] [readonly] ## Methods @@ -331,6 +332,31 @@ SetType sets Type field to given value. HasType returns a boolean if a field has been set. +### GetVerificationDeadlines + +`func (o *LegalEntity) GetVerificationDeadlines() []VerificationDeadline` + +GetVerificationDeadlines returns the VerificationDeadlines field if non-nil, zero value otherwise. + +### GetVerificationDeadlinesOk + +`func (o *LegalEntity) GetVerificationDeadlinesOk() (*[]VerificationDeadline, bool)` + +GetVerificationDeadlinesOk returns a tuple with the VerificationDeadlines field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVerificationDeadlines + +`func (o *LegalEntity) SetVerificationDeadlines(v []VerificationDeadline)` + +SetVerificationDeadlines sets VerificationDeadlines field to given value. + +### HasVerificationDeadlines + +`func (o *LegalEntity) HasVerificationDeadlines() bool` + +HasVerificationDeadlines returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/src/legalentity/docs/LegalEntityAssociation.md b/src/legalentity/docs/LegalEntityAssociation.md index 974488c60..cb6e41e5f 100644 --- a/src/legalentity/docs/LegalEntityAssociation.md +++ b/src/legalentity/docs/LegalEntityAssociation.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AssociatorId** | Pointer to **string** | The unique identifier of another legal entity with which the `legalEntityId` is associated. When the `legalEntityId` is associated to legal entities other than the current one, the response returns all the associations. | [optional] [readonly] -**EntityType** | Pointer to **string** | The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. | [optional] [readonly] +**EntityType** | Pointer to **string** | The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. | [optional] [readonly] **JobTitle** | Pointer to **string** | The individual's job title if the `type` is **uboThroughControl** or **signatory**. | [optional] **LegalEntityId** | **string** | The unique identifier of the associated [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). | **Name** | Pointer to **string** | The name of the associated [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). - For **individual**, `name.firstName` and `name.lastName`. - For **organization**, `legalName`. - For **soleProprietorship**, `name`. | [optional] [readonly] -**Type** | **string** | Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. | +**Type** | **string** | Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. | ## Methods diff --git a/src/legalentity/docs/Organization.md b/src/legalentity/docs/Organization.md index e0a73d700..057f40958 100644 --- a/src/legalentity/docs/Organization.md +++ b/src/legalentity/docs/Organization.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **StockData** | Pointer to [**StockData**](StockData.md) | | [optional] **TaxInformation** | Pointer to [**[]TaxInformation**](TaxInformation.md) | The tax information of the organization. | [optional] **TaxReportingClassification** | Pointer to [**TaxReportingClassification**](TaxReportingClassification.md) | | [optional] -**Type** | Pointer to **string** | Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. | [optional] +**Type** | Pointer to **string** | Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. | [optional] **VatAbsenceReason** | Pointer to **string** | The reason the organization has not provided a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. | [optional] **VatNumber** | Pointer to **string** | The organization's VAT number. | [optional] **WebData** | Pointer to [**WebData**](WebData.md) | | [optional] diff --git a/src/legalentity/docs/SGLocalAccountIdentification.md b/src/legalentity/docs/SGLocalAccountIdentification.md new file mode 100644 index 000000000..4cc600528 --- /dev/null +++ b/src/legalentity/docs/SGLocalAccountIdentification.md @@ -0,0 +1,98 @@ +# SGLocalAccountIdentification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountNumber** | **string** | The 4- to 19-digit bank account number, without separators or whitespace. | +**Bic** | **string** | The bank's 8- or 11-character BIC or SWIFT code. | +**Type** | Pointer to **string** | **sgLocal** | [optional] [default to "sgLocal"] + +## Methods + +### NewSGLocalAccountIdentification + +`func NewSGLocalAccountIdentification(accountNumber string, bic string, ) *SGLocalAccountIdentification` + +NewSGLocalAccountIdentification instantiates a new SGLocalAccountIdentification object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSGLocalAccountIdentificationWithDefaults + +`func NewSGLocalAccountIdentificationWithDefaults() *SGLocalAccountIdentification` + +NewSGLocalAccountIdentificationWithDefaults instantiates a new SGLocalAccountIdentification object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountNumber + +`func (o *SGLocalAccountIdentification) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *SGLocalAccountIdentification) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *SGLocalAccountIdentification) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + + +### GetBic + +`func (o *SGLocalAccountIdentification) GetBic() string` + +GetBic returns the Bic field if non-nil, zero value otherwise. + +### GetBicOk + +`func (o *SGLocalAccountIdentification) GetBicOk() (*string, bool)` + +GetBicOk returns a tuple with the Bic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBic + +`func (o *SGLocalAccountIdentification) SetBic(v string)` + +SetBic sets Bic field to given value. + + +### GetType + +`func (o *SGLocalAccountIdentification) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SGLocalAccountIdentification) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SGLocalAccountIdentification) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SGLocalAccountIdentification) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/legalentity/docs/TransferInstrumentReference.md b/src/legalentity/docs/TransferInstrumentReference.md index 49c1124b9..ebd313b81 100644 --- a/src/legalentity/docs/TransferInstrumentReference.md +++ b/src/legalentity/docs/TransferInstrumentReference.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **AccountIdentifier** | **string** | The masked IBAN or bank account number. | **Id** | **string** | The unique identifier of the resource. | **RealLastFour** | Pointer to **string** | Four last digits of the bank account number. | [optional] -**TrustedSource** | Pointer to **bool** | Identifies if the TI was created from a trusted source. | [optional] [readonly] +**TrustedSource** | Pointer to **bool** | Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). | [optional] [readonly] ## Methods diff --git a/src/legalentity/docs/VerificationDeadline.md b/src/legalentity/docs/VerificationDeadline.md new file mode 100644 index 000000000..25b7f7c0a --- /dev/null +++ b/src/legalentity/docs/VerificationDeadline.md @@ -0,0 +1,72 @@ +# VerificationDeadline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Capabilities** | **[]string** | The names of the capabilities to be disallowed. | [readonly] +**ExpiresAt** | **time.Time** | The date that verification is due by before capabilities are disallowed. | [readonly] + +## Methods + +### NewVerificationDeadline + +`func NewVerificationDeadline(capabilities []string, expiresAt time.Time, ) *VerificationDeadline` + +NewVerificationDeadline instantiates a new VerificationDeadline object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVerificationDeadlineWithDefaults + +`func NewVerificationDeadlineWithDefaults() *VerificationDeadline` + +NewVerificationDeadlineWithDefaults instantiates a new VerificationDeadline object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCapabilities + +`func (o *VerificationDeadline) GetCapabilities() []string` + +GetCapabilities returns the Capabilities field if non-nil, zero value otherwise. + +### GetCapabilitiesOk + +`func (o *VerificationDeadline) GetCapabilitiesOk() (*[]string, bool)` + +GetCapabilitiesOk returns a tuple with the Capabilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapabilities + +`func (o *VerificationDeadline) SetCapabilities(v []string)` + +SetCapabilities sets Capabilities field to given value. + + +### GetExpiresAt + +`func (o *VerificationDeadline) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *VerificationDeadline) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *VerificationDeadline) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/src/legalentity/model_accept_terms_of_service_request.go b/src/legalentity/model_accept_terms_of_service_request.go index 88e6adc14..8b85edf36 100644 --- a/src/legalentity/model_accept_terms_of_service_request.go +++ b/src/legalentity/model_accept_terms_of_service_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AcceptTermsOfServiceRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &AcceptTermsOfServiceRequest{} // AcceptTermsOfServiceRequest struct for AcceptTermsOfServiceRequest type AcceptTermsOfServiceRequest struct { // The unique identifier of the user accepting the Terms of Service. - AcceptedBy *string `json:"acceptedBy,omitempty"` + AcceptedBy string `json:"acceptedBy"` // The IP address of the user accepting the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` } @@ -29,8 +28,9 @@ type AcceptTermsOfServiceRequest struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAcceptTermsOfServiceRequest() *AcceptTermsOfServiceRequest { +func NewAcceptTermsOfServiceRequest(acceptedBy string) *AcceptTermsOfServiceRequest { this := AcceptTermsOfServiceRequest{} + this.AcceptedBy = acceptedBy return &this } @@ -42,36 +42,28 @@ func NewAcceptTermsOfServiceRequestWithDefaults() *AcceptTermsOfServiceRequest { return &this } -// GetAcceptedBy returns the AcceptedBy field value if set, zero value otherwise. +// GetAcceptedBy returns the AcceptedBy field value func (o *AcceptTermsOfServiceRequest) GetAcceptedBy() string { - if o == nil || common.IsNil(o.AcceptedBy) { + if o == nil { var ret string return ret } - return *o.AcceptedBy + + return o.AcceptedBy } -// GetAcceptedByOk returns a tuple with the AcceptedBy field value if set, nil otherwise +// GetAcceptedByOk returns a tuple with the AcceptedBy field value // and a boolean to check if the value has been set. func (o *AcceptTermsOfServiceRequest) GetAcceptedByOk() (*string, bool) { - if o == nil || common.IsNil(o.AcceptedBy) { + if o == nil { return nil, false } - return o.AcceptedBy, true -} - -// HasAcceptedBy returns a boolean if a field has been set. -func (o *AcceptTermsOfServiceRequest) HasAcceptedBy() bool { - if o != nil && !common.IsNil(o.AcceptedBy) { - return true - } - - return false + return &o.AcceptedBy, true } -// SetAcceptedBy gets a reference to the given string and assigns it to the AcceptedBy field. +// SetAcceptedBy sets field value func (o *AcceptTermsOfServiceRequest) SetAcceptedBy(v string) { - o.AcceptedBy = &v + o.AcceptedBy = v } // GetIpAddress returns the IpAddress field value if set, zero value otherwise. @@ -107,7 +99,7 @@ func (o *AcceptTermsOfServiceRequest) SetIpAddress(v string) { } func (o AcceptTermsOfServiceRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -116,9 +108,7 @@ func (o AcceptTermsOfServiceRequest) MarshalJSON() ([]byte, error) { func (o AcceptTermsOfServiceRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.AcceptedBy) { - toSerialize["acceptedBy"] = o.AcceptedBy - } + toSerialize["acceptedBy"] = o.AcceptedBy if !common.IsNil(o.IpAddress) { toSerialize["ipAddress"] = o.IpAddress } @@ -160,3 +150,6 @@ func (v *NullableAcceptTermsOfServiceRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 1dc20d196..4bc7cbfd3 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AcceptTermsOfServiceResponse type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *AcceptTermsOfServiceResponse) SetType(v string) { } func (o AcceptTermsOfServiceResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableAcceptTermsOfServiceResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcceptTermsOfServiceResponse) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_additional_bank_identification.go b/src/legalentity/model_additional_bank_identification.go index 209d3ee08..cff59995c 100644 --- a/src/legalentity/model_additional_bank_identification.go +++ b/src/legalentity/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_address.go b/src/legalentity/model_address.go index 4c80ac8a6..2c4810c0d 100644 --- a/src/legalentity/model_address.go +++ b/src/legalentity/model_address.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type Address struct { Country string `json:"country"` // Postal code. Required if `stateOrProvince` and/or `city` is provided. PostalCode *string `json:"postalCode,omitempty"` - // The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. + // The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. StateOrProvince *string `json:"stateOrProvince,omitempty"` // The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided. Street *string `json:"street,omitempty"` @@ -236,7 +235,7 @@ func (o *Address) SetStreet2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_amount.go b/src/legalentity/model_amount.go index 3a58ec64a..abda5f830 100644 --- a/src/legalentity/model_amount.go +++ b/src/legalentity/model_amount.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_attachment.go b/src/legalentity/model_attachment.go index 2df2387c4..41e7b8c56 100644 --- a/src/legalentity/model_attachment.go +++ b/src/legalentity/model_attachment.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Attachment type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &Attachment{} type Attachment struct { // The document in Base64-encoded string format. Content string `json:"content"` - // The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. + // The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. // Deprecated ContentType *string `json:"contentType,omitempty"` // The name of the file including the file extension. @@ -210,7 +209,7 @@ func (o *Attachment) SetPageType(v string) { } func (o Attachment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableAttachment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_au_local_account_identification.go b/src/legalentity/model_au_local_account_identification.go index 3066c2d92..50e67c865 100644 --- a/src/legalentity/model_au_local_account_identification.go +++ b/src/legalentity/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_bank_account_info.go b/src/legalentity/model_bank_account_info.go index e31faa7a1..7e5d57012 100644 --- a/src/legalentity/model_bank_account_info.go +++ b/src/legalentity/model_bank_account_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccountInfo type satisfies the MappedNullable interface at compile time @@ -25,6 +24,8 @@ type BankAccountInfo struct { AccountType *string `json:"accountType,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the bank account is registered. For example, **NL**. CountryCode *string `json:"countryCode,omitempty"` + // Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). + TrustedSource *bool `json:"trustedSource,omitempty"` } // NewBankAccountInfo instantiates a new BankAccountInfo object @@ -143,8 +144,40 @@ func (o *BankAccountInfo) SetCountryCode(v string) { o.CountryCode = &v } +// GetTrustedSource returns the TrustedSource field value if set, zero value otherwise. +func (o *BankAccountInfo) GetTrustedSource() bool { + if o == nil || common.IsNil(o.TrustedSource) { + var ret bool + return ret + } + return *o.TrustedSource +} + +// GetTrustedSourceOk returns a tuple with the TrustedSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountInfo) GetTrustedSourceOk() (*bool, bool) { + if o == nil || common.IsNil(o.TrustedSource) { + return nil, false + } + return o.TrustedSource, true +} + +// HasTrustedSource returns a boolean if a field has been set. +func (o *BankAccountInfo) HasTrustedSource() bool { + if o != nil && !common.IsNil(o.TrustedSource) { + return true + } + + return false +} + +// SetTrustedSource gets a reference to the given bool and assigns it to the TrustedSource field. +func (o *BankAccountInfo) SetTrustedSource(v bool) { + o.TrustedSource = &v +} + func (o BankAccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -162,6 +195,9 @@ func (o BankAccountInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CountryCode) { toSerialize["countryCode"] = o.CountryCode } + if !common.IsNil(o.TrustedSource) { + toSerialize["trustedSource"] = o.TrustedSource + } return toSerialize, nil } @@ -200,3 +236,6 @@ func (v *NullableBankAccountInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_bank_account_info_account_identification.go b/src/legalentity/model_bank_account_info_account_identification.go index 4f5a1b9fb..94207a8d6 100644 --- a/src/legalentity/model_bank_account_info_account_identification.go +++ b/src/legalentity/model_bank_account_info_account_identification.go @@ -10,23 +10,25 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // BankAccountInfoAccountIdentification - Identification of the bank account. type BankAccountInfoAccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountInfoAccountIdentification @@ -99,6 +101,13 @@ func SELocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *SELoc } } +// SGLocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns SGLocalAccountIdentification wrapped in BankAccountInfoAccountIdentification +func SGLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *SGLocalAccountIdentification) BankAccountInfoAccountIdentification { + return BankAccountInfoAccountIdentification{ + SGLocalAccountIdentification: v, + } +} + // UKLocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns UKLocalAccountIdentification wrapped in BankAccountInfoAccountIdentification func UKLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *UKLocalAccountIdentification) BankAccountInfoAccountIdentification { return BankAccountInfoAccountIdentification{ @@ -113,6 +122,7 @@ func USLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *USLoc } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -123,7 +133,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -136,7 +146,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -149,7 +159,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -162,7 +172,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -175,7 +185,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -188,7 +198,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -201,7 +211,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -214,7 +224,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -227,7 +237,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -240,20 +250,33 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { dst.SELocalAccountIdentification = nil } + // try to unmarshal data into SGLocalAccountIdentification + err = json.Unmarshal(data, &dst.SGLocalAccountIdentification) + if err == nil { + jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) + if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct + dst.SGLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.SGLocalAccountIdentification = nil + } + // try to unmarshal data into UKLocalAccountIdentification err = json.Unmarshal(data, &dst.UKLocalAccountIdentification) if err == nil { jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -266,7 +289,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -285,6 +308,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.NumberAndBicAccountIdentification = nil dst.PLLocalAccountIdentification = nil dst.SELocalAccountIdentification = nil + dst.SGLocalAccountIdentification = nil dst.UKLocalAccountIdentification = nil dst.USLocalAccountIdentification = nil @@ -338,6 +362,10 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SELocalAccountIdentification) } + if src.SGLocalAccountIdentification != nil { + return json.Marshal(&src.SGLocalAccountIdentification) + } + if src.UKLocalAccountIdentification != nil { return json.Marshal(&src.UKLocalAccountIdentification) } @@ -350,7 +378,7 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountInfoAccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -394,6 +422,10 @@ func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} return obj.SELocalAccountIdentification } + if obj.SGLocalAccountIdentification != nil { + return obj.SGLocalAccountIdentification + } + if obj.UKLocalAccountIdentification != nil { return obj.UKLocalAccountIdentification } @@ -441,3 +473,5 @@ func (v *NullableBankAccountInfoAccountIdentification) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/legalentity/model_birth_data.go b/src/legalentity/model_birth_data.go index ac89f5633..93261b902 100644 --- a/src/legalentity/model_birth_data.go +++ b/src/legalentity/model_birth_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BirthData type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BirthData) SetDateOfBirth(v string) { } func (o BirthData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBirthData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_business_line.go b/src/legalentity/model_business_line.go index 8e5dfeb44..6e0f41e49 100644 --- a/src/legalentity/model_business_line.go +++ b/src/legalentity/model_business_line.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BusinessLine type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &BusinessLine{} // BusinessLine struct for BusinessLine type BusinessLine struct { - // The capability for which you are creating the business line. For example, **receivePayments**. + // The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** // Deprecated Capability *string `json:"capability,omitempty"` // The unique identifier of the business line. @@ -32,11 +31,11 @@ type BusinessLine struct { Problems []CapabilityProblem `json:"problems,omitempty"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** - Service string `json:"service"` + // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** + Service string `json:"service"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -353,7 +352,7 @@ func (o *BusinessLine) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLine) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -365,7 +364,7 @@ func (o BusinessLine) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Capability) { toSerialize["capability"] = o.Capability } - // skip: id is readOnly + toSerialize["id"] = o.Id toSerialize["industryCode"] = o.IndustryCode toSerialize["legalEntityId"] = o.LegalEntityId if !common.IsNil(o.Problems) { @@ -423,12 +422,23 @@ func (v *NullableBusinessLine) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + +func (o *BusinessLine) isValidCapability() bool { + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false +} func (o *BusinessLine) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "issuing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_line_info.go b/src/legalentity/model_business_line_info.go index dbcb331fa..11ee6ad49 100644 --- a/src/legalentity/model_business_line_info.go +++ b/src/legalentity/model_business_line_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BusinessLineInfo type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &BusinessLineInfo{} // BusinessLineInfo struct for BusinessLineInfo type BusinessLineInfo struct { - // The capability for which you are creating the business line. For example, **receivePayments**. + // The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** // Deprecated Capability *string `json:"capability,omitempty"` // A code that represents the industry of the legal entity. For example, **4431A** for computer software stores. @@ -28,11 +27,11 @@ type BusinessLineInfo struct { LegalEntityId string `json:"legalEntityId"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** - Service string `json:"service"` + // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** + Service string `json:"service"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -292,7 +291,7 @@ func (o *BusinessLineInfo) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLineInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -358,12 +357,23 @@ func (v *NullableBusinessLineInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + +func (o *BusinessLineInfo) isValidCapability() bool { + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false +} func (o *BusinessLineInfo) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "issuing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_line_info_update.go b/src/legalentity/model_business_line_info_update.go index 46a441cec..9ac8f8df1 100644 --- a/src/legalentity/model_business_line_info_update.go +++ b/src/legalentity/model_business_line_info_update.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BusinessLineInfoUpdate type satisfies the MappedNullable interface at compile time @@ -28,11 +27,11 @@ type BusinessLineInfoUpdate struct { LegalEntityId *string `json:"legalEntityId,omitempty"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** - Service string `json:"service"` + // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** + Service string `json:"service"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -306,7 +305,7 @@ func (o *BusinessLineInfoUpdate) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLineInfoUpdate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -376,12 +375,23 @@ func (v *NullableBusinessLineInfoUpdate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + +func (o *BusinessLineInfoUpdate) isValidCapability() bool { + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false +} func (o *BusinessLineInfoUpdate) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "issuing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_lines.go b/src/legalentity/model_business_lines.go index f7a629996..b74b93c06 100644 --- a/src/legalentity/model_business_lines.go +++ b/src/legalentity/model_business_lines.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BusinessLines type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *BusinessLines) SetBusinessLines(v []BusinessLine) { } func (o BusinessLines) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableBusinessLines) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_ca_local_account_identification.go b/src/legalentity/model_ca_local_account_identification.go index 8862ea719..088eefb69 100644 --- a/src/legalentity/model_ca_local_account_identification.go +++ b/src/legalentity/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_capability_problem.go b/src/legalentity/model_capability_problem.go index fc6904100..19d9ae478 100644 --- a/src/legalentity/model_capability_problem.go +++ b/src/legalentity/model_capability_problem.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapabilityProblem type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &CapabilityProblem{} // CapabilityProblem struct for CapabilityProblem type CapabilityProblem struct { - Entity *CapabilityProblemEntity `json:"entity,omitempty"` - VerificationErrors []VerificationError `json:"verificationErrors,omitempty"` + Entity *CapabilityProblemEntity `json:"entity,omitempty"` + VerificationErrors []VerificationError `json:"verificationErrors,omitempty"` } // NewCapabilityProblem instantiates a new CapabilityProblem object @@ -105,7 +104,7 @@ func (o *CapabilityProblem) SetVerificationErrors(v []VerificationError) { } func (o CapabilityProblem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableCapabilityProblem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_capability_problem_entity.go b/src/legalentity/model_capability_problem_entity.go index 212161a75..1cdf70e80 100644 --- a/src/legalentity/model_capability_problem_entity.go +++ b/src/legalentity/model_capability_problem_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapabilityProblemEntity type satisfies the MappedNullable interface at compile time @@ -20,10 +19,10 @@ var _ common.MappedNullable = &CapabilityProblemEntity{} // CapabilityProblemEntity struct for CapabilityProblemEntity type CapabilityProblemEntity struct { // List of document IDs corresponding to the verification errors from capabilities. - Documents []string `json:"documents,omitempty"` - Id *string `json:"id,omitempty"` - Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` - Type *string `json:"type,omitempty"` + Documents []string `json:"documents,omitempty"` + Id *string `json:"id,omitempty"` + Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` + Type *string `json:"type,omitempty"` } // NewCapabilityProblemEntity instantiates a new CapabilityProblemEntity object @@ -172,7 +171,7 @@ func (o *CapabilityProblemEntity) SetType(v string) { } func (o CapabilityProblemEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,12 +231,14 @@ func (v *NullableCapabilityProblemEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntity) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity", "product" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_capability_problem_entity_recursive.go b/src/legalentity/model_capability_problem_entity_recursive.go index 794c23f03..441db0983 100644 --- a/src/legalentity/model_capability_problem_entity_recursive.go +++ b/src/legalentity/model_capability_problem_entity_recursive.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapabilityProblemEntityRecursive type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &CapabilityProblemEntityRecursive{} type CapabilityProblemEntityRecursive struct { // List of document IDs corresponding to the verification errors from capabilities. Documents []string `json:"documents,omitempty"` - Id *string `json:"id,omitempty"` - Type *string `json:"type,omitempty"` + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` } // NewCapabilityProblemEntityRecursive instantiates a new CapabilityProblemEntityRecursive object @@ -139,7 +138,7 @@ func (o *CapabilityProblemEntityRecursive) SetType(v string) { } func (o CapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,12 +195,14 @@ func (v *NullableCapabilityProblemEntityRecursive) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntityRecursive) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity", "product" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_capability_settings.go b/src/legalentity/model_capability_settings.go index 718aac5f3..7573522ef 100644 --- a/src/legalentity/model_capability_settings.go +++ b/src/legalentity/model_capability_settings.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CapabilitySettings type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type CapabilitySettings struct { // The funding source of the card, for example **debit**. FundingSource []string `json:"fundingSource,omitempty"` // The period when the rule conditions apply. - Interval *string `json:"interval,omitempty"` + Interval *string `json:"interval,omitempty"` MaxAmount *Amount `json:"maxAmount,omitempty"` } @@ -208,7 +207,7 @@ func (o *CapabilitySettings) SetMaxAmount(v Amount) { } func (o CapabilitySettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableCapabilitySettings) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilitySettings) isValidInterval() bool { - var allowedEnumValues = []string{"daily", "monthly", "weekly"} - for _, allowed := range allowedEnumValues { - if o.GetInterval() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "monthly", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetInterval() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_cz_local_account_identification.go b/src/legalentity/model_cz_local_account_identification.go index a75603566..22bb65fee 100644 --- a/src/legalentity/model_cz_local_account_identification.go +++ b/src/legalentity/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_dk_local_account_identification.go b/src/legalentity/model_dk_local_account_identification.go index eb91866e0..b1b19a1e8 100644 --- a/src/legalentity/model_dk_local_account_identification.go +++ b/src/legalentity/model_dk_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *DKLocalAccountIdentification) SetType(v string) { } func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"dkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_document.go b/src/legalentity/model_document.go index 7ae3a0541..6b24600cf 100644 --- a/src/legalentity/model_document.go +++ b/src/legalentity/model_document.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Document type satisfies the MappedNullable interface at compile time @@ -43,9 +42,9 @@ type Document struct { // The modification date of the document. ModificationDate *time.Time `json:"modificationDate,omitempty"` // The number in the document. - Number *string `json:"number,omitempty"` - Owner OwnerEntity `json:"owner"` - // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + Number *string `json:"number,omitempty"` + Owner OwnerEntity `json:"owner"` + // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). Type string `json:"type"` } @@ -464,7 +463,7 @@ func (o *Document) SetType(v string) { } func (o Document) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -477,7 +476,9 @@ func (o Document) ToMap() (map[string]interface{}, error) { toSerialize["attachment"] = o.Attachment } toSerialize["attachments"] = o.Attachments - // skip: creationDate is readOnly + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } toSerialize["description"] = o.Description if !common.IsNil(o.ExpiryDate) { toSerialize["expiryDate"] = o.ExpiryDate @@ -485,14 +486,18 @@ func (o Document) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FileName) { toSerialize["fileName"] = o.FileName } - // skip: id is readOnly + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } if !common.IsNil(o.IssuerCountry) { toSerialize["issuerCountry"] = o.IssuerCountry } if !common.IsNil(o.IssuerState) { toSerialize["issuerState"] = o.IssuerState } - // skip: modificationDate is readOnly + if !common.IsNil(o.ModificationDate) { + toSerialize["modificationDate"] = o.ModificationDate + } if !common.IsNil(o.Number) { toSerialize["number"] = o.Number } @@ -537,12 +542,14 @@ func (v *NullableDocument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Document) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_document_page.go b/src/legalentity/model_document_page.go new file mode 100644 index 000000000..b7052b329 --- /dev/null +++ b/src/legalentity/model_document_page.go @@ -0,0 +1,207 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the DocumentPage type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &DocumentPage{} + +// DocumentPage struct for DocumentPage +type DocumentPage struct { + PageName *string `json:"pageName,omitempty"` + PageNumber *int32 `json:"pageNumber,omitempty"` + Type *string `json:"type,omitempty"` +} + +// NewDocumentPage instantiates a new DocumentPage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDocumentPage() *DocumentPage { + this := DocumentPage{} + return &this +} + +// NewDocumentPageWithDefaults instantiates a new DocumentPage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDocumentPageWithDefaults() *DocumentPage { + this := DocumentPage{} + return &this +} + +// GetPageName returns the PageName field value if set, zero value otherwise. +func (o *DocumentPage) GetPageName() string { + if o == nil || common.IsNil(o.PageName) { + var ret string + return ret + } + return *o.PageName +} + +// GetPageNameOk returns a tuple with the PageName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DocumentPage) GetPageNameOk() (*string, bool) { + if o == nil || common.IsNil(o.PageName) { + return nil, false + } + return o.PageName, true +} + +// HasPageName returns a boolean if a field has been set. +func (o *DocumentPage) HasPageName() bool { + if o != nil && !common.IsNil(o.PageName) { + return true + } + + return false +} + +// SetPageName gets a reference to the given string and assigns it to the PageName field. +func (o *DocumentPage) SetPageName(v string) { + o.PageName = &v +} + +// GetPageNumber returns the PageNumber field value if set, zero value otherwise. +func (o *DocumentPage) GetPageNumber() int32 { + if o == nil || common.IsNil(o.PageNumber) { + var ret int32 + return ret + } + return *o.PageNumber +} + +// GetPageNumberOk returns a tuple with the PageNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DocumentPage) GetPageNumberOk() (*int32, bool) { + if o == nil || common.IsNil(o.PageNumber) { + return nil, false + } + return o.PageNumber, true +} + +// HasPageNumber returns a boolean if a field has been set. +func (o *DocumentPage) HasPageNumber() bool { + if o != nil && !common.IsNil(o.PageNumber) { + return true + } + + return false +} + +// SetPageNumber gets a reference to the given int32 and assigns it to the PageNumber field. +func (o *DocumentPage) SetPageNumber(v int32) { + o.PageNumber = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DocumentPage) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DocumentPage) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DocumentPage) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *DocumentPage) SetType(v string) { + o.Type = &v +} + +func (o DocumentPage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DocumentPage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.PageName) { + toSerialize["pageName"] = o.PageName + } + if !common.IsNil(o.PageNumber) { + toSerialize["pageNumber"] = o.PageNumber + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableDocumentPage struct { + value *DocumentPage + isSet bool +} + +func (v NullableDocumentPage) Get() *DocumentPage { + return v.value +} + +func (v *NullableDocumentPage) Set(val *DocumentPage) { + v.value = val + v.isSet = true +} + +func (v NullableDocumentPage) IsSet() bool { + return v.isSet +} + +func (v *NullableDocumentPage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDocumentPage(val *DocumentPage) *NullableDocumentPage { + return &NullableDocumentPage{value: val, isSet: true} +} + +func (v NullableDocumentPage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDocumentPage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *DocumentPage) isValidType() bool { + var allowedEnumValues = []string{ "BACK", "FRONT", "UNDEFINED" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/legalentity/model_document_reference.go b/src/legalentity/model_document_reference.go index d4267d3cf..5090b520a 100644 --- a/src/legalentity/model_document_reference.go +++ b/src/legalentity/model_document_reference.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DocumentReference type satisfies the MappedNullable interface at compile time @@ -30,6 +29,8 @@ type DocumentReference struct { Id *string `json:"id,omitempty"` // The modification date of the document. ModificationDate *time.Time `json:"modificationDate,omitempty"` + // List of document pages + Pages []DocumentPage `json:"pages,omitempty"` // Type of document, used when providing an ID number or uploading a document. Type *string `json:"type,omitempty"` } @@ -211,6 +212,38 @@ func (o *DocumentReference) SetModificationDate(v time.Time) { o.ModificationDate = &v } +// GetPages returns the Pages field value if set, zero value otherwise. +func (o *DocumentReference) GetPages() []DocumentPage { + if o == nil || common.IsNil(o.Pages) { + var ret []DocumentPage + return ret + } + return o.Pages +} + +// GetPagesOk returns a tuple with the Pages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DocumentReference) GetPagesOk() ([]DocumentPage, bool) { + if o == nil || common.IsNil(o.Pages) { + return nil, false + } + return o.Pages, true +} + +// HasPages returns a boolean if a field has been set. +func (o *DocumentReference) HasPages() bool { + if o != nil && !common.IsNil(o.Pages) { + return true + } + + return false +} + +// SetPages gets a reference to the given []DocumentPage and assigns it to the Pages field. +func (o *DocumentReference) SetPages(v []DocumentPage) { + o.Pages = v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *DocumentReference) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -244,7 +277,7 @@ func (o *DocumentReference) SetType(v string) { } func (o DocumentReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -268,6 +301,9 @@ func (o DocumentReference) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ModificationDate) { toSerialize["modificationDate"] = o.ModificationDate } + if !common.IsNil(o.Pages) { + toSerialize["pages"] = o.Pages + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } @@ -309,3 +345,6 @@ func (v *NullableDocumentReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_entity_reference.go b/src/legalentity/model_entity_reference.go index b8a019924..f2a35eb3b 100644 --- a/src/legalentity/model_entity_reference.go +++ b/src/legalentity/model_entity_reference.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the EntityReference type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *EntityReference) SetId(v string) { } func (o EntityReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableEntityReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index a0683c79f..d2258a7d2 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GeneratePciDescriptionRequest type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GeneratePciDescriptionRequest) SetLanguage(v string) { } func (o GeneratePciDescriptionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGeneratePciDescriptionRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_generate_pci_description_response.go b/src/legalentity/model_generate_pci_description_response.go index da4522d65..8822d37e7 100644 --- a/src/legalentity/model_generate_pci_description_response.go +++ b/src/legalentity/model_generate_pci_description_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GeneratePciDescriptionResponse type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *GeneratePciDescriptionResponse) SetPciTemplateReferences(v []string) { } func (o GeneratePciDescriptionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableGeneratePciDescriptionResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_pci_questionnaire_infos_response.go b/src/legalentity/model_get_pci_questionnaire_infos_response.go index 48b5a2e44..13b405e45 100644 --- a/src/legalentity/model_get_pci_questionnaire_infos_response.go +++ b/src/legalentity/model_get_pci_questionnaire_infos_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetPciQuestionnaireInfosResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetPciQuestionnaireInfosResponse) SetData(v []PciDocumentInfo) { } func (o GetPciQuestionnaireInfosResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetPciQuestionnaireInfosResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_pci_questionnaire_response.go b/src/legalentity/model_get_pci_questionnaire_response.go index 41780c71b..d4545d644 100644 --- a/src/legalentity/model_get_pci_questionnaire_response.go +++ b/src/legalentity/model_get_pci_questionnaire_response.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetPciQuestionnaireResponse type satisfies the MappedNullable interface at compile time @@ -176,7 +175,7 @@ func (o *GetPciQuestionnaireResponse) SetValidUntil(v time.Time) { } func (o GetPciQuestionnaireResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableGetPciQuestionnaireResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go b/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go index 1708fa41d..b338fbd38 100644 --- a/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go +++ b/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTermsOfServiceAcceptanceInfosResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetTermsOfServiceAcceptanceInfosResponse) SetData(v []TermsOfServiceAcc } func (o GetTermsOfServiceAcceptanceInfosResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetTermsOfServiceAcceptanceInfosResponse) UnmarshalJSON(src []b v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_terms_of_service_document_request.go b/src/legalentity/model_get_terms_of_service_document_request.go index b8b8dd28c..2363e5609 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTermsOfServiceDocumentRequest type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *GetTermsOfServiceDocumentRequest) SetType(v string) { } func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableGetTermsOfServiceDocumentRequest) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *GetTermsOfServiceDocumentRequest) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_get_terms_of_service_document_response.go b/src/legalentity/model_get_terms_of_service_document_response.go index be9c91002..86ca6edbc 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTermsOfServiceDocumentResponse type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *GetTermsOfServiceDocumentResponse) SetType(v string) { } func (o GetTermsOfServiceDocumentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableGetTermsOfServiceDocumentResponse) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *GetTermsOfServiceDocumentResponse) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_hu_local_account_identification.go b/src/legalentity/model_hu_local_account_identification.go index 39fa93472..a674a25fe 100644 --- a/src/legalentity/model_hu_local_account_identification.go +++ b/src/legalentity/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_iban_account_identification.go b/src/legalentity/model_iban_account_identification.go index 2c2126d59..dafb4e69e 100644 --- a/src/legalentity/model_iban_account_identification.go +++ b/src/legalentity/model_iban_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index df446c9d7..0dbca2a40 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IdentificationData type satisfies the MappedNullable interface at compile time @@ -33,7 +32,7 @@ type IdentificationData struct { NationalIdExempt *bool `json:"nationalIdExempt,omitempty"` // The number in the document. Number *string `json:"number,omitempty"` - // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). Type string `json:"type"` } @@ -278,7 +277,7 @@ func (o *IdentificationData) SetType(v string) { } func (o IdentificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,12 +344,14 @@ func (v *NullableIdentificationData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IdentificationData) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_individual.go b/src/legalentity/model_individual.go index dbdf37a12..84add9cd0 100644 --- a/src/legalentity/model_individual.go +++ b/src/legalentity/model_individual.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Individual type satisfies the MappedNullable interface at compile time @@ -21,16 +20,16 @@ var _ common.MappedNullable = &Individual{} type Individual struct { BirthData *BirthData `json:"birthData,omitempty"` // The email address of the legal entity. - Email *string `json:"email,omitempty"` + Email *string `json:"email,omitempty"` IdentificationData *IdentificationData `json:"identificationData,omitempty"` - Name Name `json:"name"` + Name Name `json:"name"` // The individual's nationality. - Nationality *string `json:"nationality,omitempty"` - Phone *PhoneNumber `json:"phone,omitempty"` - ResidentialAddress Address `json:"residentialAddress"` + Nationality *string `json:"nationality,omitempty"` + Phone *PhoneNumber `json:"phone,omitempty"` + ResidentialAddress Address `json:"residentialAddress"` // The tax information of the individual. TaxInformation []TaxInformation `json:"taxInformation,omitempty"` - WebData *WebData `json:"webData,omitempty"` + WebData *WebData `json:"webData,omitempty"` } // NewIndividual instantiates a new Individual object @@ -325,7 +324,7 @@ func (o *Individual) SetWebData(v WebData) { } func (o Individual) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -395,3 +394,6 @@ func (v *NullableIndividual) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index 4d840ca35..1bf634115 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LegalEntity type satisfies the MappedNullable interface at compile time @@ -29,18 +28,20 @@ type LegalEntity struct { // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` // The unique identifier of the legal entity. - Id string `json:"id"` - Individual *Individual `json:"individual,omitempty"` + Id string `json:"id"` + Individual *Individual `json:"individual,omitempty"` Organization *Organization `json:"organization,omitempty"` // List of the verification errors from capabilities for the legal entity. Problems []CapabilityProblem `json:"problems,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` // List of transfer instruments that the legal entity owns. TransferInstruments []TransferInstrumentReference `json:"transferInstruments,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. Type *string `json:"type,omitempty"` + // List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + VerificationDeadlines []VerificationDeadline `json:"verificationDeadlines,omitempty"` } // NewLegalEntity instantiates a new LegalEntity object @@ -440,8 +441,40 @@ func (o *LegalEntity) SetType(v string) { o.Type = &v } +// GetVerificationDeadlines returns the VerificationDeadlines field value if set, zero value otherwise. +func (o *LegalEntity) GetVerificationDeadlines() []VerificationDeadline { + if o == nil || common.IsNil(o.VerificationDeadlines) { + var ret []VerificationDeadline + return ret + } + return o.VerificationDeadlines +} + +// GetVerificationDeadlinesOk returns a tuple with the VerificationDeadlines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegalEntity) GetVerificationDeadlinesOk() ([]VerificationDeadline, bool) { + if o == nil || common.IsNil(o.VerificationDeadlines) { + return nil, false + } + return o.VerificationDeadlines, true +} + +// HasVerificationDeadlines returns a boolean if a field has been set. +func (o *LegalEntity) HasVerificationDeadlines() bool { + if o != nil && !common.IsNil(o.VerificationDeadlines) { + return true + } + + return false +} + +// SetVerificationDeadlines gets a reference to the given []VerificationDeadline and assigns it to the VerificationDeadlines field. +func (o *LegalEntity) SetVerificationDeadlines(v []VerificationDeadline) { + o.VerificationDeadlines = v +} + func (o LegalEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -450,7 +483,9 @@ func (o LegalEntity) MarshalJSON() ([]byte, error) { func (o LegalEntity) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: capabilities is readOnly + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } if !common.IsNil(o.DocumentDetails) { toSerialize["documentDetails"] = o.DocumentDetails } @@ -460,7 +495,7 @@ func (o LegalEntity) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.EntityAssociations) { toSerialize["entityAssociations"] = o.EntityAssociations } - // skip: id is readOnly + toSerialize["id"] = o.Id if !common.IsNil(o.Individual) { toSerialize["individual"] = o.Individual } @@ -476,10 +511,15 @@ func (o LegalEntity) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.SoleProprietorship) { toSerialize["soleProprietorship"] = o.SoleProprietorship } - // skip: transferInstruments is readOnly + if !common.IsNil(o.TransferInstruments) { + toSerialize["transferInstruments"] = o.TransferInstruments + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } + if !common.IsNil(o.VerificationDeadlines) { + toSerialize["verificationDeadlines"] = o.VerificationDeadlines + } return toSerialize, nil } @@ -519,12 +559,14 @@ func (v *NullableLegalEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntity) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_association.go b/src/legalentity/model_legal_entity_association.go index 898e81d00..5e8b9e38c 100644 --- a/src/legalentity/model_legal_entity_association.go +++ b/src/legalentity/model_legal_entity_association.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LegalEntityAssociation type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &LegalEntityAssociation{} type LegalEntityAssociation struct { // The unique identifier of another legal entity with which the `legalEntityId` is associated. When the `legalEntityId` is associated to legal entities other than the current one, the response returns all the associations. AssociatorId *string `json:"associatorId,omitempty"` - // The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. + // The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. EntityType *string `json:"entityType,omitempty"` // The individual's job title if the `type` is **uboThroughControl** or **signatory**. JobTitle *string `json:"jobTitle,omitempty"` @@ -29,7 +28,7 @@ type LegalEntityAssociation struct { LegalEntityId string `json:"legalEntityId"` // The name of the associated [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). - For **individual**, `name.firstName` and `name.lastName`. - For **organization**, `legalName`. - For **soleProprietorship**, `name`. Name *string `json:"name,omitempty"` - // Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. + // Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Type string `json:"type"` } @@ -229,7 +228,7 @@ func (o *LegalEntityAssociation) SetType(v string) { } func (o LegalEntityAssociation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -238,13 +237,19 @@ func (o LegalEntityAssociation) MarshalJSON() ([]byte, error) { func (o LegalEntityAssociation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: associatorId is readOnly - // skip: entityType is readOnly + if !common.IsNil(o.AssociatorId) { + toSerialize["associatorId"] = o.AssociatorId + } + if !common.IsNil(o.EntityType) { + toSerialize["entityType"] = o.EntityType + } if !common.IsNil(o.JobTitle) { toSerialize["jobTitle"] = o.JobTitle } toSerialize["legalEntityId"] = o.LegalEntityId - // skip: name is readOnly + if !common.IsNil(o.Name) { + toSerialize["name"] = o.Name + } toSerialize["type"] = o.Type return toSerialize, nil } @@ -285,12 +290,14 @@ func (v *NullableLegalEntityAssociation) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityAssociation) isValidType() bool { - var allowedEnumValues = []string{"pciSignatory", "signatory", "soleProprietorship", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "pciSignatory", "signatory", "soleProprietorship", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_capability.go b/src/legalentity/model_legal_entity_capability.go index a98b43e5b..4c8de479e 100644 --- a/src/legalentity/model_legal_entity_capability.go +++ b/src/legalentity/model_legal_entity_capability.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LegalEntityCapability type satisfies the MappedNullable interface at compile time @@ -19,19 +18,19 @@ var _ common.MappedNullable = &LegalEntityCapability{} // LegalEntityCapability struct for LegalEntityCapability type LegalEntityCapability struct { - // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful + // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful Allowed *bool `json:"allowed,omitempty"` // The capability level that is allowed for the legal entity. Possible values: **notApplicable**, **low**, **medium**, **high**. - AllowedLevel *string `json:"allowedLevel,omitempty"` + AllowedLevel *string `json:"allowedLevel,omitempty"` AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` - // Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, + // Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. - RequestedLevel *string `json:"requestedLevel,omitempty"` + RequestedLevel *string `json:"requestedLevel,omitempty"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` // Capability status for transfer instruments associated with legal entity TransferInstruments []SupportingEntityCapability `json:"transferInstruments,omitempty"` - // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -309,7 +308,7 @@ func (o *LegalEntityCapability) SetVerificationStatus(v string) { } func (o LegalEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -318,18 +317,30 @@ func (o LegalEntityCapability) MarshalJSON() ([]byte, error) { func (o LegalEntityCapability) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: allowed is readOnly - // skip: allowedLevel is readOnly + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.AllowedLevel) { + toSerialize["allowedLevel"] = o.AllowedLevel + } if !common.IsNil(o.AllowedSettings) { toSerialize["allowedSettings"] = o.AllowedSettings } - // skip: requested is readOnly - // skip: requestedLevel is readOnly + if !common.IsNil(o.Requested) { + toSerialize["requested"] = o.Requested + } + if !common.IsNil(o.RequestedLevel) { + toSerialize["requestedLevel"] = o.RequestedLevel + } if !common.IsNil(o.RequestedSettings) { toSerialize["requestedSettings"] = o.RequestedSettings } - // skip: transferInstruments is readOnly - // skip: verificationStatus is readOnly + if !common.IsNil(o.TransferInstruments) { + toSerialize["transferInstruments"] = o.TransferInstruments + } + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } return toSerialize, nil } @@ -369,21 +380,23 @@ func (v *NullableLegalEntityCapability) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *LegalEntityCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_info.go b/src/legalentity/model_legal_entity_info.go index 2a33ad7a0..435681186 100644 --- a/src/legalentity/model_legal_entity_info.go +++ b/src/legalentity/model_legal_entity_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LegalEntityInfo type satisfies the MappedNullable interface at compile time @@ -23,10 +22,10 @@ type LegalEntityInfo struct { Capabilities *map[string]LegalEntityCapability `json:"capabilities,omitempty"` // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` - Individual *Individual `json:"individual,omitempty"` - Organization *Organization `json:"organization,omitempty"` + Individual *Individual `json:"individual,omitempty"` + Organization *Organization `json:"organization,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. Type *string `json:"type,omitempty"` @@ -274,7 +273,7 @@ func (o *LegalEntityInfo) SetType(v string) { } func (o LegalEntityInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -283,7 +282,9 @@ func (o LegalEntityInfo) MarshalJSON() ([]byte, error) { func (o LegalEntityInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: capabilities is readOnly + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } if !common.IsNil(o.EntityAssociations) { toSerialize["entityAssociations"] = o.EntityAssociations } @@ -341,12 +342,14 @@ func (v *NullableLegalEntityInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityInfo) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_info_required_type.go b/src/legalentity/model_legal_entity_info_required_type.go index 1e711c0d7..5d6d5b6e3 100644 --- a/src/legalentity/model_legal_entity_info_required_type.go +++ b/src/legalentity/model_legal_entity_info_required_type.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LegalEntityInfoRequiredType type satisfies the MappedNullable interface at compile time @@ -23,10 +22,10 @@ type LegalEntityInfoRequiredType struct { Capabilities *map[string]LegalEntityCapability `json:"capabilities,omitempty"` // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` - Individual *Individual `json:"individual,omitempty"` - Organization *Organization `json:"organization,omitempty"` + Individual *Individual `json:"individual,omitempty"` + Organization *Organization `json:"organization,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. Type string `json:"type"` @@ -267,7 +266,7 @@ func (o *LegalEntityInfoRequiredType) SetType(v string) { } func (o LegalEntityInfoRequiredType) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -276,7 +275,9 @@ func (o LegalEntityInfoRequiredType) MarshalJSON() ([]byte, error) { func (o LegalEntityInfoRequiredType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: capabilities is readOnly + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } if !common.IsNil(o.EntityAssociations) { toSerialize["entityAssociations"] = o.EntityAssociations } @@ -332,12 +333,14 @@ func (v *NullableLegalEntityInfoRequiredType) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityInfoRequiredType) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_name.go b/src/legalentity/model_name.go index 6ffa9b16b..465ffb40f 100644 --- a/src/legalentity/model_name.go +++ b/src/legalentity/model_name.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_no_local_account_identification.go b/src/legalentity/model_no_local_account_identification.go index 43c37b919..fa648df06 100644 --- a/src/legalentity/model_no_local_account_identification.go +++ b/src/legalentity/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_number_and_bic_account_identification.go b/src/legalentity/model_number_and_bic_account_identification.go index 7b997f080..88f7aadba 100644 --- a/src/legalentity/model_number_and_bic_account_identification.go +++ b/src/legalentity/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_onboarding_link.go b/src/legalentity/model_onboarding_link.go index 4302ae69b..0a15cbf58 100644 --- a/src/legalentity/model_onboarding_link.go +++ b/src/legalentity/model_onboarding_link.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OnboardingLink type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *OnboardingLink) SetUrl(v string) { } func (o OnboardingLink) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableOnboardingLink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_link_info.go b/src/legalentity/model_onboarding_link_info.go index f3371d8fa..c154be3a5 100644 --- a/src/legalentity/model_onboarding_link_info.go +++ b/src/legalentity/model_onboarding_link_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OnboardingLinkInfo type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type OnboardingLinkInfo struct { Locale *string `json:"locale,omitempty"` // The URL where the user is redirected after they complete hosted onboarding. RedirectUrl *string `json:"redirectUrl,omitempty"` - // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. By default, the values are set to **true**. Set to **false** to not allow the action. Possible keys: - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. + // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. By default, the values are set to **true**. Set to **false** to not allow the action. Possible keys: - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. Settings *map[string]bool `json:"settings,omitempty"` // The unique identifier of the hosted onboarding theme. ThemeId *string `json:"themeId,omitempty"` @@ -175,7 +174,7 @@ func (o *OnboardingLinkInfo) SetThemeId(v string) { } func (o OnboardingLinkInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableOnboardingLinkInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_theme.go b/src/legalentity/model_onboarding_theme.go index 9bbd18c0b..61a3096c3 100644 --- a/src/legalentity/model_onboarding_theme.go +++ b/src/legalentity/model_onboarding_theme.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OnboardingTheme type satisfies the MappedNullable interface at compile time @@ -189,7 +188,7 @@ func (o *OnboardingTheme) SetUpdatedAt(v time.Time) { } func (o OnboardingTheme) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -245,3 +244,6 @@ func (v *NullableOnboardingTheme) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_themes.go b/src/legalentity/model_onboarding_themes.go index d0a9e0bef..a97f5e50c 100644 --- a/src/legalentity/model_onboarding_themes.go +++ b/src/legalentity/model_onboarding_themes.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OnboardingThemes type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *OnboardingThemes) SetThemes(v []OnboardingTheme) { } func (o OnboardingThemes) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableOnboardingThemes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_organization.go b/src/legalentity/model_organization.go index 33bf7f581..884cc7bd0 100644 --- a/src/legalentity/model_organization.go +++ b/src/legalentity/model_organization.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Organization type satisfies the MappedNullable interface at compile time @@ -28,23 +27,23 @@ type Organization struct { // The email address of the legal entity. Email *string `json:"email,omitempty"` // The organization's legal name. - LegalName string `json:"legalName"` - Phone *PhoneNumber `json:"phone,omitempty"` - PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + LegalName string `json:"legalName"` + Phone *PhoneNumber `json:"phone,omitempty"` + PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` + RegisteredAddress Address `json:"registeredAddress"` // The organization's registration number. - RegistrationNumber *string `json:"registrationNumber,omitempty"` - StockData *StockData `json:"stockData,omitempty"` + RegistrationNumber *string `json:"registrationNumber,omitempty"` + StockData *StockData `json:"stockData,omitempty"` // The tax information of the organization. - TaxInformation []TaxInformation `json:"taxInformation,omitempty"` + TaxInformation []TaxInformation `json:"taxInformation,omitempty"` TaxReportingClassification *TaxReportingClassification `json:"taxReportingClassification,omitempty"` - // Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. + // Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. Type *string `json:"type,omitempty"` // The reason the organization has not provided a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. VatAbsenceReason *string `json:"vatAbsenceReason,omitempty"` // The organization's VAT number. - VatNumber *string `json:"vatNumber,omitempty"` - WebData *WebData `json:"webData,omitempty"` + VatNumber *string `json:"vatNumber,omitempty"` + WebData *WebData `json:"webData,omitempty"` } // NewOrganization instantiates a new Organization object @@ -563,7 +562,7 @@ func (o *Organization) SetWebData(v WebData) { } func (o Organization) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -655,21 +654,23 @@ func (v *NullableOrganization) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Organization) isValidType() bool { - var allowedEnumValues = []string{"associationIncorporated", "governmentalOrganization", "listedPublicCompany", "nonProfit", "partnershipIncorporated", "privateCompany"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "associationIncorporated", "governmentalOrganization", "listedPublicCompany", "nonProfit", "partnershipIncorporated", "privateCompany" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } func (o *Organization) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_owner_entity.go b/src/legalentity/model_owner_entity.go index eec21ef67..0778c6fad 100644 --- a/src/legalentity/model_owner_entity.go +++ b/src/legalentity/model_owner_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OwnerEntity type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *OwnerEntity) SetType(v string) { } func (o OwnerEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableOwnerEntity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_document_info.go b/src/legalentity/model_pci_document_info.go index 38ad7b65a..66be7b416 100644 --- a/src/legalentity/model_pci_document_info.go +++ b/src/legalentity/model_pci_document_info.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PciDocumentInfo type satisfies the MappedNullable interface at compile time @@ -142,7 +141,7 @@ func (o *PciDocumentInfo) SetValidUntil(v time.Time) { } func (o PciDocumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullablePciDocumentInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_signing_request.go b/src/legalentity/model_pci_signing_request.go index 994dc6f80..68fc47601 100644 --- a/src/legalentity/model_pci_signing_request.go +++ b/src/legalentity/model_pci_signing_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PciSigningRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *PciSigningRequest) SetSignedBy(v string) { } func (o PciSigningRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullablePciSigningRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_signing_response.go b/src/legalentity/model_pci_signing_response.go index 18148fd47..db2e60cce 100644 --- a/src/legalentity/model_pci_signing_response.go +++ b/src/legalentity/model_pci_signing_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PciSigningResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PciSigningResponse) SetSignedBy(v string) { } func (o PciSigningResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePciSigningResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_phone_number.go b/src/legalentity/model_phone_number.go index ee6a37686..28a896dfe 100644 --- a/src/legalentity/model_phone_number.go +++ b/src/legalentity/model_phone_number.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PhoneNumber type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PhoneNumber{} type PhoneNumber struct { // The full phone number, including the country code. For example, **+3112345678**. Number string `json:"number"` - // The type of phone number. Possible values: **mobile**, **landline**, **sip**, **fax.** + // The type of phone number. Possible values: **mobile**, **landline**, **sip**, **fax.** Type *string `json:"type,omitempty"` } @@ -100,7 +99,7 @@ func (o *PhoneNumber) SetType(v string) { } func (o PhoneNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pl_local_account_identification.go b/src/legalentity/model_pl_local_account_identification.go index 30365b15f..c5aa2b6d9 100644 --- a/src/legalentity/model_pl_local_account_identification.go +++ b/src/legalentity/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_remediating_action.go b/src/legalentity/model_remediating_action.go index 13ccd9de2..58b041789 100644 --- a/src/legalentity/model_remediating_action.go +++ b/src/legalentity/model_remediating_action.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RemediatingAction type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &RemediatingAction{} // RemediatingAction struct for RemediatingAction type RemediatingAction struct { - Code *string `json:"code,omitempty"` + Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` } @@ -105,7 +104,7 @@ func (o *RemediatingAction) SetMessage(v string) { } func (o RemediatingAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableRemediatingAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_se_local_account_identification.go b/src/legalentity/model_se_local_account_identification.go index 0a1d5e836..59b706b1c 100644 --- a/src/legalentity/model_se_local_account_identification.go +++ b/src/legalentity/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_service_error.go b/src/legalentity/model_service_error.go index cd7336a21..f061f4c65 100644 --- a/src/legalentity/model_service_error.go +++ b/src/legalentity/model_service_error.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_sg_local_account_identification.go b/src/legalentity/model_sg_local_account_identification.go new file mode 100644 index 000000000..3d306bc4a --- /dev/null +++ b/src/legalentity/model_sg_local_account_identification.go @@ -0,0 +1,196 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SGLocalAccountIdentification{} + +// SGLocalAccountIdentification struct for SGLocalAccountIdentification +type SGLocalAccountIdentification struct { + // The 4- to 19-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The bank's 8- or 11-character BIC or SWIFT code. + Bic string `json:"bic"` + // **sgLocal** + Type *string `json:"type,omitempty"` +} + +// NewSGLocalAccountIdentification instantiates a new SGLocalAccountIdentification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSGLocalAccountIdentification(accountNumber string, bic string) *SGLocalAccountIdentification { + this := SGLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Bic = bic + var type_ string = "sgLocal" + this.Type = &type_ + return &this +} + +// NewSGLocalAccountIdentificationWithDefaults instantiates a new SGLocalAccountIdentification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSGLocalAccountIdentificationWithDefaults() *SGLocalAccountIdentification { + this := SGLocalAccountIdentification{} + var type_ string = "sgLocal" + this.Type = &type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *SGLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *SGLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBic returns the Bic field value +func (o *SGLocalAccountIdentification) GetBic() string { + if o == nil { + var ret string + return ret + } + + return o.Bic +} + +// GetBicOk returns a tuple with the Bic field value +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetBicOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bic, true +} + +// SetBic sets field value +func (o *SGLocalAccountIdentification) SetBic(v string) { + o.Bic = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SGLocalAccountIdentification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SGLocalAccountIdentification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SGLocalAccountIdentification) SetType(v string) { + o.Type = &v +} + +func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SGLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bic"] = o.Bic + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableSGLocalAccountIdentification struct { + value *SGLocalAccountIdentification + isSet bool +} + +func (v NullableSGLocalAccountIdentification) Get() *SGLocalAccountIdentification { + return v.value +} + +func (v *NullableSGLocalAccountIdentification) Set(val *SGLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableSGLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableSGLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSGLocalAccountIdentification(val *SGLocalAccountIdentification) *NullableSGLocalAccountIdentification { + return &NullableSGLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableSGLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SGLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/legalentity/model_sole_proprietorship.go b/src/legalentity/model_sole_proprietorship.go index e51117baa..64cd65a00 100644 --- a/src/legalentity/model_sole_proprietorship.go +++ b/src/legalentity/model_sole_proprietorship.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SoleProprietorship type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type SoleProprietorship struct { // The registered name, if different from the `name`. DoingBusinessAs *string `json:"doingBusinessAs,omitempty"` // The legal name. - Name string `json:"name"` + Name string `json:"name"` PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + RegisteredAddress Address `json:"registeredAddress"` // The registration number. RegistrationNumber *string `json:"registrationNumber,omitempty"` // The reason for not providing a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. @@ -322,7 +321,7 @@ func (o *SoleProprietorship) SetVatNumber(v string) { } func (o SoleProprietorship) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -391,12 +390,14 @@ func (v *NullableSoleProprietorship) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SoleProprietorship) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_source_of_funds.go b/src/legalentity/model_source_of_funds.go index 99d61ea63..6ec7c3eb8 100644 --- a/src/legalentity/model_source_of_funds.go +++ b/src/legalentity/model_source_of_funds.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SourceOfFunds type satisfies the MappedNullable interface at compile time @@ -179,7 +178,7 @@ func (o *SourceOfFunds) SetType(v string) { } func (o SourceOfFunds) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,12 +238,14 @@ func (v *NullableSourceOfFunds) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SourceOfFunds) isValidType() bool { - var allowedEnumValues = []string{"business"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "business" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_stock_data.go b/src/legalentity/model_stock_data.go index e234e049a..4dc724cf3 100644 --- a/src/legalentity/model_stock_data.go +++ b/src/legalentity/model_stock_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StockData type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *StockData) SetTickerSymbol(v string) { } func (o StockData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableStockData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_supporting_entity_capability.go b/src/legalentity/model_supporting_entity_capability.go index 8a312a8df..efeb5f03d 100644 --- a/src/legalentity/model_supporting_entity_capability.go +++ b/src/legalentity/model_supporting_entity_capability.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SupportingEntityCapability type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &SupportingEntityCapability{} type SupportingEntityCapability struct { // Indicates whether the supporting entity capability is allowed. If a supporting entity is allowed but its parent legal entity is not, it means there are other supporting entities that failed validation. **The allowed supporting entity can still be used** Allowed *bool `json:"allowed,omitempty"` - // Supporting entity reference + // Supporting entity reference Id *string `json:"id,omitempty"` - // Indicates whether the supporting entity capability is requested. + // Indicates whether the supporting entity capability is requested. Requested *bool `json:"requested,omitempty"` - // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -175,7 +174,7 @@ func (o *SupportingEntityCapability) SetVerificationStatus(v string) { } func (o SupportingEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,10 +183,18 @@ func (o SupportingEntityCapability) MarshalJSON() ([]byte, error) { func (o SupportingEntityCapability) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - // skip: allowed is readOnly - // skip: id is readOnly - // skip: requested is readOnly - // skip: verificationStatus is readOnly + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Requested) { + toSerialize["requested"] = o.Requested + } + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } return toSerialize, nil } @@ -226,3 +233,6 @@ func (v *NullableSupportingEntityCapability) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_tax_information.go b/src/legalentity/model_tax_information.go index 6a139a06c..36dbe9f28 100644 --- a/src/legalentity/model_tax_information.go +++ b/src/legalentity/model_tax_information.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TaxInformation type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *TaxInformation) SetType(v string) { } func (o TaxInformation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableTaxInformation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_tax_reporting_classification.go b/src/legalentity/model_tax_reporting_classification.go index 854e1ddf0..bef03c905 100644 --- a/src/legalentity/model_tax_reporting_classification.go +++ b/src/legalentity/model_tax_reporting_classification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TaxReportingClassification type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *TaxReportingClassification) SetType(v string) { } func (o TaxReportingClassification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,30 +234,32 @@ func (v *NullableTaxReportingClassification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TaxReportingClassification) isValidBusinessType() bool { - var allowedEnumValues = []string{"other", "listedPublicCompany", "subsidiaryOfListedPublicCompany", "governmentalOrganization", "internationalOrganization", "financialInstitution."} - for _, allowed := range allowedEnumValues { - if o.GetBusinessType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "other", "listedPublicCompany", "subsidiaryOfListedPublicCompany", "governmentalOrganization", "internationalOrganization", "financialInstitution." } + for _, allowed := range allowedEnumValues { + if o.GetBusinessType() == allowed { + return true + } + } + return false } func (o *TaxReportingClassification) isValidMainSourceOfIncome() bool { - var allowedEnumValues = []string{"businessOperation", "realEstateSales", "investmentInterestOrRoyalty", "propertyRental", "other"} - for _, allowed := range allowedEnumValues { - if o.GetMainSourceOfIncome() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "businessOperation", "realEstateSales", "investmentInterestOrRoyalty", "propertyRental", "other" } + for _, allowed := range allowedEnumValues { + if o.GetMainSourceOfIncome() == allowed { + return true + } + } + return false } func (o *TaxReportingClassification) isValidType() bool { - var allowedEnumValues = []string{"nonFinancialNonReportable", "financialNonReportable", "nonFinancialActive", "nonFinancialPassive"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nonFinancialNonReportable", "financialNonReportable", "nonFinancialActive", "nonFinancialPassive" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_terms_of_service_acceptance_info.go b/src/legalentity/model_terms_of_service_acceptance_info.go index 1d649533a..0ee1bc8b8 100644 --- a/src/legalentity/model_terms_of_service_acceptance_info.go +++ b/src/legalentity/model_terms_of_service_acceptance_info.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TermsOfServiceAcceptanceInfo type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *TermsOfServiceAcceptanceInfo) SetType(v string) { } func (o TermsOfServiceAcceptanceInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,12 +272,14 @@ func (v *NullableTermsOfServiceAcceptanceInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TermsOfServiceAcceptanceInfo) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument.go b/src/legalentity/model_transfer_instrument.go index b6db08ef9..446bf9671 100644 --- a/src/legalentity/model_transfer_instrument.go +++ b/src/legalentity/model_transfer_instrument.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransferInstrument type satisfies the MappedNullable interface at compile time @@ -248,7 +247,7 @@ func (o *TransferInstrument) SetType(v string) { } func (o TransferInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -264,7 +263,7 @@ func (o TransferInstrument) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DocumentDetails) { toSerialize["documentDetails"] = o.DocumentDetails } - // skip: id is readOnly + toSerialize["id"] = o.Id toSerialize["legalEntityId"] = o.LegalEntityId if !common.IsNil(o.Problems) { toSerialize["problems"] = o.Problems @@ -309,12 +308,14 @@ func (v *NullableTransferInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "recurringDetail"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "recurringDetail" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument_info.go b/src/legalentity/model_transfer_instrument_info.go index bb7e5b88b..9252f83fe 100644 --- a/src/legalentity/model_transfer_instrument_info.go +++ b/src/legalentity/model_transfer_instrument_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransferInstrumentInfo type satisfies the MappedNullable interface at compile time @@ -119,7 +118,7 @@ func (o *TransferInstrumentInfo) SetType(v string) { } func (o TransferInstrumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,12 +169,14 @@ func (v *NullableTransferInstrumentInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInstrumentInfo) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "recurringDetail"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "recurringDetail" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument_reference.go b/src/legalentity/model_transfer_instrument_reference.go index 65e111ae9..5be25f76b 100644 --- a/src/legalentity/model_transfer_instrument_reference.go +++ b/src/legalentity/model_transfer_instrument_reference.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransferInstrumentReference type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type TransferInstrumentReference struct { Id string `json:"id"` // Four last digits of the bank account number. RealLastFour *string `json:"realLastFour,omitempty"` - // Identifies if the TI was created from a trusted source. + // Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). TrustedSource *bool `json:"trustedSource,omitempty"` } @@ -161,7 +160,7 @@ func (o *TransferInstrumentReference) SetTrustedSource(v bool) { } func (o TransferInstrumentReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -175,7 +174,9 @@ func (o TransferInstrumentReference) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RealLastFour) { toSerialize["realLastFour"] = o.RealLastFour } - // skip: trustedSource is readOnly + if !common.IsNil(o.TrustedSource) { + toSerialize["trustedSource"] = o.TrustedSource + } return toSerialize, nil } @@ -214,3 +215,6 @@ func (v *NullableTransferInstrumentReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_uk_local_account_identification.go b/src/legalentity/model_uk_local_account_identification.go index 2ab813828..a858567ce 100644 --- a/src/legalentity/model_uk_local_account_identification.go +++ b/src/legalentity/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_us_local_account_identification.go b/src/legalentity/model_us_local_account_identification.go index 18d9e231b..17e118767 100644 --- a/src/legalentity/model_us_local_account_identification.go +++ b/src/legalentity/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_deadline.go b/src/legalentity/model_verification_deadline.go new file mode 100644 index 000000000..eecda86ab --- /dev/null +++ b/src/legalentity/model_verification_deadline.go @@ -0,0 +1,147 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" + "time" +) + +// checks if the VerificationDeadline type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &VerificationDeadline{} + +// VerificationDeadline struct for VerificationDeadline +type VerificationDeadline struct { + // The names of the capabilities to be disallowed. + Capabilities []string `json:"capabilities"` + // The date that verification is due by before capabilities are disallowed. + ExpiresAt time.Time `json:"expiresAt"` +} + +// NewVerificationDeadline instantiates a new VerificationDeadline object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVerificationDeadline(capabilities []string, expiresAt time.Time) *VerificationDeadline { + this := VerificationDeadline{} + this.Capabilities = capabilities + this.ExpiresAt = expiresAt + return &this +} + +// NewVerificationDeadlineWithDefaults instantiates a new VerificationDeadline object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVerificationDeadlineWithDefaults() *VerificationDeadline { + this := VerificationDeadline{} + return &this +} + +// GetCapabilities returns the Capabilities field value +func (o *VerificationDeadline) GetCapabilities() []string { + if o == nil { + var ret []string + return ret + } + + return o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value +// and a boolean to check if the value has been set. +func (o *VerificationDeadline) GetCapabilitiesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Capabilities, true +} + +// SetCapabilities sets field value +func (o *VerificationDeadline) SetCapabilities(v []string) { + o.Capabilities = v +} + +// GetExpiresAt returns the ExpiresAt field value +func (o *VerificationDeadline) GetExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value +// and a boolean to check if the value has been set. +func (o *VerificationDeadline) GetExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ExpiresAt, true +} + +// SetExpiresAt sets field value +func (o *VerificationDeadline) SetExpiresAt(v time.Time) { + o.ExpiresAt = v +} + +func (o VerificationDeadline) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerificationDeadline) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["capabilities"] = o.Capabilities + toSerialize["expiresAt"] = o.ExpiresAt + return toSerialize, nil +} + +type NullableVerificationDeadline struct { + value *VerificationDeadline + isSet bool +} + +func (v NullableVerificationDeadline) Get() *VerificationDeadline { + return v.value +} + +func (v *NullableVerificationDeadline) Set(val *VerificationDeadline) { + v.value = val + v.isSet = true +} + +func (v NullableVerificationDeadline) IsSet() bool { + return v.isSet +} + +func (v *NullableVerificationDeadline) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerificationDeadline(val *VerificationDeadline) *NullableVerificationDeadline { + return &NullableVerificationDeadline{value: val, isSet: true} +} + +func (v NullableVerificationDeadline) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerificationDeadline) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/legalentity/model_verification_error.go b/src/legalentity/model_verification_error.go index a05deebe8..08ab52583 100644 --- a/src/legalentity/model_verification_error.go +++ b/src/legalentity/model_verification_error.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VerificationError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *VerificationError) SetType(v string) { } func (o VerificationError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableVerificationError) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationError) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_error_recursive.go b/src/legalentity/model_verification_error_recursive.go index 7c2b96a1a..a028302c5 100644 --- a/src/legalentity/model_verification_error_recursive.go +++ b/src/legalentity/model_verification_error_recursive.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VerificationErrorRecursive type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *VerificationErrorRecursive) SetRemediatingActions(v []RemediatingAction } func (o VerificationErrorRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableVerificationErrorRecursive) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationErrorRecursive) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_errors.go b/src/legalentity/model_verification_errors.go index 0d058b4d0..f5a2e47a7 100644 --- a/src/legalentity/model_verification_errors.go +++ b/src/legalentity/model_verification_errors.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VerificationErrors type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *VerificationErrors) SetProblems(v []CapabilityProblem) { } func (o VerificationErrors) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableVerificationErrors) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_web_data.go b/src/legalentity/model_web_data.go index a87bc268f..719e059dd 100644 --- a/src/legalentity/model_web_data.go +++ b/src/legalentity/model_web_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WebData type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *WebData) SetWebAddressId(v string) { } func (o WebData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -119,7 +118,9 @@ func (o WebData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.WebAddress) { toSerialize["webAddress"] = o.WebAddress } - // skip: webAddressId is readOnly + if !common.IsNil(o.WebAddressId) { + toSerialize["webAddressId"] = o.WebAddressId + } return toSerialize, nil } @@ -158,3 +159,6 @@ func (v *NullableWebData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_web_data_exemption.go b/src/legalentity/model_web_data_exemption.go index 08c3184db..495846464 100644 --- a/src/legalentity/model_web_data_exemption.go +++ b/src/legalentity/model_web_data_exemption.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WebDataExemption type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *WebDataExemption) SetReason(v string) { } func (o WebDataExemption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableWebDataExemption) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WebDataExemption) isValidReason() bool { - var allowedEnumValues = []string{"noOnlinePresence"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noOnlinePresence" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } + diff --git a/src/management/api_account_company_level.go b/src/management/api_account_company_level.go index 4522bfb5e..7319c8810 100644 --- a/src/management/api_account_company_level.go +++ b/src/management/api_account_company_level.go @@ -10,38 +10,36 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AccountCompanyLevelApi AccountCompanyLevelApi service type AccountCompanyLevelApi common.Service type AccountCompanyLevelApiGetCompanyAccountConfig struct { - ctx context.Context + ctx context.Context companyId string } + /* GetCompanyAccount Get a company account -Returns the company account specified in the path. Your API credential must have access to the company account. +Returns the company account specified in the path. Your API credential must have access to the company account. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return AccountCompanyLevelApiGetCompanyAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return AccountCompanyLevelApiGetCompanyAccountConfig */ func (a *AccountCompanyLevelApi) GetCompanyAccountConfig(ctx context.Context, companyId string) AccountCompanyLevelApiGetCompanyAccountConfig { return AccountCompanyLevelApiGetCompanyAccountConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -55,65 +53,72 @@ Returns the company account specified in the path. Your API credential must have */ func (a *AccountCompanyLevelApi) GetCompanyAccount(r AccountCompanyLevelApiGetCompanyAccountConfig) (Company, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Company{} + var serviceError common.RestServiceError + res := &Company{} path := "/companies/{companyId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountCompanyLevelApiListCompanyAccountsConfig struct { - ctx context.Context + ctx context.Context pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -128,6 +133,7 @@ func (r AccountCompanyLevelApiListCompanyAccountsConfig) PageSize(pageSize int32 return r } + /* ListCompanyAccounts Get a list of company accounts @@ -137,8 +143,8 @@ To make this request, your API credential must have the following [roles](https: * Management API—Account read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AccountCompanyLevelApiListCompanyAccountsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return AccountCompanyLevelApiListCompanyAccountsConfig */ func (a *AccountCompanyLevelApi) ListCompanyAccountsConfig(ctx context.Context) AccountCompanyLevelApiListCompanyAccountsConfig { return AccountCompanyLevelApiListCompanyAccountsConfig{ @@ -154,71 +160,78 @@ Returns the list of company accounts that your API credential has access to. The */ func (a *AccountCompanyLevelApi) ListCompanyAccounts(r AccountCompanyLevelApiListCompanyAccountsConfig) (ListCompanyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListCompanyResponse{} + var serviceError common.RestServiceError + res := &ListCompanyResponse{} path := "/companies" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountCompanyLevelApiListMerchantAccountsConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -233,21 +246,22 @@ func (r AccountCompanyLevelApiListMerchantAccountsConfig) PageSize(pageSize int3 return r } + /* ListMerchantAccounts Get a list of merchant accounts -Returns the list of merchant accounts under the company account specified in the path. The list only includes merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. +Returns the list of merchant accounts under the company account specified in the path. The list only includes merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return AccountCompanyLevelApiListMerchantAccountsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return AccountCompanyLevelApiListMerchantAccountsConfig */ func (a *AccountCompanyLevelApi) ListMerchantAccountsConfig(ctx context.Context, companyId string) AccountCompanyLevelApiListMerchantAccountsConfig { return AccountCompanyLevelApiListMerchantAccountsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -261,63 +275,70 @@ Returns the list of merchant accounts under the company account specified in the */ func (a *AccountCompanyLevelApi) ListMerchantAccounts(r AccountCompanyLevelApiListMerchantAccountsConfig) (ListMerchantResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListMerchantResponse{} + var serviceError common.RestServiceError + res := &ListMerchantResponse{} path := "/companies/{companyId}/merchants" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_account_merchant_level.go b/src/management/api_account_merchant_level.go index 56c10c757..ab3819016 100644 --- a/src/management/api_account_merchant_level.go +++ b/src/management/api_account_merchant_level.go @@ -10,20 +10,17 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AccountMerchantLevelApi AccountMerchantLevelApi service type AccountMerchantLevelApi common.Service type AccountMerchantLevelApiCreateMerchantAccountConfig struct { - ctx context.Context + ctx context.Context createMerchantRequest *CreateMerchantRequest } @@ -32,6 +29,7 @@ func (r AccountMerchantLevelApiCreateMerchantAccountConfig) CreateMerchantReques return r } + /* CreateMerchantAccount Create a merchant account @@ -42,8 +40,8 @@ Use this endpoint if your integration requires it, such as Adyen for Platforms M To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Accounts read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AccountMerchantLevelApiCreateMerchantAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return AccountMerchantLevelApiCreateMerchantAccountConfig */ func (a *AccountMerchantLevelApi) CreateMerchantAccountConfig(ctx context.Context) AccountMerchantLevelApiCreateMerchantAccountConfig { return AccountMerchantLevelApiCreateMerchantAccountConfig{ @@ -54,71 +52,79 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccountConfig(ctx context.Contex /* Create a merchant account Creates a merchant account for the company account specified in the request. Use this endpoint if your integration requires it, such as Adyen for Platforms Manage. Your Adyen contact will set up your access. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Accounts read and write - * @param req CreateMerchantRequest - reference of CreateMerchantRequest). + * @param req CreateMerchantRequest - reference of CreateMerchantRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateMerchantResponse */ func (a *AccountMerchantLevelApi) CreateMerchantAccount(r AccountMerchantLevelApiCreateMerchantAccountConfig) (CreateMerchantResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CreateMerchantResponse{} + var serviceError common.RestServiceError + res := &CreateMerchantResponse{} path := "/merchants" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createMerchantRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createMerchantRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountMerchantLevelApiGetMerchantAccountConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* GetMerchantAccount Get a merchant account @@ -127,13 +133,13 @@ Returns the merchant account specified in the path. Your API credential must hav To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return AccountMerchantLevelApiGetMerchantAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return AccountMerchantLevelApiGetMerchantAccountConfig */ func (a *AccountMerchantLevelApi) GetMerchantAccountConfig(ctx context.Context, merchantId string) AccountMerchantLevelApiGetMerchantAccountConfig { return AccountMerchantLevelApiGetMerchantAccountConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -147,65 +153,72 @@ Returns the merchant account specified in the path. Your API credential must hav */ func (a *AccountMerchantLevelApi) GetMerchantAccount(r AccountMerchantLevelApiGetMerchantAccountConfig) (Merchant, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Merchant{} + var serviceError common.RestServiceError + res := &Merchant{} path := "/merchants/{merchantId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountMerchantLevelApiListMerchantAccountsConfig struct { - ctx context.Context + ctx context.Context pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -220,16 +233,17 @@ func (r AccountMerchantLevelApiListMerchantAccountsConfig) PageSize(pageSize int return r } + /* ListMerchantAccounts Get a list of merchant accounts -Returns the list of merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. +Returns the list of merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AccountMerchantLevelApiListMerchantAccountsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return AccountMerchantLevelApiListMerchantAccountsConfig */ func (a *AccountMerchantLevelApi) ListMerchantAccountsConfig(ctx context.Context) AccountMerchantLevelApiListMerchantAccountsConfig { return AccountMerchantLevelApiListMerchantAccountsConfig{ @@ -245,71 +259,79 @@ Returns the list of merchant accounts that your API credential has access to. Th */ func (a *AccountMerchantLevelApi) ListMerchantAccounts(r AccountMerchantLevelApiListMerchantAccountsConfig) (ListMerchantResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListMerchantResponse{} + var serviceError common.RestServiceError + res := &ListMerchantResponse{} path := "/merchants" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountMerchantLevelApiRequestToActivateMerchantAccountConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* RequestToActivateMerchantAccount Request to activate a merchant account @@ -322,13 +344,13 @@ Use this endpoint if your integration requires it, such as Adyen for Platforms M To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Accounts read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return AccountMerchantLevelApiRequestToActivateMerchantAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return AccountMerchantLevelApiRequestToActivateMerchantAccountConfig */ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccountConfig(ctx context.Context, merchantId string) AccountMerchantLevelApiRequestToActivateMerchantAccountConfig { return AccountMerchantLevelApiRequestToActivateMerchantAccountConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -342,57 +364,64 @@ Sends a request to activate the merchant account identified in the path. You ge */ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(r AccountMerchantLevelApiRequestToActivateMerchantAccountConfig) (RequestActivationResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &RequestActivationResponse{} + var serviceError common.RestServiceError + res := &RequestActivationResponse{} path := "/merchants/{merchantId}/activate" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_account_store_level.go b/src/management/api_account_store_level.go index a10acad39..5d6e22ccb 100644 --- a/src/management/api_account_store_level.go +++ b/src/management/api_account_store_level.go @@ -10,20 +10,17 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AccountStoreLevelApi AccountStoreLevelApi service type AccountStoreLevelApi common.Service type AccountStoreLevelApiCreateStoreConfig struct { - ctx context.Context + ctx context.Context storeCreationWithMerchantCodeRequest *StoreCreationWithMerchantCodeRequest } @@ -32,6 +29,7 @@ func (r AccountStoreLevelApiCreateStoreConfig) StoreCreationWithMerchantCodeRequ return r } + /* CreateStore Create a store @@ -40,8 +38,8 @@ Creates a store for the merchant account specified in the request. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AccountStoreLevelApiCreateStoreConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return AccountStoreLevelApiCreateStoreConfig */ func (a *AccountStoreLevelApi) CreateStoreConfig(ctx context.Context) AccountStoreLevelApiCreateStoreConfig { return AccountStoreLevelApiCreateStoreConfig{ @@ -52,69 +50,76 @@ func (a *AccountStoreLevelApi) CreateStoreConfig(ctx context.Context) AccountSto /* Create a store Creates a store for the merchant account specified in the request. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write - * @param req StoreCreationWithMerchantCodeRequest - reference of StoreCreationWithMerchantCodeRequest). + * @param req StoreCreationWithMerchantCodeRequest - reference of StoreCreationWithMerchantCodeRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Store */ func (a *AccountStoreLevelApi) CreateStore(r AccountStoreLevelApiCreateStoreConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/stores" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storeCreationWithMerchantCodeRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storeCreationWithMerchantCodeRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiCreateStoreByMerchantIdConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string storeCreationRequest *StoreCreationRequest } @@ -123,6 +128,7 @@ func (r AccountStoreLevelApiCreateStoreByMerchantIdConfig) StoreCreationRequest( return r } + /* CreateStoreByMerchantId Create a store @@ -131,13 +137,13 @@ Creates a store for the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return AccountStoreLevelApiCreateStoreByMerchantIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return AccountStoreLevelApiCreateStoreByMerchantIdConfig */ func (a *AccountStoreLevelApi) CreateStoreByMerchantIdConfig(ctx context.Context, merchantId string) AccountStoreLevelApiCreateStoreByMerchantIdConfig { return AccountStoreLevelApiCreateStoreByMerchantIdConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -146,73 +152,81 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantIdConfig(ctx context.Context Create a store Creates a store for the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write * @param merchantId The unique identifier of the merchant account. - * @param req StoreCreationRequest - reference of StoreCreationRequest). + * @param req StoreCreationRequest - reference of StoreCreationRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Store */ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(r AccountStoreLevelApiCreateStoreByMerchantIdConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/merchants/{merchantId}/stores" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storeCreationRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storeCreationRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiGetStoreConfig struct { - ctx context.Context + ctx context.Context merchantId string - storeId string + storeId string } + /* GetStore Get a store @@ -222,16 +236,16 @@ To make this request, your API credential must have one of the following [roles] * Management API—Stores read * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param storeId The unique identifier of the store. - @return AccountStoreLevelApiGetStoreConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param storeId The unique identifier of the store. + @return AccountStoreLevelApiGetStoreConfig */ func (a *AccountStoreLevelApi) GetStoreConfig(ctx context.Context, merchantId string, storeId string) AccountStoreLevelApiGetStoreConfig { return AccountStoreLevelApiGetStoreConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - storeId: storeId, + storeId: storeId, } } @@ -245,67 +259,75 @@ Returns the details of the store identified in the path. To make this request, */ func (a *AccountStoreLevelApi) GetStore(r AccountStoreLevelApiGetStoreConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/merchants/{merchantId}/stores/{storeId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiGetStoreByIdConfig struct { - ctx context.Context + ctx context.Context storeId string } + /* GetStoreById Get a store @@ -315,13 +337,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Stores read * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return AccountStoreLevelApiGetStoreByIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return AccountStoreLevelApiGetStoreByIdConfig */ func (a *AccountStoreLevelApi) GetStoreByIdConfig(ctx context.Context, storeId string) AccountStoreLevelApiGetStoreByIdConfig { return AccountStoreLevelApiGetStoreByIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -335,66 +357,73 @@ Returns the details of the store identified in the path. To make this request, */ func (a *AccountStoreLevelApi) GetStoreById(r AccountStoreLevelApiGetStoreByIdConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/stores/{storeId}" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiListStoresConfig struct { - ctx context.Context + ctx context.Context pageNumber *int32 - pageSize *int32 - reference *string + pageSize *int32 + reference *string merchantId *string } @@ -422,6 +451,7 @@ func (r AccountStoreLevelApiListStoresConfig) MerchantId(merchantId string) Acco return r } + /* ListStores Get a list of stores @@ -431,8 +461,8 @@ To make this request, your API credential must have one of the following [roles] * Management API—Stores read * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return AccountStoreLevelApiListStoresConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return AccountStoreLevelApiListStoresConfig */ func (a *AccountStoreLevelApi) ListStoresConfig(ctx context.Context) AccountStoreLevelApiListStoresConfig { return AccountStoreLevelApiListStoresConfig{ @@ -448,78 +478,85 @@ Returns a list of stores. The list is grouped into pages as defined by the query */ func (a *AccountStoreLevelApi) ListStores(r AccountStoreLevelApiListStoresConfig) (ListStoresResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListStoresResponse{} + var serviceError common.RestServiceError + res := &ListStoresResponse{} path := "/stores" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.reference != nil { - common.ParameterAddToQuery(queryParams, "reference", r.reference, "") - } - if r.merchantId != nil { - common.ParameterAddToQuery(queryParams, "merchantId", r.merchantId, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.reference != nil { + common.ParameterAddToQuery(queryParams, "reference", r.reference, "") + } + if r.merchantId != nil { + common.ParameterAddToQuery(queryParams, "merchantId", r.merchantId, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiListStoresByMerchantIdConfig struct { - ctx context.Context + ctx context.Context merchantId string pageNumber *int32 - pageSize *int32 - reference *string + pageSize *int32 + reference *string } // The number of the page to fetch. @@ -540,6 +577,7 @@ func (r AccountStoreLevelApiListStoresByMerchantIdConfig) Reference(reference st return r } + /* ListStoresByMerchantId Get a list of stores @@ -549,13 +587,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Stores read * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return AccountStoreLevelApiListStoresByMerchantIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return AccountStoreLevelApiListStoresByMerchantIdConfig */ func (a *AccountStoreLevelApi) ListStoresByMerchantIdConfig(ctx context.Context, merchantId string) AccountStoreLevelApiListStoresByMerchantIdConfig { return AccountStoreLevelApiListStoresByMerchantIdConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -569,74 +607,81 @@ Returns a list of stores for the merchant account identified in the path. The li */ func (a *AccountStoreLevelApi) ListStoresByMerchantId(r AccountStoreLevelApiListStoresByMerchantIdConfig) (ListStoresResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListStoresResponse{} + var serviceError common.RestServiceError + res := &ListStoresResponse{} path := "/merchants/{merchantId}/stores" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.reference != nil { - common.ParameterAddToQuery(queryParams, "reference", r.reference, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.reference != nil { + common.ParameterAddToQuery(queryParams, "reference", r.reference, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiUpdateStoreConfig struct { - ctx context.Context - merchantId string - storeId string + ctx context.Context + merchantId string + storeId string updateStoreRequest *UpdateStoreRequest } @@ -645,6 +690,7 @@ func (r AccountStoreLevelApiUpdateStoreConfig) UpdateStoreRequest(updateStoreReq return r } + /* UpdateStore Update a store @@ -653,16 +699,16 @@ Updates the store identified in the path. You can only update some store paramet To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param storeId The unique identifier of the store. - @return AccountStoreLevelApiUpdateStoreConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param storeId The unique identifier of the store. + @return AccountStoreLevelApiUpdateStoreConfig */ func (a *AccountStoreLevelApi) UpdateStoreConfig(ctx context.Context, merchantId string, storeId string) AccountStoreLevelApiUpdateStoreConfig { return AccountStoreLevelApiUpdateStoreConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - storeId: storeId, + storeId: storeId, } } @@ -671,71 +717,78 @@ Update a store Updates the store identified in the path. You can only update some store parameters. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write * @param merchantId The unique identifier of the merchant account. * @param storeId The unique identifier of the store. - * @param req UpdateStoreRequest - reference of UpdateStoreRequest). + * @param req UpdateStoreRequest - reference of UpdateStoreRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Store */ func (a *AccountStoreLevelApi) UpdateStore(r AccountStoreLevelApiUpdateStoreConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/merchants/{merchantId}/stores/{storeId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateStoreRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateStoreRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AccountStoreLevelApiUpdateStoreByIdConfig struct { - ctx context.Context - storeId string + ctx context.Context + storeId string updateStoreRequest *UpdateStoreRequest } @@ -744,6 +797,7 @@ func (r AccountStoreLevelApiUpdateStoreByIdConfig) UpdateStoreRequest(updateStor return r } + /* UpdateStoreById Update a store @@ -753,13 +807,13 @@ You can only update some store parameters. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return AccountStoreLevelApiUpdateStoreByIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return AccountStoreLevelApiUpdateStoreByIdConfig */ func (a *AccountStoreLevelApi) UpdateStoreByIdConfig(ctx context.Context, storeId string) AccountStoreLevelApiUpdateStoreByIdConfig { return AccountStoreLevelApiUpdateStoreByIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -768,63 +822,70 @@ func (a *AccountStoreLevelApi) UpdateStoreByIdConfig(ctx context.Context, storeI Update a store Updates the store identified in the path. You can only update some store parameters. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Stores read and write * @param storeId The unique identifier of the store. - * @param req UpdateStoreRequest - reference of UpdateStoreRequest). + * @param req UpdateStoreRequest - reference of UpdateStoreRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Store */ func (a *AccountStoreLevelApi) UpdateStoreById(r AccountStoreLevelApiUpdateStoreByIdConfig) (Store, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Store{} + var serviceError common.RestServiceError + res := &Store{} path := "/stores/{storeId}" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateStoreRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateStoreRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_allowed_origins_company_level.go b/src/management/api_allowed_origins_company_level.go index 94a5157f7..b2435bd65 100644 --- a/src/management/api_allowed_origins_company_level.go +++ b/src/management/api_allowed_origins_company_level.go @@ -10,23 +10,20 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AllowedOriginsCompanyLevelApi AllowedOriginsCompanyLevelApi service type AllowedOriginsCompanyLevelApi common.Service type AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string - allowedOrigin *AllowedOrigin + allowedOrigin *AllowedOrigin } func (r AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig) AllowedOrigin(allowedOrigin AllowedOrigin) AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig { @@ -34,6 +31,7 @@ func (r AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig) AllowedOrigin(al return r } + /* CreateAllowedOrigin Create an allowed origin @@ -42,15 +40,15 @@ Adds a new [allowed origin](https://docs.adyen.com/development-resources/client- To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig */ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOriginConfig(ctx context.Context, companyId string, apiCredentialId string) AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig { return AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -60,75 +58,83 @@ Create an allowed origin Adds a new [allowed origin](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) to the API credential's list of allowed origins. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param companyId The unique identifier of the company account. * @param apiCredentialId Unique identifier of the API credential. - * @param req AllowedOrigin - reference of AllowedOrigin). + * @param req AllowedOrigin - reference of AllowedOrigin). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AllowedOriginsResponse */ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(r AllowedOriginsCompanyLevelApiCreateAllowedOriginConfig) (AllowedOriginsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOriginsResponse{} + var serviceError common.RestServiceError + res := &AllowedOriginsResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.allowedOrigin, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.allowedOrigin, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string - originId string + originId string } + /* DeleteAllowedOrigin Delete an allowed origin @@ -137,18 +143,18 @@ Removes the [allowed origin](https://docs.adyen.com/development-resources/client To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @param originId Unique identifier of the allowed origin. - @return AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @param originId Unique identifier of the allowed origin. + @return AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig */ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOriginConfig(ctx context.Context, companyId string, apiCredentialId string, originId string) AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig { return AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -162,70 +168,77 @@ Removes the [allowed origin](https://docs.adyen.com/development-resources/client */ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(r AllowedOriginsCompanyLevelApiDeleteAllowedOriginConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type AllowedOriginsCompanyLevelApiGetAllowedOriginConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string - originId string + originId string } + /* GetAllowedOrigin Get an allowed origin @@ -234,18 +247,18 @@ Returns the [allowed origin](https://docs.adyen.com/development-resources/client To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @param originId Unique identifier of the allowed origin. - @return AllowedOriginsCompanyLevelApiGetAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @param originId Unique identifier of the allowed origin. + @return AllowedOriginsCompanyLevelApiGetAllowedOriginConfig */ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOriginConfig(ctx context.Context, companyId string, apiCredentialId string, originId string) AllowedOriginsCompanyLevelApiGetAllowedOriginConfig { return AllowedOriginsCompanyLevelApiGetAllowedOriginConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -260,69 +273,77 @@ Returns the [allowed origin](https://docs.adyen.com/development-resources/client */ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(r AllowedOriginsCompanyLevelApiGetAllowedOriginConfig) (AllowedOrigin, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOrigin{} + var serviceError common.RestServiceError + res := &AllowedOrigin{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AllowedOriginsCompanyLevelApiListAllowedOriginsConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string } + /* ListAllowedOrigins Get a list of allowed origins @@ -331,15 +352,15 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return AllowedOriginsCompanyLevelApiListAllowedOriginsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return AllowedOriginsCompanyLevelApiListAllowedOriginsConfig */ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOriginsConfig(ctx context.Context, companyId string, apiCredentialId string) AllowedOriginsCompanyLevelApiListAllowedOriginsConfig { return AllowedOriginsCompanyLevelApiListAllowedOriginsConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -354,58 +375,65 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc */ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(r AllowedOriginsCompanyLevelApiListAllowedOriginsConfig) (AllowedOriginsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOriginsResponse{} + var serviceError common.RestServiceError + res := &AllowedOriginsResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_allowed_origins_merchant_level.go b/src/management/api_allowed_origins_merchant_level.go index df36ef235..9b8453b1c 100644 --- a/src/management/api_allowed_origins_merchant_level.go +++ b/src/management/api_allowed_origins_merchant_level.go @@ -10,23 +10,20 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // AllowedOriginsMerchantLevelApi AllowedOriginsMerchantLevelApi service type AllowedOriginsMerchantLevelApi common.Service type AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string - allowedOrigin *AllowedOrigin + allowedOrigin *AllowedOrigin } func (r AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig) AllowedOrigin(allowedOrigin AllowedOrigin) AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig { @@ -34,6 +31,7 @@ func (r AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig) AllowedOrigin(a return r } + /* CreateAllowedOrigin Create an allowed origin @@ -42,15 +40,15 @@ Adds a new [allowed origin](https://docs.adyen.com/development-resources/client- To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig */ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOriginConfig(ctx context.Context, merchantId string, apiCredentialId string) AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig { return AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -60,75 +58,83 @@ Create an allowed origin Adds a new [allowed origin](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) to the API credential's list of allowed origins. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param merchantId The unique identifier of the merchant account. * @param apiCredentialId Unique identifier of the API credential. - * @param req AllowedOrigin - reference of AllowedOrigin). + * @param req AllowedOrigin - reference of AllowedOrigin). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AllowedOriginsResponse */ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(r AllowedOriginsMerchantLevelApiCreateAllowedOriginConfig) (AllowedOriginsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOriginsResponse{} + var serviceError common.RestServiceError + res := &AllowedOriginsResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.allowedOrigin, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.allowedOrigin, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string - originId string + originId string } + /* DeleteAllowedOrigin Delete an allowed origin @@ -137,18 +143,18 @@ Removes the [allowed origin](https://docs.adyen.com/development-resources/client To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @param originId Unique identifier of the allowed origin. - @return AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @param originId Unique identifier of the allowed origin. + @return AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig */ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOriginConfig(ctx context.Context, merchantId string, apiCredentialId string, originId string) AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig { return AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -162,70 +168,77 @@ Removes the [allowed origin](https://docs.adyen.com/development-resources/client */ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(r AllowedOriginsMerchantLevelApiDeleteAllowedOriginConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type AllowedOriginsMerchantLevelApiGetAllowedOriginConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string - originId string + originId string } + /* GetAllowedOrigin Get an allowed origin @@ -234,18 +247,18 @@ Returns the [allowed origin](https://docs.adyen.com/development-resources/client To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @param originId Unique identifier of the allowed origin. - @return AllowedOriginsMerchantLevelApiGetAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @param originId Unique identifier of the allowed origin. + @return AllowedOriginsMerchantLevelApiGetAllowedOriginConfig */ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOriginConfig(ctx context.Context, merchantId string, apiCredentialId string, originId string) AllowedOriginsMerchantLevelApiGetAllowedOriginConfig { return AllowedOriginsMerchantLevelApiGetAllowedOriginConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -260,69 +273,77 @@ Returns the [allowed origin](https://docs.adyen.com/development-resources/client */ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(r AllowedOriginsMerchantLevelApiGetAllowedOriginConfig) (AllowedOrigin, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOrigin{} + var serviceError common.RestServiceError + res := &AllowedOrigin{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type AllowedOriginsMerchantLevelApiListAllowedOriginsConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string } + /* ListAllowedOrigins Get a list of allowed origins @@ -331,15 +352,15 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return AllowedOriginsMerchantLevelApiListAllowedOriginsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return AllowedOriginsMerchantLevelApiListAllowedOriginsConfig */ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOriginsConfig(ctx context.Context, merchantId string, apiCredentialId string) AllowedOriginsMerchantLevelApiListAllowedOriginsConfig { return AllowedOriginsMerchantLevelApiListAllowedOriginsConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -354,58 +375,65 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc */ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(r AllowedOriginsMerchantLevelApiListAllowedOriginsConfig) (AllowedOriginsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOriginsResponse{} + var serviceError common.RestServiceError + res := &AllowedOriginsResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_api_credentials_company_level.go b/src/management/api_api_credentials_company_level.go index 0b2e161d9..b7f652b02 100644 --- a/src/management/api_api_credentials_company_level.go +++ b/src/management/api_api_credentials_company_level.go @@ -10,21 +10,18 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // APICredentialsCompanyLevelApi APICredentialsCompanyLevelApi service type APICredentialsCompanyLevelApi common.Service type APICredentialsCompanyLevelApiCreateApiCredentialConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string createCompanyApiCredentialRequest *CreateCompanyApiCredentialRequest } @@ -33,6 +30,7 @@ func (r APICredentialsCompanyLevelApiCreateApiCredentialConfig) CreateCompanyApi return r } + /* CreateApiCredential Create an API credential. @@ -50,13 +48,13 @@ If your API key is lost or compromised, you need to [generate a new API key](htt To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return APICredentialsCompanyLevelApiCreateApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return APICredentialsCompanyLevelApiCreateApiCredentialConfig */ func (a *APICredentialsCompanyLevelApi) CreateApiCredentialConfig(ctx context.Context, companyId string) APICredentialsCompanyLevelApiCreateApiCredentialConfig { return APICredentialsCompanyLevelApiCreateApiCredentialConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -65,73 +63,81 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredentialConfig(ctx context.Co Create an API credential. Creates an [API credential](https://docs.adyen.com/development-resources/api-credentials) for the company account identified in the path. In the request, you can specify which merchant accounts the new API credential will have access to, as well as its roles and allowed origins. The response includes several types of authentication details: * [API key](https://docs.adyen.com/development-resources/api-authentication#api-key-authentication): used for API request authentication. * [Client key](https://docs.adyen.com/development-resources/client-side-authentication#how-it-works): public key used for client-side authentication. * [Username and password](https://docs.adyen.com/development-resources/api-authentication#using-basic-authentication): used for basic authentication. > Make sure you store the API key securely in your system. You won't be able to retrieve it later. If your API key is lost or compromised, you need to [generate a new API key](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey). To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param companyId The unique identifier of the company account. - * @param req CreateCompanyApiCredentialRequest - reference of CreateCompanyApiCredentialRequest). + * @param req CreateCompanyApiCredentialRequest - reference of CreateCompanyApiCredentialRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateCompanyApiCredentialResponse */ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(r APICredentialsCompanyLevelApiCreateApiCredentialConfig) (CreateCompanyApiCredentialResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CreateCompanyApiCredentialResponse{} + var serviceError common.RestServiceError + res := &CreateCompanyApiCredentialResponse{} path := "/companies/{companyId}/apiCredentials" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createCompanyApiCredentialRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createCompanyApiCredentialRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsCompanyLevelApiGetApiCredentialConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string } + /* GetApiCredential Get an API credential @@ -140,15 +146,15 @@ Returns the [API credential](https://docs.adyen.com/development-resources/api-cr To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return APICredentialsCompanyLevelApiGetApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return APICredentialsCompanyLevelApiGetApiCredentialConfig */ func (a *APICredentialsCompanyLevelApi) GetApiCredentialConfig(ctx context.Context, companyId string, apiCredentialId string) APICredentialsCompanyLevelApiGetApiCredentialConfig { return APICredentialsCompanyLevelApiGetApiCredentialConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -163,67 +169,74 @@ Returns the [API credential](https://docs.adyen.com/development-resources/api-cr */ func (a *APICredentialsCompanyLevelApi) GetApiCredential(r APICredentialsCompanyLevelApiGetApiCredentialConfig) (CompanyApiCredential, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CompanyApiCredential{} + var serviceError common.RestServiceError + res := &CompanyApiCredential{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsCompanyLevelApiListApiCredentialsConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -238,6 +251,7 @@ func (r APICredentialsCompanyLevelApiListApiCredentialsConfig) PageSize(pageSize return r } + /* ListApiCredentials Get a list of API credentials @@ -246,13 +260,13 @@ Returns the list of [API credentials](https://docs.adyen.com/development-resourc To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return APICredentialsCompanyLevelApiListApiCredentialsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return APICredentialsCompanyLevelApiListApiCredentialsConfig */ func (a *APICredentialsCompanyLevelApi) ListApiCredentialsConfig(ctx context.Context, companyId string) APICredentialsCompanyLevelApiListApiCredentialsConfig { return APICredentialsCompanyLevelApiListApiCredentialsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -266,71 +280,78 @@ Returns the list of [API credentials](https://docs.adyen.com/development-resourc */ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(r APICredentialsCompanyLevelApiListApiCredentialsConfig) (ListCompanyApiCredentialsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListCompanyApiCredentialsResponse{} + var serviceError common.RestServiceError + res := &ListCompanyApiCredentialsResponse{} path := "/companies/{companyId}/apiCredentials" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsCompanyLevelApiUpdateApiCredentialConfig struct { - ctx context.Context - companyId string - apiCredentialId string + ctx context.Context + companyId string + apiCredentialId string updateCompanyApiCredentialRequest *UpdateCompanyApiCredentialRequest } @@ -339,23 +360,24 @@ func (r APICredentialsCompanyLevelApiUpdateApiCredentialConfig) UpdateCompanyApi return r } + /* UpdateApiCredential Update an API credential. -Changes the API credential's roles, merchant account access, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. +Changes the API credential's roles, merchant account access, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return APICredentialsCompanyLevelApiUpdateApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return APICredentialsCompanyLevelApiUpdateApiCredentialConfig */ func (a *APICredentialsCompanyLevelApi) UpdateApiCredentialConfig(ctx context.Context, companyId string, apiCredentialId string) APICredentialsCompanyLevelApiUpdateApiCredentialConfig { return APICredentialsCompanyLevelApiUpdateApiCredentialConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -365,64 +387,71 @@ Update an API credential. Changes the API credential's roles, merchant account access, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param companyId The unique identifier of the company account. * @param apiCredentialId Unique identifier of the API credential. - * @param req UpdateCompanyApiCredentialRequest - reference of UpdateCompanyApiCredentialRequest). + * @param req UpdateCompanyApiCredentialRequest - reference of UpdateCompanyApiCredentialRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CompanyApiCredential */ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(r APICredentialsCompanyLevelApiUpdateApiCredentialConfig) (CompanyApiCredential, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CompanyApiCredential{} + var serviceError common.RestServiceError + res := &CompanyApiCredential{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateCompanyApiCredentialRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateCompanyApiCredentialRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_api_credentials_merchant_level.go b/src/management/api_api_credentials_merchant_level.go index 82434a44e..0ae15bd24 100644 --- a/src/management/api_api_credentials_merchant_level.go +++ b/src/management/api_api_credentials_merchant_level.go @@ -10,21 +10,18 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // APICredentialsMerchantLevelApi APICredentialsMerchantLevelApi service type APICredentialsMerchantLevelApi common.Service type APICredentialsMerchantLevelApiCreateApiCredentialConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string createMerchantApiCredentialRequest *CreateMerchantApiCredentialRequest } @@ -33,6 +30,7 @@ func (r APICredentialsMerchantLevelApiCreateApiCredentialConfig) CreateMerchantA return r } + /* CreateApiCredential Create an API credential @@ -50,13 +48,13 @@ If your API key is lost or compromised, you need to [generate a new API key](htt To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return APICredentialsMerchantLevelApiCreateApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return APICredentialsMerchantLevelApiCreateApiCredentialConfig */ func (a *APICredentialsMerchantLevelApi) CreateApiCredentialConfig(ctx context.Context, merchantId string) APICredentialsMerchantLevelApiCreateApiCredentialConfig { return APICredentialsMerchantLevelApiCreateApiCredentialConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -65,73 +63,81 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredentialConfig(ctx context.C Create an API credential Creates an [API credential](https://docs.adyen.com/development-resources/api-credentials) for the company account identified in the path. In the request, you can specify the roles and allowed origins for the new API credential. The response includes the: * [API key](https://docs.adyen.com/development-resources/api-authentication#api-key-authentication): used for API request authentication. * [Client key](https://docs.adyen.com/development-resources/client-side-authentication#how-it-works): public key used for client-side authentication. * [Username and password](https://docs.adyen.com/development-resources/api-authentication#using-basic-authentication): used for basic authentication. > Make sure you store the API key securely in your system. You won't be able to retrieve it later. If your API key is lost or compromised, you need to [generate a new API key](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey). To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param merchantId The unique identifier of the merchant account. - * @param req CreateMerchantApiCredentialRequest - reference of CreateMerchantApiCredentialRequest). + * @param req CreateMerchantApiCredentialRequest - reference of CreateMerchantApiCredentialRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateApiCredentialResponse */ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(r APICredentialsMerchantLevelApiCreateApiCredentialConfig) (CreateApiCredentialResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CreateApiCredentialResponse{} + var serviceError common.RestServiceError + res := &CreateApiCredentialResponse{} path := "/merchants/{merchantId}/apiCredentials" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createMerchantApiCredentialRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createMerchantApiCredentialRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsMerchantLevelApiGetApiCredentialConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string } + /* GetApiCredential Get an API credential @@ -140,15 +146,15 @@ Returns the [API credential](https://docs.adyen.com/development-resources/api-cr To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return APICredentialsMerchantLevelApiGetApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return APICredentialsMerchantLevelApiGetApiCredentialConfig */ func (a *APICredentialsMerchantLevelApi) GetApiCredentialConfig(ctx context.Context, merchantId string, apiCredentialId string) APICredentialsMerchantLevelApiGetApiCredentialConfig { return APICredentialsMerchantLevelApiGetApiCredentialConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -163,67 +169,74 @@ Returns the [API credential](https://docs.adyen.com/development-resources/api-cr */ func (a *APICredentialsMerchantLevelApi) GetApiCredential(r APICredentialsMerchantLevelApiGetApiCredentialConfig) (ApiCredential, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ApiCredential{} + var serviceError common.RestServiceError + res := &ApiCredential{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsMerchantLevelApiListApiCredentialsConfig struct { - ctx context.Context + ctx context.Context merchantId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -238,6 +251,7 @@ func (r APICredentialsMerchantLevelApiListApiCredentialsConfig) PageSize(pageSiz return r } + /* ListApiCredentials Get a list of API credentials @@ -246,13 +260,13 @@ Returns the list of [API credentials](https://docs.adyen.com/development-resourc To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return APICredentialsMerchantLevelApiListApiCredentialsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return APICredentialsMerchantLevelApiListApiCredentialsConfig */ func (a *APICredentialsMerchantLevelApi) ListApiCredentialsConfig(ctx context.Context, merchantId string) APICredentialsMerchantLevelApiListApiCredentialsConfig { return APICredentialsMerchantLevelApiListApiCredentialsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -266,71 +280,78 @@ Returns the list of [API credentials](https://docs.adyen.com/development-resourc */ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(r APICredentialsMerchantLevelApiListApiCredentialsConfig) (ListMerchantApiCredentialsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListMerchantApiCredentialsResponse{} + var serviceError common.RestServiceError + res := &ListMerchantApiCredentialsResponse{} path := "/merchants/{merchantId}/apiCredentials" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type APICredentialsMerchantLevelApiUpdateApiCredentialConfig struct { - ctx context.Context - merchantId string - apiCredentialId string + ctx context.Context + merchantId string + apiCredentialId string updateMerchantApiCredentialRequest *UpdateMerchantApiCredentialRequest } @@ -339,23 +360,24 @@ func (r APICredentialsMerchantLevelApiUpdateApiCredentialConfig) UpdateMerchantA return r } + /* UpdateApiCredential Update an API credential -Changes the API credential's roles, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. +Changes the API credential's roles, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return APICredentialsMerchantLevelApiUpdateApiCredentialConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return APICredentialsMerchantLevelApiUpdateApiCredentialConfig */ func (a *APICredentialsMerchantLevelApi) UpdateApiCredentialConfig(ctx context.Context, merchantId string, apiCredentialId string) APICredentialsMerchantLevelApiUpdateApiCredentialConfig { return APICredentialsMerchantLevelApiUpdateApiCredentialConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -365,64 +387,71 @@ Update an API credential Changes the API credential's roles, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write * @param merchantId The unique identifier of the merchant account. * @param apiCredentialId Unique identifier of the API credential. - * @param req UpdateMerchantApiCredentialRequest - reference of UpdateMerchantApiCredentialRequest). + * @param req UpdateMerchantApiCredentialRequest - reference of UpdateMerchantApiCredentialRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCredential */ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(r APICredentialsMerchantLevelApiUpdateApiCredentialConfig) (ApiCredential, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ApiCredential{} + var serviceError common.RestServiceError + res := &ApiCredential{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateMerchantApiCredentialRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateMerchantApiCredentialRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_api_key_company_level.go b/src/management/api_api_key_company_level.go index eb168d13e..721057659 100644 --- a/src/management/api_api_key_company_level.go +++ b/src/management/api_api_key_company_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // APIKeyCompanyLevelApi APIKeyCompanyLevelApi service type APIKeyCompanyLevelApi common.Service type APIKeyCompanyLevelApiGenerateNewApiKeyConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string } + /* GenerateNewApiKey Generate new API key @@ -36,15 +34,15 @@ Returns a new API key for the API credential. You can use the new API key a few To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return APIKeyCompanyLevelApiGenerateNewApiKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return APIKeyCompanyLevelApiGenerateNewApiKeyConfig */ func (a *APIKeyCompanyLevelApi) GenerateNewApiKeyConfig(ctx context.Context, companyId string, apiCredentialId string) APIKeyCompanyLevelApiGenerateNewApiKeyConfig { return APIKeyCompanyLevelApiGenerateNewApiKeyConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -59,58 +57,65 @@ Returns a new API key for the API credential. You can use the new API key a few */ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(r APIKeyCompanyLevelApiGenerateNewApiKeyConfig) (GenerateApiKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateApiKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateApiKeyResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_api_key_merchant_level.go b/src/management/api_api_key_merchant_level.go index 82476f0d7..97aad7fc7 100644 --- a/src/management/api_api_key_merchant_level.go +++ b/src/management/api_api_key_merchant_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // APIKeyMerchantLevelApi APIKeyMerchantLevelApi service type APIKeyMerchantLevelApi common.Service type APIKeyMerchantLevelApiGenerateNewApiKeyConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string } + /* GenerateNewApiKey Generate new API key @@ -36,15 +34,15 @@ Returns a new API key for the API credential. You can use the new API key a few To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return APIKeyMerchantLevelApiGenerateNewApiKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return APIKeyMerchantLevelApiGenerateNewApiKeyConfig */ func (a *APIKeyMerchantLevelApi) GenerateNewApiKeyConfig(ctx context.Context, merchantId string, apiCredentialId string) APIKeyMerchantLevelApiGenerateNewApiKeyConfig { return APIKeyMerchantLevelApiGenerateNewApiKeyConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -59,58 +57,65 @@ Returns a new API key for the API credential. You can use the new API key a few */ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(r APIKeyMerchantLevelApiGenerateNewApiKeyConfig) (GenerateApiKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateApiKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateApiKeyResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_client_key_company_level.go b/src/management/api_client_key_company_level.go index 128e750f7..f23a679ec 100644 --- a/src/management/api_client_key_company_level.go +++ b/src/management/api_client_key_company_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ClientKeyCompanyLevelApi ClientKeyCompanyLevelApi service type ClientKeyCompanyLevelApi common.Service type ClientKeyCompanyLevelApiGenerateNewClientKeyConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string apiCredentialId string } + /* GenerateNewClientKey Generate new client key @@ -36,15 +34,15 @@ Returns a new [client key](https://docs.adyen.com/development-resources/client-s To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param apiCredentialId Unique identifier of the API credential. - @return ClientKeyCompanyLevelApiGenerateNewClientKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param apiCredentialId Unique identifier of the API credential. + @return ClientKeyCompanyLevelApiGenerateNewClientKeyConfig */ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKeyConfig(ctx context.Context, companyId string, apiCredentialId string) ClientKeyCompanyLevelApiGenerateNewClientKeyConfig { return ClientKeyCompanyLevelApiGenerateNewClientKeyConfig{ - ctx: ctx, - companyId: companyId, + ctx: ctx, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -59,58 +57,65 @@ Returns a new [client key](https://docs.adyen.com/development-resources/client-s */ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(r ClientKeyCompanyLevelApiGenerateNewClientKeyConfig) (GenerateClientKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateClientKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateClientKeyResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_client_key_merchant_level.go b/src/management/api_client_key_merchant_level.go index f15253e60..d2185589e 100644 --- a/src/management/api_client_key_merchant_level.go +++ b/src/management/api_client_key_merchant_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ClientKeyMerchantLevelApi ClientKeyMerchantLevelApi service type ClientKeyMerchantLevelApi common.Service type ClientKeyMerchantLevelApiGenerateNewClientKeyConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string apiCredentialId string } + /* GenerateNewClientKey Generate new client key @@ -36,15 +34,15 @@ Returns a new [client key](https://docs.adyen.com/development-resources/client-s To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param apiCredentialId Unique identifier of the API credential. - @return ClientKeyMerchantLevelApiGenerateNewClientKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param apiCredentialId Unique identifier of the API credential. + @return ClientKeyMerchantLevelApiGenerateNewClientKeyConfig */ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKeyConfig(ctx context.Context, merchantId string, apiCredentialId string) ClientKeyMerchantLevelApiGenerateNewClientKeyConfig { return ClientKeyMerchantLevelApiGenerateNewClientKeyConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -59,58 +57,65 @@ Returns a new [client key](https://docs.adyen.com/development-resources/client-s */ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(r ClientKeyMerchantLevelApiGenerateNewClientKeyConfig) (GenerateClientKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateClientKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateClientKeyResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_my_api_credential.go b/src/management/api_my_api_credential.go index 911acd75d..821d5bcf0 100644 --- a/src/management/api_my_api_credential.go +++ b/src/management/api_my_api_credential.go @@ -10,20 +10,17 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // MyAPICredentialApi MyAPICredentialApi service type MyAPICredentialApi common.Service type MyAPICredentialApiAddAllowedOriginConfig struct { - ctx context.Context + ctx context.Context createAllowedOriginRequest *CreateAllowedOriginRequest } @@ -32,6 +29,7 @@ func (r MyAPICredentialApiAddAllowedOriginConfig) CreateAllowedOriginRequest(cre return r } + /* AddAllowedOrigin Add allowed origin @@ -40,8 +38,8 @@ The API key from the request is used to identify the [API credential](https://do You can make this request with any of the Management API roles. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MyAPICredentialApiAddAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return MyAPICredentialApiAddAllowedOriginConfig */ func (a *MyAPICredentialApi) AddAllowedOriginConfig(ctx context.Context) MyAPICredentialApiAddAllowedOriginConfig { return MyAPICredentialApiAddAllowedOriginConfig{ @@ -52,71 +50,79 @@ func (a *MyAPICredentialApi) AddAllowedOriginConfig(ctx context.Context) MyAPICr /* Add allowed origin Adds an allowed origin to the list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) of your API credential. The API key from the request is used to identify the [API credential](https://docs.adyen.com/development-resources/api-credentials). You can make this request with any of the Management API roles. - * @param req CreateAllowedOriginRequest - reference of CreateAllowedOriginRequest). + * @param req CreateAllowedOriginRequest - reference of CreateAllowedOriginRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AllowedOrigin */ func (a *MyAPICredentialApi) AddAllowedOrigin(r MyAPICredentialApiAddAllowedOriginConfig) (AllowedOrigin, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOrigin{} + var serviceError common.RestServiceError + res := &AllowedOrigin{} path := "/me/allowedOrigins" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createAllowedOriginRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createAllowedOriginRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type MyAPICredentialApiGetAllowedOriginDetailsConfig struct { - ctx context.Context + ctx context.Context originId string } + /* GetAllowedOriginDetails Get allowed origin details @@ -125,13 +131,13 @@ The API key from the request is used to identify the [API credential](https://do You can make this request with any of the Management API roles. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param originId Unique identifier of the allowed origin. - @return MyAPICredentialApiGetAllowedOriginDetailsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param originId Unique identifier of the allowed origin. + @return MyAPICredentialApiGetAllowedOriginDetailsConfig */ func (a *MyAPICredentialApi) GetAllowedOriginDetailsConfig(ctx context.Context, originId string) MyAPICredentialApiGetAllowedOriginDetailsConfig { return MyAPICredentialApiGetAllowedOriginDetailsConfig{ - ctx: ctx, + ctx: ctx, originId: originId, } } @@ -145,65 +151,73 @@ Returns the details of the [allowed origin](https://docs.adyen.com/development-r */ func (a *MyAPICredentialApi) GetAllowedOriginDetails(r MyAPICredentialApiGetAllowedOriginDetailsConfig) (AllowedOrigin, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOrigin{} + var serviceError common.RestServiceError + res := &AllowedOrigin{} path := "/me/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type MyAPICredentialApiGetAllowedOriginsConfig struct { ctx context.Context } + /* GetAllowedOrigins Get allowed origins @@ -211,8 +225,8 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc You can make this request with any of the Management API roles. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MyAPICredentialApiGetAllowedOriginsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return MyAPICredentialApiGetAllowedOriginsConfig */ func (a *MyAPICredentialApi) GetAllowedOriginsConfig(ctx context.Context) MyAPICredentialApiGetAllowedOriginsConfig { return MyAPICredentialApiGetAllowedOriginsConfig{ @@ -228,64 +242,72 @@ Returns the list of [allowed origins](https://docs.adyen.com/development-resourc */ func (a *MyAPICredentialApi) GetAllowedOrigins(r MyAPICredentialApiGetAllowedOriginsConfig) (AllowedOriginsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AllowedOriginsResponse{} + var serviceError common.RestServiceError + res := &AllowedOriginsResponse{} path := "/me/allowedOrigins" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type MyAPICredentialApiGetApiCredentialDetailsConfig struct { ctx context.Context } + /* GetApiCredentialDetails Get API credential details @@ -293,8 +315,8 @@ Returns your [API credential](https://docs.adyen.com/development-resources/api-c You can make this request with any of the Management API roles. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MyAPICredentialApiGetApiCredentialDetailsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return MyAPICredentialApiGetApiCredentialDetailsConfig */ func (a *MyAPICredentialApi) GetApiCredentialDetailsConfig(ctx context.Context) MyAPICredentialApiGetApiCredentialDetailsConfig { return MyAPICredentialApiGetApiCredentialDetailsConfig{ @@ -310,65 +332,73 @@ Returns your [API credential](https://docs.adyen.com/development-resources/api-c */ func (a *MyAPICredentialApi) GetApiCredentialDetails(r MyAPICredentialApiGetApiCredentialDetailsConfig) (MeApiCredential, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &MeApiCredential{} + var serviceError common.RestServiceError + res := &MeApiCredential{} path := "/me" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type MyAPICredentialApiRemoveAllowedOriginConfig struct { - ctx context.Context + ctx context.Context originId string } + /* RemoveAllowedOrigin Remove allowed origin @@ -377,13 +407,13 @@ The API key from the request is used to identify the [API credential](https://do You can make this request with any of the Management API roles. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param originId Unique identifier of the allowed origin. - @return MyAPICredentialApiRemoveAllowedOriginConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param originId Unique identifier of the allowed origin. + @return MyAPICredentialApiRemoveAllowedOriginConfig */ func (a *MyAPICredentialApi) RemoveAllowedOriginConfig(ctx context.Context, originId string) MyAPICredentialApiRemoveAllowedOriginConfig { return MyAPICredentialApiRemoveAllowedOriginConfig{ - ctx: ctx, + ctx: ctx, originId: originId, } } @@ -396,57 +426,63 @@ Removes the [allowed origin](https://docs.adyen.com/development-resources/client */ func (a *MyAPICredentialApi) RemoveAllowedOrigin(r MyAPICredentialApiRemoveAllowedOriginConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/me/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + diff --git a/src/management/api_payment_methods_merchant_level.go b/src/management/api_payment_methods_merchant_level.go index c6244b22b..f2245bccb 100644 --- a/src/management/api_payment_methods_merchant_level.go +++ b/src/management/api_payment_methods_merchant_level.go @@ -10,23 +10,20 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PaymentMethodsMerchantLevelApi PaymentMethodsMerchantLevelApi service type PaymentMethodsMerchantLevelApi common.Service type PaymentMethodsMerchantLevelApiAddApplePayDomainConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string paymentMethodId string - applePayInfo *ApplePayInfo + applePayInfo *ApplePayInfo } func (r PaymentMethodsMerchantLevelApiAddApplePayDomainConfig) ApplePayInfo(applePayInfo ApplePayInfo) PaymentMethodsMerchantLevelApiAddApplePayDomainConfig { @@ -34,6 +31,7 @@ func (r PaymentMethodsMerchantLevelApiAddApplePayDomainConfig) ApplePayInfo(appl return r } + /* AddApplePayDomain Add an Apple Pay domain @@ -42,92 +40,99 @@ Adds the new domain to the list of Apple Pay domains that are registered with th To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param paymentMethodId The unique identifier of the payment method. - @return PaymentMethodsMerchantLevelApiAddApplePayDomainConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param paymentMethodId The unique identifier of the payment method. + @return PaymentMethodsMerchantLevelApiAddApplePayDomainConfig */ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomainConfig(ctx context.Context, merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiAddApplePayDomainConfig { return PaymentMethodsMerchantLevelApiAddApplePayDomainConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } /* Add an Apple Pay domain -Adds the new domain to the list of Apple Pay domains that are registered with the merchant account and the payment method identified in the path. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/enable-apple-pay#register-merchant-domain). To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write +Adds the new domain to the list of Apple Pay domains that are registered with the merchant account and the payment method identified in the path. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/enable-apple-pay#register-merchant-domain). To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write * @param merchantId The unique identifier of the merchant account. * @param paymentMethodId The unique identifier of the payment method. - * @param req ApplePayInfo - reference of ApplePayInfo). + * @param req ApplePayInfo - reference of ApplePayInfo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(r PaymentMethodsMerchantLevelApiAddApplePayDomainConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.applePayInfo, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.applePayInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig struct { - ctx context.Context - merchantId string - storeId *string + ctx context.Context + merchantId string + storeId *string businessLineId *string - pageSize *int32 - pageNumber *int32 + pageSize *int32 + pageNumber *int32 } // The unique identifier of the store for which to return the payment methods. @@ -154,6 +159,7 @@ func (r PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig) PageNumber(pag return r } + /* GetAllPaymentMethods Get all payment methods @@ -162,99 +168,108 @@ Returns details for all payment methods of the merchant account identified in th To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig */ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethodsConfig(ctx context.Context, merchantId string) PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig { return PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } /* Get all payment methods -Returns details for all payment methods of the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read +Returns details for all payment methods of the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read * @param merchantId The unique identifier of the merchant account. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentMethodResponse */ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(r PaymentMethodsMerchantLevelApiGetAllPaymentMethodsConfig) (PaymentMethodResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PaymentMethodResponse{} + var serviceError common.RestServiceError + res := &PaymentMethodResponse{} path := "/merchants/{merchantId}/paymentMethodSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.storeId != nil { - common.ParameterAddToQuery(queryParams, "storeId", r.storeId, "") - } - if r.businessLineId != nil { - common.ParameterAddToQuery(queryParams, "businessLineId", r.businessLineId, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.storeId != nil { + common.ParameterAddToQuery(queryParams, "storeId", r.storeId, "") + } + if r.businessLineId != nil { + common.ParameterAddToQuery(queryParams, "businessLineId", r.businessLineId, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string paymentMethodId string } + /* GetApplePayDomains Get Apple Pay domains @@ -263,22 +278,23 @@ Returns all Apple Pay domains that are registered with the merchant account and To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param paymentMethodId The unique identifier of the payment method. - @return PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param paymentMethodId The unique identifier of the payment method. + @return PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig */ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomainsConfig(ctx context.Context, merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig { return PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } /* Get Apple Pay domains -Returns all Apple Pay domains that are registered with the merchant account and the payment method identified in the path. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/enable-apple-pay#register-merchant-domain). To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read +Returns all Apple Pay domains that are registered with the merchant account and the payment method identified in the path. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/enable-apple-pay#register-merchant-domain). To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read * @param merchantId The unique identifier of the merchant account. * @param paymentMethodId The unique identifier of the payment method. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -286,68 +302,76 @@ Returns all Apple Pay domains that are registered with the merchant account and */ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(r PaymentMethodsMerchantLevelApiGetApplePayDomainsConfig) (ApplePayInfo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ApplePayInfo{} + var serviceError common.RestServiceError + res := &ApplePayInfo{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string paymentMethodId string } + /* GetPaymentMethodDetails Get payment method details @@ -356,22 +380,23 @@ Returns details for the merchant account and the payment method identified in th To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param paymentMethodId The unique identifier of the payment method. - @return PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param paymentMethodId The unique identifier of the payment method. + @return PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig */ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetailsConfig(ctx context.Context, merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig { return PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } /* Get payment method details -Returns details for the merchant account and the payment method identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read +Returns details for the merchant account and the payment method identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read * @param merchantId The unique identifier of the merchant account. * @param paymentMethodId The unique identifier of the payment method. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -379,65 +404,72 @@ Returns details for the merchant account and the payment method identified in th */ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(r PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsConfig) (PaymentMethod, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PaymentMethod{} + var serviceError common.RestServiceError + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string paymentMethodSetupInfo *PaymentMethodSetupInfo } @@ -446,6 +478,7 @@ func (r PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig) PaymentMethodS return r } + /* RequestPaymentMethod Request a payment method @@ -454,86 +487,94 @@ Sends a request to add a new payment method to the merchant account identified i To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig */ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethodConfig(ctx context.Context, merchantId string) PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig { return PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } /* Request a payment method -Sends a request to add a new payment method to the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write +Sends a request to add a new payment method to the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write * @param merchantId The unique identifier of the merchant account. - * @param req PaymentMethodSetupInfo - reference of PaymentMethodSetupInfo). + * @param req PaymentMethodSetupInfo - reference of PaymentMethodSetupInfo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentMethod */ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(r PaymentMethodsMerchantLevelApiRequestPaymentMethodConfig) (PaymentMethod, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PaymentMethod{} + var serviceError common.RestServiceError + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentMethodSetupInfo, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentMethodSetupInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig struct { - ctx context.Context - merchantId string - paymentMethodId string + ctx context.Context + merchantId string + paymentMethodId string updatePaymentMethodInfo *UpdatePaymentMethodInfo } @@ -542,6 +583,7 @@ func (r PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig) UpdatePaymentMe return r } + /* UpdatePaymentMethod Update a payment method @@ -550,82 +592,90 @@ Updates payment method details for the merchant account and the payment method i To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param paymentMethodId The unique identifier of the payment method. - @return PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param paymentMethodId The unique identifier of the payment method. + @return PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig */ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethodConfig(ctx context.Context, merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig { return PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } /* Update a payment method -Updates payment method details for the merchant account and the payment method identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write +Updates payment method details for the merchant account and the payment method identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payment methods read and write * @param merchantId The unique identifier of the merchant account. * @param paymentMethodId The unique identifier of the payment method. - * @param req UpdatePaymentMethodInfo - reference of UpdatePaymentMethodInfo). + * @param req UpdatePaymentMethodInfo - reference of UpdatePaymentMethodInfo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentMethod */ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(r PaymentMethodsMerchantLevelApiUpdatePaymentMethodConfig) (PaymentMethod, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PaymentMethod{} + var serviceError common.RestServiceError + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updatePaymentMethodInfo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updatePaymentMethodInfo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_payout_settings_merchant_level.go b/src/management/api_payout_settings_merchant_level.go index 14b78dd92..dc754db52 100644 --- a/src/management/api_payout_settings_merchant_level.go +++ b/src/management/api_payout_settings_merchant_level.go @@ -10,21 +10,18 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // PayoutSettingsMerchantLevelApi PayoutSettingsMerchantLevelApi service type PayoutSettingsMerchantLevelApi common.Service type PayoutSettingsMerchantLevelApiAddPayoutSettingConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string payoutSettingsRequest *PayoutSettingsRequest } @@ -33,6 +30,7 @@ func (r PayoutSettingsMerchantLevelApiAddPayoutSettingConfig) PayoutSettingsRequ return r } + /* AddPayoutSetting Add a payout setting @@ -46,13 +44,13 @@ To make this request, your API credential must have the following [roles](https: * Management API—Payout account settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return PayoutSettingsMerchantLevelApiAddPayoutSettingConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return PayoutSettingsMerchantLevelApiAddPayoutSettingConfig */ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSettingConfig(ctx context.Context, merchantId string) PayoutSettingsMerchantLevelApiAddPayoutSettingConfig { return PayoutSettingsMerchantLevelApiAddPayoutSettingConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -61,73 +59,81 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSettingConfig(ctx context.Cont Add a payout setting Sends a request to add a payout setting for the merchant account specified in the path. A payout setting links the merchant account to the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments) that contains the details of the payout bank account. Adyen verifies the bank account before allowing and enabling the payout setting. If you're accepting payments in multiple currencies, you may add multiple payout settings for the merchant account. Use this endpoint if your integration requires it, such as Adyen for Platforms Manage. Your Adyen contact will set up your access. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payout account settings read and write * @param merchantId The unique identifier of the merchant account. - * @param req PayoutSettingsRequest - reference of PayoutSettingsRequest). + * @param req PayoutSettingsRequest - reference of PayoutSettingsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PayoutSettings */ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(r PayoutSettingsMerchantLevelApiAddPayoutSettingConfig) (PayoutSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PayoutSettings{} + var serviceError common.RestServiceError + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.payoutSettingsRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.payoutSettingsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string payoutSettingsId string } + /* DeletePayoutSetting Delete a payout setting @@ -139,15 +145,15 @@ To make this request, your API credential must have the following [roles](https: * Management API—Payout account settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param payoutSettingsId The unique identifier of the payout setting. - @return PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param payoutSettingsId The unique identifier of the payout setting. + @return PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig */ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSettingConfig(ctx context.Context, merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig { return PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -161,68 +167,75 @@ Deletes the payout setting identified in the path. Use this endpoint if your in */ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(r PayoutSettingsMerchantLevelApiDeletePayoutSettingConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type PayoutSettingsMerchantLevelApiGetPayoutSettingConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string payoutSettingsId string } + /* GetPayoutSetting Get a payout setting @@ -233,15 +246,15 @@ Use this endpoint if your integration requires it, such as Adyen for Platforms M To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payout account settings read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param payoutSettingsId The unique identifier of the payout setting. - @return PayoutSettingsMerchantLevelApiGetPayoutSettingConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param payoutSettingsId The unique identifier of the payout setting. + @return PayoutSettingsMerchantLevelApiGetPayoutSettingConfig */ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSettingConfig(ctx context.Context, merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiGetPayoutSettingConfig { return PayoutSettingsMerchantLevelApiGetPayoutSettingConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -256,67 +269,75 @@ Returns the payout setting identified in the path. Use this endpoint if your in */ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(r PayoutSettingsMerchantLevelApiGetPayoutSettingConfig) (PayoutSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PayoutSettings{} + var serviceError common.RestServiceError + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PayoutSettingsMerchantLevelApiListPayoutSettingsConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* ListPayoutSettings Get a list of payout settings @@ -327,13 +348,13 @@ Use this endpoint if your integration requires it, such as Adyen for Platforms M To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payout account settings read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return PayoutSettingsMerchantLevelApiListPayoutSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return PayoutSettingsMerchantLevelApiListPayoutSettingsConfig */ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettingsConfig(ctx context.Context, merchantId string) PayoutSettingsMerchantLevelApiListPayoutSettingsConfig { return PayoutSettingsMerchantLevelApiListPayoutSettingsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -347,65 +368,72 @@ Returns the list of payout settings for the merchant account identified in the p */ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(r PayoutSettingsMerchantLevelApiListPayoutSettingsConfig) (PayoutSettingsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PayoutSettingsResponse{} + var serviceError common.RestServiceError + res := &PayoutSettingsResponse{} path := "/merchants/{merchantId}/payoutSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig struct { - ctx context.Context - merchantId string - payoutSettingsId string + ctx context.Context + merchantId string + payoutSettingsId string updatePayoutSettingsRequest *UpdatePayoutSettingsRequest } @@ -414,6 +442,7 @@ func (r PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig) UpdatePayoutSet return r } + /* UpdatePayoutSetting Update a payout setting @@ -425,15 +454,15 @@ To make this request, your API credential must have the following [roles](https: * Management API—Payout account settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param payoutSettingsId The unique identifier of the payout setting. - @return PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param payoutSettingsId The unique identifier of the payout setting. + @return PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig */ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSettingConfig(ctx context.Context, merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig { return PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -443,64 +472,71 @@ Update a payout setting Updates the payout setting identified in the path. You can enable or disable the payout setting. Use this endpoint if your integration requires it, such as Adyen for Platforms Manage. Your Adyen contact will set up your access. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Payout account settings read and write * @param merchantId The unique identifier of the merchant account. * @param payoutSettingsId The unique identifier of the payout setting. - * @param req UpdatePayoutSettingsRequest - reference of UpdatePayoutSettingsRequest). + * @param req UpdatePayoutSettingsRequest - reference of UpdatePayoutSettingsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PayoutSettings */ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(r PayoutSettingsMerchantLevelApiUpdatePayoutSettingConfig) (PayoutSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &PayoutSettings{} + var serviceError common.RestServiceError + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updatePayoutSettingsRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updatePayoutSettingsRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_split_configuration_merchant_level.go b/src/management/api_split_configuration_merchant_level.go index 62c8a7c65..1b431468c 100644 --- a/src/management/api_split_configuration_merchant_level.go +++ b/src/management/api_split_configuration_merchant_level.go @@ -10,22 +10,19 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // SplitConfigurationMerchantLevelApi SplitConfigurationMerchantLevelApi service type SplitConfigurationMerchantLevelApi common.Service type SplitConfigurationMerchantLevelApiCreateRuleConfig struct { - ctx context.Context - merchantId string - splitConfigurationId string + ctx context.Context + merchantId string + splitConfigurationId string splitConfigurationRule *SplitConfigurationRule } @@ -34,6 +31,7 @@ func (r SplitConfigurationMerchantLevelApiCreateRuleConfig) SplitConfigurationRu return r } + /* CreateRule Create a rule @@ -42,15 +40,15 @@ Creates a rule in the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The unique identifier of the split configuration. - @return SplitConfigurationMerchantLevelApiCreateRuleConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The unique identifier of the split configuration. + @return SplitConfigurationMerchantLevelApiCreateRuleConfig */ func (a *SplitConfigurationMerchantLevelApi) CreateRuleConfig(ctx context.Context, merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiCreateRuleConfig { return SplitConfigurationMerchantLevelApiCreateRuleConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -60,71 +58,78 @@ Create a rule Creates a rule in the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write * @param merchantId The unique identifier of the merchant account. * @param splitConfigurationId The unique identifier of the split configuration. - * @param req SplitConfigurationRule - reference of SplitConfigurationRule). + * @param req SplitConfigurationRule - reference of SplitConfigurationRule). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) CreateRule(r SplitConfigurationMerchantLevelApiCreateRuleConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.splitConfigurationRule, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.splitConfigurationRule, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string splitConfiguration *SplitConfiguration } @@ -133,6 +138,7 @@ func (r SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig) SplitC return r } + /* CreateSplitConfiguration Create a split configuration @@ -141,13 +147,13 @@ Creates a split configuration for the merchant account specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig */ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfigurationConfig(ctx context.Context, merchantId string) SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig { return SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -156,73 +162,81 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfigurationConfig(ctx Create a split configuration Creates a split configuration for the merchant account specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write * @param merchantId The unique identifier of the merchant account. - * @param req SplitConfiguration - reference of SplitConfiguration). + * @param req SplitConfiguration - reference of SplitConfiguration). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(r SplitConfigurationMerchantLevelApiCreateSplitConfigurationConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.splitConfiguration, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.splitConfiguration, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string splitConfigurationId string } + /* DeleteSplitConfiguration Delete a split configuration @@ -231,15 +245,15 @@ Deletes the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The unique identifier of the split configuration. - @return SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The unique identifier of the split configuration. + @return SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationConfig(ctx context.Context, merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig { return SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -254,68 +268,76 @@ Deletes the split configuration specified in the path. To make this request, yo */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(r SplitConfigurationMerchantLevelApiDeleteSplitConfigurationConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string splitConfigurationId string } + /* GetSplitConfiguration Get a split configuration @@ -324,15 +346,15 @@ Returns the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The unique identifier of the split configuration. - @return SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The unique identifier of the split configuration. + @return SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig */ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfigurationConfig(ctx context.Context, merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig { return SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -347,67 +369,75 @@ Returns the split configuration specified in the path. To make this request, yo */ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(r SplitConfigurationMerchantLevelApiGetSplitConfigurationConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* ListSplitConfigurations Get a list of split configurations @@ -416,13 +446,13 @@ Returns the list of split configurations for the merchant account. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig */ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurationsConfig(ctx context.Context, merchantId string) SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig { return SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -436,66 +466,73 @@ Returns the list of split configurations for the merchant account. To make this */ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(r SplitConfigurationMerchantLevelApiListSplitConfigurationsConfig) (SplitConfigurationList, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfigurationList{} + var serviceError common.RestServiceError + res := &SplitConfigurationList{} path := "/merchants/{merchantId}/splitConfigurations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig struct { - ctx context.Context - merchantId string - splitConfigurationId string - ruleId string + ctx context.Context + merchantId string + splitConfigurationId string + ruleId string updateSplitConfigurationRuleRequest *UpdateSplitConfigurationRuleRequest } @@ -504,6 +541,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig) UpdateSpl return r } + /* UpdateSplitConditions Update split conditions @@ -512,18 +550,18 @@ Changes the conditions of the split configuration rule specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The identifier of the split configuration. - @param ruleId The unique identifier of the split configuration rule. - @return SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The identifier of the split configuration. + @param ruleId The unique identifier of the split configuration rule. + @return SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditionsConfig(ctx context.Context, merchantId string, splitConfigurationId string, ruleId string) SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig { return SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, - ruleId: ruleId, + ruleId: ruleId, } } @@ -533,73 +571,80 @@ Changes the conditions of the split configuration rule specified in the path. T * @param merchantId The unique identifier of the merchant account. * @param splitConfigurationId The identifier of the split configuration. * @param ruleId The unique identifier of the split configuration rule. - * @param req UpdateSplitConfigurationRuleRequest - reference of UpdateSplitConfigurationRuleRequest). + * @param req UpdateSplitConfigurationRuleRequest - reference of UpdateSplitConfigurationRuleRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(r SplitConfigurationMerchantLevelApiUpdateSplitConditionsConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateSplitConfigurationRuleRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateSplitConfigurationRuleRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig struct { - ctx context.Context - merchantId string - splitConfigurationId string + ctx context.Context + merchantId string + splitConfigurationId string updateSplitConfigurationRequest *UpdateSplitConfigurationRequest } @@ -608,6 +653,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionCon return r } + /* UpdateSplitConfigurationDescription Update split configuration description @@ -616,15 +662,15 @@ Changes the description of the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The unique identifier of the split configuration. - @return SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The unique identifier of the split configuration. + @return SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescriptionConfig(ctx context.Context, merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig { return SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -634,74 +680,81 @@ Update split configuration description Changes the description of the split configuration specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write * @param merchantId The unique identifier of the merchant account. * @param splitConfigurationId The unique identifier of the split configuration. - * @param req UpdateSplitConfigurationRequest - reference of UpdateSplitConfigurationRequest). + * @param req UpdateSplitConfigurationRequest - reference of UpdateSplitConfigurationRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription(r SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateSplitConfigurationRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateSplitConfigurationRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig struct { - ctx context.Context - merchantId string - splitConfigurationId string - ruleId string - splitLogicId string + ctx context.Context + merchantId string + splitConfigurationId string + ruleId string + splitLogicId string updateSplitConfigurationLogicRequest *UpdateSplitConfigurationLogicRequest } @@ -710,6 +763,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig) UpdateSplitCon return r } + /* UpdateSplitLogic Update the split logic @@ -718,20 +772,20 @@ Changes the split logic specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API - SplitConfiguration read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param splitConfigurationId The unique identifier of the split configuration. - @param ruleId The unique identifier of the split configuration rule. - @param splitLogicId The unique identifier of the split configuration split. - @return SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param splitConfigurationId The unique identifier of the split configuration. + @param ruleId The unique identifier of the split configuration rule. + @param splitLogicId The unique identifier of the split configuration split. + @return SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogicConfig(ctx context.Context, merchantId string, splitConfigurationId string, ruleId string, splitLogicId string) SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig { return SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig{ - ctx: ctx, - merchantId: merchantId, + ctx: ctx, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, - ruleId: ruleId, - splitLogicId: splitLogicId, + ruleId: ruleId, + splitLogicId: splitLogicId, } } @@ -742,66 +796,73 @@ Changes the split logic specified in the path. To make this request, your API c * @param splitConfigurationId The unique identifier of the split configuration. * @param ruleId The unique identifier of the split configuration rule. * @param splitLogicId The unique identifier of the split configuration split. - * @param req UpdateSplitConfigurationLogicRequest - reference of UpdateSplitConfigurationLogicRequest). + * @param req UpdateSplitConfigurationLogicRequest - reference of UpdateSplitConfigurationLogicRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(r SplitConfigurationMerchantLevelApiUpdateSplitLogicConfig) (SplitConfiguration, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &SplitConfiguration{} + var serviceError common.RestServiceError + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}/splitLogic/{splitLogicId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) - path = strings.Replace(path, "{"+"splitLogicId"+"}", url.PathEscape(common.ParameterValueToString(r.splitLogicId, "splitLogicId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateSplitConfigurationLogicRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) + path = strings.Replace(path, "{"+"splitLogicId"+"}", url.PathEscape(common.ParameterValueToString(r.splitLogicId, "splitLogicId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateSplitConfigurationLogicRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_actions_company_level.go b/src/management/api_terminal_actions_company_level.go index 740b44f18..6d88f9d2c 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalActionsCompanyLevelApi TerminalActionsCompanyLevelApi service type TerminalActionsCompanyLevelApi common.Service type TerminalActionsCompanyLevelApiGetTerminalActionConfig struct { - ctx context.Context + ctx context.Context companyId string - actionId string + actionId string } + /* GetTerminalAction Get terminal action @@ -36,16 +34,16 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal actions read * Management API—Terminal actions read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param actionId The unique identifier of the terminal action. - @return TerminalActionsCompanyLevelApiGetTerminalActionConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param actionId The unique identifier of the terminal action. + @return TerminalActionsCompanyLevelApiGetTerminalActionConfig */ func (a *TerminalActionsCompanyLevelApi) GetTerminalActionConfig(ctx context.Context, companyId string, actionId string) TerminalActionsCompanyLevelApiGetTerminalActionConfig { return TerminalActionsCompanyLevelApiGetTerminalActionConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - actionId: actionId, + actionId: actionId, } } @@ -59,67 +57,74 @@ Returns the details of the [terminal action](https://docs.adyen.com/point-of-sal */ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(r TerminalActionsCompanyLevelApiGetTerminalActionConfig) (ExternalTerminalAction, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ExternalTerminalAction{} + var serviceError common.RestServiceError + res := &ExternalTerminalAction{} path := "/companies/{companyId}/terminalActions/{actionId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"actionId"+"}", url.PathEscape(common.ParameterValueToString(r.actionId, "actionId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"actionId"+"}", url.PathEscape(common.ParameterValueToString(r.actionId, "actionId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalActionsCompanyLevelApiListAndroidAppsConfig struct { - ctx context.Context - companyId string - pageNumber *int32 - pageSize *int32 + ctx context.Context + companyId string + pageNumber *int32 + pageSize *int32 packageName *string versionCode *int32 } @@ -148,23 +153,24 @@ func (r TerminalActionsCompanyLevelApiListAndroidAppsConfig) VersionCode(version return r } + /* ListAndroidApps Get a list of Android apps -Returns a list of the Android apps that are available for the company identified in the path. +Returns a list of the Android apps that are available for the company identified in the path. These apps have been uploaded to Adyen and can be installed or uninstalled on Android payment terminals through [terminal actions](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal actions read * Management API—Terminal actions read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalActionsCompanyLevelApiListAndroidAppsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalActionsCompanyLevelApiListAndroidAppsConfig */ func (a *TerminalActionsCompanyLevelApi) ListAndroidAppsConfig(ctx context.Context, companyId string) TerminalActionsCompanyLevelApiListAndroidAppsConfig { return TerminalActionsCompanyLevelApiListAndroidAppsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -178,78 +184,85 @@ Returns a list of the Android apps that are available for the company identified */ func (a *TerminalActionsCompanyLevelApi) ListAndroidApps(r TerminalActionsCompanyLevelApiListAndroidAppsConfig) (AndroidAppsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AndroidAppsResponse{} + var serviceError common.RestServiceError + res := &AndroidAppsResponse{} path := "/companies/{companyId}/androidApps" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.packageName != nil { - common.ParameterAddToQuery(queryParams, "packageName", r.packageName, "") - } - if r.versionCode != nil { - common.ParameterAddToQuery(queryParams, "versionCode", r.versionCode, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.packageName != nil { + common.ParameterAddToQuery(queryParams, "packageName", r.packageName, "") + } + if r.versionCode != nil { + common.ParameterAddToQuery(queryParams, "versionCode", r.versionCode, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalActionsCompanyLevelApiListAndroidCertificatesConfig struct { - ctx context.Context - companyId string - pageNumber *int32 - pageSize *int32 + ctx context.Context + companyId string + pageNumber *int32 + pageSize *int32 certificateName *string } @@ -271,6 +284,7 @@ func (r TerminalActionsCompanyLevelApiListAndroidCertificatesConfig) Certificate return r } + /* ListAndroidCertificates Get a list of Android certificates @@ -281,13 +295,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal actions read * Management API—Terminal actions read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalActionsCompanyLevelApiListAndroidCertificatesConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalActionsCompanyLevelApiListAndroidCertificatesConfig */ func (a *TerminalActionsCompanyLevelApi) ListAndroidCertificatesConfig(ctx context.Context, companyId string) TerminalActionsCompanyLevelApiListAndroidCertificatesConfig { return TerminalActionsCompanyLevelApiListAndroidCertificatesConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -301,77 +315,84 @@ Returns a list of the Android certificates that are available for the company id */ func (a *TerminalActionsCompanyLevelApi) ListAndroidCertificates(r TerminalActionsCompanyLevelApiListAndroidCertificatesConfig) (AndroidCertificatesResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &AndroidCertificatesResponse{} + var serviceError common.RestServiceError + res := &AndroidCertificatesResponse{} path := "/companies/{companyId}/androidCertificates" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.certificateName != nil { - common.ParameterAddToQuery(queryParams, "certificateName", r.certificateName, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.certificateName != nil { + common.ParameterAddToQuery(queryParams, "certificateName", r.certificateName, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalActionsCompanyLevelApiListTerminalActionsConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string pageNumber *int32 - pageSize *int32 - status *string - type_ *string + pageSize *int32 + status *string + type_ *string } // The number of the page to fetch. @@ -398,6 +419,7 @@ func (r TerminalActionsCompanyLevelApiListTerminalActionsConfig) Type_(type_ str return r } + /* ListTerminalActions Get a list of terminal actions @@ -406,13 +428,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal actions read * Management API—Terminal actions read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalActionsCompanyLevelApiListTerminalActionsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalActionsCompanyLevelApiListTerminalActionsConfig */ func (a *TerminalActionsCompanyLevelApi) ListTerminalActionsConfig(ctx context.Context, companyId string) TerminalActionsCompanyLevelApiListTerminalActionsConfig { return TerminalActionsCompanyLevelApiListTerminalActionsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -426,69 +448,76 @@ Returns the [terminal actions](https://docs.adyen.com/point-of-sale/automating-t */ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(r TerminalActionsCompanyLevelApiListTerminalActionsConfig) (ListExternalTerminalActionsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListExternalTerminalActionsResponse{} + var serviceError common.RestServiceError + res := &ListExternalTerminalActionsResponse{} path := "/companies/{companyId}/terminalActions" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.type_ != nil { - common.ParameterAddToQuery(queryParams, "type", r.type_, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.type_ != nil { + common.ParameterAddToQuery(queryParams, "type", r.type_, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_actions_terminal_level.go b/src/management/api_terminal_actions_terminal_level.go index 86cb4dba2..e2ed3185a 100644 --- a/src/management/api_terminal_actions_terminal_level.go +++ b/src/management/api_terminal_actions_terminal_level.go @@ -10,19 +10,17 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalActionsTerminalLevelApi TerminalActionsTerminalLevelApi service type TerminalActionsTerminalLevelApi common.Service type TerminalActionsTerminalLevelApiCreateTerminalActionConfig struct { - ctx context.Context + ctx context.Context scheduleTerminalActionsRequest *ScheduleTerminalActionsRequest } @@ -31,21 +29,22 @@ func (r TerminalActionsTerminalLevelApiCreateTerminalActionConfig) ScheduleTermi return r } + /* CreateTerminalAction Create a terminal action -Schedules a [terminal action](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api) by specifying the action and the terminals that the action must be applied to. +Schedules a [terminal action](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api) by specifying the action and the terminals that the action must be applied to. The following restrictions apply: -* You can schedule only one action at a time. For example, to install a new app version and remove an old app version, you have to make two API requests. -* The maximum number of terminals in a request is **100**. For example, to apply an action to 250 terminals, you have to divide the terminals over three API requests. -* If there is an error with one or more terminal IDs in the request, the action is scheduled for none of the terminals. You need to fix the error and try again. +* You can schedule only one action at a time. For example, to install a new app version and remove an old app version, you have to make two API requests. +* The maximum number of terminals in a request is **100**. For example, to apply an action to 250 terminals, you have to divide the terminals over three API requests. +* If there is an error with one or more terminal IDs in the request, the action is scheduled for none of the terminals. You need to fix the error and try again. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal actions read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return TerminalActionsTerminalLevelApiCreateTerminalActionConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return TerminalActionsTerminalLevelApiCreateTerminalActionConfig */ func (a *TerminalActionsTerminalLevelApi) CreateTerminalActionConfig(ctx context.Context) TerminalActionsTerminalLevelApiCreateTerminalActionConfig { return TerminalActionsTerminalLevelApiCreateTerminalActionConfig{ @@ -56,62 +55,69 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalActionConfig(ctx context /* Create a terminal action Schedules a [terminal action](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api) by specifying the action and the terminals that the action must be applied to. The following restrictions apply: * You can schedule only one action at a time. For example, to install a new app version and remove an old app version, you have to make two API requests. * The maximum number of terminals in a request is **100**. For example, to apply an action to 250 terminals, you have to divide the terminals over three API requests. * If there is an error with one or more terminal IDs in the request, the action is scheduled for none of the terminals. You need to fix the error and try again. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal actions read and write - * @param req ScheduleTerminalActionsRequest - reference of ScheduleTerminalActionsRequest). + * @param req ScheduleTerminalActionsRequest - reference of ScheduleTerminalActionsRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ScheduleTerminalActionsResponse */ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(r TerminalActionsTerminalLevelApiCreateTerminalActionConfig) (ScheduleTerminalActionsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ScheduleTerminalActionsResponse{} + var serviceError common.RestServiceError + res := &ScheduleTerminalActionsResponse{} path := "/terminals/scheduleActions" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.scheduleTerminalActionsRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.scheduleTerminalActionsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_orders_company_level.go b/src/management/api_terminal_orders_company_level.go index 50a4988e2..cde578505 100644 --- a/src/management/api_terminal_orders_company_level.go +++ b/src/management/api_terminal_orders_company_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalOrdersCompanyLevelApi TerminalOrdersCompanyLevelApi service type TerminalOrdersCompanyLevelApi common.Service type TerminalOrdersCompanyLevelApiCancelOrderConfig struct { - ctx context.Context + ctx context.Context companyId string - orderId string + orderId string } + /* CancelOrder Cancel an order @@ -38,16 +36,16 @@ To cancel an order, make a POST call without a request body. The response return To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param orderId The unique identifier of the order. - @return TerminalOrdersCompanyLevelApiCancelOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param orderId The unique identifier of the order. + @return TerminalOrdersCompanyLevelApiCancelOrderConfig */ func (a *TerminalOrdersCompanyLevelApi) CancelOrderConfig(ctx context.Context, companyId string, orderId string) TerminalOrdersCompanyLevelApiCancelOrderConfig { return TerminalOrdersCompanyLevelApiCancelOrderConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -61,65 +59,72 @@ Cancels the terminal products order identified in the path. Cancelling is only p */ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(r TerminalOrdersCompanyLevelApiCancelOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}/cancel" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiCreateOrderConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string terminalOrderRequest *TerminalOrderRequest } @@ -128,6 +133,7 @@ func (r TerminalOrdersCompanyLevelApiCreateOrderConfig) TerminalOrderRequest(ter return r } + /* CreateOrder Create an order @@ -136,13 +142,13 @@ Creates an order for payment terminal products for the company identified in the To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiCreateOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiCreateOrderConfig */ func (a *TerminalOrdersCompanyLevelApi) CreateOrderConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiCreateOrderConfig { return TerminalOrdersCompanyLevelApiCreateOrderConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -151,70 +157,77 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrderConfig(ctx context.Context, c Create an order Creates an order for payment terminal products for the company identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param companyId The unique identifier of the company account. - * @param req TerminalOrderRequest - reference of TerminalOrderRequest). + * @param req TerminalOrderRequest - reference of TerminalOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalOrder */ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(r TerminalOrdersCompanyLevelApiCreateOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalOrderRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalOrderRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiCreateShippingLocationConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string shippingLocation *ShippingLocation } @@ -223,6 +236,7 @@ func (r TerminalOrdersCompanyLevelApiCreateShippingLocationConfig) ShippingLocat return r } + /* CreateShippingLocation Create a shipping location @@ -231,13 +245,13 @@ Creates a shipping location for the company identified in the path. A shipping l To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiCreateShippingLocationConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiCreateShippingLocationConfig */ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocationConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiCreateShippingLocationConfig { return TerminalOrdersCompanyLevelApiCreateShippingLocationConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -246,73 +260,81 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocationConfig(ctx context Create a shipping location Creates a shipping location for the company identified in the path. A shipping location defines an address where orders can be delivered. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param companyId The unique identifier of the company account. - * @param req ShippingLocation - reference of ShippingLocation). + * @param req ShippingLocation - reference of ShippingLocation). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ShippingLocation */ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(r TerminalOrdersCompanyLevelApiCreateShippingLocationConfig) (ShippingLocation, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ShippingLocation{} + var serviceError common.RestServiceError + res := &ShippingLocation{} path := "/companies/{companyId}/shippingLocations" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.shippingLocation, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.shippingLocation, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiGetOrderConfig struct { - ctx context.Context + ctx context.Context companyId string - orderId string + orderId string } + /* GetOrder Get an order @@ -322,16 +344,16 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param orderId The unique identifier of the order. - @return TerminalOrdersCompanyLevelApiGetOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param orderId The unique identifier of the order. + @return TerminalOrdersCompanyLevelApiGetOrderConfig */ func (a *TerminalOrdersCompanyLevelApi) GetOrderConfig(ctx context.Context, companyId string, orderId string) TerminalOrdersCompanyLevelApiGetOrderConfig { return TerminalOrdersCompanyLevelApiGetOrderConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -345,66 +367,73 @@ Returns the details of the terminal products order identified in the path. To m */ func (a *TerminalOrdersCompanyLevelApi) GetOrder(r TerminalOrdersCompanyLevelApiGetOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiListBillingEntitiesConfig struct { - ctx context.Context + ctx context.Context companyId string - name *string + name *string } // The name of the billing entity. @@ -413,6 +442,7 @@ func (r TerminalOrdersCompanyLevelApiListBillingEntitiesConfig) Name(name string return r } + /* ListBillingEntities Get a list of billing entities @@ -423,13 +453,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiListBillingEntitiesConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiListBillingEntitiesConfig */ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntitiesConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiListBillingEntitiesConfig { return TerminalOrdersCompanyLevelApiListBillingEntitiesConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -443,71 +473,78 @@ Returns the billing entities of the company identified in the path and all merch */ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(r TerminalOrdersCompanyLevelApiListBillingEntitiesConfig) (BillingEntitiesResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &BillingEntitiesResponse{} + var serviceError common.RestServiceError + res := &BillingEntitiesResponse{} path := "/companies/{companyId}/billingEntities" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiListOrdersConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string customerOrderReference *string - status *string - offset *int32 - limit *int32 + status *string + offset *int32 + limit *int32 } // Your purchase order number. @@ -534,6 +571,7 @@ func (r TerminalOrdersCompanyLevelApiListOrdersConfig) Limit(limit int32) Termin return r } + /* ListOrders Get a list of orders @@ -544,13 +582,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiListOrdersConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiListOrdersConfig */ func (a *TerminalOrdersCompanyLevelApi) ListOrdersConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiListOrdersConfig { return TerminalOrdersCompanyLevelApiListOrdersConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -564,79 +602,86 @@ Returns a lists of terminal products orders for the company identified in the pa */ func (a *TerminalOrdersCompanyLevelApi) ListOrders(r TerminalOrdersCompanyLevelApiListOrdersConfig) (TerminalOrdersResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrdersResponse{} + var serviceError common.RestServiceError + res := &TerminalOrdersResponse{} path := "/companies/{companyId}/terminalOrders" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.customerOrderReference != nil { - common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.customerOrderReference != nil { + common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiListShippingLocationsConfig struct { - ctx context.Context + ctx context.Context companyId string - name *string - offset *int32 - limit *int32 + name *string + offset *int32 + limit *int32 } // The name of the shipping location. @@ -657,6 +702,7 @@ func (r TerminalOrdersCompanyLevelApiListShippingLocationsConfig) Limit(limit in return r } + /* ListShippingLocations Get a list of shipping locations @@ -667,13 +713,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiListShippingLocationsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiListShippingLocationsConfig */ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocationsConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiListShippingLocationsConfig { return TerminalOrdersCompanyLevelApiListShippingLocationsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -687,75 +733,83 @@ Returns the shipping locations for the company identified in the path and all me */ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(r TerminalOrdersCompanyLevelApiListShippingLocationsConfig) (ShippingLocationsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ShippingLocationsResponse{} + var serviceError common.RestServiceError + res := &ShippingLocationsResponse{} path := "/companies/{companyId}/shippingLocations" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiListTerminalModelsConfig struct { - ctx context.Context + ctx context.Context companyId string } + /* ListTerminalModels Get a list of terminal models @@ -766,13 +820,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiListTerminalModelsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiListTerminalModelsConfig */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModelsConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiListTerminalModelsConfig { return TerminalOrdersCompanyLevelApiListTerminalModelsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -786,68 +840,75 @@ Returns a list of payment terminal models that the company identified in the pat */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(r TerminalOrdersCompanyLevelApiListTerminalModelsConfig) (TerminalModelsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalModelsResponse{} + var serviceError common.RestServiceError + res := &TerminalModelsResponse{} path := "/companies/{companyId}/terminalModels" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiListTerminalProductsConfig struct { - ctx context.Context - companyId string - country *string + ctx context.Context + companyId string + country *string terminalModelId *string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** @@ -874,22 +935,23 @@ func (r TerminalOrdersCompanyLevelApiListTerminalProductsConfig) Limit(limit int return r } + /* ListTerminalProducts Get a list of terminal products Returns a country-specific list of payment terminal packages and parts that the company identified in the path has access to. - + To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalOrdersCompanyLevelApiListTerminalProductsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalOrdersCompanyLevelApiListTerminalProductsConfig */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProductsConfig(ctx context.Context, companyId string) TerminalOrdersCompanyLevelApiListTerminalProductsConfig { return TerminalOrdersCompanyLevelApiListTerminalProductsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -903,77 +965,84 @@ Returns a country-specific list of payment terminal packages and parts that the */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(r TerminalOrdersCompanyLevelApiListTerminalProductsConfig) (TerminalProductsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalProductsResponse{} + var serviceError common.RestServiceError + res := &TerminalProductsResponse{} path := "/companies/{companyId}/terminalProducts" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.country != nil { - common.ParameterAddToQuery(queryParams, "country", r.country, "") - } - if r.terminalModelId != nil { - common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.country != nil { + common.ParameterAddToQuery(queryParams, "country", r.country, "") + } + if r.terminalModelId != nil { + common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersCompanyLevelApiUpdateOrderConfig struct { - ctx context.Context - companyId string - orderId string + ctx context.Context + companyId string + orderId string terminalOrderRequest *TerminalOrderRequest } @@ -982,30 +1051,30 @@ func (r TerminalOrdersCompanyLevelApiUpdateOrderConfig) TerminalOrderRequest(ter return r } + /* UpdateOrder Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. -The request body only needs to contain what you want to change. +The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provide the entire array. For example, if the array has three items: - - To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. + To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param orderId The unique identifier of the order. - @return TerminalOrdersCompanyLevelApiUpdateOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param orderId The unique identifier of the order. + @return TerminalOrdersCompanyLevelApiUpdateOrderConfig */ func (a *TerminalOrdersCompanyLevelApi) UpdateOrderConfig(ctx context.Context, companyId string, orderId string) TerminalOrdersCompanyLevelApiUpdateOrderConfig { return TerminalOrdersCompanyLevelApiUpdateOrderConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -1014,64 +1083,71 @@ Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provide the entire array. For example, if the array has three items: To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param companyId The unique identifier of the company account. * @param orderId The unique identifier of the order. - * @param req TerminalOrderRequest - reference of TerminalOrderRequest). + * @param req TerminalOrderRequest - reference of TerminalOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalOrder */ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(r TerminalOrdersCompanyLevelApiUpdateOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalOrderRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalOrderRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_orders_merchant_level.go b/src/management/api_terminal_orders_merchant_level.go index f7bc8f418..457edfd8e 100644 --- a/src/management/api_terminal_orders_merchant_level.go +++ b/src/management/api_terminal_orders_merchant_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalOrdersMerchantLevelApi TerminalOrdersMerchantLevelApi service type TerminalOrdersMerchantLevelApi common.Service type TerminalOrdersMerchantLevelApiCancelOrderConfig struct { - ctx context.Context + ctx context.Context merchantId string - orderId string + orderId string } + /* CancelOrder Cancel an order @@ -38,16 +36,16 @@ To cancel an order, make a POST call without a request body. The response return To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param orderId The unique identifier of the order. - @return TerminalOrdersMerchantLevelApiCancelOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param orderId The unique identifier of the order. + @return TerminalOrdersMerchantLevelApiCancelOrderConfig */ func (a *TerminalOrdersMerchantLevelApi) CancelOrderConfig(ctx context.Context, merchantId string, orderId string) TerminalOrdersMerchantLevelApiCancelOrderConfig { return TerminalOrdersMerchantLevelApiCancelOrderConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -61,65 +59,72 @@ Cancels the terminal products order identified in the path. Cancelling is only p */ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(r TerminalOrdersMerchantLevelApiCancelOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}/cancel" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiCreateOrderConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string terminalOrderRequest *TerminalOrderRequest } @@ -128,6 +133,7 @@ func (r TerminalOrdersMerchantLevelApiCreateOrderConfig) TerminalOrderRequest(te return r } + /* CreateOrder Create an order @@ -136,13 +142,13 @@ Creates an order for payment terminal products for the merchant account identifi To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiCreateOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiCreateOrderConfig */ func (a *TerminalOrdersMerchantLevelApi) CreateOrderConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiCreateOrderConfig { return TerminalOrdersMerchantLevelApiCreateOrderConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -151,70 +157,77 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrderConfig(ctx context.Context, Create an order Creates an order for payment terminal products for the merchant account identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param merchantId The unique identifier of the merchant account. - * @param req TerminalOrderRequest - reference of TerminalOrderRequest). + * @param req TerminalOrderRequest - reference of TerminalOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalOrder */ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(r TerminalOrdersMerchantLevelApiCreateOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalOrderRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalOrderRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiCreateShippingLocationConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string shippingLocation *ShippingLocation } @@ -223,21 +236,22 @@ func (r TerminalOrdersMerchantLevelApiCreateShippingLocationConfig) ShippingLoca return r } + /* CreateShippingLocation Create a shipping location -Creates a shipping location for the merchant account identified in the path. A shipping location defines an address where orders can be shipped to. +Creates a shipping location for the merchant account identified in the path. A shipping location defines an address where orders can be shipped to. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiCreateShippingLocationConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiCreateShippingLocationConfig */ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocationConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiCreateShippingLocationConfig { return TerminalOrdersMerchantLevelApiCreateShippingLocationConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -246,73 +260,81 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocationConfig(ctx contex Create a shipping location Creates a shipping location for the merchant account identified in the path. A shipping location defines an address where orders can be shipped to. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param merchantId The unique identifier of the merchant account. - * @param req ShippingLocation - reference of ShippingLocation). + * @param req ShippingLocation - reference of ShippingLocation). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ShippingLocation */ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(r TerminalOrdersMerchantLevelApiCreateShippingLocationConfig) (ShippingLocation, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ShippingLocation{} + var serviceError common.RestServiceError + res := &ShippingLocation{} path := "/merchants/{merchantId}/shippingLocations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.shippingLocation, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.shippingLocation, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiGetOrderConfig struct { - ctx context.Context + ctx context.Context merchantId string - orderId string + orderId string } + /* GetOrder Get an order @@ -322,16 +344,16 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param orderId The unique identifier of the order. - @return TerminalOrdersMerchantLevelApiGetOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param orderId The unique identifier of the order. + @return TerminalOrdersMerchantLevelApiGetOrderConfig */ func (a *TerminalOrdersMerchantLevelApi) GetOrderConfig(ctx context.Context, merchantId string, orderId string) TerminalOrdersMerchantLevelApiGetOrderConfig { return TerminalOrdersMerchantLevelApiGetOrderConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -345,66 +367,73 @@ Returns the details of the terminal products order identified in the path. To m */ func (a *TerminalOrdersMerchantLevelApi) GetOrder(r TerminalOrdersMerchantLevelApiGetOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiListBillingEntitiesConfig struct { - ctx context.Context + ctx context.Context merchantId string - name *string + name *string } // The name of the billing entity. @@ -413,6 +442,7 @@ func (r TerminalOrdersMerchantLevelApiListBillingEntitiesConfig) Name(name strin return r } + /* ListBillingEntities Get a list of billing entities @@ -423,13 +453,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiListBillingEntitiesConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiListBillingEntitiesConfig */ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntitiesConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiListBillingEntitiesConfig { return TerminalOrdersMerchantLevelApiListBillingEntitiesConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -443,71 +473,78 @@ Returns the billing entities of the merchant account identified in the path. A b */ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(r TerminalOrdersMerchantLevelApiListBillingEntitiesConfig) (BillingEntitiesResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &BillingEntitiesResponse{} + var serviceError common.RestServiceError + res := &BillingEntitiesResponse{} path := "/merchants/{merchantId}/billingEntities" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiListOrdersConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string customerOrderReference *string - status *string - offset *int32 - limit *int32 + status *string + offset *int32 + limit *int32 } // Your purchase order number. @@ -534,6 +571,7 @@ func (r TerminalOrdersMerchantLevelApiListOrdersConfig) Limit(limit int32) Termi return r } + /* ListOrders Get a list of orders @@ -543,13 +581,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId - @return TerminalOrdersMerchantLevelApiListOrdersConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId + @return TerminalOrdersMerchantLevelApiListOrdersConfig */ func (a *TerminalOrdersMerchantLevelApi) ListOrdersConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiListOrdersConfig { return TerminalOrdersMerchantLevelApiListOrdersConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -563,79 +601,86 @@ Returns a list of terminal products orders for the merchant account identified i */ func (a *TerminalOrdersMerchantLevelApi) ListOrders(r TerminalOrdersMerchantLevelApiListOrdersConfig) (TerminalOrdersResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrdersResponse{} + var serviceError common.RestServiceError + res := &TerminalOrdersResponse{} path := "/merchants/{merchantId}/terminalOrders" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.customerOrderReference != nil { - common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.customerOrderReference != nil { + common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiListShippingLocationsConfig struct { - ctx context.Context + ctx context.Context merchantId string - name *string - offset *int32 - limit *int32 + name *string + offset *int32 + limit *int32 } // The name of the shipping location. @@ -656,6 +701,7 @@ func (r TerminalOrdersMerchantLevelApiListShippingLocationsConfig) Limit(limit i return r } + /* ListShippingLocations Get a list of shipping locations @@ -666,13 +712,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiListShippingLocationsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiListShippingLocationsConfig */ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocationsConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiListShippingLocationsConfig { return TerminalOrdersMerchantLevelApiListShippingLocationsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -686,75 +732,83 @@ Returns the shipping locations for the merchant account identified in the path. */ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(r TerminalOrdersMerchantLevelApiListShippingLocationsConfig) (ShippingLocationsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ShippingLocationsResponse{} + var serviceError common.RestServiceError + res := &ShippingLocationsResponse{} path := "/merchants/{merchantId}/shippingLocations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiListTerminalModelsConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* ListTerminalModels Get a list of terminal models @@ -764,13 +818,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiListTerminalModelsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiListTerminalModelsConfig */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModelsConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiListTerminalModelsConfig { return TerminalOrdersMerchantLevelApiListTerminalModelsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -784,68 +838,75 @@ Returns the payment terminal models that merchant account identified in the path */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(r TerminalOrdersMerchantLevelApiListTerminalModelsConfig) (TerminalModelsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalModelsResponse{} + var serviceError common.RestServiceError + res := &TerminalModelsResponse{} path := "/merchants/{merchantId}/terminalModels" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiListTerminalProductsConfig struct { - ctx context.Context - merchantId string - country *string + ctx context.Context + merchantId string + country *string terminalModelId *string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** @@ -872,6 +933,7 @@ func (r TerminalOrdersMerchantLevelApiListTerminalProductsConfig) Limit(limit in return r } + /* ListTerminalProducts Get a list of terminal products @@ -881,13 +943,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal ordering read * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalOrdersMerchantLevelApiListTerminalProductsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalOrdersMerchantLevelApiListTerminalProductsConfig */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProductsConfig(ctx context.Context, merchantId string) TerminalOrdersMerchantLevelApiListTerminalProductsConfig { return TerminalOrdersMerchantLevelApiListTerminalProductsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -901,77 +963,84 @@ Returns a country-specific list of payment terminal packages and parts that the */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(r TerminalOrdersMerchantLevelApiListTerminalProductsConfig) (TerminalProductsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalProductsResponse{} + var serviceError common.RestServiceError + res := &TerminalProductsResponse{} path := "/merchants/{merchantId}/terminalProducts" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.country != nil { - common.ParameterAddToQuery(queryParams, "country", r.country, "") - } - if r.terminalModelId != nil { - common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.country != nil { + common.ParameterAddToQuery(queryParams, "country", r.country, "") + } + if r.terminalModelId != nil { + common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalOrdersMerchantLevelApiUpdateOrderConfig struct { - ctx context.Context - merchantId string - orderId string + ctx context.Context + merchantId string + orderId string terminalOrderRequest *TerminalOrderRequest } @@ -980,30 +1049,30 @@ func (r TerminalOrdersMerchantLevelApiUpdateOrderConfig) TerminalOrderRequest(te return r } + /* UpdateOrder Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. -The request body only needs to contain what you want to change. +The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provice the entire array. For example, if the array has three items: - - To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. + To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param orderId The unique identifier of the order. - @return TerminalOrdersMerchantLevelApiUpdateOrderConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param orderId The unique identifier of the order. + @return TerminalOrdersMerchantLevelApiUpdateOrderConfig */ func (a *TerminalOrdersMerchantLevelApi) UpdateOrderConfig(ctx context.Context, merchantId string, orderId string) TerminalOrdersMerchantLevelApiUpdateOrderConfig { return TerminalOrdersMerchantLevelApiUpdateOrderConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -1012,64 +1081,71 @@ Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provice the entire array. For example, if the array has three items: To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write * @param merchantId The unique identifier of the merchant account. * @param orderId The unique identifier of the order. - * @param req TerminalOrderRequest - reference of TerminalOrderRequest). + * @param req TerminalOrderRequest - reference of TerminalOrderRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalOrder */ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(r TerminalOrdersMerchantLevelApiUpdateOrderConfig) (TerminalOrder, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalOrder{} + var serviceError common.RestServiceError + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalOrderRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalOrderRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_company_level.go b/src/management/api_terminal_settings_company_level.go index 44eb24387..5bc9c330d 100644 --- a/src/management/api_terminal_settings_company_level.go +++ b/src/management/api_terminal_settings_company_level.go @@ -10,22 +10,19 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalSettingsCompanyLevelApi TerminalSettingsCompanyLevelApi service type TerminalSettingsCompanyLevelApi common.Service type TerminalSettingsCompanyLevelApiGetTerminalLogoConfig struct { - ctx context.Context + ctx context.Context companyId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -34,25 +31,26 @@ func (r TerminalSettingsCompanyLevelApiGetTerminalLogoConfig) Model(model string return r } + /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the company identified in the path. +Returns the logo that is configured for a specific payment terminal model at the company identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalSettingsCompanyLevelApiGetTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalSettingsCompanyLevelApiGetTerminalLogoConfig */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogoConfig(ctx context.Context, companyId string) TerminalSettingsCompanyLevelApiGetTerminalLogoConfig { return TerminalSettingsCompanyLevelApiGetTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -66,69 +64,77 @@ Returns the logo that is configured for a specific payment terminal model at the */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(r TerminalSettingsCompanyLevelApiGetTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/companies/{companyId}/terminalLogos" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig struct { - ctx context.Context + ctx context.Context companyId string } + /* GetTerminalSettings Get terminal settings @@ -141,13 +147,13 @@ To make this request, your API credential must have one of the following [roles] For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettingsConfig(ctx context.Context, companyId string) TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig { return TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -161,66 +167,73 @@ Returns the payment terminal settings that are configured for the company identi */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(r TerminalSettingsCompanyLevelApiGetTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/companies/{companyId}/terminalSettings" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig struct { - ctx context.Context + ctx context.Context companyId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -234,24 +247,25 @@ func (r TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig) Logo(logo Logo) return r } + /* UpdateTerminalLogo Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the company identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). +This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from the Adyen PSP level, specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogoConfig(ctx context.Context, companyId string) TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig { return TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -260,73 +274,80 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogoConfig(ctx context.C Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the company identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from the Adyen PSP level, specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param companyId The unique identifier of the company account. - * @param req Logo - reference of Logo). + * @param req Logo - reference of Logo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Logo */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(r TerminalSettingsCompanyLevelApiUpdateTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/companies/{companyId}/terminalLogos" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.logo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.logo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string terminalSettings *TerminalSettings } @@ -335,6 +356,7 @@ func (r TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig) TerminalSet return r } + /* UpdateTerminalSettings Update terminal settings @@ -350,13 +372,13 @@ To make this request, your API credential must have the following [role](https:/ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettingsConfig(ctx context.Context, companyId string) TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig { return TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -365,63 +387,70 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettingsConfig(ctx conte Update terminal settings Updates payment terminal settings for the company identified in the path. These settings apply to all terminals under the company, unless different values are configured at a lower level (merchant account, store, or individual terminal). * To change a parameter value, include the full object that contains the parameter, even if you don't want to change all parameters in the object. * To restore a parameter value inherited from the Adyen PSP level, include the full object that contains the parameter, and specify an empty value for the parameter or omit the parameter. * Objects that are not included in the request are not updated. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write * @param companyId The unique identifier of the company account. - * @param req TerminalSettings - reference of TerminalSettings). + * @param req TerminalSettings - reference of TerminalSettings). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalSettings */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(r TerminalSettingsCompanyLevelApiUpdateTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/companies/{companyId}/terminalSettings" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalSettings, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalSettings, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_merchant_level.go b/src/management/api_terminal_settings_merchant_level.go index d213751f9..65ac859e1 100644 --- a/src/management/api_terminal_settings_merchant_level.go +++ b/src/management/api_terminal_settings_merchant_level.go @@ -10,22 +10,19 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalSettingsMerchantLevelApi TerminalSettingsMerchantLevelApi service type TerminalSettingsMerchantLevelApi common.Service type TerminalSettingsMerchantLevelApiGetTerminalLogoConfig struct { - ctx context.Context + ctx context.Context merchantId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -34,24 +31,25 @@ func (r TerminalSettingsMerchantLevelApiGetTerminalLogoConfig) Model(model strin return r } + /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the merchant account identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the merchant account identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the merchant account, unless a different logo is configured at a lower level (store or individual terminal). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalSettingsMerchantLevelApiGetTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalSettingsMerchantLevelApiGetTerminalLogoConfig */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogoConfig(ctx context.Context, merchantId string) TerminalSettingsMerchantLevelApiGetTerminalLogoConfig { return TerminalSettingsMerchantLevelApiGetTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -65,69 +63,77 @@ Returns the logo that is configured for a specific payment terminal model at the */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(r TerminalSettingsMerchantLevelApiGetTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/merchants/{merchantId}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig struct { - ctx context.Context + ctx context.Context merchantId string } + /* GetTerminalSettings Get terminal settings @@ -137,13 +143,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettingsConfig(ctx context.Context, merchantId string) TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig { return TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -157,66 +163,73 @@ Returns the payment terminal settings that are configured for the merchant accou */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(r TerminalSettingsMerchantLevelApiGetTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/merchants/{merchantId}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig struct { - ctx context.Context + ctx context.Context merchantId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -230,10 +243,11 @@ func (r TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig) Logo(logo Logo return r } + /* UpdateTerminalLogo Update the terminal logo -Updates the logo for a specific payment terminal model at the merchant account identified in the path. You can update the logo for only one terminal model at a time. +Updates the logo for a specific payment terminal model at the merchant account identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the merchant account, unless a different logo is configured at a lower level (store or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. @@ -242,13 +256,13 @@ This logo applies to all terminals of the specified model under the merchant acc To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogoConfig(ctx context.Context, merchantId string) TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig { return TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -257,73 +271,80 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogoConfig(ctx context. Update the terminal logo Updates the logo for a specific payment terminal model at the merchant account identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the merchant account, unless a different logo is configured at a lower level (store or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from the company account, specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param merchantId The unique identifier of the merchant account. - * @param req Logo - reference of Logo). + * @param req Logo - reference of Logo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Logo */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(r TerminalSettingsMerchantLevelApiUpdateTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/merchants/{merchantId}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.logo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.logo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string terminalSettings *TerminalSettings } @@ -332,6 +353,7 @@ func (r TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig) TerminalSe return r } + /* UpdateTerminalSettings Update terminal settings @@ -345,13 +367,13 @@ These settings apply to all terminals under the merchant account, unless differe To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettingsConfig(ctx context.Context, merchantId string) TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig { return TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -360,63 +382,70 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettingsConfig(ctx cont Update terminal settings Updates payment terminal settings for the merchant account identified in the path. These settings apply to all terminals under the merchant account, unless different values are configured at a lower level (store or individual terminal). * To change a parameter value, include the full object that contains the parameter, even if you don't want to change all parameters in the object. * To restore a parameter value inherited from a higher level, include the full object that contains the parameter, and specify an empty value for the parameter or omit the parameter. * Objects that are not included in the request are not updated. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param merchantId The unique identifier of the merchant account. - * @param req TerminalSettings - reference of TerminalSettings). + * @param req TerminalSettings - reference of TerminalSettings). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalSettings */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(r TerminalSettingsMerchantLevelApiUpdateTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/merchants/{merchantId}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalSettings, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalSettings, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_store_level.go b/src/management/api_terminal_settings_store_level.go index 70d725e90..db8a16614 100644 --- a/src/management/api_terminal_settings_store_level.go +++ b/src/management/api_terminal_settings_store_level.go @@ -10,23 +10,20 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalSettingsStoreLevelApi TerminalSettingsStoreLevelApi service type TerminalSettingsStoreLevelApi common.Service type TerminalSettingsStoreLevelApiGetTerminalLogoConfig struct { - ctx context.Context + ctx context.Context merchantId string - reference string - model *string + reference string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -35,27 +32,28 @@ func (r TerminalSettingsStoreLevelApiGetTerminalLogoConfig) Model(model string) return r } + /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the store identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the store identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param reference The reference that identifies the store. - @return TerminalSettingsStoreLevelApiGetTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param reference The reference that identifies the store. + @return TerminalSettingsStoreLevelApiGetTerminalLogoConfig */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoConfig(ctx context.Context, merchantId string, reference string) TerminalSettingsStoreLevelApiGetTerminalLogoConfig { return TerminalSettingsStoreLevelApiGetTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -69,69 +67,76 @@ Returns the logo that is configured for a specific payment terminal model at the */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(r TerminalSettingsStoreLevelApiGetTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/merchants/{merchantId}/stores/{reference}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig struct { - ctx context.Context + ctx context.Context storeId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -140,24 +145,25 @@ func (r TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig) Model(model return r } + /* GetTerminalLogoByStoreId Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the store identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the store identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of that model under the store unless a different logo is configured for an individual terminal. To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreIdConfig(ctx context.Context, storeId string) TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig { return TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -171,70 +177,78 @@ Returns the logo that is configured for a specific payment terminal model at the */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(r TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/stores/{storeId}/terminalLogos" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiGetTerminalSettingsConfig struct { - ctx context.Context + ctx context.Context merchantId string - reference string + reference string } + /* GetTerminalSettings Get terminal settings @@ -247,16 +261,16 @@ To make this request, your API credential must have one of the following [roles] For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param reference The reference that identifies the store. - @return TerminalSettingsStoreLevelApiGetTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param reference The reference that identifies the store. + @return TerminalSettingsStoreLevelApiGetTerminalSettingsConfig */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsConfig(ctx context.Context, merchantId string, reference string) TerminalSettingsStoreLevelApiGetTerminalSettingsConfig { return TerminalSettingsStoreLevelApiGetTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -270,67 +284,75 @@ Returns the payment terminal settings that are configured for the store identifi */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(r TerminalSettingsStoreLevelApiGetTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/merchants/{merchantId}/stores/{reference}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig struct { - ctx context.Context + ctx context.Context storeId string } + /* GetTerminalSettingsByStoreId Get terminal settings @@ -343,13 +365,13 @@ To make this request, your API credential must have one of the following [roles] For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreIdConfig(ctx context.Context, storeId string) TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig { return TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -363,67 +385,74 @@ Returns the payment terminal settings that are configured for the store identifi */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(r TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/stores/{storeId}/terminalSettings" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig struct { - ctx context.Context + ctx context.Context merchantId string - reference string - model *string - logo *Logo + reference string + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T @@ -437,11 +466,12 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig) Logo(logo Logo) T return r } + /* UpdateTerminalLogo Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. +This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. @@ -449,16 +479,16 @@ This logo applies to all terminals of the specified model under the store, unles To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param reference The reference that identifies the store. - @return TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param reference The reference that identifies the store. + @return TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoConfig(ctx context.Context, merchantId string, reference string) TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig { return TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -467,76 +497,83 @@ Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param merchantId The unique identifier of the merchant account. * @param reference The reference that identifies the store. - * @param req Logo - reference of Logo). + * @param req Logo - reference of Logo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Logo */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(r TerminalSettingsStoreLevelApiUpdateTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/merchants/{merchantId}/stores/{reference}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.logo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.logo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig struct { - ctx context.Context + ctx context.Context storeId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -550,11 +587,12 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig) Logo(log return r } + /* UpdateTerminalLogoByStoreId Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. +This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. @@ -562,13 +600,13 @@ This logo applies to all terminals of the specified model under the store, unles To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreIdConfig(ctx context.Context, storeId string) TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig { return TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -577,74 +615,81 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreIdConfig(ctx co Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param storeId The unique identifier of the store. - * @param req Logo - reference of Logo). + * @param req Logo - reference of Logo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Logo */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(r TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/stores/{storeId}/terminalLogos" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.logo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.logo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig struct { - ctx context.Context - merchantId string - reference string + ctx context.Context + merchantId string + reference string terminalSettings *TerminalSettings } @@ -653,6 +698,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig) TerminalSetti return r } + /* UpdateTerminalSettings Update terminal settings @@ -668,16 +714,16 @@ To make this request, your API credential must have the following [role](https:/ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param reference The reference that identifies the store. - @return TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param reference The reference that identifies the store. + @return TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsConfig(ctx context.Context, merchantId string, reference string) TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig { return TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -686,71 +732,78 @@ Update terminal settings Updates payment terminal settings for the store identified in the path. These settings apply to all terminals under the store, unless different values are configured for an individual terminal. * To change a parameter value, include the full object that contains the parameter, even if you don't want to change all parameters in the object. * To restore a parameter value inherited from a higher level, include the full object that contains the parameter, and specify an empty value for the parameter or omit the parameter. * Objects that are not included in the request are not updated. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write * @param merchantId The unique identifier of the merchant account. * @param reference The reference that identifies the store. - * @param req TerminalSettings - reference of TerminalSettings). + * @param req TerminalSettings - reference of TerminalSettings). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalSettings */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(r TerminalSettingsStoreLevelApiUpdateTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/merchants/{merchantId}/stores/{reference}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalSettings, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalSettings, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig struct { - ctx context.Context - storeId string + ctx context.Context + storeId string terminalSettings *TerminalSettings } @@ -759,6 +812,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig) Term return r } + /* UpdateTerminalSettingsByStoreId Update terminal settings @@ -774,13 +828,13 @@ To make this request, your API credential must have the following [role](https:/ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param storeId The unique identifier of the store. - @return TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param storeId The unique identifier of the store. + @return TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreIdConfig(ctx context.Context, storeId string) TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig { return TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig{ - ctx: ctx, + ctx: ctx, storeId: storeId, } } @@ -789,63 +843,70 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreIdConfig(ct Update terminal settings Updates payment terminal settings for the store identified in the path. These settings apply to all terminals under the store, unless different values are configured for an individual terminal. * To change a parameter value, include the full object that contains the parameter, even if you don't want to change all parameters in the object. * To restore a parameter value inherited from a higher level, include the full object that contains the parameter, and specify an empty value for the parameter or omit the parameter. * Objects that are not included in the request are not updated. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write * @param storeId The unique identifier of the store. - * @param req TerminalSettings - reference of TerminalSettings). + * @param req TerminalSettings - reference of TerminalSettings). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalSettings */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(r TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/stores/{storeId}/terminalSettings" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalSettings, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalSettings, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_terminal_level.go b/src/management/api_terminal_settings_terminal_level.go index a0257ac16..3fa53597e 100644 --- a/src/management/api_terminal_settings_terminal_level.go +++ b/src/management/api_terminal_settings_terminal_level.go @@ -10,23 +10,21 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalSettingsTerminalLevelApi TerminalSettingsTerminalLevelApi service type TerminalSettingsTerminalLevelApi common.Service type TerminalSettingsTerminalLevelApiGetTerminalLogoConfig struct { - ctx context.Context + ctx context.Context terminalId string } + /* GetTerminalLogo Get the terminal logo @@ -37,13 +35,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Terminal settings read * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param terminalId The unique identifier of the payment terminal. - @return TerminalSettingsTerminalLevelApiGetTerminalLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param terminalId The unique identifier of the payment terminal. + @return TerminalSettingsTerminalLevelApiGetTerminalLogoConfig */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogoConfig(ctx context.Context, terminalId string) TerminalSettingsTerminalLevelApiGetTerminalLogoConfig { return TerminalSettingsTerminalLevelApiGetTerminalLogoConfig{ - ctx: ctx, + ctx: ctx, terminalId: terminalId, } } @@ -57,66 +55,74 @@ Returns the logo that is configured for the payment terminal identified in the p */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(r TerminalSettingsTerminalLevelApiGetTerminalLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/terminals/{terminalId}/terminalLogos" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig struct { - ctx context.Context + ctx context.Context terminalId string } + /* GetTerminalSettings Get terminal settings @@ -129,13 +135,13 @@ To make this request, your API credential must have one of the following [roles] For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param terminalId The unique identifier of the payment terminal. - @return TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param terminalId The unique identifier of the payment terminal. + @return TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettingsConfig(ctx context.Context, terminalId string) TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig { return TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, terminalId: terminalId, } } @@ -149,65 +155,72 @@ Returns the settings that are configured for the payment terminal identified in */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(r TerminalSettingsTerminalLevelApiGetTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/terminals/{terminalId}/terminalSettings" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsTerminalLevelApiUpdateLogoConfig struct { - ctx context.Context + ctx context.Context terminalId string - logo *Logo + logo *Logo } func (r TerminalSettingsTerminalLevelApiUpdateLogoConfig) Logo(logo Logo) TerminalSettingsTerminalLevelApiUpdateLogoConfig { @@ -215,6 +228,7 @@ func (r TerminalSettingsTerminalLevelApiUpdateLogoConfig) Logo(logo Logo) Termin return r } + /* UpdateLogo Update the logo @@ -226,13 +240,13 @@ Updates the logo for the payment terminal identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param terminalId The unique identifier of the payment terminal. - @return TerminalSettingsTerminalLevelApiUpdateLogoConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param terminalId The unique identifier of the payment terminal. + @return TerminalSettingsTerminalLevelApiUpdateLogoConfig */ func (a *TerminalSettingsTerminalLevelApi) UpdateLogoConfig(ctx context.Context, terminalId string) TerminalSettingsTerminalLevelApiUpdateLogoConfig { return TerminalSettingsTerminalLevelApiUpdateLogoConfig{ - ctx: ctx, + ctx: ctx, terminalId: terminalId, } } @@ -241,70 +255,77 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogoConfig(ctx context.Context, Update the logo Updates the logo for the payment terminal identified in the path. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (store, merchant account, or company account), specify an empty logo value. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write * @param terminalId The unique identifier of the payment terminal. - * @param req Logo - reference of Logo). + * @param req Logo - reference of Logo). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Logo */ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(r TerminalSettingsTerminalLevelApiUpdateLogoConfig) (Logo, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Logo{} + var serviceError common.RestServiceError + res := &Logo{} path := "/terminals/{terminalId}/terminalLogos" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.logo, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.logo, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig struct { - ctx context.Context - terminalId string + ctx context.Context + terminalId string terminalSettings *TerminalSettings } @@ -313,6 +334,7 @@ func (r TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig) TerminalSe return r } + /* UpdateTerminalSettings Update terminal settings @@ -328,13 +350,13 @@ To make this request, your API credential must have the following [role](https:/ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param terminalId The unique identifier of the payment terminal. - @return TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param terminalId The unique identifier of the payment terminal. + @return TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig */ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettingsConfig(ctx context.Context, terminalId string) TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig { return TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig{ - ctx: ctx, + ctx: ctx, terminalId: terminalId, } } @@ -343,63 +365,70 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettingsConfig(ctx cont Update terminal settings Updates the settings that are configured for the payment terminal identified in the path. * To change a parameter value, include the full object that contains the parameter, even if you don't want to change all parameters in the object. * To restore a parameter value inherited from a higher level, include the full object that contains the parameter, and specify an empty value for the parameter or omit the parameter. * Objects that are not included in the request are not updated. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal settings read and write For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automating-terminal-management/configure-terminals-api#sensitive-terminal-settings), your API credential must have the following role: * Management API—Terminal settings Advanced read and write * @param terminalId The unique identifier of the payment terminal. - * @param req TerminalSettings - reference of TerminalSettings). + * @param req TerminalSettings - reference of TerminalSettings). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TerminalSettings */ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(r TerminalSettingsTerminalLevelApiUpdateTerminalSettingsConfig) (TerminalSettings, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TerminalSettings{} + var serviceError common.RestServiceError + res := &TerminalSettings{} path := "/terminals/{terminalId}/terminalSettings" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.terminalSettings, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.terminalSettings, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_terminals_terminal_level.go b/src/management/api_terminals_terminal_level.go index 5bbfb89d8..353bb46f8 100644 --- a/src/management/api_terminals_terminal_level.go +++ b/src/management/api_terminals_terminal_level.go @@ -10,26 +10,24 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // TerminalsTerminalLevelApi TerminalsTerminalLevelApi service type TerminalsTerminalLevelApi common.Service type TerminalsTerminalLevelApiListTerminalsConfig struct { - ctx context.Context + ctx context.Context searchQuery *string - countries *string + countries *string merchantIds *string - storeIds *string + storeIds *string brandModels *string - pageNumber *int32 - pageSize *int32 + pageNumber *int32 + pageSize *int32 } // Returns terminals with an ID that contains the specified string. If present, other query parameters are ignored. @@ -74,17 +72,18 @@ func (r TerminalsTerminalLevelApiListTerminalsConfig) PageSize(pageSize int32) T return r } + /* ListTerminals Get a list of terminals -Returns the payment terminals that the API credential has access to and that match the query parameters. +Returns the payment terminals that the API credential has access to and that match the query parameters. When using `searchQuery`, other query parameters are ignored. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API — Terminal actions read - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return TerminalsTerminalLevelApiListTerminalsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return TerminalsTerminalLevelApiListTerminalsConfig */ func (a *TerminalsTerminalLevelApi) ListTerminalsConfig(ctx context.Context) TerminalsTerminalLevelApiListTerminalsConfig { return TerminalsTerminalLevelApiListTerminalsConfig{ @@ -100,77 +99,84 @@ Returns the payment terminals that the API credential has access to and that mat */ func (a *TerminalsTerminalLevelApi) ListTerminals(r TerminalsTerminalLevelApiListTerminalsConfig) (ListTerminalsResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListTerminalsResponse{} + var serviceError common.RestServiceError + res := &ListTerminalsResponse{} path := "/terminals" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.searchQuery != nil { - common.ParameterAddToQuery(queryParams, "searchQuery", r.searchQuery, "") - } - if r.countries != nil { - common.ParameterAddToQuery(queryParams, "countries", r.countries, "") - } - if r.merchantIds != nil { - common.ParameterAddToQuery(queryParams, "merchantIds", r.merchantIds, "") - } - if r.storeIds != nil { - common.ParameterAddToQuery(queryParams, "storeIds", r.storeIds, "") - } - if r.brandModels != nil { - common.ParameterAddToQuery(queryParams, "brandModels", r.brandModels, "") - } - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.searchQuery != nil { + common.ParameterAddToQuery(queryParams, "searchQuery", r.searchQuery, "") + } + if r.countries != nil { + common.ParameterAddToQuery(queryParams, "countries", r.countries, "") + } + if r.merchantIds != nil { + common.ParameterAddToQuery(queryParams, "merchantIds", r.merchantIds, "") + } + if r.storeIds != nil { + common.ParameterAddToQuery(queryParams, "storeIds", r.storeIds, "") + } + if r.brandModels != nil { + common.ParameterAddToQuery(queryParams, "brandModels", r.brandModels, "") + } + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_users_company_level.go b/src/management/api_users_company_level.go index 0d569dccd..386fc0a82 100644 --- a/src/management/api_users_company_level.go +++ b/src/management/api_users_company_level.go @@ -10,21 +10,18 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // UsersCompanyLevelApi UsersCompanyLevelApi service type UsersCompanyLevelApi common.Service type UsersCompanyLevelApiCreateNewUserConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string createCompanyUserRequest *CreateCompanyUserRequest } @@ -33,6 +30,7 @@ func (r UsersCompanyLevelApiCreateNewUserConfig) CreateCompanyUserRequest(create return r } + /* CreateNewUser Create a new user @@ -41,88 +39,97 @@ Creates the user for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return UsersCompanyLevelApiCreateNewUserConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return UsersCompanyLevelApiCreateNewUserConfig */ func (a *UsersCompanyLevelApi) CreateNewUserConfig(ctx context.Context, companyId string) UsersCompanyLevelApiCreateNewUserConfig { return UsersCompanyLevelApiCreateNewUserConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } /* Create a new user -Creates the user for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Creates the user for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param companyId The unique identifier of the company account. - * @param req CreateCompanyUserRequest - reference of CreateCompanyUserRequest). + * @param req CreateCompanyUserRequest - reference of CreateCompanyUserRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateCompanyUserResponse */ func (a *UsersCompanyLevelApi) CreateNewUser(r UsersCompanyLevelApiCreateNewUserConfig) (CreateCompanyUserResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CreateCompanyUserResponse{} + var serviceError common.RestServiceError + res := &CreateCompanyUserResponse{} path := "/companies/{companyId}/users" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createCompanyUserRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createCompanyUserRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersCompanyLevelApiGetUserDetailsConfig struct { - ctx context.Context + ctx context.Context companyId string - userId string + userId string } + /* GetUserDetails Get user details @@ -131,22 +138,23 @@ Returns user details for the `userId` and the `companyId` identified in the path To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param userId The unique identifier of the user. - @return UsersCompanyLevelApiGetUserDetailsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param userId The unique identifier of the user. + @return UsersCompanyLevelApiGetUserDetailsConfig */ func (a *UsersCompanyLevelApi) GetUserDetailsConfig(ctx context.Context, companyId string, userId string) UsersCompanyLevelApiGetUserDetailsConfig { return UsersCompanyLevelApiGetUserDetailsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - userId: userId, + userId: userId, } } /* Get user details -Returns user details for the `userId` and the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Returns user details for the `userId` and the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param companyId The unique identifier of the company account. * @param userId The unique identifier of the user. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -154,68 +162,75 @@ Returns user details for the `userId` and the `companyId` id */ func (a *UsersCompanyLevelApi) GetUserDetails(r UsersCompanyLevelApiGetUserDetailsConfig) (CompanyUser, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CompanyUser{} + var serviceError common.RestServiceError + res := &CompanyUser{} path := "/companies/{companyId}/users/{userId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersCompanyLevelApiListUsersConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string pageNumber *int32 - pageSize *int32 - username *string + pageSize *int32 + username *string } // The number of the page to return. @@ -236,6 +251,7 @@ func (r UsersCompanyLevelApiListUsersConfig) Username(username string) UsersComp return r } + /* ListUsers Get a list of users @@ -244,94 +260,102 @@ Returns the list of users for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @return UsersCompanyLevelApiListUsersConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @return UsersCompanyLevelApiListUsersConfig */ func (a *UsersCompanyLevelApi) ListUsersConfig(ctx context.Context, companyId string) UsersCompanyLevelApiListUsersConfig { return UsersCompanyLevelApiListUsersConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } /* Get a list of users -Returns the list of users for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Returns the list of users for the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param companyId The unique identifier of the company account. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ListCompanyUsersResponse */ func (a *UsersCompanyLevelApi) ListUsers(r UsersCompanyLevelApiListUsersConfig) (ListCompanyUsersResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListCompanyUsersResponse{} + var serviceError common.RestServiceError + res := &ListCompanyUsersResponse{} path := "/companies/{companyId}/users" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.username != nil { - common.ParameterAddToQuery(queryParams, "username", r.username, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.username != nil { + common.ParameterAddToQuery(queryParams, "username", r.username, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersCompanyLevelApiUpdateUserDetailsConfig struct { - ctx context.Context - companyId string - userId string + ctx context.Context + companyId string + userId string updateCompanyUserRequest *UpdateCompanyUserRequest } @@ -340,6 +364,7 @@ func (r UsersCompanyLevelApiUpdateUserDetailsConfig) UpdateCompanyUserRequest(up return r } + /* UpdateUserDetails Update user details @@ -348,82 +373,90 @@ Updates user details for the `userId` and the `companyId` identified in the path To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param userId The unique identifier of the user. - @return UsersCompanyLevelApiUpdateUserDetailsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param userId The unique identifier of the user. + @return UsersCompanyLevelApiUpdateUserDetailsConfig */ func (a *UsersCompanyLevelApi) UpdateUserDetailsConfig(ctx context.Context, companyId string, userId string) UsersCompanyLevelApiUpdateUserDetailsConfig { return UsersCompanyLevelApiUpdateUserDetailsConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, - userId: userId, + userId: userId, } } /* Update user details -Updates user details for the `userId` and the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Updates user details for the `userId` and the `companyId` identified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param companyId The unique identifier of the company account. * @param userId The unique identifier of the user. - * @param req UpdateCompanyUserRequest - reference of UpdateCompanyUserRequest). + * @param req UpdateCompanyUserRequest - reference of UpdateCompanyUserRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CompanyUser */ func (a *UsersCompanyLevelApi) UpdateUserDetails(r UsersCompanyLevelApiUpdateUserDetailsConfig) (CompanyUser, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CompanyUser{} + var serviceError common.RestServiceError + res := &CompanyUser{} path := "/companies/{companyId}/users/{userId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateCompanyUserRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateCompanyUserRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_users_merchant_level.go b/src/management/api_users_merchant_level.go index 8cef4844c..8f6549578 100644 --- a/src/management/api_users_merchant_level.go +++ b/src/management/api_users_merchant_level.go @@ -10,21 +10,18 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // UsersMerchantLevelApi UsersMerchantLevelApi service type UsersMerchantLevelApi common.Service type UsersMerchantLevelApiCreateNewUserConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string createMerchantUserRequest *CreateMerchantUserRequest } @@ -33,6 +30,7 @@ func (r UsersMerchantLevelApiCreateNewUserConfig) CreateMerchantUserRequest(crea return r } + /* CreateNewUser Create a new user @@ -41,88 +39,97 @@ Creates a user for the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId Unique identifier of the merchant. - @return UsersMerchantLevelApiCreateNewUserConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId Unique identifier of the merchant. + @return UsersMerchantLevelApiCreateNewUserConfig */ func (a *UsersMerchantLevelApi) CreateNewUserConfig(ctx context.Context, merchantId string) UsersMerchantLevelApiCreateNewUserConfig { return UsersMerchantLevelApiCreateNewUserConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } /* Create a new user -Creates a user for the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Creates a user for the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param merchantId Unique identifier of the merchant. - * @param req CreateMerchantUserRequest - reference of CreateMerchantUserRequest). + * @param req CreateMerchantUserRequest - reference of CreateMerchantUserRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreateUserResponse */ func (a *UsersMerchantLevelApi) CreateNewUser(r UsersMerchantLevelApiCreateNewUserConfig) (CreateUserResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &CreateUserResponse{} + var serviceError common.RestServiceError + res := &CreateUserResponse{} path := "/merchants/{merchantId}/users" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createMerchantUserRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createMerchantUserRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersMerchantLevelApiGetUserDetailsConfig struct { - ctx context.Context + ctx context.Context merchantId string - userId string + userId string } + /* GetUserDetails Get user details @@ -131,22 +138,23 @@ Returns user details for the `userId` and the `merchantId` specified in the path To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId Unique identifier of the merchant. - @param userId Unique identifier of the user. - @return UsersMerchantLevelApiGetUserDetailsConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId Unique identifier of the merchant. + @param userId Unique identifier of the user. + @return UsersMerchantLevelApiGetUserDetailsConfig */ func (a *UsersMerchantLevelApi) GetUserDetailsConfig(ctx context.Context, merchantId string, userId string) UsersMerchantLevelApiGetUserDetailsConfig { return UsersMerchantLevelApiGetUserDetailsConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - userId: userId, + userId: userId, } } /* Get user details -Returns user details for the `userId` and the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Returns user details for the `userId` and the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param merchantId Unique identifier of the merchant. * @param userId Unique identifier of the user. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -154,68 +162,75 @@ Returns user details for the `userId` and the `merchantId` s */ func (a *UsersMerchantLevelApi) GetUserDetails(r UsersMerchantLevelApiGetUserDetailsConfig) (User, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &User{} + var serviceError common.RestServiceError + res := &User{} path := "/merchants/{merchantId}/users/{userId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersMerchantLevelApiListUsersConfig struct { - ctx context.Context + ctx context.Context merchantId string pageNumber *int32 - pageSize *int32 - username *string + pageSize *int32 + username *string } // The number of the page to fetch. @@ -236,6 +251,7 @@ func (r UsersMerchantLevelApiListUsersConfig) Username(username string) UsersMer return r } + /* ListUsers Get a list of users @@ -244,94 +260,102 @@ Returns a list of users associated with the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId Unique identifier of the merchant. - @return UsersMerchantLevelApiListUsersConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId Unique identifier of the merchant. + @return UsersMerchantLevelApiListUsersConfig */ func (a *UsersMerchantLevelApi) ListUsersConfig(ctx context.Context, merchantId string) UsersMerchantLevelApiListUsersConfig { return UsersMerchantLevelApiListUsersConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } /* Get a list of users -Returns a list of users associated with the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Returns a list of users associated with the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param merchantId Unique identifier of the merchant. * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ListMerchantUsersResponse */ func (a *UsersMerchantLevelApi) ListUsers(r UsersMerchantLevelApiListUsersConfig) (ListMerchantUsersResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListMerchantUsersResponse{} + var serviceError common.RestServiceError + res := &ListMerchantUsersResponse{} path := "/merchants/{merchantId}/users" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.username != nil { - common.ParameterAddToQuery(queryParams, "username", r.username, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.username != nil { + common.ParameterAddToQuery(queryParams, "username", r.username, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type UsersMerchantLevelApiUpdateUserConfig struct { - ctx context.Context - merchantId string - userId string + ctx context.Context + merchantId string + userId string updateMerchantUserRequest *UpdateMerchantUserRequest } @@ -340,6 +364,7 @@ func (r UsersMerchantLevelApiUpdateUserConfig) UpdateMerchantUserRequest(updateM return r } + /* UpdateUser Update a user @@ -348,82 +373,90 @@ Updates user details for the `userId` and the `merchantId` specified in the path To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId Unique identifier of the merchant. - @param userId Unique identifier of the user. - @return UsersMerchantLevelApiUpdateUserConfig + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId Unique identifier of the merchant. + @param userId Unique identifier of the user. + @return UsersMerchantLevelApiUpdateUserConfig */ func (a *UsersMerchantLevelApi) UpdateUserConfig(ctx context.Context, merchantId string, userId string) UsersMerchantLevelApiUpdateUserConfig { return UsersMerchantLevelApiUpdateUserConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - userId: userId, + userId: userId, } } /* Update a user -Updates user details for the `userId` and the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write +Updates user details for the `userId` and the `merchantId` specified in the path. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Users read and write * @param merchantId Unique identifier of the merchant. * @param userId Unique identifier of the user. - * @param req UpdateMerchantUserRequest - reference of UpdateMerchantUserRequest). + * @param req UpdateMerchantUserRequest - reference of UpdateMerchantUserRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return User */ func (a *UsersMerchantLevelApi) UpdateUser(r UsersMerchantLevelApiUpdateUserConfig) (User, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &User{} + var serviceError common.RestServiceError + res := &User{} path := "/merchants/{merchantId}/users/{userId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateMerchantUserRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateMerchantUserRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_webhooks_company_level.go b/src/management/api_webhooks_company_level.go index 2d32fc542..ad09957ff 100644 --- a/src/management/api_webhooks_company_level.go +++ b/src/management/api_webhooks_company_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // WebhooksCompanyLevelApi WebhooksCompanyLevelApi service type WebhooksCompanyLevelApi common.Service type WebhooksCompanyLevelApiGenerateHmacKeyConfig struct { - ctx context.Context + ctx context.Context companyId string webhookId string } + /* GenerateHmacKey Generate an HMAC key @@ -36,14 +34,14 @@ Returns an [HMAC key](https://en.wikipedia.org/wiki/HMAC) for the webhook identi To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksCompanyLevelApiGenerateHmacKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksCompanyLevelApiGenerateHmacKeyConfig */ func (a *WebhooksCompanyLevelApi) GenerateHmacKeyConfig(ctx context.Context, companyId string, webhookId string) WebhooksCompanyLevelApiGenerateHmacKeyConfig { return WebhooksCompanyLevelApiGenerateHmacKeyConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, webhookId: webhookId, } @@ -59,68 +57,76 @@ Returns an [HMAC key](https://en.wikipedia.org/wiki/HMAC) for the webhook identi */ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(r WebhooksCompanyLevelApiGenerateHmacKeyConfig) (GenerateHmacKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateHmacKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateHmacKeyResponse{} path := "/companies/{companyId}/webhooks/{webhookId}/generateHmac" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksCompanyLevelApiGetWebhookConfig struct { - ctx context.Context + ctx context.Context companyId string webhookId string } + /* GetWebhook Get a webhook @@ -130,14 +136,14 @@ To make this request, your API credential must have one of the following [roles] * Management API—Webhooks read * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksCompanyLevelApiGetWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksCompanyLevelApiGetWebhookConfig */ func (a *WebhooksCompanyLevelApi) GetWebhookConfig(ctx context.Context, companyId string, webhookId string) WebhooksCompanyLevelApiGetWebhookConfig { return WebhooksCompanyLevelApiGetWebhookConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, webhookId: webhookId, } @@ -153,67 +159,74 @@ Returns the configuration for the webhook identified in the path. To make this */ func (a *WebhooksCompanyLevelApi) GetWebhook(r WebhooksCompanyLevelApiGetWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksCompanyLevelApiListAllWebhooksConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -228,6 +241,7 @@ func (r WebhooksCompanyLevelApiListAllWebhooksConfig) PageSize(pageSize int32) W return r } + /* ListAllWebhooks List all webhooks @@ -237,13 +251,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Webhooks read * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). - @return WebhooksCompanyLevelApiListAllWebhooksConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + @return WebhooksCompanyLevelApiListAllWebhooksConfig */ func (a *WebhooksCompanyLevelApi) ListAllWebhooksConfig(ctx context.Context, companyId string) WebhooksCompanyLevelApiListAllWebhooksConfig { return WebhooksCompanyLevelApiListAllWebhooksConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -257,73 +271,81 @@ Lists all webhook configurations for the company account. To make this request, */ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(r WebhooksCompanyLevelApiListAllWebhooksConfig) (ListWebhooksResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListWebhooksResponse{} + var serviceError common.RestServiceError + res := &ListWebhooksResponse{} path := "/companies/{companyId}/webhooks" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksCompanyLevelApiRemoveWebhookConfig struct { - ctx context.Context + ctx context.Context companyId string webhookId string } + /* RemoveWebhook Remove a webhook @@ -332,14 +354,14 @@ Remove the configuration for the webhook identified in the path. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksCompanyLevelApiRemoveWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksCompanyLevelApiRemoveWebhookConfig */ func (a *WebhooksCompanyLevelApi) RemoveWebhookConfig(ctx context.Context, companyId string, webhookId string) WebhooksCompanyLevelApiRemoveWebhookConfig { return WebhooksCompanyLevelApiRemoveWebhookConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, webhookId: webhookId, } @@ -354,65 +376,71 @@ Remove the configuration for the webhook identified in the path. To make this r */ func (a *WebhooksCompanyLevelApi) RemoveWebhook(r WebhooksCompanyLevelApiRemoveWebhookConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type WebhooksCompanyLevelApiSetUpWebhookConfig struct { - ctx context.Context - companyId string + ctx context.Context + companyId string createCompanyWebhookRequest *CreateCompanyWebhookRequest } @@ -421,6 +449,7 @@ func (r WebhooksCompanyLevelApiSetUpWebhookConfig) CreateCompanyWebhookRequest(c return r } + /* SetUpWebhook Set up a webhook @@ -429,13 +458,13 @@ Subscribe to receive webhook notifications about events related to your company To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). - @return WebhooksCompanyLevelApiSetUpWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). + @return WebhooksCompanyLevelApiSetUpWebhookConfig */ func (a *WebhooksCompanyLevelApi) SetUpWebhookConfig(ctx context.Context, companyId string) WebhooksCompanyLevelApiSetUpWebhookConfig { return WebhooksCompanyLevelApiSetUpWebhookConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, } } @@ -444,71 +473,78 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhookConfig(ctx context.Context, compan Set up a webhook Subscribe to receive webhook notifications about events related to your company account. You can add basic authentication to make sure the data is secure. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). - * @param req CreateCompanyWebhookRequest - reference of CreateCompanyWebhookRequest). + * @param req CreateCompanyWebhookRequest - reference of CreateCompanyWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Webhook */ func (a *WebhooksCompanyLevelApi) SetUpWebhook(r WebhooksCompanyLevelApiSetUpWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/companies/{companyId}/webhooks" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createCompanyWebhookRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createCompanyWebhookRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksCompanyLevelApiTestWebhookConfig struct { - ctx context.Context - companyId string - webhookId string + ctx context.Context + companyId string + webhookId string testCompanyWebhookRequest *TestCompanyWebhookRequest } @@ -517,6 +553,7 @@ func (r WebhooksCompanyLevelApiTestWebhookConfig) TestCompanyWebhookRequest(test return r } + /* TestWebhook Test a webhook @@ -531,14 +568,14 @@ The response describes the result of the test. The `status` field tells you if t To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksCompanyLevelApiTestWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksCompanyLevelApiTestWebhookConfig */ func (a *WebhooksCompanyLevelApi) TestWebhookConfig(ctx context.Context, companyId string, webhookId string) WebhooksCompanyLevelApiTestWebhookConfig { return WebhooksCompanyLevelApiTestWebhookConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, webhookId: webhookId, } @@ -549,72 +586,79 @@ Test a webhook Sends sample notifications to test if the webhook is set up correctly. We send sample notifications for maximum 20 of the merchant accounts that the webhook is configured for. If the webhook is configured for more than 20 merchant accounts, use the `merchantIds` array to specify a subset of the merchant accounts for which to send test notifications. We send four test notifications for each event code you choose. They cover success and failure scenarios for the hard-coded currencies EUR and GBP, regardless of the currencies configured in the merchant accounts. For custom notifications, we only send the specified custom notification. The response describes the result of the test. The `status` field tells you if the test was successful or not. You can use the other response fields to troubleshoot unsuccessful tests. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param companyId The unique identifier of the company account. * @param webhookId Unique identifier of the webhook configuration. - * @param req TestCompanyWebhookRequest - reference of TestCompanyWebhookRequest). + * @param req TestCompanyWebhookRequest - reference of TestCompanyWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TestWebhookResponse */ func (a *WebhooksCompanyLevelApi) TestWebhook(r WebhooksCompanyLevelApiTestWebhookConfig) (TestWebhookResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TestWebhookResponse{} + var serviceError common.RestServiceError + res := &TestWebhookResponse{} path := "/companies/{companyId}/webhooks/{webhookId}/test" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.testCompanyWebhookRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.testCompanyWebhookRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksCompanyLevelApiUpdateWebhookConfig struct { - ctx context.Context - companyId string - webhookId string + ctx context.Context + companyId string + webhookId string updateCompanyWebhookRequest *UpdateCompanyWebhookRequest } @@ -623,6 +667,7 @@ func (r WebhooksCompanyLevelApiUpdateWebhookConfig) UpdateCompanyWebhookRequest( return r } + /* UpdateWebhook Update a webhook @@ -631,14 +676,14 @@ Make changes to the configuration of the webhook identified in the path. The req To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param companyId The unique identifier of the company account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksCompanyLevelApiUpdateWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param companyId The unique identifier of the company account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksCompanyLevelApiUpdateWebhookConfig */ func (a *WebhooksCompanyLevelApi) UpdateWebhookConfig(ctx context.Context, companyId string, webhookId string) WebhooksCompanyLevelApiUpdateWebhookConfig { return WebhooksCompanyLevelApiUpdateWebhookConfig{ - ctx: ctx, + ctx: ctx, companyId: companyId, webhookId: webhookId, } @@ -649,64 +694,71 @@ Update a webhook Make changes to the configuration of the webhook identified in the path. The request contains the new values you want to have in the webhook configuration. The response contains the full configuration for the webhook, which includes the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param companyId The unique identifier of the company account. * @param webhookId Unique identifier of the webhook configuration. - * @param req UpdateCompanyWebhookRequest - reference of UpdateCompanyWebhookRequest). + * @param req UpdateCompanyWebhookRequest - reference of UpdateCompanyWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Webhook */ func (a *WebhooksCompanyLevelApi) UpdateWebhook(r WebhooksCompanyLevelApiUpdateWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateCompanyWebhookRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateCompanyWebhookRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/api_webhooks_merchant_level.go b/src/management/api_webhooks_merchant_level.go index a9515197d..7f170b82b 100644 --- a/src/management/api_webhooks_merchant_level.go +++ b/src/management/api_webhooks_merchant_level.go @@ -10,24 +10,22 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - _nethttp "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // WebhooksMerchantLevelApi WebhooksMerchantLevelApi service type WebhooksMerchantLevelApi common.Service type WebhooksMerchantLevelApiGenerateHmacKeyConfig struct { - ctx context.Context + ctx context.Context merchantId string - webhookId string + webhookId string } + /* GenerateHmacKey Generate an HMAC key @@ -36,16 +34,16 @@ Returns an [HMAC key](https://en.wikipedia.org/wiki/HMAC) for the webhook identi To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param webhookId - @return WebhooksMerchantLevelApiGenerateHmacKeyConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param webhookId + @return WebhooksMerchantLevelApiGenerateHmacKeyConfig */ func (a *WebhooksMerchantLevelApi) GenerateHmacKeyConfig(ctx context.Context, merchantId string, webhookId string) WebhooksMerchantLevelApiGenerateHmacKeyConfig { return WebhooksMerchantLevelApiGenerateHmacKeyConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -59,68 +57,76 @@ Returns an [HMAC key](https://en.wikipedia.org/wiki/HMAC) for the webhook identi */ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(r WebhooksMerchantLevelApiGenerateHmacKeyConfig) (GenerateHmacKeyResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &GenerateHmacKeyResponse{} + var serviceError common.RestServiceError + res := &GenerateHmacKeyResponse{} path := "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksMerchantLevelApiGetWebhookConfig struct { - ctx context.Context + ctx context.Context merchantId string - webhookId string + webhookId string } + /* GetWebhook Get a webhook @@ -130,16 +136,16 @@ To make this request, your API credential must have one of the following [roles] * Management API—Webhooks read * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksMerchantLevelApiGetWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksMerchantLevelApiGetWebhookConfig */ func (a *WebhooksMerchantLevelApi) GetWebhookConfig(ctx context.Context, merchantId string, webhookId string) WebhooksMerchantLevelApiGetWebhookConfig { return WebhooksMerchantLevelApiGetWebhookConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -153,67 +159,74 @@ Returns the configuration for the webhook identified in the path. To make this */ func (a *WebhooksMerchantLevelApi) GetWebhook(r WebhooksMerchantLevelApiGetWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksMerchantLevelApiListAllWebhooksConfig struct { - ctx context.Context + ctx context.Context merchantId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -228,6 +241,7 @@ func (r WebhooksMerchantLevelApiListAllWebhooksConfig) PageSize(pageSize int32) return r } + /* ListAllWebhooks List all webhooks @@ -237,13 +251,13 @@ To make this request, your API credential must have one of the following [roles] * Management API—Webhooks read * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return WebhooksMerchantLevelApiListAllWebhooksConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return WebhooksMerchantLevelApiListAllWebhooksConfig */ func (a *WebhooksMerchantLevelApi) ListAllWebhooksConfig(ctx context.Context, merchantId string) WebhooksMerchantLevelApiListAllWebhooksConfig { return WebhooksMerchantLevelApiListAllWebhooksConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -257,73 +271,81 @@ Lists all webhook configurations for the merchant account. To make this request */ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(r WebhooksMerchantLevelApiListAllWebhooksConfig) (ListWebhooksResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &ListWebhooksResponse{} + var serviceError common.RestServiceError + res := &ListWebhooksResponse{} path := "/merchants/{merchantId}/webhooks" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksMerchantLevelApiRemoveWebhookConfig struct { - ctx context.Context + ctx context.Context merchantId string - webhookId string + webhookId string } + /* RemoveWebhook Remove a webhook @@ -332,16 +354,16 @@ Remove the configuration for the webhook identified in the path. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksMerchantLevelApiRemoveWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksMerchantLevelApiRemoveWebhookConfig */ func (a *WebhooksMerchantLevelApi) RemoveWebhookConfig(ctx context.Context, merchantId string, webhookId string) WebhooksMerchantLevelApiRemoveWebhookConfig { return WebhooksMerchantLevelApiRemoveWebhookConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -354,65 +376,71 @@ Remove the configuration for the webhook identified in the path. To make this r */ func (a *WebhooksMerchantLevelApi) RemoveWebhook(r WebhooksMerchantLevelApiRemoveWebhookConfig) (*_nethttp.Response, error) { - var serviceError common.RestServiceError - var res interface{} + var serviceError common.RestServiceError + var res interface{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - nil, - res, - _nethttp.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return httpRes, serviceError - } - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return httpRes, serviceError + } + return httpRes, err } + type WebhooksMerchantLevelApiSetUpWebhookConfig struct { - ctx context.Context - merchantId string + ctx context.Context + merchantId string createMerchantWebhookRequest *CreateMerchantWebhookRequest } @@ -421,6 +449,7 @@ func (r WebhooksMerchantLevelApiSetUpWebhookConfig) CreateMerchantWebhookRequest return r } + /* SetUpWebhook Set up a webhook @@ -429,13 +458,13 @@ Subscribe to receive webhook notifications about events related to your merchant To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @return WebhooksMerchantLevelApiSetUpWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @return WebhooksMerchantLevelApiSetUpWebhookConfig */ func (a *WebhooksMerchantLevelApi) SetUpWebhookConfig(ctx context.Context, merchantId string) WebhooksMerchantLevelApiSetUpWebhookConfig { return WebhooksMerchantLevelApiSetUpWebhookConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, } } @@ -444,71 +473,78 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhookConfig(ctx context.Context, merch Set up a webhook Subscribe to receive webhook notifications about events related to your merchant account. You can add basic authentication to make sure the data is secure. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param merchantId The unique identifier of the merchant account. - * @param req CreateMerchantWebhookRequest - reference of CreateMerchantWebhookRequest). + * @param req CreateMerchantWebhookRequest - reference of CreateMerchantWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Webhook */ func (a *WebhooksMerchantLevelApi) SetUpWebhook(r WebhooksMerchantLevelApiSetUpWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/merchants/{merchantId}/webhooks" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.createMerchantWebhookRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createMerchantWebhookRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksMerchantLevelApiTestWebhookConfig struct { - ctx context.Context - merchantId string - webhookId string + ctx context.Context + merchantId string + webhookId string testWebhookRequest *TestWebhookRequest } @@ -517,6 +553,7 @@ func (r WebhooksMerchantLevelApiTestWebhookConfig) TestWebhookRequest(testWebhoo return r } + /* TestWebhook Test a webhook @@ -529,16 +566,16 @@ The response describes the result of the test. The `status` field tells you if t To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksMerchantLevelApiTestWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksMerchantLevelApiTestWebhookConfig */ func (a *WebhooksMerchantLevelApi) TestWebhookConfig(ctx context.Context, merchantId string, webhookId string) WebhooksMerchantLevelApiTestWebhookConfig { return WebhooksMerchantLevelApiTestWebhookConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -547,72 +584,79 @@ Test a webhook Sends sample notifications to test if the webhook is set up correctly. We send four test notifications for each event code you choose. They cover success and failure scenarios for the hard-coded currencies EUR and GBP, regardless of the currencies configured in the merchant accounts. For custom notifications, we only send the specified custom notification. The response describes the result of the test. The `status` field tells you if the test was successful or not. You can use the other fields to troubleshoot unsuccessful tests. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param merchantId The unique identifier of the merchant account. * @param webhookId Unique identifier of the webhook configuration. - * @param req TestWebhookRequest - reference of TestWebhookRequest). + * @param req TestWebhookRequest - reference of TestWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return TestWebhookResponse */ func (a *WebhooksMerchantLevelApi) TestWebhook(r WebhooksMerchantLevelApiTestWebhookConfig) (TestWebhookResponse, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &TestWebhookResponse{} + var serviceError common.RestServiceError + res := &TestWebhookResponse{} path := "/merchants/{merchantId}/webhooks/{webhookId}/test" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.testWebhookRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.testWebhookRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type WebhooksMerchantLevelApiUpdateWebhookConfig struct { - ctx context.Context - merchantId string - webhookId string + ctx context.Context + merchantId string + webhookId string updateMerchantWebhookRequest *UpdateMerchantWebhookRequest } @@ -621,6 +665,7 @@ func (r WebhooksMerchantLevelApiUpdateWebhookConfig) UpdateMerchantWebhookReques return r } + /* UpdateWebhook Update a webhook @@ -629,16 +674,16 @@ Make changes to the configuration of the webhook identified in the path. The req To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param merchantId The unique identifier of the merchant account. - @param webhookId Unique identifier of the webhook configuration. - @return WebhooksMerchantLevelApiUpdateWebhookConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantId The unique identifier of the merchant account. + @param webhookId Unique identifier of the webhook configuration. + @return WebhooksMerchantLevelApiUpdateWebhookConfig */ func (a *WebhooksMerchantLevelApi) UpdateWebhookConfig(ctx context.Context, merchantId string, webhookId string) WebhooksMerchantLevelApiUpdateWebhookConfig { return WebhooksMerchantLevelApiUpdateWebhookConfig{ - ctx: ctx, + ctx: ctx, merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -647,64 +692,71 @@ Update a webhook Make changes to the configuration of the webhook identified in the path. The request contains the new values you want to have in the webhook configuration. The response contains the full configuration for the webhook, which includes the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read and write * @param merchantId The unique identifier of the merchant account. * @param webhookId Unique identifier of the webhook configuration. - * @param req UpdateMerchantWebhookRequest - reference of UpdateMerchantWebhookRequest). + * @param req UpdateMerchantWebhookRequest - reference of UpdateMerchantWebhookRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Webhook */ func (a *WebhooksMerchantLevelApi) UpdateWebhook(r WebhooksMerchantLevelApiUpdateWebhookConfig) (Webhook, *_nethttp.Response, error) { - var serviceError common.RestServiceError - res := &Webhook{} + var serviceError common.RestServiceError + res := &Webhook{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.updateMerchantWebhookRequest, - res, - _nethttp.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - defer httpRes.Body.Close() - - if httpRes.StatusCode == 400 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - // Read the response body - body, _ := ioutil.ReadAll(httpRes.Body) - _ = json.Unmarshal([]byte(body), &serviceError) - return *res, httpRes, serviceError - } - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.updateMerchantWebhookRequest, + res, + _nethttp.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/management/model_additional_commission.go b/src/management/model_additional_commission.go index 296fefc6a..0b067ce76 100644 --- a/src/management/model_additional_commission.go +++ b/src/management/model_additional_commission.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalCommission type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalCommission) SetVariablePercentage(v int64) { } func (o AdditionalCommission) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalCommission) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_additional_settings.go b/src/management/model_additional_settings.go index 03dcb58fa..e8bd1511f 100644 --- a/src/management/model_additional_settings.go +++ b/src/management/model_additional_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalSettings type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &AdditionalSettings{} // AdditionalSettings struct for AdditionalSettings type AdditionalSettings struct { - // Object containing list of event codes for which the notifcation will be sent. + // Object containing list of event codes for which the notifcation will be sent. IncludeEventCodes []string `json:"includeEventCodes,omitempty"` // Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. Properties *map[string]bool `json:"properties,omitempty"` @@ -107,7 +106,7 @@ func (o *AdditionalSettings) SetProperties(v map[string]bool) { } func (o AdditionalSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableAdditionalSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_additional_settings_response.go b/src/management/model_additional_settings_response.go index 0bdcd4c05..a8237057d 100644 --- a/src/management/model_additional_settings_response.go +++ b/src/management/model_additional_settings_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalSettingsResponse type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &AdditionalSettingsResponse{} // AdditionalSettingsResponse struct for AdditionalSettingsResponse type AdditionalSettingsResponse struct { - // Object containing list of event codes for which the notifcation will not be sent. + // Object containing list of event codes for which the notifcation will not be sent. ExcludeEventCodes []string `json:"excludeEventCodes,omitempty"` - // Object containing list of event codes for which the notifcation will be sent. + // Object containing list of event codes for which the notifcation will be sent. IncludeEventCodes []string `json:"includeEventCodes,omitempty"` // Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. Properties *map[string]bool `json:"properties,omitempty"` @@ -141,7 +140,7 @@ func (o *AdditionalSettingsResponse) SetProperties(v map[string]bool) { } func (o AdditionalSettingsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalSettingsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_address.go b/src/management/model_address.go index b954f26d9..b3992f086 100644 --- a/src/management/model_address.go +++ b/src/management/model_address.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *Address) SetStreetAddress2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_afterpay_touch_info.go b/src/management/model_afterpay_touch_info.go index 8f2251aa4..8c1f46991 100644 --- a/src/management/model_afterpay_touch_info.go +++ b/src/management/model_afterpay_touch_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AfterpayTouchInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *AfterpayTouchInfo) SetSupportUrl(v string) { } func (o AfterpayTouchInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableAfterpayTouchInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_allowed_origin.go b/src/management/model_allowed_origin.go index d3cddef40..ebec4915b 100644 --- a/src/management/model_allowed_origin.go +++ b/src/management/model_allowed_origin.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AllowedOrigin type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *AllowedOrigin) SetId(v string) { } func (o AllowedOrigin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullableAllowedOrigin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_allowed_origins_response.go b/src/management/model_allowed_origins_response.go index c38c3c9aa..3cdf48933 100644 --- a/src/management/model_allowed_origins_response.go +++ b/src/management/model_allowed_origins_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AllowedOriginsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AllowedOriginsResponse) SetData(v []AllowedOrigin) { } func (o AllowedOriginsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAllowedOriginsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_amount.go b/src/management/model_amount.go index eedb31577..966a9f918 100644 --- a/src/management/model_amount.go +++ b/src/management/model_amount.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_app.go b/src/management/model_android_app.go index 67f84b5b7..10dafe2d8 100644 --- a/src/management/model_android_app.go +++ b/src/management/model_android_app.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AndroidApp type satisfies the MappedNullable interface at compile time @@ -263,7 +262,7 @@ func (o *AndroidApp) SetVersionName(v string) { } func (o AndroidApp) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -327,3 +326,6 @@ func (v *NullableAndroidApp) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_apps_response.go b/src/management/model_android_apps_response.go index 8999afc5b..b32bb8a6c 100644 --- a/src/management/model_android_apps_response.go +++ b/src/management/model_android_apps_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AndroidAppsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AndroidAppsResponse) SetData(v []AndroidApp) { } func (o AndroidAppsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAndroidAppsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_certificate.go b/src/management/model_android_certificate.go index 7710a6086..af2429648 100644 --- a/src/management/model_android_certificate.go +++ b/src/management/model_android_certificate.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AndroidCertificate type satisfies the MappedNullable interface at compile time @@ -271,7 +270,7 @@ func (o *AndroidCertificate) SetStatus(v string) { } func (o AndroidCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -337,3 +336,6 @@ func (v *NullableAndroidCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_certificates_response.go b/src/management/model_android_certificates_response.go index ff4e71ce5..02d1b85a3 100644 --- a/src/management/model_android_certificates_response.go +++ b/src/management/model_android_certificates_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AndroidCertificatesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AndroidCertificatesResponse) SetData(v []AndroidCertificate) { } func (o AndroidCertificatesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAndroidCertificatesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_api_credential.go b/src/management/model_api_credential.go index 5b2226762..d9c3b3f07 100644 --- a/src/management/model_api_credential.go +++ b/src/management/model_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApiCredential type satisfies the MappedNullable interface at compile time @@ -302,7 +301,7 @@ func (o *ApiCredential) SetUsername(v string) { } func (o ApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -364,3 +363,6 @@ func (v *NullableApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_api_credential_links.go b/src/management/model_api_credential_links.go index 3291e998d..d727a8c83 100644 --- a/src/management/model_api_credential_links.go +++ b/src/management/model_api_credential_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApiCredentialLinks type satisfies the MappedNullable interface at compile time @@ -19,12 +18,12 @@ var _ common.MappedNullable = &ApiCredentialLinks{} // ApiCredentialLinks struct for ApiCredentialLinks type ApiCredentialLinks struct { - AllowedOrigins *LinksElement `json:"allowedOrigins,omitempty"` - Company *LinksElement `json:"company,omitempty"` - GenerateApiKey *LinksElement `json:"generateApiKey,omitempty"` + AllowedOrigins *LinksElement `json:"allowedOrigins,omitempty"` + Company *LinksElement `json:"company,omitempty"` + GenerateApiKey *LinksElement `json:"generateApiKey,omitempty"` GenerateClientKey *LinksElement `json:"generateClientKey,omitempty"` - Merchant *LinksElement `json:"merchant,omitempty"` - Self LinksElement `json:"self"` + Merchant *LinksElement `json:"merchant,omitempty"` + Self LinksElement `json:"self"` } // NewApiCredentialLinks instantiates a new ApiCredentialLinks object @@ -230,7 +229,7 @@ func (o *ApiCredentialLinks) SetSelf(v LinksElement) { } func (o ApiCredentialLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -293,3 +292,6 @@ func (v *NullableApiCredentialLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_apple_pay_info.go b/src/management/model_apple_pay_info.go index 6f4a46db2..9e4ce03d7 100644 --- a/src/management/model_apple_pay_info.go +++ b/src/management/model_apple_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApplePayInfo type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ApplePayInfo) SetDomains(v []string) { } func (o ApplePayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableApplePayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_bcmc_info.go b/src/management/model_bcmc_info.go index 68f211fb4..5a6287d24 100644 --- a/src/management/model_bcmc_info.go +++ b/src/management/model_bcmc_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BcmcInfo type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BcmcInfo) SetEnableBcmcMobile(v bool) { } func (o BcmcInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBcmcInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_billing_entities_response.go b/src/management/model_billing_entities_response.go index 0e0a5397a..c73551169 100644 --- a/src/management/model_billing_entities_response.go +++ b/src/management/model_billing_entities_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BillingEntitiesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BillingEntitiesResponse) SetData(v []BillingEntity) { } func (o BillingEntitiesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBillingEntitiesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_billing_entity.go b/src/management/model_billing_entity.go index 94eaa976c..6e3215508 100644 --- a/src/management/model_billing_entity.go +++ b/src/management/model_billing_entity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BillingEntity type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *BillingEntity) SetTaxId(v string) { } func (o BillingEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableBillingEntity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_cardholder_receipt.go b/src/management/model_cardholder_receipt.go index e2a6db14b..b5701f27e 100644 --- a/src/management/model_cardholder_receipt.go +++ b/src/management/model_cardholder_receipt.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CardholderReceipt type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CardholderReceipt) SetHeaderForAuthorizedReceipt(v string) { } func (o CardholderReceipt) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCardholderReceipt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_cartes_bancaires_info.go b/src/management/model_cartes_bancaires_info.go index dbb303bbd..194b8b3b9 100644 --- a/src/management/model_cartes_bancaires_info.go +++ b/src/management/model_cartes_bancaires_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CartesBancairesInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *CartesBancairesInfo) SetSiret(v string) { } func (o CartesBancairesInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableCartesBancairesInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_clearpay_info.go b/src/management/model_clearpay_info.go index 14458f49d..0f5d6e8ec 100644 --- a/src/management/model_clearpay_info.go +++ b/src/management/model_clearpay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ClearpayInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *ClearpayInfo) SetSupportUrl(v string) { } func (o ClearpayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableClearpayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_commission.go b/src/management/model_commission.go index 09034fc95..e5d795d1b 100644 --- a/src/management/model_commission.go +++ b/src/management/model_commission.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Commission type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Commission) SetVariablePercentage(v int64) { } func (o Commission) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommission) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company.go b/src/management/model_company.go index 26206d869..6f04bea5b 100644 --- a/src/management/model_company.go +++ b/src/management/model_company.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Company type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *Company) SetStatus(v string) { } func (o Company) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableCompany) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_api_credential.go b/src/management/model_company_api_credential.go index e4d31460f..2f9b61177 100644 --- a/src/management/model_company_api_credential.go +++ b/src/management/model_company_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CompanyApiCredential type satisfies the MappedNullable interface at compile time @@ -336,7 +335,7 @@ func (o *CompanyApiCredential) SetUsername(v string) { } func (o CompanyApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -401,3 +400,6 @@ func (v *NullableCompanyApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_links.go b/src/management/model_company_links.go index 277c43183..bd5a1419a 100644 --- a/src/management/model_company_links.go +++ b/src/management/model_company_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CompanyLinks type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &CompanyLinks{} // CompanyLinks struct for CompanyLinks type CompanyLinks struct { ApiCredentials *LinksElement `json:"apiCredentials,omitempty"` - Self LinksElement `json:"self"` - Users *LinksElement `json:"users,omitempty"` - Webhooks *LinksElement `json:"webhooks,omitempty"` + Self LinksElement `json:"self"` + Users *LinksElement `json:"users,omitempty"` + Webhooks *LinksElement `json:"webhooks,omitempty"` } // NewCompanyLinks instantiates a new CompanyLinks object @@ -164,7 +163,7 @@ func (o *CompanyLinks) SetWebhooks(v LinksElement) { } func (o CompanyLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,3 +220,6 @@ func (v *NullableCompanyLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_user.go b/src/management/model_company_user.go index ec6dc78f8..e7e62fac2 100644 --- a/src/management/model_company_user.go +++ b/src/management/model_company_user.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CompanyUser type satisfies the MappedNullable interface at compile time @@ -31,8 +30,8 @@ type CompanyUser struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -376,7 +375,7 @@ func (o *CompanyUser) SetUsername(v string) { } func (o CompanyUser) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -446,3 +445,6 @@ func (v *NullableCompanyUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_configuration.go b/src/management/model_configuration.go index 04601e660..d2044f442 100644 --- a/src/management/model_configuration.go +++ b/src/management/model_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Configuration type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Configuration{} // Configuration struct for Configuration type Configuration struct { - // Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + // Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). Brand string `json:"brand"` // Currency, and surcharge percentage or amount. Currencies []Currency `json:"currencies"` @@ -127,7 +126,7 @@ func (o *Configuration) SetSources(v []string) { } func (o Configuration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_connectivity.go b/src/management/model_connectivity.go index 8f5bdece6..e89707f53 100644 --- a/src/management/model_connectivity.go +++ b/src/management/model_connectivity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Connectivity type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Connectivity) SetSimcardStatus(v string) { } func (o Connectivity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableConnectivity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Connectivity) isValidSimcardStatus() bool { - var allowedEnumValues = []string{"ACTIVATED", "INVENTORY"} - for _, allowed := range allowedEnumValues { - if o.GetSimcardStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ACTIVATED", "INVENTORY" } + for _, allowed := range allowedEnumValues { + if o.GetSimcardStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_contact.go b/src/management/model_contact.go index 315d232f5..88aee1003 100644 --- a/src/management/model_contact.go +++ b/src/management/model_contact.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Contact type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *Contact) SetPhoneNumber(v string) { } func (o Contact) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableContact) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_allowed_origin_request.go b/src/management/model_create_allowed_origin_request.go index 4644bc416..6a3766661 100644 --- a/src/management/model_create_allowed_origin_request.go +++ b/src/management/model_create_allowed_origin_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateAllowedOriginRequest type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *CreateAllowedOriginRequest) SetId(v string) { } func (o CreateAllowedOriginRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullableCreateAllowedOriginRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_api_credential_response.go b/src/management/model_create_api_credential_response.go index 4ff5e7766..906e0515a 100644 --- a/src/management/model_create_api_credential_response.go +++ b/src/management/model_create_api_credential_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateApiCredentialResponse type satisfies the MappedNullable interface at compile time @@ -356,7 +355,7 @@ func (o *CreateApiCredentialResponse) SetUsername(v string) { } func (o CreateApiCredentialResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -420,3 +419,6 @@ func (v *NullableCreateApiCredentialResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_api_credential_request.go b/src/management/model_create_company_api_credential_request.go index 1b4b43309..792649b65 100644 --- a/src/management/model_create_company_api_credential_request.go +++ b/src/management/model_create_company_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCompanyApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *CreateCompanyApiCredentialRequest) SetRoles(v []string) { } func (o CreateCompanyApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableCreateCompanyApiCredentialRequest) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_api_credential_response.go b/src/management/model_create_company_api_credential_response.go index 5d221a886..1a376f9c1 100644 --- a/src/management/model_create_company_api_credential_response.go +++ b/src/management/model_create_company_api_credential_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCompanyApiCredentialResponse type satisfies the MappedNullable interface at compile time @@ -383,7 +382,7 @@ func (o *CreateCompanyApiCredentialResponse) SetUsername(v string) { } func (o CreateCompanyApiCredentialResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -448,3 +447,6 @@ func (v *NullableCreateCompanyApiCredentialResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_user_request.go b/src/management/model_create_company_user_request.go index ceb030748..eedf8169e 100644 --- a/src/management/model_create_company_user_request.go +++ b/src/management/model_create_company_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCompanyUserRequest type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type CreateCompanyUserRequest struct { AssociatedMerchantAccounts []string `json:"associatedMerchantAccounts,omitempty"` // The email address of the user. Email string `json:"email"` - Name Name `json:"name"` + Name Name `json:"name"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -255,7 +254,7 @@ func (o *CreateCompanyUserRequest) SetUsername(v string) { } func (o CreateCompanyUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -317,3 +316,6 @@ func (v *NullableCreateCompanyUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_user_response.go b/src/management/model_create_company_user_response.go index c8a66ea88..3e9f0d622 100644 --- a/src/management/model_create_company_user_response.go +++ b/src/management/model_create_company_user_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCompanyUserResponse type satisfies the MappedNullable interface at compile time @@ -31,8 +30,8 @@ type CreateCompanyUserResponse struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -376,7 +375,7 @@ func (o *CreateCompanyUserResponse) SetUsername(v string) { } func (o CreateCompanyUserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -446,3 +445,6 @@ func (v *NullableCreateCompanyUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_webhook_request.go b/src/management/model_create_company_webhook_request.go index 74a128416..ce1c6a0c2 100644 --- a/src/management/model_create_company_webhook_request.go +++ b/src/management/model_create_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type CreateCompanyWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -540,7 +539,7 @@ func (o *CreateCompanyWebhookRequest) SetUsername(v string) { } func (o CreateCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -624,39 +623,41 @@ func (v *NullableCreateCompanyWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateCompanyWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidSslVersion() bool { - var allowedEnumValues = []string{"HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetSslVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetSslVersion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_create_merchant_api_credential_request.go b/src/management/model_create_merchant_api_credential_request.go index d2def3d61..e0fc558d3 100644 --- a/src/management/model_create_merchant_api_credential_request.go +++ b/src/management/model_create_merchant_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateMerchantApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CreateMerchantApiCredentialRequest) SetRoles(v []string) { } func (o CreateMerchantApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCreateMerchantApiCredentialRequest) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_request.go b/src/management/model_create_merchant_request.go index cf49f00c4..fde94d70c 100644 --- a/src/management/model_create_merchant_request.go +++ b/src/management/model_create_merchant_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateMerchantRequest type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *CreateMerchantRequest) SetSalesChannels(v []string) { } func (o CreateMerchantRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -336,3 +335,6 @@ func (v *NullableCreateMerchantRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_response.go b/src/management/model_create_merchant_response.go index e9f94c4ca..a218d458a 100644 --- a/src/management/model_create_merchant_response.go +++ b/src/management/model_create_merchant_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateMerchantResponse type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *CreateMerchantResponse) SetReference(v string) { } func (o CreateMerchantResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableCreateMerchantResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_user_request.go b/src/management/model_create_merchant_user_request.go index 4c4e5c9a9..8dae0daef 100644 --- a/src/management/model_create_merchant_user_request.go +++ b/src/management/model_create_merchant_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateMerchantUserRequest type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type CreateMerchantUserRequest struct { AccountGroups []string `json:"accountGroups,omitempty"` // The email address of the user. Email string `json:"email"` - Name Name `json:"name"` + Name Name `json:"name"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -221,7 +220,7 @@ func (o *CreateMerchantUserRequest) SetUsername(v string) { } func (o CreateMerchantUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -280,3 +279,6 @@ func (v *NullableCreateMerchantUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_webhook_request.go b/src/management/model_create_merchant_webhook_request.go index a35e9b539..923da8e58 100644 --- a/src/management/model_create_merchant_webhook_request.go +++ b/src/management/model_create_merchant_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateMerchantWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type CreateMerchantWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -486,7 +485,7 @@ func (o *CreateMerchantWebhookRequest) SetUsername(v string) { } func (o CreateMerchantWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -568,30 +567,32 @@ func (v *NullableCreateMerchantWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateMerchantWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *CreateMerchantWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } func (o *CreateMerchantWebhookRequest) isValidSslVersion() bool { - var allowedEnumValues = []string{"HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetSslVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetSslVersion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_create_user_response.go b/src/management/model_create_user_response.go index 7da1a31f3..eb2a2558a 100644 --- a/src/management/model_create_user_response.go +++ b/src/management/model_create_user_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time @@ -29,8 +28,8 @@ type CreateUserResponse struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -342,7 +341,7 @@ func (o *CreateUserResponse) SetUsername(v string) { } func (o CreateUserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,3 +408,6 @@ func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_currency.go b/src/management/model_currency.go index fab2e0ef9..4336a9b3e 100644 --- a/src/management/model_currency.go +++ b/src/management/model_currency.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Currency type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *Currency) SetPercentage(v float64) { } func (o Currency) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableCurrency) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_custom_notification.go b/src/management/model_custom_notification.go index 405d2f79d..1df33e5ac 100644 --- a/src/management/model_custom_notification.go +++ b/src/management/model_custom_notification.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CustomNotification type satisfies the MappedNullable interface at compile time @@ -27,11 +26,11 @@ type CustomNotification struct { EventDate *time.Time `json:"eventDate,omitempty"` // Your reference for the custom test notification. MerchantReference *string `json:"merchantReference,omitempty"` - // The payment method for the payment that the notification is about. Possible values: * **amex** * **visa** * **mc** * **maestro** * **bcmc** * **paypal** * **sms** * **bankTransfer_NL** * **bankTransfer_DE** * **bankTransfer_BE** * **ideal** * **elv** * **sepadirectdebit** + // The payment method for the payment that the notification is about. Possible values: * **amex** * **visa** * **mc** * **maestro** * **bcmc** * **paypal** * **sms** * **bankTransfer_NL** * **bankTransfer_DE** * **bankTransfer_BE** * **ideal** * **elv** * **sepadirectdebit** PaymentMethod *string `json:"paymentMethod,omitempty"` // A descripton of what caused the notification. Reason *string `json:"reason,omitempty"` - // The outcome of the event which the notification is about. Set to either **true** or **false**. + // The outcome of the event which the notification is about. Set to either **true** or **false**. Success *bool `json:"success,omitempty"` } @@ -277,7 +276,7 @@ func (o *CustomNotification) SetSuccess(v bool) { } func (o CustomNotification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableCustomNotification) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_data_center.go b/src/management/model_data_center.go index 5e6572295..8ff9869e5 100644 --- a/src/management/model_data_center.go +++ b/src/management/model_data_center.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DataCenter type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *DataCenter) SetName(v string) { } func (o DataCenter) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableDataCenter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_event_url.go b/src/management/model_event_url.go index 352408048..efcbc061c 100644 --- a/src/management/model_event_url.go +++ b/src/management/model_event_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the EventUrl type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *EventUrl) SetEventPublicUrls(v []Url) { } func (o EventUrl) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableEventUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_external_terminal_action.go b/src/management/model_external_terminal_action.go index ee69edd49..0594a2dcd 100644 --- a/src/management/model_external_terminal_action.go +++ b/src/management/model_external_terminal_action.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ExternalTerminalAction type satisfies the MappedNullable interface at compile time @@ -312,7 +311,7 @@ func (o *ExternalTerminalAction) SetTerminalId(v string) { } func (o ExternalTerminalAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -383,3 +382,6 @@ func (v *NullableExternalTerminalAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_file.go b/src/management/model_file.go index ac12f2e74..02e4f5df2 100644 --- a/src/management/model_file.go +++ b/src/management/model_file.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the File type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *File) SetName(v string) { } func (o File) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableFile) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_api_key_response.go b/src/management/model_generate_api_key_response.go index 24e8bc120..05444ec27 100644 --- a/src/management/model_generate_api_key_response.go +++ b/src/management/model_generate_api_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GenerateApiKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateApiKeyResponse) SetApiKey(v string) { } func (o GenerateApiKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateApiKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_client_key_response.go b/src/management/model_generate_client_key_response.go index 5b5a25e28..262611ac1 100644 --- a/src/management/model_generate_client_key_response.go +++ b/src/management/model_generate_client_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GenerateClientKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateClientKeyResponse) SetClientKey(v string) { } func (o GenerateClientKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateClientKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_hmac_key_response.go b/src/management/model_generate_hmac_key_response.go index 49f74aa93..c9d957203 100644 --- a/src/management/model_generate_hmac_key_response.go +++ b/src/management/model_generate_hmac_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GenerateHmacKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateHmacKeyResponse) SetHmacKey(v string) { } func (o GenerateHmacKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateHmacKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_giro_pay_info.go b/src/management/model_giro_pay_info.go index 52a1a79fc..4653406f4 100644 --- a/src/management/model_giro_pay_info.go +++ b/src/management/model_giro_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GiroPayInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GiroPayInfo) SetSupportEmail(v string) { } func (o GiroPayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGiroPayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_google_pay_info.go b/src/management/model_google_pay_info.go index 634e40f56..95d9ef28f 100644 --- a/src/management/model_google_pay_info.go +++ b/src/management/model_google_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GooglePayInfo type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *GooglePayInfo) SetReuseMerchantId(v bool) { } func (o GooglePayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableGooglePayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_gratuity.go b/src/management/model_gratuity.go index 5caa00a88..dea4fb173 100644 --- a/src/management/model_gratuity.go +++ b/src/management/model_gratuity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Gratuity type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Gratuity) SetUsePredefinedTipEntries(v bool) { } func (o Gratuity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableGratuity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_hardware.go b/src/management/model_hardware.go index 63aed16b6..b1cb277f1 100644 --- a/src/management/model_hardware.go +++ b/src/management/model_hardware.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Hardware type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Hardware) SetRestartHour(v int32) { } func (o Hardware) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableHardware) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_id_name.go b/src/management/model_id_name.go index dcf25c823..07cdf7ef3 100644 --- a/src/management/model_id_name.go +++ b/src/management/model_id_name.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IdName type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *IdName) SetName(v string) { } func (o IdName) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableIdName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_install_android_app_details.go b/src/management/model_install_android_app_details.go index 381ea5d23..348e36061 100644 --- a/src/management/model_install_android_app_details.go +++ b/src/management/model_install_android_app_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InstallAndroidAppDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *InstallAndroidAppDetails) SetType(v string) { } func (o InstallAndroidAppDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableInstallAndroidAppDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *InstallAndroidAppDetails) isValidType() bool { - var allowedEnumValues = []string{"InstallAndroidApp"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "InstallAndroidApp" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_install_android_certificate_details.go b/src/management/model_install_android_certificate_details.go index 81708ac3c..b2c24c83b 100644 --- a/src/management/model_install_android_certificate_details.go +++ b/src/management/model_install_android_certificate_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InstallAndroidCertificateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *InstallAndroidCertificateDetails) SetType(v string) { } func (o InstallAndroidCertificateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableInstallAndroidCertificateDetails) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *InstallAndroidCertificateDetails) isValidType() bool { - var allowedEnumValues = []string{"InstallAndroidCertificate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "InstallAndroidCertificate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_invalid_field.go b/src/management/model_invalid_field.go index bfa24bc57..5389dff22 100644 --- a/src/management/model_invalid_field.go +++ b/src/management/model_invalid_field.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_invalid_field_wrapper.go b/src/management/model_invalid_field_wrapper.go index 2362504b2..f7e491c61 100644 --- a/src/management/model_invalid_field_wrapper.go +++ b/src/management/model_invalid_field_wrapper.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InvalidFieldWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *InvalidFieldWrapper) SetInvalidField(v InvalidField) { } func (o InvalidFieldWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableInvalidFieldWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_json_object.go b/src/management/model_json_object.go index 6a9c9f870..6e50f8fd8 100644 --- a/src/management/model_json_object.go +++ b/src/management/model_json_object.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONObject type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &JSONObject{} // JSONObject struct for JSONObject type JSONObject struct { - Paths []JSONPathWrapper `json:"paths,omitempty"` - RootPath *JSONPath `json:"rootPath,omitempty"` + Paths []JSONPathWrapper `json:"paths,omitempty"` + RootPath *JSONPath `json:"rootPath,omitempty"` } // NewJSONObject instantiates a new JSONObject object @@ -105,7 +104,7 @@ func (o *JSONObject) SetRootPath(v JSONPath) { } func (o JSONObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableJSONObject) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_json_path.go b/src/management/model_json_path.go index 7010ef508..5b683b6f9 100644 --- a/src/management/model_json_path.go +++ b/src/management/model_json_path.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONPath type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *JSONPath) SetContent(v []string) { } func (o JSONPath) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableJSONPath) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_json_path_wrapper.go b/src/management/model_json_path_wrapper.go index cf529b6cf..78e0edfb3 100644 --- a/src/management/model_json_path_wrapper.go +++ b/src/management/model_json_path_wrapper.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONPathWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *JSONPathWrapper) SetJSONPath(v JSONPath) { } func (o JSONPathWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableJSONPathWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_key.go b/src/management/model_key.go index 52d72a7ac..2a12a5bf3 100644 --- a/src/management/model_key.go +++ b/src/management/model_key.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Key type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Key) SetVersion(v int32) { } func (o Key) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_klarna_info.go b/src/management/model_klarna_info.go index 1b03d25ca..405c3c6f4 100644 --- a/src/management/model_klarna_info.go +++ b/src/management/model_klarna_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the KlarnaInfo type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *KlarnaInfo) SetSupportEmail(v string) { } func (o KlarnaInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -217,12 +216,14 @@ func (v *NullableKlarnaInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *KlarnaInfo) isValidRegion() bool { - var allowedEnumValues = []string{"NA", "EU", "CH", "AU"} - for _, allowed := range allowedEnumValues { - if o.GetRegion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NA", "EU", "CH", "AU" } + for _, allowed := range allowedEnumValues { + if o.GetRegion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_links.go b/src/management/model_links.go index a0448f902..7fc70e870 100644 --- a/src/management/model_links.go +++ b/src/management/model_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Links type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *Links) SetSelf(v LinksElement) { } func (o Links) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_links_element.go b/src/management/model_links_element.go index bbb2175c5..05e6fd1d3 100644 --- a/src/management/model_links_element.go +++ b/src/management/model_links_element.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the LinksElement type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *LinksElement) SetHref(v string) { } func (o LinksElement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableLinksElement) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_api_credentials_response.go b/src/management/model_list_company_api_credentials_response.go index cdd5a4b9d..0661d4cc5 100644 --- a/src/management/model_list_company_api_credentials_response.go +++ b/src/management/model_list_company_api_credentials_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListCompanyApiCredentialsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyApiCredentialsResponse) SetPagesTotal(v int32) { } func (o ListCompanyApiCredentialsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyApiCredentialsResponse) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_response.go b/src/management/model_list_company_response.go index f272db7ab..758fb3e99 100644 --- a/src/management/model_list_company_response.go +++ b/src/management/model_list_company_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListCompanyResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyResponse) SetPagesTotal(v int32) { } func (o ListCompanyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_users_response.go b/src/management/model_list_company_users_response.go index 7b1335998..cc550c971 100644 --- a/src/management/model_list_company_users_response.go +++ b/src/management/model_list_company_users_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListCompanyUsersResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyUsersResponse) SetPagesTotal(v int32) { } func (o ListCompanyUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyUsersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_external_terminal_actions_response.go b/src/management/model_list_external_terminal_actions_response.go index 3c0940a41..6eafaaac5 100644 --- a/src/management/model_list_external_terminal_actions_response.go +++ b/src/management/model_list_external_terminal_actions_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListExternalTerminalActionsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ListExternalTerminalActionsResponse) SetData(v []ExternalTerminalAction } func (o ListExternalTerminalActionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableListExternalTerminalActionsResponse) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_api_credentials_response.go b/src/management/model_list_merchant_api_credentials_response.go index b9e819de8..c8744ae0d 100644 --- a/src/management/model_list_merchant_api_credentials_response.go +++ b/src/management/model_list_merchant_api_credentials_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListMerchantApiCredentialsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantApiCredentialsResponse) SetPagesTotal(v int32) { } func (o ListMerchantApiCredentialsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantApiCredentialsResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_response.go b/src/management/model_list_merchant_response.go index 52b6eacdc..21c15251f 100644 --- a/src/management/model_list_merchant_response.go +++ b/src/management/model_list_merchant_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListMerchantResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantResponse) SetPagesTotal(v int32) { } func (o ListMerchantResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_users_response.go b/src/management/model_list_merchant_users_response.go index c916dbb02..af1938c23 100644 --- a/src/management/model_list_merchant_users_response.go +++ b/src/management/model_list_merchant_users_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListMerchantUsersResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantUsersResponse) SetPagesTotal(v int32) { } func (o ListMerchantUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantUsersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_stores_response.go b/src/management/model_list_stores_response.go index a684369ce..aa4b40c48 100644 --- a/src/management/model_list_stores_response.go +++ b/src/management/model_list_stores_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListStoresResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListStoresResponse) SetPagesTotal(v int32) { } func (o ListStoresResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListStoresResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_terminals_response.go b/src/management/model_list_terminals_response.go index 316933217..ceaf1b303 100644 --- a/src/management/model_list_terminals_response.go +++ b/src/management/model_list_terminals_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListTerminalsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListTerminalsResponse) SetPagesTotal(v int32) { } func (o ListTerminalsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListTerminalsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_webhooks_response.go b/src/management/model_list_webhooks_response.go index 311bf9c57..92323ca49 100644 --- a/src/management/model_list_webhooks_response.go +++ b/src/management/model_list_webhooks_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ListWebhooksResponse type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *ListWebhooksResponse) SetPagesTotal(v int32) { } func (o ListWebhooksResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -252,3 +251,6 @@ func (v *NullableListWebhooksResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_logo.go b/src/management/model_logo.go index 224430999..40912c8dd 100644 --- a/src/management/model_logo.go +++ b/src/management/model_logo.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Logo type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Logo) SetData(v string) { } func (o Logo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableLogo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_me_api_credential.go b/src/management/model_me_api_credential.go index 6c7e78145..48ffdd9e2 100644 --- a/src/management/model_me_api_credential.go +++ b/src/management/model_me_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MeApiCredential type satisfies the MappedNullable interface at compile time @@ -370,7 +369,7 @@ func (o *MeApiCredential) SetUsername(v string) { } func (o MeApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -438,3 +437,6 @@ func (v *NullableMeApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_meal_voucher_fr_info.go b/src/management/model_meal_voucher_fr_info.go index 745edfd65..45ec84dc2 100644 --- a/src/management/model_meal_voucher_fr_info.go +++ b/src/management/model_meal_voucher_fr_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MealVoucherFRInfo type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *MealVoucherFRInfo) SetSubTypes(v []string) { } func (o MealVoucherFRInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableMealVoucherFRInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_merchant.go b/src/management/model_merchant.go index 16ae12bdf..bc6c592ad 100644 --- a/src/management/model_merchant.go +++ b/src/management/model_merchant.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Merchant type satisfies the MappedNullable interface at compile time @@ -514,7 +513,7 @@ func (o *Merchant) SetStatus(v string) { } func (o Merchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -603,3 +602,6 @@ func (v *NullableMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_merchant_links.go b/src/management/model_merchant_links.go index 6eada2b6a..bb5c63a30 100644 --- a/src/management/model_merchant_links.go +++ b/src/management/model_merchant_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantLinks type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &MerchantLinks{} // MerchantLinks struct for MerchantLinks type MerchantLinks struct { ApiCredentials *LinksElement `json:"apiCredentials,omitempty"` - Self LinksElement `json:"self"` - Users *LinksElement `json:"users,omitempty"` - Webhooks *LinksElement `json:"webhooks,omitempty"` + Self LinksElement `json:"self"` + Users *LinksElement `json:"users,omitempty"` + Webhooks *LinksElement `json:"webhooks,omitempty"` } // NewMerchantLinks instantiates a new MerchantLinks object @@ -164,7 +163,7 @@ func (o *MerchantLinks) SetWebhooks(v LinksElement) { } func (o MerchantLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,3 +220,6 @@ func (v *NullableMerchantLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_minor_units_monetary_value.go b/src/management/model_minor_units_monetary_value.go index a1afe3064..17ff78df2 100644 --- a/src/management/model_minor_units_monetary_value.go +++ b/src/management/model_minor_units_monetary_value.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MinorUnitsMonetaryValue type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *MinorUnitsMonetaryValue) SetCurrencyCode(v string) { } func (o MinorUnitsMonetaryValue) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableMinorUnitsMonetaryValue) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_name.go b/src/management/model_name.go index 7fe34fb64..756d00178 100644 --- a/src/management/model_name.go +++ b/src/management/model_name.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_name2.go b/src/management/model_name2.go index f0b5a4817..1b45f4b79 100644 --- a/src/management/model_name2.go +++ b/src/management/model_name2.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name2 type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Name2) SetLastName(v string) { } func (o Name2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableName2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_nexo.go b/src/management/model_nexo.go index 87bff3534..fd0b59023 100644 --- a/src/management/model_nexo.go +++ b/src/management/model_nexo.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Nexo type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &Nexo{} // Nexo struct for Nexo type Nexo struct { - DisplayUrls *NotificationUrl `json:"displayUrls,omitempty"` - EncryptionKey *Key `json:"encryptionKey,omitempty"` - EventUrls *EventUrl `json:"eventUrls,omitempty"` + DisplayUrls *NotificationUrl `json:"displayUrls,omitempty"` + EncryptionKey *Key `json:"encryptionKey,omitempty"` + EventUrls *EventUrl `json:"eventUrls,omitempty"` // One or more URLs to send event messages to when using Terminal API. // Deprecated - NexoEventUrls []string `json:"nexoEventUrls,omitempty"` - Notification *Notification `json:"notification,omitempty"` + NexoEventUrls []string `json:"nexoEventUrls,omitempty"` + Notification *Notification `json:"notification,omitempty"` } // NewNexo instantiates a new Nexo object @@ -209,7 +208,7 @@ func (o *Nexo) SetNotification(v Notification) { } func (o Nexo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableNexo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_notification.go b/src/management/model_notification.go index f1ecccc48..7c76d0fac 100644 --- a/src/management/model_notification.go +++ b/src/management/model_notification.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Notification type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Notification) SetShowButton(v bool) { } func (o Notification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableNotification) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_notification_url.go b/src/management/model_notification_url.go index ab5dd3113..254f7d6da 100644 --- a/src/management/model_notification_url.go +++ b/src/management/model_notification_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NotificationUrl type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *NotificationUrl) SetPublicUrls(v []Url) { } func (o NotificationUrl) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableNotificationUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_offline_processing.go b/src/management/model_offline_processing.go index 4d9154916..5dc775d59 100644 --- a/src/management/model_offline_processing.go +++ b/src/management/model_offline_processing.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OfflineProcessing type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *OfflineProcessing) SetOfflineSwipeLimits(v []MinorUnitsMonetaryValue) { } func (o OfflineProcessing) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableOfflineProcessing) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_opi.go b/src/management/model_opi.go index 931a17dee..31d01ac1a 100644 --- a/src/management/model_opi.go +++ b/src/management/model_opi.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Opi type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Opi) SetPayAtTableURL(v string) { } func (o Opi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_order_item.go b/src/management/model_order_item.go index 04e825fa6..0b050687e 100644 --- a/src/management/model_order_item.go +++ b/src/management/model_order_item.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the OrderItem type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *OrderItem) SetQuantity(v int32) { } func (o OrderItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableOrderItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_pagination_links.go b/src/management/model_pagination_links.go index bf228c298..4478b516d 100644 --- a/src/management/model_pagination_links.go +++ b/src/management/model_pagination_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaginationLinks type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &PaginationLinks{} // PaginationLinks struct for PaginationLinks type PaginationLinks struct { - First LinksElement `json:"first"` - Last LinksElement `json:"last"` - Next *LinksElement `json:"next,omitempty"` - Prev *LinksElement `json:"prev,omitempty"` - Self LinksElement `json:"self"` + First LinksElement `json:"first"` + Last LinksElement `json:"last"` + Next *LinksElement `json:"next,omitempty"` + Prev *LinksElement `json:"prev,omitempty"` + Self LinksElement `json:"self"` } // NewPaginationLinks instantiates a new PaginationLinks object @@ -183,7 +182,7 @@ func (o *PaginationLinks) SetSelf(v LinksElement) { } func (o PaginationLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,3 +238,6 @@ func (v *NullablePaginationLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_passcodes.go b/src/management/model_passcodes.go index cd894fed2..c19ed519f 100644 --- a/src/management/model_passcodes.go +++ b/src/management/model_passcodes.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Passcodes type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Passcodes) SetTxMenuPin(v string) { } func (o Passcodes) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullablePasscodes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_pay_at_table.go b/src/management/model_pay_at_table.go index 91767d11f..5dbd0b97d 100644 --- a/src/management/model_pay_at_table.go +++ b/src/management/model_pay_at_table.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayAtTable type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PayAtTable) SetEnablePayAtTable(v bool) { } func (o PayAtTable) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullablePayAtTable) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayAtTable) isValidAuthenticationMethod() bool { - var allowedEnumValues = []string{"MAGSWIPE", "MKE"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "MAGSWIPE", "MKE" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationMethod() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_pay_pal_info.go b/src/management/model_pay_pal_info.go index 7c32acbfd..b6597e714 100644 --- a/src/management/model_pay_pal_info.go +++ b/src/management/model_pay_pal_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayPalInfo type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *PayPalInfo) SetSubject(v string) { } func (o PayPalInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullablePayPalInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment.go b/src/management/model_payment.go index 1307a5b31..129e01b03 100644 --- a/src/management/model_payment.go +++ b/src/management/model_payment.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Payment type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Payment) SetHideMinorUnitsInCurrencies(v []string) { } func (o Payment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullablePayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment_method.go b/src/management/model_payment_method.go index b179f45c4..eb188bf9c 100644 --- a/src/management/model_payment_method.go +++ b/src/management/model_payment_method.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethod type satisfies the MappedNullable interface at compile time @@ -21,13 +20,13 @@ var _ common.MappedNullable = &PaymentMethod{} type PaymentMethod struct { AfterpayTouch *AfterpayTouchInfo `json:"afterpayTouch,omitempty"` // Indicates whether receiving payments is allowed. This value is set to **true** by Adyen after screening your merchant account. - Allowed *bool `json:"allowed,omitempty"` + Allowed *bool `json:"allowed,omitempty"` ApplePay *ApplePayInfo `json:"applePay,omitempty"` - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` // The unique identifier of the business line. - BusinessLineId *string `json:"businessLineId,omitempty"` + BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` - Clearpay *ClearpayInfo `json:"clearpay,omitempty"` + Clearpay *ClearpayInfo `json:"clearpay,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. Countries []string `json:"countries,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. @@ -35,28 +34,28 @@ type PaymentMethod struct { // The list of custom routing flags to route payment to the intended acquirer. CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). - Enabled *bool `json:"enabled,omitempty"` - GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` GooglePay *GooglePayInfo `json:"googlePay,omitempty"` // The identifier of the resource. - Id string `json:"id"` - Klarna *KlarnaInfo `json:"klarna,omitempty"` + Id string `json:"id"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` - Paypal *PayPalInfo `json:"paypal,omitempty"` + Paypal *PayPalInfo `json:"paypal,omitempty"` // Your reference for the payment method. Supported characters a-z, A-Z, 0-9. Reference *string `json:"reference,omitempty"` // The sales channel. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - Sofort *SofortInfo `json:"sofort,omitempty"` + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + Sofort *SofortInfo `json:"sofort,omitempty"` // The ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/stores__resParam_id), if any. - StoreId *string `json:"storeId,omitempty"` - Swish *SwishInfo `json:"swish,omitempty"` - Twint *TwintInfo `json:"twint,omitempty"` + StoreId *string `json:"storeId,omitempty"` + Swish *SwishInfo `json:"swish,omitempty"` + Twint *TwintInfo `json:"twint,omitempty"` // Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). Type *string `json:"type,omitempty"` // Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** - VerificationStatus *string `json:"verificationStatus,omitempty"` - Vipps *VippsInfo `json:"vipps,omitempty"` + VerificationStatus *string `json:"verificationStatus,omitempty"` + Vipps *VippsInfo `json:"vipps,omitempty"` } // NewPaymentMethod instantiates a new PaymentMethod object @@ -902,7 +901,7 @@ func (o *PaymentMethod) SetVipps(v VippsInfo) { } func (o PaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1026,12 +1025,14 @@ func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethod) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"valid", "pending", "invalid", "rejected"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "valid", "pending", "invalid", "rejected" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payment_method_response.go b/src/management/model_payment_method_response.go index 499a26822..3ebb1d13f 100644 --- a/src/management/model_payment_method_response.go +++ b/src/management/model_payment_method_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodResponse type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *PaymentMethodResponse) SetTypesWithErrors(v []string) { } func (o PaymentMethodResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -252,3 +251,6 @@ func (v *NullablePaymentMethodResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment_method_setup_info.go b/src/management/model_payment_method_setup_info.go index 8009af9af..e71b261ae 100644 --- a/src/management/model_payment_method_setup_info.go +++ b/src/management/model_payment_method_setup_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodSetupInfo type satisfies the MappedNullable interface at compile time @@ -20,34 +19,34 @@ var _ common.MappedNullable = &PaymentMethodSetupInfo{} // PaymentMethodSetupInfo struct for PaymentMethodSetupInfo type PaymentMethodSetupInfo struct { AfterpayTouch *AfterpayTouchInfo `json:"afterpayTouch,omitempty"` - ApplePay *ApplePayInfo `json:"applePay,omitempty"` - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + ApplePay *ApplePayInfo `json:"applePay,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` // The unique identifier of the business line. - BusinessLineId *string `json:"businessLineId,omitempty"` + BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` - Clearpay *ClearpayInfo `json:"clearpay,omitempty"` + Clearpay *ClearpayInfo `json:"clearpay,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. Countries []string `json:"countries,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. Currencies []string `json:"currencies,omitempty"` // The list of custom routing flags to route payment to the intended acquirer. - CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` - GiroPay *GiroPayInfo `json:"giroPay,omitempty"` - GooglePay *GooglePayInfo `json:"googlePay,omitempty"` - Klarna *KlarnaInfo `json:"klarna,omitempty"` - MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` - Paypal *PayPalInfo `json:"paypal,omitempty"` + CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + GooglePay *GooglePayInfo `json:"googlePay,omitempty"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` + MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` + Paypal *PayPalInfo `json:"paypal,omitempty"` // Your reference for the payment method. Supported characters a-z, A-Z, 0-9. Reference *string `json:"reference,omitempty"` - // The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - Sofort *SofortInfo `json:"sofort,omitempty"` + // The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + Sofort *SofortInfo `json:"sofort,omitempty"` // The ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/stores__resParam_id), if any. - StoreId *string `json:"storeId,omitempty"` - Swish *SwishInfo `json:"swish,omitempty"` - Twint *TwintInfo `json:"twint,omitempty"` + StoreId *string `json:"storeId,omitempty"` + Swish *SwishInfo `json:"swish,omitempty"` + Twint *TwintInfo `json:"twint,omitempty"` // Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` Vipps *VippsInfo `json:"vipps,omitempty"` } @@ -773,7 +772,7 @@ func (o *PaymentMethodSetupInfo) SetVipps(v VippsInfo) { } func (o PaymentMethodSetupInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -887,21 +886,23 @@ func (v *NullablePaymentMethodSetupInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodSetupInfo) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"eCommerce", "pos", "moto", "contAuth"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "eCommerce", "pos", "moto", "contAuth" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *PaymentMethodSetupInfo) isValidType() bool { - var allowedEnumValues = []string{"afterpaytouch", "alipay", "alipay_hk", "amex", "applepay", "bcmc", "blik", "cartebancaire", "clearpay", "cup", "diners", "directEbanking", "directdebit_GB", "discover", "ebanking_FI", "eftpos_australia", "elo", "elocredit", "elodebit", "girocard", "giropay", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "afterpaytouch", "alipay", "alipay_hk", "amex", "applepay", "bcmc", "blik", "cartebancaire", "clearpay", "cup", "diners", "directEbanking", "directdebit_GB", "discover", "ebanking_FI", "eftpos_australia", "elo", "elocredit", "elodebit", "girocard", "giropay", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payment_method_wrapper.go b/src/management/model_payment_method_wrapper.go index e3b3361ba..7680322d0 100644 --- a/src/management/model_payment_method_wrapper.go +++ b/src/management/model_payment_method_wrapper.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentMethodWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *PaymentMethodWrapper) SetPaymentMethod(v PaymentMethod) { } func (o PaymentMethodWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullablePaymentMethodWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payout_settings.go b/src/management/model_payout_settings.go index c7065171b..5c677fea3 100644 --- a/src/management/model_payout_settings.go +++ b/src/management/model_payout_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayoutSettings type satisfies the MappedNullable interface at compile time @@ -263,7 +262,7 @@ func (o *PayoutSettings) SetVerificationStatus(v string) { } func (o PayoutSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -328,21 +327,23 @@ func (v *NullablePayoutSettings) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutSettings) isValidPriority() bool { - var allowedEnumValues = []string{"first", "normal", "urgent"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "first", "normal", "urgent" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } func (o *PayoutSettings) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payout_settings_request.go b/src/management/model_payout_settings_request.go index ab9ce5c26..e30dda95f 100644 --- a/src/management/model_payout_settings_request.go +++ b/src/management/model_payout_settings_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayoutSettingsRequest type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *PayoutSettingsRequest) SetTransferInstrumentId(v string) { } func (o PayoutSettingsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullablePayoutSettingsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payout_settings_response.go b/src/management/model_payout_settings_response.go index 8b65bcaf0..b22674794 100644 --- a/src/management/model_payout_settings_response.go +++ b/src/management/model_payout_settings_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayoutSettingsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *PayoutSettingsResponse) SetData(v []PayoutSettings) { } func (o PayoutSettingsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullablePayoutSettingsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_profile.go b/src/management/model_profile.go index ce1d42796..c1392673f 100644 --- a/src/management/model_profile.go +++ b/src/management/model_profile.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Profile type satisfies the MappedNullable interface at compile time @@ -30,15 +29,15 @@ type Profile struct { // Indicates whether this is your preferred wireless network. If **true**, the terminal will try connecting to this network first. DefaultProfile *bool `json:"defaultProfile,omitempty"` // For `authType` **wpa-eap** or **wpa2-eap**. Possible values: **tls**, **peap**, **leap**, **fast** - Eap *string `json:"eap,omitempty"` - EapCaCert *File `json:"eapCaCert,omitempty"` - EapClientCert *File `json:"eapClientCert,omitempty"` - EapClientKey *File `json:"eapClientKey,omitempty"` + Eap *string `json:"eap,omitempty"` + EapCaCert *File `json:"eapCaCert,omitempty"` + EapClientCert *File `json:"eapClientCert,omitempty"` + EapClientKey *File `json:"eapClientKey,omitempty"` // For `eap` **tls**. The password of the RSA key file, if that file is password-protected. EapClientPwd *string `json:"eapClientPwd,omitempty"` // For `authType` **wpa-eap** or **wpa2-eap**. The EAP-PEAP username from your MS-CHAP account. Must match the configuration of your RADIUS server. - EapIdentity *string `json:"eapIdentity,omitempty"` - EapIntermediateCert *File `json:"eapIntermediateCert,omitempty"` + EapIdentity *string `json:"eapIdentity,omitempty"` + EapIntermediateCert *File `json:"eapIntermediateCert,omitempty"` // For `eap` **peap**. The EAP-PEAP password from your MS-CHAP account. Must match the configuration of your RADIUS server. EapPwd *string `json:"eapPwd,omitempty"` // Indicates if the network doesn't broadcast its SSID. Mandatory for Android terminals, because these terminals rely on this setting to be able to connect to any network. @@ -619,7 +618,7 @@ func (o *Profile) SetWsec(v string) { } func (o Profile) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -712,3 +711,6 @@ func (v *NullableProfile) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_receipt_options.go b/src/management/model_receipt_options.go index 4a19f1291..392a28901 100644 --- a/src/management/model_receipt_options.go +++ b/src/management/model_receipt_options.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ReceiptOptions type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ReceiptOptions) SetQrCodeData(v string) { } func (o ReceiptOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableReceiptOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_receipt_printing.go b/src/management/model_receipt_printing.go index 61def9d14..cc43bbd66 100644 --- a/src/management/model_receipt_printing.go +++ b/src/management/model_receipt_printing.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ReceiptPrinting type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *ReceiptPrinting) SetShopperVoid(v bool) { } func (o ReceiptPrinting) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -678,3 +677,6 @@ func (v *NullableReceiptPrinting) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_release_update_details.go b/src/management/model_release_update_details.go index 2c98d1329..9d5f3af33 100644 --- a/src/management/model_release_update_details.go +++ b/src/management/model_release_update_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ReleaseUpdateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *ReleaseUpdateDetails) SetUpdateAtFirstMaintenanceCall(v bool) { } func (o ReleaseUpdateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableReleaseUpdateDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ReleaseUpdateDetails) isValidType() bool { - var allowedEnumValues = []string{"ReleaseUpdate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ReleaseUpdate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_request_activation_response.go b/src/management/model_request_activation_response.go index f41abc171..1dce38341 100644 --- a/src/management/model_request_activation_response.go +++ b/src/management/model_request_activation_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RequestActivationResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *RequestActivationResponse) SetMerchantId(v string) { } func (o RequestActivationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableRequestActivationResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_rest_service_error.go b/src/management/model_rest_service_error.go index 645860fff..f549c3d48 100644 --- a/src/management/model_rest_service_error.go +++ b/src/management/model_rest_service_error.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidFieldWrapper `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - Response *JSONObject `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response *JSONObject `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -309,7 +308,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -373,3 +372,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_schedule_terminal_actions_request.go b/src/management/model_schedule_terminal_actions_request.go index 27bb3d8ce..40726c03a 100644 --- a/src/management/model_schedule_terminal_actions_request.go +++ b/src/management/model_schedule_terminal_actions_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ScheduleTerminalActionsRequest type satisfies the MappedNullable interface at compile time @@ -174,7 +173,7 @@ func (o *ScheduleTerminalActionsRequest) SetTerminalIds(v []string) { } func (o ScheduleTerminalActionsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -233,3 +232,6 @@ func (v *NullableScheduleTerminalActionsRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_schedule_terminal_actions_request_action_details.go b/src/management/model_schedule_terminal_actions_request_action_details.go index 65582a125..5576d8d4c 100644 --- a/src/management/model_schedule_terminal_actions_request_action_details.go +++ b/src/management/model_schedule_terminal_actions_request_action_details.go @@ -10,15 +10,16 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // ScheduleTerminalActionsRequestActionDetails - Information about the action to take. type ScheduleTerminalActionsRequestActionDetails struct { - InstallAndroidAppDetails *InstallAndroidAppDetails - InstallAndroidCertificateDetails *InstallAndroidCertificateDetails - ReleaseUpdateDetails *ReleaseUpdateDetails - UninstallAndroidAppDetails *UninstallAndroidAppDetails + InstallAndroidAppDetails *InstallAndroidAppDetails + InstallAndroidCertificateDetails *InstallAndroidCertificateDetails + ReleaseUpdateDetails *ReleaseUpdateDetails + UninstallAndroidAppDetails *UninstallAndroidAppDetails UninstallAndroidCertificateDetails *UninstallAndroidCertificateDetails } @@ -57,6 +58,7 @@ func UninstallAndroidCertificateDetailsAsScheduleTerminalActionsRequestActionDet } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byte) error { var err error @@ -67,7 +69,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonInstallAndroidAppDetails, _ := json.Marshal(dst.InstallAndroidAppDetails) if string(jsonInstallAndroidAppDetails) == "{}" || !dst.InstallAndroidAppDetails.isValidType() { // empty struct dst.InstallAndroidAppDetails = nil - } else { + } else { match++ } } else { @@ -80,7 +82,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonInstallAndroidCertificateDetails, _ := json.Marshal(dst.InstallAndroidCertificateDetails) if string(jsonInstallAndroidCertificateDetails) == "{}" || !dst.InstallAndroidCertificateDetails.isValidType() { // empty struct dst.InstallAndroidCertificateDetails = nil - } else { + } else { match++ } } else { @@ -93,7 +95,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonReleaseUpdateDetails, _ := json.Marshal(dst.ReleaseUpdateDetails) if string(jsonReleaseUpdateDetails) == "{}" || !dst.ReleaseUpdateDetails.isValidType() { // empty struct dst.ReleaseUpdateDetails = nil - } else { + } else { match++ } } else { @@ -106,7 +108,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonUninstallAndroidAppDetails, _ := json.Marshal(dst.UninstallAndroidAppDetails) if string(jsonUninstallAndroidAppDetails) == "{}" || !dst.UninstallAndroidAppDetails.isValidType() { // empty struct dst.UninstallAndroidAppDetails = nil - } else { + } else { match++ } } else { @@ -119,7 +121,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonUninstallAndroidCertificateDetails, _ := json.Marshal(dst.UninstallAndroidCertificateDetails) if string(jsonUninstallAndroidCertificateDetails) == "{}" || !dst.UninstallAndroidCertificateDetails.isValidType() { // empty struct dst.UninstallAndroidCertificateDetails = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (src ScheduleTerminalActionsRequestActionDetails) MarshalJSON() ([]byte, er } // Get the actual instance -func (obj *ScheduleTerminalActionsRequestActionDetails) GetActualInstance() interface{} { +func (obj *ScheduleTerminalActionsRequestActionDetails) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -231,3 +233,5 @@ func (v *NullableScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(src v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/management/model_schedule_terminal_actions_response.go b/src/management/model_schedule_terminal_actions_response.go index 5cb0590be..573830fbf 100644 --- a/src/management/model_schedule_terminal_actions_response.go +++ b/src/management/model_schedule_terminal_actions_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ScheduleTerminalActionsResponse type satisfies the MappedNullable interface at compile time @@ -314,7 +313,7 @@ func (o *ScheduleTerminalActionsResponse) SetTotalScheduled(v int32) { } func (o ScheduleTerminalActionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -385,3 +384,6 @@ func (v *NullableScheduleTerminalActionsResponse) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_settings.go b/src/management/model_settings.go index e0f93984d..903ffe00a 100644 --- a/src/management/model_settings.go +++ b/src/management/model_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Settings type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Settings) SetTimeout(v int32) { } func (o Settings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_shipping_location.go b/src/management/model_shipping_location.go index f8085e1f9..267228b6d 100644 --- a/src/management/model_shipping_location.go +++ b/src/management/model_shipping_location.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ShippingLocation type satisfies the MappedNullable interface at compile time @@ -173,7 +172,7 @@ func (o *ShippingLocation) SetName(v string) { } func (o ShippingLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,3 +231,6 @@ func (v *NullableShippingLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_shipping_locations_response.go b/src/management/model_shipping_locations_response.go index 5b737c692..5e6f55f55 100644 --- a/src/management/model_shipping_locations_response.go +++ b/src/management/model_shipping_locations_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ShippingLocationsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ShippingLocationsResponse) SetData(v []ShippingLocation) { } func (o ShippingLocationsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableShippingLocationsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_signature.go b/src/management/model_signature.go index b543e362a..613262df0 100644 --- a/src/management/model_signature.go +++ b/src/management/model_signature.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Signature type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Signature) SetSkipSignature(v bool) { } func (o Signature) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSignature) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_sofort_info.go b/src/management/model_sofort_info.go index 5ed430ffc..8abc50efd 100644 --- a/src/management/model_sofort_info.go +++ b/src/management/model_sofort_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SofortInfo type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *SofortInfo) SetLogo(v string) { } func (o SofortInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableSofortInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration.go b/src/management/model_split_configuration.go index b625b7d35..57a62ff52 100644 --- a/src/management/model_split_configuration.go +++ b/src/management/model_split_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitConfiguration type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *SplitConfiguration) SetStores(v []string) { } func (o SplitConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableSplitConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration_list.go b/src/management/model_split_configuration_list.go index 221be2af4..1eaa804d1 100644 --- a/src/management/model_split_configuration_list.go +++ b/src/management/model_split_configuration_list.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitConfigurationList type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *SplitConfigurationList) SetData(v []SplitConfiguration) { } func (o SplitConfigurationList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableSplitConfigurationList) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration_logic.go b/src/management/model_split_configuration_logic.go index 6b153010c..7f02c2007 100644 --- a/src/management/model_split_configuration_logic.go +++ b/src/management/model_split_configuration_logic.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitConfigurationLogic type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SplitConfigurationLogic{} type SplitConfigurationLogic struct { AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - Chargeback *string `json:"chargeback,omitempty"` + Chargeback *string `json:"chargeback,omitempty"` Commission Commission `json:"commission"` // Specifies the logic to apply when booking the transaction fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. PaymentFee string `json:"paymentFee"` @@ -295,7 +294,7 @@ func (o *SplitConfigurationLogic) SetTip(v string) { } func (o SplitConfigurationLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -363,48 +362,50 @@ func (v *NullableSplitConfigurationLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SplitConfigurationLogic) isValidChargeback() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} - for _, allowed := range allowedEnumValues { - if o.GetChargeback() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio" } + for _, allowed := range allowedEnumValues { + if o.GetChargeback() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidPaymentFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentFee() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidRemainder() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetRemainder() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetRemainder() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidSurcharge() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSurcharge() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSurcharge() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidTip() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetTip() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetTip() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_split_configuration_rule.go b/src/management/model_split_configuration_rule.go index 9870c95c7..8c3d60823 100644 --- a/src/management/model_split_configuration_rule.go +++ b/src/management/model_split_configuration_rule.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitConfigurationRule type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type SplitConfigurationRule struct { // The unique identifier of the split configuration rule. RuleId *string `json:"ruleId,omitempty"` // The sales channel condition that defines whether the split logic applies. Possible values: * **Ecommerce**: Online transactions where the cardholder is present. * **ContAuth**: Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). * **Moto**: Mail-order and telephone-order transactions where the customer is in contact with the merchant via email or telephone. * **POS**: Point-of-sale transactions where the customer is physically present to make a payment using a secure payment terminal. * **ANY**: All sales channels. - ShopperInteraction string `json:"shopperInteraction"` - SplitLogic SplitConfigurationLogic `json:"splitLogic"` + ShopperInteraction string `json:"shopperInteraction"` + SplitLogic SplitConfigurationLogic `json:"splitLogic"` } // NewSplitConfigurationRule instantiates a new SplitConfigurationRule object @@ -214,7 +213,7 @@ func (o *SplitConfigurationRule) SetSplitLogic(v SplitConfigurationLogic) { } func (o SplitConfigurationRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,21 +271,23 @@ func (v *NullableSplitConfigurationRule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SplitConfigurationRule) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit", "ANY"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit", "ANY" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *SplitConfigurationRule) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS", "ANY"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS", "ANY" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_standalone.go b/src/management/model_standalone.go index 8f8a28b99..f8dbece7d 100644 --- a/src/management/model_standalone.go +++ b/src/management/model_standalone.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Standalone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Standalone) SetEnableStandalone(v bool) { } func (o Standalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store.go b/src/management/model_store.go index c84ca7877..fbee773db 100644 --- a/src/management/model_store.go +++ b/src/management/model_store.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Store type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Store{} // Store struct for Store type Store struct { - Links *Links `json:"_links,omitempty"` + Links *Links `json:"_links,omitempty"` Address *StoreLocation `json:"address,omitempty"` // The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. // Deprecated @@ -37,7 +36,7 @@ type Store struct { // A reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_) Reference *string `json:"reference,omitempty"` // The store name shown on the shopper's bank or credit card statement and on the shopper receipt. - ShopperStatement *string `json:"shopperStatement,omitempty"` + ShopperStatement *string `json:"shopperStatement,omitempty"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` // The status of the store. Possible values are: - **active**. This value is assigned automatically when a store is created. - **inactive**. The terminals under the store are blocked from accepting new transactions, but capturing outstanding transactions is still possible. - **closed**. This status is irreversible. The terminals under the store are reassigned to the merchant inventory. Status *string `json:"status,omitempty"` @@ -448,7 +447,7 @@ func (o *Store) SetStatus(v string) { } func (o Store) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -532,12 +531,14 @@ func (v *NullableStore) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Store) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_store_creation_request.go b/src/management/model_store_creation_request.go index 20122c6d0..7b8aaee0d 100644 --- a/src/management/model_store_creation_request.go +++ b/src/management/model_store_creation_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreCreationRequest type satisfies the MappedNullable interface at compile time @@ -32,7 +31,7 @@ type StoreCreationRequest struct { // Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). Reference *string `json:"reference,omitempty"` // The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. - ShopperStatement string `json:"shopperStatement"` + ShopperStatement string `json:"shopperStatement"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` } @@ -285,7 +284,7 @@ func (o *StoreCreationRequest) SetSplitConfiguration(v StoreSplitConfiguration) } func (o StoreCreationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -348,3 +347,6 @@ func (v *NullableStoreCreationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_creation_with_merchant_code_request.go b/src/management/model_store_creation_with_merchant_code_request.go index fbd03c461..b5f47ea04 100644 --- a/src/management/model_store_creation_with_merchant_code_request.go +++ b/src/management/model_store_creation_with_merchant_code_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreCreationWithMerchantCodeRequest type satisfies the MappedNullable interface at compile time @@ -34,7 +33,7 @@ type StoreCreationWithMerchantCodeRequest struct { // Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). Reference *string `json:"reference,omitempty"` // The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. - ShopperStatement string `json:"shopperStatement"` + ShopperStatement string `json:"shopperStatement"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` } @@ -312,7 +311,7 @@ func (o *StoreCreationWithMerchantCodeRequest) SetSplitConfiguration(v StoreSpli } func (o StoreCreationWithMerchantCodeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -376,3 +375,6 @@ func (v *NullableStoreCreationWithMerchantCodeRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_location.go b/src/management/model_store_location.go index eb0c11731..d31796ec1 100644 --- a/src/management/model_store_location.go +++ b/src/management/model_store_location.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreLocation type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *StoreLocation) SetStateOrProvince(v string) { } func (o StoreLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -336,3 +335,6 @@ func (v *NullableStoreLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_split_configuration.go b/src/management/model_store_split_configuration.go index 9acf28132..c3797b7ee 100644 --- a/src/management/model_store_split_configuration.go +++ b/src/management/model_store_split_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreSplitConfiguration type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *StoreSplitConfiguration) SetSplitConfigurationId(v string) { } func (o StoreSplitConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableStoreSplitConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_surcharge.go b/src/management/model_surcharge.go index 78298630d..c005f9ab2 100644 --- a/src/management/model_surcharge.go +++ b/src/management/model_surcharge.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Surcharge type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Surcharge) SetConfigurations(v []Configuration) { } func (o Surcharge) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableSurcharge) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_swish_info.go b/src/management/model_swish_info.go index d2a7d95d9..b617d04c3 100644 --- a/src/management/model_swish_info.go +++ b/src/management/model_swish_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SwishInfo type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *SwishInfo) SetSwishNumber(v string) { } func (o SwishInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableSwishInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal.go b/src/management/model_terminal.go index 7f0a9b1cf..dfeb734d2 100644 --- a/src/management/model_terminal.go +++ b/src/management/model_terminal.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Terminal type satisfies the MappedNullable interface at compile time @@ -860,7 +859,7 @@ func (o *Terminal) SetWifiSsid(v string) { } func (o Terminal) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -973,3 +972,6 @@ func (v *NullableTerminal) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_action_schedule_detail.go b/src/management/model_terminal_action_schedule_detail.go index 9c63bd72a..8447d2182 100644 --- a/src/management/model_terminal_action_schedule_detail.go +++ b/src/management/model_terminal_action_schedule_detail.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalActionScheduleDetail type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalActionScheduleDetail) SetTerminalId(v string) { } func (o TerminalActionScheduleDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTerminalActionScheduleDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_models_response.go b/src/management/model_terminal_models_response.go index 969f25923..2824f4311 100644 --- a/src/management/model_terminal_models_response.go +++ b/src/management/model_terminal_models_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalModelsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalModelsResponse) SetData(v []IdName) { } func (o TerminalModelsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalModelsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_order.go b/src/management/model_terminal_order.go index 16304d7fc..b40bc8bbe 100644 --- a/src/management/model_terminal_order.go +++ b/src/management/model_terminal_order.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalOrder type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type TerminalOrder struct { // The products included in the order. Items []OrderItem `json:"items,omitempty"` // The date and time that the order was placed, in UTC ISO 8601 format. For example, \"2011-12-03T10:15:30Z\". - OrderDate *string `json:"orderDate,omitempty"` + OrderDate *string `json:"orderDate,omitempty"` ShippingLocation *ShippingLocation `json:"shippingLocation,omitempty"` // The processing status of the order. Status *string `json:"status,omitempty"` @@ -309,7 +308,7 @@ func (o *TerminalOrder) SetTrackingUrl(v string) { } func (o TerminalOrder) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -380,3 +379,6 @@ func (v *NullableTerminalOrder) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_order_request.go b/src/management/model_terminal_order_request.go index 623b37687..e45e84612 100644 --- a/src/management/model_terminal_order_request.go +++ b/src/management/model_terminal_order_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalOrderRequest type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *TerminalOrderRequest) SetTaxId(v string) { } func (o TerminalOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableTerminalOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_orders_response.go b/src/management/model_terminal_orders_response.go index f44f57925..12b56ee53 100644 --- a/src/management/model_terminal_orders_response.go +++ b/src/management/model_terminal_orders_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalOrdersResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalOrdersResponse) SetData(v []TerminalOrder) { } func (o TerminalOrdersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalOrdersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_product.go b/src/management/model_terminal_product.go index 833d8341c..2777cc2ba 100644 --- a/src/management/model_terminal_product.go +++ b/src/management/model_terminal_product.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalProduct type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type TerminalProduct struct { // A list of parts included in the terminal package. ItemsIncluded []string `json:"itemsIncluded,omitempty"` // The descriptive name of the product. - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Price *TerminalProductPrice `json:"price,omitempty"` } @@ -208,7 +207,7 @@ func (o *TerminalProduct) SetPrice(v TerminalProductPrice) { } func (o TerminalProduct) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableTerminalProduct) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_product_price.go b/src/management/model_terminal_product_price.go index 9b5ddd74b..8d7ef87fc 100644 --- a/src/management/model_terminal_product_price.go +++ b/src/management/model_terminal_product_price.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalProductPrice type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalProductPrice) SetValue(v float64) { } func (o TerminalProductPrice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTerminalProductPrice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_products_response.go b/src/management/model_terminal_products_response.go index dfadae910..33a8fe4ff 100644 --- a/src/management/model_terminal_products_response.go +++ b/src/management/model_terminal_products_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalProductsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalProductsResponse) SetData(v []TerminalProduct) { } func (o TerminalProductsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalProductsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_settings.go b/src/management/model_terminal_settings.go index b7aa89da3..6af400295 100644 --- a/src/management/model_terminal_settings.go +++ b/src/management/model_terminal_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TerminalSettings type satisfies the MappedNullable interface at compile time @@ -20,23 +19,23 @@ var _ common.MappedNullable = &TerminalSettings{} // TerminalSettings struct for TerminalSettings type TerminalSettings struct { CardholderReceipt *CardholderReceipt `json:"cardholderReceipt,omitempty"` - Connectivity *Connectivity `json:"connectivity,omitempty"` + Connectivity *Connectivity `json:"connectivity,omitempty"` // Settings for tipping with or without predefined options to choose from. The maximum number of predefined options is four, or three plus the option to enter a custom tip. - Gratuities []Gratuity `json:"gratuities,omitempty"` - Hardware *Hardware `json:"hardware,omitempty"` - Nexo *Nexo `json:"nexo,omitempty"` + Gratuities []Gratuity `json:"gratuities,omitempty"` + Hardware *Hardware `json:"hardware,omitempty"` + Nexo *Nexo `json:"nexo,omitempty"` OfflineProcessing *OfflineProcessing `json:"offlineProcessing,omitempty"` - Opi *Opi `json:"opi,omitempty"` - Passcodes *Passcodes `json:"passcodes,omitempty"` - PayAtTable *PayAtTable `json:"payAtTable,omitempty"` - Payment *Payment `json:"payment,omitempty"` - ReceiptOptions *ReceiptOptions `json:"receiptOptions,omitempty"` - ReceiptPrinting *ReceiptPrinting `json:"receiptPrinting,omitempty"` - Signature *Signature `json:"signature,omitempty"` - Standalone *Standalone `json:"standalone,omitempty"` - Surcharge *Surcharge `json:"surcharge,omitempty"` - Timeouts *Timeouts `json:"timeouts,omitempty"` - WifiProfiles *WifiProfiles `json:"wifiProfiles,omitempty"` + Opi *Opi `json:"opi,omitempty"` + Passcodes *Passcodes `json:"passcodes,omitempty"` + PayAtTable *PayAtTable `json:"payAtTable,omitempty"` + Payment *Payment `json:"payment,omitempty"` + ReceiptOptions *ReceiptOptions `json:"receiptOptions,omitempty"` + ReceiptPrinting *ReceiptPrinting `json:"receiptPrinting,omitempty"` + Signature *Signature `json:"signature,omitempty"` + Standalone *Standalone `json:"standalone,omitempty"` + Surcharge *Surcharge `json:"surcharge,omitempty"` + Timeouts *Timeouts `json:"timeouts,omitempty"` + WifiProfiles *WifiProfiles `json:"wifiProfiles,omitempty"` } // NewTerminalSettings instantiates a new TerminalSettings object @@ -601,7 +600,7 @@ func (o *TerminalSettings) SetWifiProfiles(v WifiProfiles) { } func (o TerminalSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -699,3 +698,6 @@ func (v *NullableTerminalSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_company_webhook_request.go b/src/management/model_test_company_webhook_request.go index e858f11b8..9c391d6cf 100644 --- a/src/management/model_test_company_webhook_request.go +++ b/src/management/model_test_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TestCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &TestCompanyWebhookRequest{} // TestCompanyWebhookRequest struct for TestCompanyWebhookRequest type TestCompanyWebhookRequest struct { // List of `merchantId` values for which test webhooks will be sent. The list can have a maximum of 20 `merchantId` values. If not specified, we send sample notifications to all the merchant accounts that the webhook is configured for. If this is more than 20 merchant accounts, use this list to specify a subset of the merchant accounts for which to send test notifications. - MerchantIds []string `json:"merchantIds,omitempty"` + MerchantIds []string `json:"merchantIds,omitempty"` Notification *CustomNotification `json:"notification,omitempty"` - // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** Types []string `json:"types,omitempty"` } @@ -140,7 +139,7 @@ func (o *TestCompanyWebhookRequest) SetTypes(v []string) { } func (o TestCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableTestCompanyWebhookRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_output.go b/src/management/model_test_output.go index 16d45e9a5..61d0d0031 100644 --- a/src/management/model_test_output.go +++ b/src/management/model_test_output.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TestOutput type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *TestOutput) SetStatus(v string) { } func (o TestOutput) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableTestOutput) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_webhook_request.go b/src/management/model_test_webhook_request.go index bec1b9ce1..99e5ef6ab 100644 --- a/src/management/model_test_webhook_request.go +++ b/src/management/model_test_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TestWebhookRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &TestWebhookRequest{} // TestWebhookRequest struct for TestWebhookRequest type TestWebhookRequest struct { Notification *CustomNotification `json:"notification,omitempty"` - // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** Types []string `json:"types,omitempty"` } @@ -106,7 +105,7 @@ func (o *TestWebhookRequest) SetTypes(v []string) { } func (o TestWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableTestWebhookRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_webhook_response.go b/src/management/model_test_webhook_response.go index 0a577b117..3496364b9 100644 --- a/src/management/model_test_webhook_response.go +++ b/src/management/model_test_webhook_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TestWebhookResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TestWebhookResponse) SetData(v []TestOutput) { } func (o TestWebhookResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTestWebhookResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_timeouts.go b/src/management/model_timeouts.go index 953036533..285b79e69 100644 --- a/src/management/model_timeouts.go +++ b/src/management/model_timeouts.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Timeouts type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Timeouts) SetFromActiveToSleep(v int32) { } func (o Timeouts) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTimeouts) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_twint_info.go b/src/management/model_twint_info.go index d1723dcf7..147d6a421 100644 --- a/src/management/model_twint_info.go +++ b/src/management/model_twint_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TwintInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *TwintInfo) SetLogo(v string) { } func (o TwintInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableTwintInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_uninstall_android_app_details.go b/src/management/model_uninstall_android_app_details.go index 44da44bb6..c5cc85093 100644 --- a/src/management/model_uninstall_android_app_details.go +++ b/src/management/model_uninstall_android_app_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UninstallAndroidAppDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *UninstallAndroidAppDetails) SetType(v string) { } func (o UninstallAndroidAppDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableUninstallAndroidAppDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UninstallAndroidAppDetails) isValidType() bool { - var allowedEnumValues = []string{"UninstallAndroidApp"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "UninstallAndroidApp" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_uninstall_android_certificate_details.go b/src/management/model_uninstall_android_certificate_details.go index 0c7c1f14d..707646c56 100644 --- a/src/management/model_uninstall_android_certificate_details.go +++ b/src/management/model_uninstall_android_certificate_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UninstallAndroidCertificateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *UninstallAndroidCertificateDetails) SetType(v string) { } func (o UninstallAndroidCertificateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableUninstallAndroidCertificateDetails) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *UninstallAndroidCertificateDetails) isValidType() bool { - var allowedEnumValues = []string{"UninstallAndroidCertificate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "UninstallAndroidCertificate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_updatable_address.go b/src/management/model_updatable_address.go index bc3511625..a1b60af8f 100644 --- a/src/management/model_updatable_address.go +++ b/src/management/model_updatable_address.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdatableAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *UpdatableAddress) SetStateOrProvince(v string) { } func (o UpdatableAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableUpdatableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_api_credential_request.go b/src/management/model_update_company_api_credential_request.go index 57efd91d9..889519d46 100644 --- a/src/management/model_update_company_api_credential_request.go +++ b/src/management/model_update_company_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateCompanyApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *UpdateCompanyApiCredentialRequest) SetRoles(v []string) { } func (o UpdateCompanyApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableUpdateCompanyApiCredentialRequest) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_user_request.go b/src/management/model_update_company_user_request.go index e21f18988..50647b59e 100644 --- a/src/management/model_update_company_user_request.go +++ b/src/management/model_update_company_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateCompanyUserRequest type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type UpdateCompanyUserRequest struct { AssociatedMerchantAccounts []string `json:"associatedMerchantAccounts,omitempty"` // The email address of the user. Email *string `json:"email,omitempty"` - Name *Name2 `json:"name,omitempty"` + Name *Name2 `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -276,7 +275,7 @@ func (o *UpdateCompanyUserRequest) SetTimeZoneCode(v string) { } func (o UpdateCompanyUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableUpdateCompanyUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_webhook_request.go b/src/management/model_update_company_webhook_request.go index 05e8e68da..bcecedb85 100644 --- a/src/management/model_update_company_webhook_request.go +++ b/src/management/model_update_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type UpdateCompanyWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active *bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat *string `json:"communicationFormat,omitempty"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -548,7 +547,7 @@ func (o *UpdateCompanyWebhookRequest) SetUsername(v string) { } func (o UpdateCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,39 +640,41 @@ func (v *NullableUpdateCompanyWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateCompanyWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidSslVersion() bool { - var allowedEnumValues = []string{"HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetSslVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetSslVersion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_merchant_api_credential_request.go b/src/management/model_update_merchant_api_credential_request.go index 2380b4c38..a1440e9b8 100644 --- a/src/management/model_update_merchant_api_credential_request.go +++ b/src/management/model_update_merchant_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateMerchantApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *UpdateMerchantApiCredentialRequest) SetRoles(v []string) { } func (o UpdateMerchantApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableUpdateMerchantApiCredentialRequest) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_merchant_user_request.go b/src/management/model_update_merchant_user_request.go index e160c42a5..1a90c21ce 100644 --- a/src/management/model_update_merchant_user_request.go +++ b/src/management/model_update_merchant_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateMerchantUserRequest type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type UpdateMerchantUserRequest struct { Active *bool `json:"active,omitempty"` // The email address of the user. Email *string `json:"email,omitempty"` - Name *Name2 `json:"name,omitempty"` + Name *Name2 `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -242,7 +241,7 @@ func (o *UpdateMerchantUserRequest) SetTimeZoneCode(v string) { } func (o UpdateMerchantUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -307,3 +306,6 @@ func (v *NullableUpdateMerchantUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_merchant_webhook_request.go b/src/management/model_update_merchant_webhook_request.go index 1a1892646..7f2fff819 100644 --- a/src/management/model_update_merchant_webhook_request.go +++ b/src/management/model_update_merchant_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateMerchantWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type UpdateMerchantWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active *bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat *string `json:"communicationFormat,omitempty"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -480,7 +479,7 @@ func (o *UpdateMerchantWebhookRequest) SetUsername(v string) { } func (o UpdateMerchantWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -567,30 +566,32 @@ func (v *NullableUpdateMerchantWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateMerchantWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *UpdateMerchantWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } func (o *UpdateMerchantWebhookRequest) isValidSslVersion() bool { - var allowedEnumValues = []string{"HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetSslVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetSslVersion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_payment_method_info.go b/src/management/model_update_payment_method_info.go index 86cbe8377..76c18a0ec 100644 --- a/src/management/model_update_payment_method_info.go +++ b/src/management/model_update_payment_method_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdatePaymentMethodInfo type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &UpdatePaymentMethodInfo{} // UpdatePaymentMethodInfo struct for UpdatePaymentMethodInfo type UpdatePaymentMethodInfo struct { - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. Countries []string `json:"countries,omitempty"` @@ -241,7 +240,7 @@ func (o *UpdatePaymentMethodInfo) SetStoreIds(v []string) { } func (o UpdatePaymentMethodInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -306,3 +305,6 @@ func (v *NullableUpdatePaymentMethodInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_payout_settings_request.go b/src/management/model_update_payout_settings_request.go index f79e2c515..6c5d34c17 100644 --- a/src/management/model_update_payout_settings_request.go +++ b/src/management/model_update_payout_settings_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdatePayoutSettingsRequest type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *UpdatePayoutSettingsRequest) SetEnabled(v bool) { } func (o UpdatePayoutSettingsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableUpdatePayoutSettingsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_split_configuration_logic_request.go b/src/management/model_update_split_configuration_logic_request.go index 14b39b581..00fcb36d0 100644 --- a/src/management/model_update_split_configuration_logic_request.go +++ b/src/management/model_update_split_configuration_logic_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateSplitConfigurationLogicRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &UpdateSplitConfigurationLogicRequest{} type UpdateSplitConfigurationLogicRequest struct { AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - Chargeback *string `json:"chargeback,omitempty"` + Chargeback *string `json:"chargeback,omitempty"` Commission Commission `json:"commission"` // Specifies the logic to apply when booking the transaction fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. PaymentFee string `json:"paymentFee"` @@ -295,7 +294,7 @@ func (o *UpdateSplitConfigurationLogicRequest) SetTip(v string) { } func (o UpdateSplitConfigurationLogicRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -363,48 +362,50 @@ func (v *NullableUpdateSplitConfigurationLogicRequest) UnmarshalJSON(src []byte) return json.Unmarshal(src, &v.value) } + func (o *UpdateSplitConfigurationLogicRequest) isValidChargeback() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} - for _, allowed := range allowedEnumValues { - if o.GetChargeback() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio" } + for _, allowed := range allowedEnumValues { + if o.GetChargeback() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidPaymentFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentFee() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidRemainder() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetRemainder() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetRemainder() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidSurcharge() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSurcharge() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSurcharge() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidTip() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetTip() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetTip() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_split_configuration_request.go b/src/management/model_update_split_configuration_request.go index a6a56cb79..f3b6b9493 100644 --- a/src/management/model_update_split_configuration_request.go +++ b/src/management/model_update_split_configuration_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateSplitConfigurationRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *UpdateSplitConfigurationRequest) SetDescription(v string) { } func (o UpdateSplitConfigurationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableUpdateSplitConfigurationRequest) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_split_configuration_rule_request.go b/src/management/model_update_split_configuration_rule_request.go index 458911a33..656ca5566 100644 --- a/src/management/model_update_split_configuration_rule_request.go +++ b/src/management/model_update_split_configuration_rule_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateSplitConfigurationRuleRequest type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *UpdateSplitConfigurationRuleRequest) SetShopperInteraction(v string) { } func (o UpdateSplitConfigurationRuleRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -207,3 +206,6 @@ func (v *NullableUpdateSplitConfigurationRuleRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_store_request.go b/src/management/model_update_store_request.go index 347daee3f..8a5ad2a04 100644 --- a/src/management/model_update_store_request.go +++ b/src/management/model_update_store_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UpdateStoreRequest type satisfies the MappedNullable interface at compile time @@ -25,8 +24,8 @@ type UpdateStoreRequest struct { // The description of the store. Description *string `json:"description,omitempty"` // When using the Zip payment method: The location ID that Zip has assigned to your store. - ExternalReferenceId *string `json:"externalReferenceId,omitempty"` - SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` + ExternalReferenceId *string `json:"externalReferenceId,omitempty"` + SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` // The status of the store. Possible values are: - **active**: This value is assigned automatically when a store is created. - **inactive**: The maximum [transaction limits and number of Store-and-Forward transactions](https://docs.adyen.com/point-of-sale/determine-account-structure/configure-features#payment-features) for the store are set to 0. This blocks new transactions, but captures are still possible. - **closed**: The terminals of the store are reassigned to the merchant inventory, so they can't process payments. You can change the status from **active** to **inactive**, and from **inactive** to **active** or **closed**. Once **closed**, a store can't be reopened. Status *string `json:"status,omitempty"` } @@ -241,7 +240,7 @@ func (o *UpdateStoreRequest) SetStatus(v string) { } func (o UpdateStoreRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -307,12 +306,14 @@ func (v *NullableUpdateStoreRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateStoreRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_url.go b/src/management/model_url.go index 894880e1e..0092495ee 100644 --- a/src/management/model_url.go +++ b/src/management/model_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Url type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Url) SetUsername(v string) { } func (o Url) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_user.go b/src/management/model_user.go index 22820866f..11cf02e03 100644 --- a/src/management/model_user.go +++ b/src/management/model_user.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the User type satisfies the MappedNullable interface at compile time @@ -29,8 +28,8 @@ type User struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -342,7 +341,7 @@ func (o *User) SetUsername(v string) { } func (o User) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,3 +408,6 @@ func (v *NullableUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_vipps_info.go b/src/management/model_vipps_info.go index 5128091b7..8a2bffc8c 100644 --- a/src/management/model_vipps_info.go +++ b/src/management/model_vipps_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VippsInfo type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *VippsInfo) SetSubscriptionCancelUrl(v string) { } func (o VippsInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableVippsInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_webhook.go b/src/management/model_webhook.go index 920f9ffff..f9397698a 100644 --- a/src/management/model_webhook.go +++ b/src/management/model_webhook.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Webhook type satisfies the MappedNullable interface at compile time @@ -29,11 +28,11 @@ type Webhook struct { // Reference to the account the webook is set on. AccountReference *string `json:"accountReference,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for you to receive webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettingsResponse `json:"additionalSettings,omitempty"` // The alias of our SSL certificate. When you receive a notification from us, the alias from the HMAC signature will match this alias. CertificateAlias *string `json:"certificateAlias,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -757,7 +756,7 @@ func (o *Webhook) SetUsername(v string) { } func (o Webhook) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,39 +862,41 @@ func (v *NullableWebhook) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Webhook) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *Webhook) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *Webhook) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } func (o *Webhook) isValidSslVersion() bool { - var allowedEnumValues = []string{"HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetSslVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "SSL", "SSLv3", "TLS", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetSslVersion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_webhook_links.go b/src/management/model_webhook_links.go index b4cba88fd..507bbf51a 100644 --- a/src/management/model_webhook_links.go +++ b/src/management/model_webhook_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WebhookLinks type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &WebhookLinks{} // WebhookLinks struct for WebhookLinks type WebhookLinks struct { - Company *LinksElement `json:"company,omitempty"` - GenerateHmac LinksElement `json:"generateHmac"` - Merchant *LinksElement `json:"merchant,omitempty"` - Self LinksElement `json:"self"` - TestWebhook LinksElement `json:"testWebhook"` + Company *LinksElement `json:"company,omitempty"` + GenerateHmac LinksElement `json:"generateHmac"` + Merchant *LinksElement `json:"merchant,omitempty"` + Self LinksElement `json:"self"` + TestWebhook LinksElement `json:"testWebhook"` } // NewWebhookLinks instantiates a new WebhookLinks object @@ -183,7 +182,7 @@ func (o *WebhookLinks) SetTestWebhook(v LinksElement) { } func (o WebhookLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,3 +238,6 @@ func (v *NullableWebhookLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_wifi_profiles.go b/src/management/model_wifi_profiles.go index 6e2657c25..d1cd178dc 100644 --- a/src/management/model_wifi_profiles.go +++ b/src/management/model_wifi_profiles.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the WifiProfiles type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *WifiProfiles) SetSettings(v Settings) { } func (o WifiProfiles) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableWifiProfiles) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/api_general.go b/src/payments/api_general.go index e73db6cc5..dd6ebcb06 100644 --- a/src/payments/api_general.go +++ b/src/payments/api_general.go @@ -10,17 +10,17 @@ package payments import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GeneralApi GeneralApi service type GeneralApi common.Service type GeneralApiAuthoriseConfig struct { - ctx context.Context + ctx context.Context paymentRequest *PaymentRequest } @@ -29,6 +29,7 @@ func (r GeneralApiAuthoriseConfig) PaymentRequest(paymentRequest PaymentRequest) return r } + /* Authorise Create an authorisation @@ -47,32 +48,75 @@ func (a *GeneralApi) AuthoriseConfig(ctx context.Context) GeneralApiAuthoriseCon /* Create an authorisation Creates a payment with a unique reference (`pspReference`) and attempts to obtain an authorisation hold. For cards, this amount can be captured or cancelled later. Non-card payment methods typically don't support this and will automatically capture as part of the authorisation. > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments) endpoint under Checkout API instead. - * @param req PaymentRequest - reference of PaymentRequest). + * @param req PaymentRequest - reference of PaymentRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentResult */ func (a *GeneralApi) Authorise(r GeneralApiAuthoriseConfig) (PaymentResult, *_nethttp.Response, error) { - res := &PaymentResult{} + var serviceError common.RestServiceError + res := &PaymentResult{} path := "/authorise" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiAuthorise3dConfig struct { - ctx context.Context + ctx context.Context paymentRequest3d *PaymentRequest3d } @@ -81,6 +125,7 @@ func (r GeneralApiAuthorise3dConfig) PaymentRequest3d(paymentRequest3d PaymentRe return r } + /* Authorise3d Complete a 3DS authorisation @@ -100,32 +145,75 @@ func (a *GeneralApi) Authorise3dConfig(ctx context.Context) GeneralApiAuthorise3 /* Complete a 3DS authorisation For an authenticated 3D Secure session, completes the payment authorisation. This endpoint must receive the `md` and `paResponse` parameters that you get from the card issuer after a shopper pays via 3D Secure. > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. - * @param req PaymentRequest3d - reference of PaymentRequest3d). + * @param req PaymentRequest3d - reference of PaymentRequest3d). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentResult */ func (a *GeneralApi) Authorise3d(r GeneralApiAuthorise3dConfig) (PaymentResult, *_nethttp.Response, error) { - res := &PaymentResult{} + var serviceError common.RestServiceError + res := &PaymentResult{} path := "/authorise3d" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentRequest3d, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentRequest3d, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiAuthorise3ds2Config struct { - ctx context.Context + ctx context.Context paymentRequest3ds2 *PaymentRequest3ds2 } @@ -134,6 +222,7 @@ func (r GeneralApiAuthorise3ds2Config) PaymentRequest3ds2(paymentRequest3ds2 Pay return r } + /* Authorise3ds2 Complete a 3DS2 authorisation @@ -153,32 +242,75 @@ func (a *GeneralApi) Authorise3ds2Config(ctx context.Context) GeneralApiAuthoris /* Complete a 3DS2 authorisation For an authenticated 3D Secure 2 session, completes the payment authorisation. This endpoint must receive the `threeDS2Token` and `threeDS2Result` parameters. > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. - * @param req PaymentRequest3ds2 - reference of PaymentRequest3ds2). + * @param req PaymentRequest3ds2 - reference of PaymentRequest3ds2). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PaymentResult */ func (a *GeneralApi) Authorise3ds2(r GeneralApiAuthorise3ds2Config) (PaymentResult, *_nethttp.Response, error) { - res := &PaymentResult{} + var serviceError common.RestServiceError + res := &PaymentResult{} path := "/authorise3ds2" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.paymentRequest3ds2, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.paymentRequest3ds2, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiGetAuthenticationResultConfig struct { - ctx context.Context + ctx context.Context authenticationResultRequest *AuthenticationResultRequest } @@ -187,6 +319,7 @@ func (r GeneralApiGetAuthenticationResultConfig) AuthenticationResultRequest(aut return r } + /* GetAuthenticationResult Get the 3DS authentication result @@ -204,32 +337,75 @@ func (a *GeneralApi) GetAuthenticationResultConfig(ctx context.Context) GeneralA /* Get the 3DS authentication result Return the authentication result after doing a 3D Secure authentication only. - * @param req AuthenticationResultRequest - reference of AuthenticationResultRequest). + * @param req AuthenticationResultRequest - reference of AuthenticationResultRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AuthenticationResultResponse */ func (a *GeneralApi) GetAuthenticationResult(r GeneralApiGetAuthenticationResultConfig) (AuthenticationResultResponse, *_nethttp.Response, error) { - res := &AuthenticationResultResponse{} + var serviceError common.RestServiceError + res := &AuthenticationResultResponse{} path := "/getAuthenticationResult" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.authenticationResultRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.authenticationResultRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiRetrieve3ds2ResultConfig struct { - ctx context.Context + ctx context.Context threeDS2ResultRequest *ThreeDS2ResultRequest } @@ -238,6 +414,7 @@ func (r GeneralApiRetrieve3ds2ResultConfig) ThreeDS2ResultRequest(threeDS2Result return r } + /* Retrieve3ds2Result Get the 3DS2 authentication result @@ -255,26 +432,69 @@ func (a *GeneralApi) Retrieve3ds2ResultConfig(ctx context.Context) GeneralApiRet /* Get the 3DS2 authentication result Retrieves the `threeDS2Result` after doing a 3D Secure 2 authentication only. - * @param req ThreeDS2ResultRequest - reference of ThreeDS2ResultRequest). + * @param req ThreeDS2ResultRequest - reference of ThreeDS2ResultRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ThreeDS2ResultResponse */ func (a *GeneralApi) Retrieve3ds2Result(r GeneralApiRetrieve3ds2ResultConfig) (ThreeDS2ResultResponse, *_nethttp.Response, error) { - res := &ThreeDS2ResultResponse{} + var serviceError common.RestServiceError + res := &ThreeDS2ResultResponse{} path := "/retrieve3ds2Result" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.threeDS2ResultRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.threeDS2ResultRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/payments/api_modifications.go b/src/payments/api_modifications.go index 25d164666..084049ffb 100644 --- a/src/payments/api_modifications.go +++ b/src/payments/api_modifications.go @@ -10,17 +10,17 @@ package payments import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ModificationsApi ModificationsApi service type ModificationsApi common.Service type ModificationsApiAdjustAuthorisationConfig struct { - ctx context.Context + ctx context.Context adjustAuthorisationRequest *AdjustAuthorisationRequest } @@ -29,6 +29,7 @@ func (r ModificationsApiAdjustAuthorisationConfig) AdjustAuthorisationRequest(ad return r } + /* AdjustAuthorisation Change the authorised amount @@ -51,32 +52,75 @@ func (a *ModificationsApi) AdjustAuthorisationConfig(ctx context.Context) Modifi /* Change the authorised amount Allows you to increase or decrease the authorised amount after the initial authorisation has taken place. This functionality enables for example tipping, improving the chances your authorisation will be valid, or charging the shopper when they have already left the merchant premises. > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). > If you have a [newer integration](https://docs.adyen.com/online-payments), and are doing: > * [Asynchronous adjustments](https://docs.adyen.com/online-payments/adjust-authorisation#asynchronous-or-synchronous-adjustment), use the [`/payments/{paymentPspReference}/amountUpdates`](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/post/payments/{paymentPspReference}/amountUpdates) endpoint on Checkout API. > * [Synchronous adjustments](https://docs.adyen.com/online-payments/adjust-authorisation#asynchronous-or-synchronous-adjustment), use this endpoint. - * @param req AdjustAuthorisationRequest - reference of AdjustAuthorisationRequest). + * @param req AdjustAuthorisationRequest - reference of AdjustAuthorisationRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) AdjustAuthorisation(r ModificationsApiAdjustAuthorisationConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/adjustAuthorisation" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.adjustAuthorisationRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.adjustAuthorisationRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiCancelConfig struct { - ctx context.Context + ctx context.Context cancelRequest *CancelRequest } @@ -85,6 +129,7 @@ func (r ModificationsApiCancelConfig) CancelRequest(cancelRequest CancelRequest) return r } + /* Cancel Cancel an authorisation @@ -106,32 +151,75 @@ func (a *ModificationsApi) CancelConfig(ctx context.Context) ModificationsApiCan /* Cancel an authorisation Cancels the authorisation hold on a payment, returning a unique reference for this request. You can cancel payments after authorisation only for payment methods that support distinct authorisations and captures. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/{paymentPspReference}/cancels) endpoint under Checkout API instead. - * @param req CancelRequest - reference of CancelRequest). + * @param req CancelRequest - reference of CancelRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) Cancel(r ModificationsApiCancelConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/cancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.cancelRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.cancelRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiCancelOrRefundConfig struct { - ctx context.Context + ctx context.Context cancelOrRefundRequest *CancelOrRefundRequest } @@ -140,6 +228,7 @@ func (r ModificationsApiCancelOrRefundConfig) CancelOrRefundRequest(cancelOrRefu return r } + /* CancelOrRefund Cancel or refund a payment @@ -167,32 +256,75 @@ func (a *ModificationsApi) CancelOrRefundConfig(ctx context.Context) Modificatio /* Cancel or refund a payment Cancels a payment if it has not been captured yet, or refunds it if it has already been captured. This is useful when it is not certain if the payment has been captured or not (for example, when using auto-capture). Do not use this endpoint for payments that involve: * [Multiple partial captures](https://docs.adyen.com/online-payments/capture). * [Split data](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) either at time of payment or capture for Adyen for Platforms. Instead, check if the payment has been captured and make a corresponding [`/refund`](https://docs.adyen.com/api-explorer/#/Payment/refund) or [`/cancel`](https://docs.adyen.com/api-explorer/#/Payment/cancel) call. For more information, refer to [Cancel or refund](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel-or-refund). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/{paymentPspReference}/reversals) endpoint under Checkout API instead. - * @param req CancelOrRefundRequest - reference of CancelOrRefundRequest). + * @param req CancelOrRefundRequest - reference of CancelOrRefundRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) CancelOrRefund(r ModificationsApiCancelOrRefundConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/cancelOrRefund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.cancelOrRefundRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.cancelOrRefundRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiCaptureConfig struct { - ctx context.Context + ctx context.Context captureRequest *CaptureRequest } @@ -201,6 +333,7 @@ func (r ModificationsApiCaptureConfig) CaptureRequest(captureRequest CaptureRequ return r } + /* Capture Capture an authorisation @@ -225,33 +358,76 @@ func (a *ModificationsApi) CaptureConfig(ctx context.Context) ModificationsApiCa /* Capture an authorisation -Captures the authorisation hold on a payment, returning a unique reference for this request. Usually the full authorisation amount is captured, however it's also possible to capture a smaller amount, which results in cancelling the remaining authorisation balance. Payment methods that are captured automatically after authorisation don't need to be captured. However, submitting a capture request on these transactions will not result in double charges. If immediate or delayed auto-capture is enabled, calling the capture method is not neccessary. For more information refer to [Capture](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/capture). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/{paymentPspReference}/captures`](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/post/payments/{paymentPspReference}/captures) endpoint on Checkout API instead. - * @param req CaptureRequest - reference of CaptureRequest). +Captures the authorisation hold on a payment, returning a unique reference for this request. Usually the full authorisation amount is captured, however it's also possible to capture a smaller amount, which results in cancelling the remaining authorisation balance. Payment methods that are captured automatically after authorisation don't need to be captured. However, submitting a capture request on these transactions will not result in double charges. If immediate or delayed auto-capture is enabled, calling the capture method is not neccessary. For more information refer to [Capture](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/capture). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/{paymentPspReference}/captures`](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/post/payments/{paymentPspReference}/captures) endpoint on Checkout API instead. + * @param req CaptureRequest - reference of CaptureRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) Capture(r ModificationsApiCaptureConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/capture" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.captureRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.captureRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiDonateConfig struct { - ctx context.Context + ctx context.Context donationRequest *DonationRequest } @@ -260,6 +436,7 @@ func (r ModificationsApiDonateConfig) DonationRequest(donationRequest DonationRe return r } + /* Donate Create a donation @@ -279,32 +456,75 @@ func (a *ModificationsApi) DonateConfig(ctx context.Context) ModificationsApiDon /* Create a donation Schedules a new payment to be created (including a new authorisation request) for the specified donation using the payment details of the original payment. > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/donations`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/donations) endpoint under Checkout API instead. - * @param req DonationRequest - reference of DonationRequest). + * @param req DonationRequest - reference of DonationRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) Donate(r ModificationsApiDonateConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/donate" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.donationRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.donationRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiRefundConfig struct { - ctx context.Context + ctx context.Context refundRequest *RefundRequest } @@ -313,6 +533,7 @@ func (r ModificationsApiRefundConfig) RefundRequest(refundRequest RefundRequest) return r } + /* Refund Refund a captured payment @@ -337,32 +558,75 @@ func (a *ModificationsApi) RefundConfig(ctx context.Context) ModificationsApiRef /* Refund a captured payment Refunds a payment that has previously been captured, returning a unique reference for this request. Refunding can be done on the full captured amount or a partial amount. Multiple (partial) refunds will be accepted as long as their sum doesn't exceed the captured amount. Payments which have been authorised, but not captured, cannot be refunded, use the /cancel method instead. Some payment methods/gateways do not support partial/multiple refunds. A margin above the captured limit can be configured to cover shipping/handling costs. For more information, refer to [Refund](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/refund). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/{paymentPspReference}/refunds`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/{paymentPspReference}/refunds) endpoint under Checkout API instead. - * @param req RefundRequest - reference of RefundRequest). + * @param req RefundRequest - reference of RefundRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) Refund(r ModificationsApiRefundConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/refund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.refundRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.refundRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiTechnicalCancelConfig struct { - ctx context.Context + ctx context.Context technicalCancelRequest *TechnicalCancelRequest } @@ -371,6 +635,7 @@ func (r ModificationsApiTechnicalCancelConfig) TechnicalCancelRequest(technicalC return r } + /* TechnicalCancel Cancel an authorisation using your reference @@ -378,7 +643,7 @@ This endpoint allows you to cancel a payment if you do not have the PSP referenc In your call, refer to the original payment by using the `reference` that you specified in your payment request. -For more information, see [Technical cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel#technical-cancel). +For more information, see [Technical cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel#technical-cancel). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/cancels) endpoint under Checkout API instead. @@ -394,32 +659,75 @@ func (a *ModificationsApi) TechnicalCancelConfig(ctx context.Context) Modificati /* Cancel an authorisation using your reference This endpoint allows you to cancel a payment if you do not have the PSP reference of the original payment request available. In your call, refer to the original payment by using the `reference` that you specified in your payment request. For more information, see [Technical cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel#technical-cancel). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/cancels) endpoint under Checkout API instead. - * @param req TechnicalCancelRequest - reference of TechnicalCancelRequest). + * @param req TechnicalCancelRequest - reference of TechnicalCancelRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) TechnicalCancel(r ModificationsApiTechnicalCancelConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/technicalCancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.technicalCancelRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.technicalCancelRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ModificationsApiVoidPendingRefundConfig struct { - ctx context.Context + ctx context.Context voidPendingRefundRequest *VoidPendingRefundRequest } @@ -428,6 +736,7 @@ func (r ModificationsApiVoidPendingRefundConfig) VoidPendingRefundRequest(voidPe return r } + /* VoidPendingRefund Cancel an in-person refund @@ -449,26 +758,69 @@ func (a *ModificationsApi) VoidPendingRefundConfig(ctx context.Context) Modifica /* Cancel an in-person refund This endpoint allows you to cancel an unreferenced refund request before it has been completed. In your call, you can refer to the original refund request either by using the `tenderReference`, or the `pspReference`. We recommend implementing based on the `tenderReference`, as this is generated for both offline and online transactions. For more information, refer to [Cancel an unreferenced refund](https://docs.adyen.com/point-of-sale/refund-payment/cancel-unreferenced). - * @param req VoidPendingRefundRequest - reference of VoidPendingRefundRequest). + * @param req VoidPendingRefundRequest - reference of VoidPendingRefundRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModificationResult */ func (a *ModificationsApi) VoidPendingRefund(r ModificationsApiVoidPendingRefundConfig) (ModificationResult, *_nethttp.Response, error) { - res := &ModificationResult{} + var serviceError common.RestServiceError + res := &ModificationResult{} path := "/voidPendingRefund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.voidPendingRefundRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.voidPendingRefundRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/payments/docs/AdditionalDataAirline.md b/src/payments/docs/AdditionalDataAirline.md index c6bab46d3..465993e80 100644 --- a/src/payments/docs/AdditionalDataAirline.md +++ b/src/payments/docs/AdditionalDataAirline.md @@ -4,34 +4,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AirlineAgencyInvoiceNumber** | Pointer to **string** | Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 | [optional] -**AirlineAgencyPlanName** | Pointer to **string** | 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 | [optional] -**AirlineAirlineCode** | Pointer to **string** | [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 | [optional] -**AirlineAirlineDesignatorCode** | Pointer to **string** | [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 | [optional] -**AirlineBoardingFee** | Pointer to **string** | Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 | [optional] -**AirlineComputerizedReservationSystem** | Pointer to **string** | The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 | [optional] -**AirlineCustomerReferenceNumber** | Pointer to **string** | Reference number; alphanumeric. * minLength: 0 * maxLength: 20 | [optional] -**AirlineDocumentType** | Pointer to **string** | Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 | [optional] -**AirlineFlightDate** | Pointer to **string** | Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 | [optional] -**AirlineLegCarrierCode** | Pointer to **string** | [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 | [optional] -**AirlineLegClassOfTravel** | Pointer to **string** | 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 | [optional] -**AirlineLegDateOfTravel** | Pointer to **string** | Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 | [optional] -**AirlineLegDepartAirport** | Pointer to **string** | Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 | [optional] -**AirlineLegDepartTax** | Pointer to **string** | [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 | [optional] -**AirlineLegDestinationCode** | Pointer to **string** | Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 | [optional] -**AirlineLegFareBaseCode** | Pointer to **string** | [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 | [optional] -**AirlineLegFlightNumber** | Pointer to **string** | The flight identifier. * minLength: 1 * maxLength: 5 | [optional] -**AirlineLegStopOverCode** | Pointer to **string** | 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 | [optional] -**AirlinePassengerDateOfBirth** | Pointer to **string** | Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 | [optional] -**AirlinePassengerFirstName** | Pointer to **string** | Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. | [optional] -**AirlinePassengerLastName** | Pointer to **string** | Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. | [optional] -**AirlinePassengerTelephoneNumber** | Pointer to **string** | Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 | [optional] -**AirlinePassengerTravellerType** | Pointer to **string** | Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 | [optional] -**AirlinePassengerName** | **string** | Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 | -**AirlineTicketIssueAddress** | Pointer to **string** | Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 | [optional] -**AirlineTicketNumber** | Pointer to **string** | The ticket's unique identifier. * minLength: 1 * maxLength: 150 | [optional] -**AirlineTravelAgencyCode** | Pointer to **string** | IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 | [optional] -**AirlineTravelAgencyName** | Pointer to **string** | The name of the travel agency. * minLength: 1 * maxLength: 25 | [optional] +**AirlineAgencyInvoiceNumber** | Pointer to **string** | The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters | [optional] +**AirlineAgencyPlanName** | Pointer to **string** | The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters | [optional] +**AirlineAirlineCode** | Pointer to **string** | The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineAirlineDesignatorCode** | Pointer to **string** | The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineBoardingFee** | Pointer to **string** | The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters | [optional] +**AirlineComputerizedReservationSystem** | Pointer to **string** | The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters | [optional] +**AirlineCustomerReferenceNumber** | Pointer to **string** | The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces | [optional] +**AirlineDocumentType** | Pointer to **string** | A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters | [optional] +**AirlineFlightDate** | Pointer to **string** | The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters | [optional] +**AirlineLegCarrierCode** | Pointer to **string** | The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegClassOfTravel** | Pointer to **string** | A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegDateOfTravel** | Pointer to **string** | Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters | [optional] +**AirlineLegDepartAirport** | Pointer to **string** | The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegDepartTax** | Pointer to **string** | The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros | [optional] +**AirlineLegDestinationCode** | Pointer to **string** | The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegFareBaseCode** | Pointer to **string** | The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegFlightNumber** | Pointer to **string** | The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineLegStopOverCode** | Pointer to **string** | A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character | [optional] +**AirlinePassengerDateOfBirth** | Pointer to **string** | The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 | [optional] +**AirlinePassengerFirstName** | Pointer to **string** | The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII | [optional] +**AirlinePassengerLastName** | Pointer to **string** | The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII | [optional] +**AirlinePassengerTelephoneNumber** | Pointer to **string** | The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters | [optional] +**AirlinePassengerTravellerType** | Pointer to **string** | The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters | [optional] +**AirlinePassengerName** | **string** | The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros | +**AirlineTicketIssueAddress** | Pointer to **string** | The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters | [optional] +**AirlineTicketNumber** | Pointer to **string** | The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineTravelAgencyCode** | Pointer to **string** | The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros | [optional] +**AirlineTravelAgencyName** | Pointer to **string** | The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros | [optional] ## Methods diff --git a/src/payments/docs/AdditionalDataCarRental.md b/src/payments/docs/AdditionalDataCarRental.md index 30eec9681..6817d101a 100644 --- a/src/payments/docs/AdditionalDataCarRental.md +++ b/src/payments/docs/AdditionalDataCarRental.md @@ -4,29 +4,29 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CarRentalCheckOutDate** | Pointer to **string** | Pick-up date. * Date format: `yyyyMMdd` | [optional] -**CarRentalCustomerServiceTollFreeNumber** | Pointer to **string** | The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 | [optional] -**CarRentalDaysRented** | Pointer to **string** | Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 | [optional] -**CarRentalFuelCharges** | Pointer to **string** | Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 | [optional] -**CarRentalInsuranceCharges** | Pointer to **string** | Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 | [optional] -**CarRentalLocationCity** | Pointer to **string** | The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 | [optional] -**CarRentalLocationCountry** | Pointer to **string** | The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 | [optional] -**CarRentalLocationStateProvince** | Pointer to **string** | The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 | [optional] -**CarRentalNoShowIndicator** | Pointer to **string** | Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. | [optional] -**CarRentalOneWayDropOffCharges** | Pointer to **string** | Charge associated with not returning a vehicle to the original rental location. | [optional] -**CarRentalRate** | Pointer to **string** | Daily rental rate. * Format: Alphanumeric * maxLength: 12 | [optional] -**CarRentalRateIndicator** | Pointer to **string** | Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. | [optional] -**CarRentalRentalAgreementNumber** | Pointer to **string** | The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 | [optional] -**CarRentalRentalClassId** | Pointer to **string** | Daily rental rate. * Format: Alphanumeric * maxLength: 12 | [optional] -**CarRentalRenterName** | Pointer to **string** | The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 | [optional] -**CarRentalReturnCity** | Pointer to **string** | The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 | [optional] -**CarRentalReturnCountry** | Pointer to **string** | The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 | [optional] -**CarRentalReturnDate** | Pointer to **string** | The last date to return the car by. * Date format: `yyyyMMdd` | [optional] -**CarRentalReturnLocationId** | Pointer to **string** | Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 | [optional] -**CarRentalReturnStateProvince** | Pointer to **string** | The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 | [optional] -**CarRentalTaxExemptIndicator** | Pointer to **string** | Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected | [optional] -**TravelEntertainmentAuthDataDuration** | Pointer to **string** | Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 | [optional] -**TravelEntertainmentAuthDataMarket** | Pointer to **string** | Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 | [optional] +**CarRentalCheckOutDate** | Pointer to **string** | The pick-up date. * Date format: `yyyyMMdd` | [optional] +**CarRentalCustomerServiceTollFreeNumber** | Pointer to **string** | The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - | [optional] +**CarRentalDaysRented** | Pointer to **string** | Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces | [optional] +**CarRentalFuelCharges** | Pointer to **string** | Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 | [optional] +**CarRentalInsuranceCharges** | Pointer to **string** | Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros | [optional] +**CarRentalLocationCity** | Pointer to **string** | The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalLocationCountry** | Pointer to **string** | The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 | [optional] +**CarRentalLocationStateProvince** | Pointer to **string** | The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalNoShowIndicator** | Pointer to **string** | Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable | [optional] +**CarRentalOneWayDropOffCharges** | Pointer to **string** | The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 | [optional] +**CarRentalRate** | Pointer to **string** | The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 | [optional] +**CarRentalRateIndicator** | Pointer to **string** | Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate | [optional] +**CarRentalRentalAgreementNumber** | Pointer to **string** | The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalRentalClassId** | Pointer to **string** | The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalRenterName** | Pointer to **string** | The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalReturnCity** | Pointer to **string** | The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalReturnCountry** | Pointer to **string** | The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 | [optional] +**CarRentalReturnDate** | Pointer to **string** | The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 | [optional] +**CarRentalReturnLocationId** | Pointer to **string** | The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalReturnStateProvince** | Pointer to **string** | The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros | [optional] +**CarRentalTaxExemptIndicator** | Pointer to **string** | Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected | [optional] +**TravelEntertainmentAuthDataDuration** | Pointer to **string** | Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 | [optional] +**TravelEntertainmentAuthDataMarket** | Pointer to **string** | Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 | [optional] ## Methods diff --git a/src/payments/docs/AdditionalDataLevel23.md b/src/payments/docs/AdditionalDataLevel23.md index 5561f3c11..a67d698ff 100644 --- a/src/payments/docs/AdditionalDataLevel23.md +++ b/src/payments/docs/AdditionalDataLevel23.md @@ -4,23 +4,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnhancedSchemeDataCustomerReference** | Pointer to **string** | Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. | [optional] -**EnhancedSchemeDataDestinationCountryCode** | Pointer to **string** | Destination country code. Encoding: ASCII. Max length: 3 characters. | [optional] -**EnhancedSchemeDataDestinationPostalCode** | Pointer to **string** | The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. | [optional] -**EnhancedSchemeDataDestinationStateProvinceCode** | Pointer to **string** | Destination state or province code. Encoding: ASCII.Max length: 3 characters. | [optional] -**EnhancedSchemeDataDutyAmount** | Pointer to **string** | Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. | [optional] -**EnhancedSchemeDataFreightAmount** | Pointer to **string** | Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrCommodityCode** | Pointer to **string** | Item commodity code. Encoding: ASCII. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrDescription** | Pointer to **string** | Item description. Encoding: ASCII. Max length: 26 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrDiscountAmount** | Pointer to **string** | Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrProductCode** | Pointer to **string** | Product code. Encoding: ASCII. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrQuantity** | Pointer to **string** | Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrTotalAmount** | Pointer to **string** | Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure** | Pointer to **string** | Item unit of measurement. Encoding: ASCII. Max length: 3 characters. | [optional] -**EnhancedSchemeDataItemDetailLineItemNrUnitPrice** | Pointer to **string** | Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. | [optional] -**EnhancedSchemeDataOrderDate** | Pointer to **string** | Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. | [optional] -**EnhancedSchemeDataShipFromPostalCode** | Pointer to **string** | The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. | [optional] -**EnhancedSchemeDataTotalTaxAmount** | Pointer to **string** | Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. | [optional] +**EnhancedSchemeDataCustomerReference** | Pointer to **string** | The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataDestinationCountryCode** | Pointer to **string** | The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters | [optional] +**EnhancedSchemeDataDestinationPostalCode** | Pointer to **string** | The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space | [optional] +**EnhancedSchemeDataDestinationStateProvinceCode** | Pointer to **string** | Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space | [optional] +**EnhancedSchemeDataDutyAmount** | Pointer to **string** | The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters | [optional] +**EnhancedSchemeDataFreightAmount** | Pointer to **string** | The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters | [optional] +**EnhancedSchemeDataItemDetailLineItemNrCommodityCode** | Pointer to **string** | The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataItemDetailLineItemNrDescription** | Pointer to **string** | A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataItemDetailLineItemNrDiscountAmount** | Pointer to **string** | The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters | [optional] +**EnhancedSchemeDataItemDetailLineItemNrProductCode** | Pointer to **string** | The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataItemDetailLineItemNrQuantity** | Pointer to **string** | The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces | [optional] +**EnhancedSchemeDataItemDetailLineItemNrTotalAmount** | Pointer to **string** | The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure** | Pointer to **string** | The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataItemDetailLineItemNrUnitPrice** | Pointer to **string** | The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters | [optional] +**EnhancedSchemeDataOrderDate** | Pointer to **string** | The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters | [optional] +**EnhancedSchemeDataShipFromPostalCode** | Pointer to **string** | The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros | [optional] +**EnhancedSchemeDataTotalTaxAmount** | Pointer to **string** | The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters | [optional] ## Methods diff --git a/src/payments/docs/AdditionalDataLodging.md b/src/payments/docs/AdditionalDataLodging.md index bba4e870f..0b125db3a 100644 --- a/src/payments/docs/AdditionalDataLodging.md +++ b/src/payments/docs/AdditionalDataLodging.md @@ -6,21 +6,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **LodgingCheckInDate** | Pointer to **string** | The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. | [optional] **LodgingCheckOutDate** | Pointer to **string** | The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. | [optional] -**LodgingCustomerServiceTollFreeNumber** | Pointer to **string** | The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. | [optional] -**LodgingFireSafetyActIndicator** | Pointer to **string** | Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character. | [optional] -**LodgingFolioCashAdvances** | Pointer to **string** | The folio cash advances. * Format: numeric. * Max length: 12 characters. | [optional] -**LodgingFolioNumber** | Pointer to **string** | The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters. | [optional] -**LodgingFoodBeverageCharges** | Pointer to **string** | The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters. | [optional] -**LodgingNoShowIndicator** | Pointer to **string** | Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in. | [optional] -**LodgingPrepaidExpenses** | Pointer to **string** | The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters. | [optional] -**LodgingPropertyPhoneNumber** | Pointer to **string** | Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. | [optional] -**LodgingRoom1NumberOfNights** | Pointer to **string** | The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters. | [optional] -**LodgingRoom1Rate** | Pointer to **string** | The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). | [optional] -**LodgingRoom1Tax** | Pointer to **string** | The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). | [optional] -**LodgingTotalRoomTax** | Pointer to **string** | The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). | [optional] -**LodgingTotalTax** | Pointer to **string** | The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). | [optional] -**TravelEntertainmentAuthDataDuration** | Pointer to **string** | The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters. | [optional] -**TravelEntertainmentAuthDataMarket** | Pointer to **string** | Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character. | [optional] +**LodgingCustomerServiceTollFreeNumber** | Pointer to **string** | The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - | [optional] +**LodgingFireSafetyActIndicator** | Pointer to **string** | Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character | [optional] +**LodgingFolioCashAdvances** | Pointer to **string** | The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters | [optional] +**LodgingFolioNumber** | Pointer to **string** | The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros | [optional] +**LodgingFoodBeverageCharges** | Pointer to **string** | Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters | [optional] +**LodgingNoShowIndicator** | Pointer to **string** | Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in | [optional] +**LodgingPrepaidExpenses** | Pointer to **string** | The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters | [optional] +**LodgingPropertyPhoneNumber** | Pointer to **string** | The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - | [optional] +**LodgingRoom1NumberOfNights** | Pointer to **string** | The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters | [optional] +**LodgingRoom1Rate** | Pointer to **string** | The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number | [optional] +**LodgingTotalRoomTax** | Pointer to **string** | The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number | [optional] +**LodgingTotalTax** | Pointer to **string** | The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number | [optional] +**TravelEntertainmentAuthDataDuration** | Pointer to **string** | The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters | [optional] +**TravelEntertainmentAuthDataMarket** | Pointer to **string** | Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character | [optional] ## Methods @@ -341,31 +340,6 @@ SetLodgingRoom1Rate sets LodgingRoom1Rate field to given value. HasLodgingRoom1Rate returns a boolean if a field has been set. -### GetLodgingRoom1Tax - -`func (o *AdditionalDataLodging) GetLodgingRoom1Tax() string` - -GetLodgingRoom1Tax returns the LodgingRoom1Tax field if non-nil, zero value otherwise. - -### GetLodgingRoom1TaxOk - -`func (o *AdditionalDataLodging) GetLodgingRoom1TaxOk() (*string, bool)` - -GetLodgingRoom1TaxOk returns a tuple with the LodgingRoom1Tax field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLodgingRoom1Tax - -`func (o *AdditionalDataLodging) SetLodgingRoom1Tax(v string)` - -SetLodgingRoom1Tax sets LodgingRoom1Tax field to given value. - -### HasLodgingRoom1Tax - -`func (o *AdditionalDataLodging) HasLodgingRoom1Tax() bool` - -HasLodgingRoom1Tax returns a boolean if a field has been set. - ### GetLodgingTotalRoomTax `func (o *AdditionalDataLodging) GetLodgingTotalRoomTax() string` diff --git a/src/payments/docs/AdditionalDataTemporaryServices.md b/src/payments/docs/AdditionalDataTemporaryServices.md index 47a4b254f..61040a071 100644 --- a/src/payments/docs/AdditionalDataTemporaryServices.md +++ b/src/payments/docs/AdditionalDataTemporaryServices.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnhancedSchemeDataCustomerReference** | Pointer to **string** | Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 | [optional] -**EnhancedSchemeDataEmployeeName** | Pointer to **string** | Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 | [optional] -**EnhancedSchemeDataJobDescription** | Pointer to **string** | Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 | [optional] -**EnhancedSchemeDataRegularHoursRate** | Pointer to **string** | Amount paid per regular hours worked, minor units. * maxLength: 7 | [optional] -**EnhancedSchemeDataRegularHoursWorked** | Pointer to **string** | Amount of time worked during a normal operation for the task or job. * maxLength: 7 | [optional] -**EnhancedSchemeDataRequestName** | Pointer to **string** | Name of the individual requesting temporary services. * maxLength: 40 | [optional] -**EnhancedSchemeDataTempStartDate** | Pointer to **string** | Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 | [optional] -**EnhancedSchemeDataTempWeekEnding** | Pointer to **string** | Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 | [optional] -**EnhancedSchemeDataTotalTaxAmount** | Pointer to **string** | Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 | [optional] +**EnhancedSchemeDataCustomerReference** | Pointer to **string** | The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 | [optional] +**EnhancedSchemeDataEmployeeName** | Pointer to **string** | The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces | [optional] +**EnhancedSchemeDataJobDescription** | Pointer to **string** | The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces | [optional] +**EnhancedSchemeDataRegularHoursRate** | Pointer to **string** | The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros | [optional] +**EnhancedSchemeDataRegularHoursWorked** | Pointer to **string** | The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros | [optional] +**EnhancedSchemeDataRequestName** | Pointer to **string** | The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces | [optional] +**EnhancedSchemeDataTempStartDate** | Pointer to **string** | The billing period start date. * Format: ddMMyy * maxLength: 6 | [optional] +**EnhancedSchemeDataTempWeekEnding** | Pointer to **string** | The billing period end date. * Format: ddMMyy * maxLength: 6 | [optional] +**EnhancedSchemeDataTotalTaxAmount** | Pointer to **string** | The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 | [optional] ## Methods diff --git a/src/payments/docs/PlatformChargebackLogic.md b/src/payments/docs/PlatformChargebackLogic.md index f433b781e..9bbda4372 100644 --- a/src/payments/docs/PlatformChargebackLogic.md +++ b/src/payments/docs/PlatformChargebackLogic.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Behavior** | Pointer to **string** | | [optional] -**CostAllocationAccount** | Pointer to **string** | | [optional] -**TargetAccount** | Pointer to **string** | | [optional] +**Behavior** | Pointer to **string** | The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. | [optional] +**CostAllocationAccount** | Pointer to **string** | The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. | [optional] +**TargetAccount** | Pointer to **string** | The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. | [optional] ## Methods diff --git a/src/payments/model_account_info.go b/src/payments/model_account_info.go index 7dcc02b2e..803c59fc5 100644 --- a/src/payments/model_account_info.go +++ b/src/payments/model_account_info.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AccountInfo type satisfies the MappedNullable interface at compile time @@ -698,7 +697,7 @@ func (o *AccountInfo) SetWorkPhone(v string) { } func (o AccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -803,57 +802,59 @@ func (v *NullableAccountInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountInfo) isValidAccountAgeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountAgeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountAgeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountChangeIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountType() bool { - var allowedEnumValues = []string{"notApplicable", "credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidDeliveryAddressUsageIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressUsageIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressUsageIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPasswordChangeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPasswordChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPasswordChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPaymentAccountIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccountIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccountIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_acct_info.go b/src/payments/model_acct_info.go index defcb6141..c6550cd45 100644 --- a/src/payments/model_acct_info.go +++ b/src/payments/model_acct_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AcctInfo type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AcctInfo) SetTxnActivityYear(v string) { } func (o AcctInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,66 +678,68 @@ func (v *NullableAcctInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcctInfo) isValidChAccAgeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccAgeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccAgeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetChAccChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetChAccChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccPwChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccPwChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccPwChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidPaymentAccInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipAddressUsageInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetShipAddressUsageInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetShipAddressUsageInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipNameIndicator() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetShipNameIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetShipNameIndicator() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidSuspiciousAccActivity() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetSuspiciousAccActivity() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetSuspiciousAccActivity() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data3_d_secure.go b/src/payments/model_additional_data3_d_secure.go index 322ef6de6..4aeb1a5fd 100644 --- a/src/payments/model_additional_data3_d_secure.go +++ b/src/payments/model_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,17 +18,17 @@ var _ common.MappedNullable = &AdditionalData3DSecure{} // AdditionalData3DSecure struct for AdditionalData3DSecure type AdditionalData3DSecure struct { - // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. Allow3DS2 *string `json:"allow3DS2,omitempty"` // Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen ChallengeWindowSize *string `json:"challengeWindowSize,omitempty"` - // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. ExecuteThreeD *string `json:"executeThreeD,omitempty"` // In case of Secure+, this field must be set to **CUPSecurePlus**. MpiImplementationType *string `json:"mpiImplementationType,omitempty"` - // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemption *string `json:"scaExemption,omitempty"` - // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. ThreeDSVersion *string `json:"threeDSVersion,omitempty"` } @@ -243,7 +242,7 @@ func (o *AdditionalData3DSecure) SetThreeDSVersion(v string) { } func (o AdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableAdditionalData3DSecure) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalData3DSecure) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data_airline.go b/src/payments/model_additional_data_airline.go index 5c558051e..0abf961a7 100644 --- a/src/payments/model_additional_data_airline.go +++ b/src/payments/model_additional_data_airline.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataAirline type satisfies the MappedNullable interface at compile time @@ -19,61 +18,61 @@ var _ common.MappedNullable = &AdditionalDataAirline{} // AdditionalDataAirline struct for AdditionalDataAirline type AdditionalDataAirline struct { - // Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + // The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` - // 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros AirlineAirlineCode *string `json:"airline.airline_code,omitempty"` - // [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros AirlineAirlineDesignatorCode *string `json:"airline.airline_designator_code,omitempty"` - // Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + // The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters AirlineBoardingFee *string `json:"airline.boarding_fee,omitempty"` - // The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + // The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters AirlineComputerizedReservationSystem *string `json:"airline.computerized_reservation_system,omitempty"` - // Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + // The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces AirlineCustomerReferenceNumber *string `json:"airline.customer_reference_number,omitempty"` - // Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + // A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters AirlineDocumentType *string `json:"airline.document_type,omitempty"` - // Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + // The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters AirlineFlightDate *string `json:"airline.flight_date,omitempty"` - // [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros AirlineLegCarrierCode *string `json:"airline.leg.carrier_code,omitempty"` - // 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros AirlineLegClassOfTravel *string `json:"airline.leg.class_of_travel,omitempty"` - // Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + // Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters AirlineLegDateOfTravel *string `json:"airline.leg.date_of_travel,omitempty"` - // Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros AirlineLegDepartAirport *string `json:"airline.leg.depart_airport,omitempty"` - // [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros AirlineLegDepartTax *string `json:"airline.leg.depart_tax,omitempty"` - // Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros AirlineLegDestinationCode *string `json:"airline.leg.destination_code,omitempty"` - // [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros AirlineLegFareBaseCode *string `json:"airline.leg.fare_base_code,omitempty"` - // The flight identifier. * minLength: 1 * maxLength: 5 + // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros AirlineLegFlightNumber *string `json:"airline.leg.flight_number,omitempty"` - // 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + // A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character AirlineLegStopOverCode *string `json:"airline.leg.stop_over_code,omitempty"` - // Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + // The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 AirlinePassengerDateOfBirth *string `json:"airline.passenger.date_of_birth,omitempty"` - // Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + // The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII AirlinePassengerFirstName *string `json:"airline.passenger.first_name,omitempty"` - // Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + // The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII AirlinePassengerLastName *string `json:"airline.passenger.last_name,omitempty"` - // Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + // The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` - // Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros AirlinePassengerName string `json:"airline.passenger_name"` - // Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + // The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters AirlineTicketIssueAddress *string `json:"airline.ticket_issue_address,omitempty"` - // The ticket's unique identifier. * minLength: 1 * maxLength: 150 + // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros AirlineTicketNumber *string `json:"airline.ticket_number,omitempty"` - // IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros AirlineTravelAgencyCode *string `json:"airline.travel_agency_code,omitempty"` - // The name of the travel agency. * minLength: 1 * maxLength: 25 + // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros AirlineTravelAgencyName *string `json:"airline.travel_agency_name,omitempty"` } @@ -984,7 +983,7 @@ func (o *AdditionalDataAirline) SetAirlineTravelAgencyName(v string) { } func (o AdditionalDataAirline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1113,3 +1112,6 @@ func (v *NullableAdditionalDataAirline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_car_rental.go b/src/payments/model_additional_data_car_rental.go index 448965667..e243b4ae7 100644 --- a/src/payments/model_additional_data_car_rental.go +++ b/src/payments/model_additional_data_car_rental.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataCarRental type satisfies the MappedNullable interface at compile time @@ -19,51 +18,51 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} // AdditionalDataCarRental struct for AdditionalDataCarRental type AdditionalDataCarRental struct { - // Pick-up date. * Date format: `yyyyMMdd` + // The pick-up date. * Date format: `yyyyMMdd` CarRentalCheckOutDate *string `json:"carRental.checkOutDate,omitempty"` - // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` - // Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + // Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 CarRentalFuelCharges *string `json:"carRental.fuelCharges,omitempty"` - // Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros CarRentalInsuranceCharges *string `json:"carRental.insuranceCharges,omitempty"` - // The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros CarRentalLocationCity *string `json:"carRental.locationCity,omitempty"` - // The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + // The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalLocationCountry *string `json:"carRental.locationCountry,omitempty"` - // The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros CarRentalLocationStateProvince *string `json:"carRental.locationStateProvince,omitempty"` - // Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + // Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` - // Charge associated with not returning a vehicle to the original rental location. + // The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 CarRentalOneWayDropOffCharges *string `json:"carRental.oneWayDropOffCharges,omitempty"` - // Daily rental rate. * Format: Alphanumeric * maxLength: 12 + // The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 CarRentalRate *string `json:"carRental.rate,omitempty"` - // Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + // Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate CarRentalRateIndicator *string `json:"carRental.rateIndicator,omitempty"` - // The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros CarRentalRentalAgreementNumber *string `json:"carRental.rentalAgreementNumber,omitempty"` - // Daily rental rate. * Format: Alphanumeric * maxLength: 12 + // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros CarRentalRentalClassId *string `json:"carRental.rentalClassId,omitempty"` - // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros CarRentalRenterName *string `json:"carRental.renterName,omitempty"` - // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros CarRentalReturnCity *string `json:"carRental.returnCity,omitempty"` - // The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + // The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalReturnCountry *string `json:"carRental.returnCountry,omitempty"` - // The last date to return the car by. * Date format: `yyyyMMdd` + // The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros CarRentalReturnLocationId *string `json:"carRental.returnLocationId,omitempty"` - // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros CarRentalReturnStateProvince *string `json:"carRental.returnStateProvince,omitempty"` - // Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + // Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected CarRentalTaxExemptIndicator *string `json:"carRental.taxExemptIndicator,omitempty"` - // Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` - // Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + // Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` } @@ -821,7 +820,7 @@ func (o *AdditionalDataCarRental) SetTravelEntertainmentAuthDataMarket(v string) } func (o AdditionalDataCarRental) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -937,3 +936,6 @@ func (v *NullableAdditionalDataCarRental) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_common.go b/src/payments/model_additional_data_common.go index c3e3c7f3a..01fc2edc2 100644 --- a/src/payments/model_additional_data_common.go +++ b/src/payments/model_additional_data_common.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataCommon) SetSubMerchantTaxId(v string) { } func (o AdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,12 +678,14 @@ func (v *NullableAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalDataCommon) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"NoShow", "DelayedCharge"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NoShow", "DelayedCharge" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data_level23.go b/src/payments/model_additional_data_level23.go index 51ab32e61..62a39ca93 100644 --- a/src/payments/model_additional_data_level23.go +++ b/src/payments/model_additional_data_level23.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataLevel23 type satisfies the MappedNullable interface at compile time @@ -19,39 +18,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + // The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // Destination country code. Encoding: ASCII. Max length: 3 characters. + // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters EnhancedSchemeDataDestinationCountryCode *string `json:"enhancedSchemeData.destinationCountryCode,omitempty"` - // The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + // The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space EnhancedSchemeDataDestinationPostalCode *string `json:"enhancedSchemeData.destinationPostalCode,omitempty"` - // Destination state or province code. Encoding: ASCII.Max length: 3 characters. + // Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataDutyAmount *string `json:"enhancedSchemeData.dutyAmount,omitempty"` - // Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataFreightAmount *string `json:"enhancedSchemeData.freightAmount,omitempty"` - // Item commodity code. Encoding: ASCII. Max length: 12 characters. + // The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrCommodityCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].commodityCode,omitempty"` - // Item description. Encoding: ASCII. Max length: 26 characters. + // A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrDescription *string `json:"enhancedSchemeData.itemDetailLine[itemNr].description,omitempty"` - // Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` - // Product code. Encoding: ASCII. Max length: 12 characters. + // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + // The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` - // Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` - // Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + // The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure,omitempty"` - // Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + // The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters EnhancedSchemeDataOrderDate *string `json:"enhancedSchemeData.orderDate,omitempty"` - // The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + // The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros EnhancedSchemeDataShipFromPostalCode *string `json:"enhancedSchemeData.shipFromPostalCode,omitempty"` - // Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } @@ -617,7 +616,7 @@ func (o *AdditionalDataLevel23) SetEnhancedSchemeDataTotalTaxAmount(v string) { } func (o AdditionalDataLevel23) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableAdditionalDataLevel23) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_lodging.go b/src/payments/model_additional_data_lodging.go index 1f909e30b..8b2b8b790 100644 --- a/src/payments/model_additional_data_lodging.go +++ b/src/payments/model_additional_data_lodging.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataLodging type satisfies the MappedNullable interface at compile time @@ -23,35 +22,33 @@ type AdditionalDataLodging struct { LodgingCheckInDate *string `json:"lodging.checkInDate,omitempty"` // The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. LodgingCheckOutDate *string `json:"lodging.checkOutDate,omitempty"` - // The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. + // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` - // Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character. + // Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character LodgingFireSafetyActIndicator *string `json:"lodging.fireSafetyActIndicator,omitempty"` - // The folio cash advances. * Format: numeric. * Max length: 12 characters. + // The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFolioCashAdvances *string `json:"lodging.folioCashAdvances,omitempty"` - // The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters. + // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros LodgingFolioNumber *string `json:"lodging.folioNumber,omitempty"` - // The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters. + // Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFoodBeverageCharges *string `json:"lodging.foodBeverageCharges,omitempty"` - // Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in. + // Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` - // The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters. + // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. + // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters. + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` - // The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingRoom1Rate *string `json:"lodging.room1.rate,omitempty"` - // The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). - LodgingRoom1Tax *string `json:"lodging.room1.tax,omitempty"` - // The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` - // The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingTotalTax *string `json:"lodging.totalTax,omitempty"` - // The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters. + // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` - // Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character. + // Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` } @@ -456,38 +453,6 @@ func (o *AdditionalDataLodging) SetLodgingRoom1Rate(v string) { o.LodgingRoom1Rate = &v } -// GetLodgingRoom1Tax returns the LodgingRoom1Tax field value if set, zero value otherwise. -func (o *AdditionalDataLodging) GetLodgingRoom1Tax() string { - if o == nil || common.IsNil(o.LodgingRoom1Tax) { - var ret string - return ret - } - return *o.LodgingRoom1Tax -} - -// GetLodgingRoom1TaxOk returns a tuple with the LodgingRoom1Tax field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalDataLodging) GetLodgingRoom1TaxOk() (*string, bool) { - if o == nil || common.IsNil(o.LodgingRoom1Tax) { - return nil, false - } - return o.LodgingRoom1Tax, true -} - -// HasLodgingRoom1Tax returns a boolean if a field has been set. -func (o *AdditionalDataLodging) HasLodgingRoom1Tax() bool { - if o != nil && !common.IsNil(o.LodgingRoom1Tax) { - return true - } - - return false -} - -// SetLodgingRoom1Tax gets a reference to the given string and assigns it to the LodgingRoom1Tax field. -func (o *AdditionalDataLodging) SetLodgingRoom1Tax(v string) { - o.LodgingRoom1Tax = &v -} - // GetLodgingTotalRoomTax returns the LodgingTotalRoomTax field value if set, zero value otherwise. func (o *AdditionalDataLodging) GetLodgingTotalRoomTax() string { if o == nil || common.IsNil(o.LodgingTotalRoomTax) { @@ -617,7 +582,7 @@ func (o *AdditionalDataLodging) SetTravelEntertainmentAuthDataMarket(v string) { } func (o AdditionalDataLodging) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -662,9 +627,6 @@ func (o AdditionalDataLodging) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.LodgingRoom1Rate) { toSerialize["lodging.room1.rate"] = o.LodgingRoom1Rate } - if !common.IsNil(o.LodgingRoom1Tax) { - toSerialize["lodging.room1.tax"] = o.LodgingRoom1Tax - } if !common.IsNil(o.LodgingTotalRoomTax) { toSerialize["lodging.totalRoomTax"] = o.LodgingTotalRoomTax } @@ -715,3 +677,6 @@ func (v *NullableAdditionalDataLodging) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_modifications.go b/src/payments/model_additional_data_modifications.go index 00c39a765..0e037878c 100644 --- a/src/payments/model_additional_data_modifications.go +++ b/src/payments/model_additional_data_modifications.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataModifications type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataModifications) SetInstallmentPaymentDataSelectedInstallme } func (o AdditionalDataModifications) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataModifications) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_open_invoice.go b/src/payments/model_additional_data_open_invoice.go index c7573c626..b482c88ab 100644 --- a/src/payments/model_additional_data_open_invoice.go +++ b/src/payments/model_additional_data_open_invoice.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataOpenInvoice type satisfies the MappedNullable interface at compile time @@ -651,7 +650,7 @@ func (o *AdditionalDataOpenInvoice) SetOpeninvoicedataLineItemNrTrackingUri(v st } func (o AdditionalDataOpenInvoice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -752,3 +751,6 @@ func (v *NullableAdditionalDataOpenInvoice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_opi.go b/src/payments/model_additional_data_opi.go index bd382f6b2..3a61d1178 100644 --- a/src/payments/model_additional_data_opi.go +++ b/src/payments/model_additional_data_opi.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataOpi) SetOpiIncludeTransToken(v string) { } func (o AdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_ratepay.go b/src/payments/model_additional_data_ratepay.go index cea6d1236..956cc6d65 100644 --- a/src/payments/model_additional_data_ratepay.go +++ b/src/payments/model_additional_data_ratepay.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRatepay type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *AdditionalDataRatepay) SetRatepaydataInvoiceId(v string) { } func (o AdditionalDataRatepay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableAdditionalDataRatepay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_retry.go b/src/payments/model_additional_data_retry.go index e22c5c26e..2bca3b81c 100644 --- a/src/payments/model_additional_data_retry.go +++ b/src/payments/model_additional_data_retry.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRetry type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalDataRetry) SetRetrySkipRetry(v string) { } func (o AdditionalDataRetry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalDataRetry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_risk.go b/src/payments/model_additional_data_risk.go index 95929d1b7..9e59fbb68 100644 --- a/src/payments/model_additional_data_risk.go +++ b/src/payments/model_additional_data_risk.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRisk type satisfies the MappedNullable interface at compile time @@ -753,7 +752,7 @@ func (o *AdditionalDataRisk) SetRiskdataSkipRisk(v string) { } func (o AdditionalDataRisk) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,3 +862,6 @@ func (v *NullableAdditionalDataRisk) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_risk_standalone.go b/src/payments/model_additional_data_risk_standalone.go index 9d16a0dfd..a89e74eb9 100644 --- a/src/payments/model_additional_data_risk_standalone.go +++ b/src/payments/model_additional_data_risk_standalone.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataRiskStandalone type satisfies the MappedNullable interface at compile time @@ -549,7 +548,7 @@ func (o *AdditionalDataRiskStandalone) SetTokenDataType(v string) { } func (o AdditionalDataRiskStandalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,3 +640,6 @@ func (v *NullableAdditionalDataRiskStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_sub_merchant.go b/src/payments/model_additional_data_sub_merchant.go index 903a6f56d..ecb663963 100644 --- a/src/payments/model_additional_data_sub_merchant.go +++ b/src/payments/model_additional_data_sub_merchant.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataSubMerchant type satisfies the MappedNullable interface at compile time @@ -379,7 +378,7 @@ func (o *AdditionalDataSubMerchant) SetSubMerchantSubSellerSubSellerNrTaxId(v st } func (o AdditionalDataSubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,3 +455,6 @@ func (v *NullableAdditionalDataSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_temporary_services.go b/src/payments/model_additional_data_temporary_services.go index 645e12f08..bbe531f29 100644 --- a/src/payments/model_additional_data_temporary_services.go +++ b/src/payments/model_additional_data_temporary_services.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataTemporaryServices type satisfies the MappedNullable interface at compile time @@ -19,23 +18,23 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} // AdditionalDataTemporaryServices struct for AdditionalDataTemporaryServices type AdditionalDataTemporaryServices struct { - // Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` - // Amount paid per regular hours worked, minor units. * maxLength: 7 + // The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros EnhancedSchemeDataRegularHoursRate *string `json:"enhancedSchemeData.regularHoursRate,omitempty"` - // Amount of time worked during a normal operation for the task or job. * maxLength: 7 + // The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros EnhancedSchemeDataRegularHoursWorked *string `json:"enhancedSchemeData.regularHoursWorked,omitempty"` - // Name of the individual requesting temporary services. * maxLength: 40 + // The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces EnhancedSchemeDataRequestName *string `json:"enhancedSchemeData.requestName,omitempty"` - // Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + // The billing period start date. * Format: ddMMyy * maxLength: 6 EnhancedSchemeDataTempStartDate *string `json:"enhancedSchemeData.tempStartDate,omitempty"` - // Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + // The billing period end date. * Format: ddMMyy * maxLength: 6 EnhancedSchemeDataTempWeekEnding *string `json:"enhancedSchemeData.tempWeekEnding,omitempty"` - // Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } @@ -345,7 +344,7 @@ func (o *AdditionalDataTemporaryServices) SetEnhancedSchemeDataTotalTaxAmount(v } func (o AdditionalDataTemporaryServices) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableAdditionalDataTemporaryServices) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_wallets.go b/src/payments/model_additional_data_wallets.go index 6ae6899ef..500d5538a 100644 --- a/src/payments/model_additional_data_wallets.go +++ b/src/payments/model_additional_data_wallets.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalDataWallets type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *AdditionalDataWallets) SetVisacheckoutCallId(v string) { } func (o AdditionalDataWallets) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableAdditionalDataWallets) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_address.go b/src/payments/model_address.go index 430ce288f..206fd5f57 100644 --- a/src/payments/model_address.go +++ b/src/payments/model_address.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_adjust_authorisation_request.go b/src/payments/model_adjust_authorisation_request.go index 998a5c617..cdb830e75 100644 --- a/src/payments/model_adjust_authorisation_request.go +++ b/src/payments/model_adjust_authorisation_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdjustAuthorisationRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type AdjustAuthorisationRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *AdjustAuthorisationRequest) SetUniqueTerminalId(v string) { } func (o AdjustAuthorisationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableAdjustAuthorisationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_amount.go b/src/payments/model_amount.go index 8ebee1c9b..e68a512d0 100644 --- a/src/payments/model_amount.go +++ b/src/payments/model_amount.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_application_info.go b/src/payments/model_application_info.go index cb4f42291..7262a375a 100644 --- a/src/payments/model_application_info.go +++ b/src/payments/model_application_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ApplicationInfo type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &ApplicationInfo{} // ApplicationInfo struct for ApplicationInfo type ApplicationInfo struct { - AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` - AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` - ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` - MerchantApplication *CommonField `json:"merchantApplication,omitempty"` - MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` + AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` + AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` + ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` + MerchantApplication *CommonField `json:"merchantApplication,omitempty"` + MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` ShopperInteractionDevice *ShopperInteractionDevice `json:"shopperInteractionDevice,omitempty"` } @@ -237,7 +236,7 @@ func (o *ApplicationInfo) SetShopperInteractionDevice(v ShopperInteractionDevice } func (o ApplicationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableApplicationInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_authentication_result_request.go b/src/payments/model_authentication_result_request.go index de5927f94..5175d473f 100644 --- a/src/payments/model_authentication_result_request.go +++ b/src/payments/model_authentication_result_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AuthenticationResultRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *AuthenticationResultRequest) SetPspReference(v string) { } func (o AuthenticationResultRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAuthenticationResultRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_authentication_result_response.go b/src/payments/model_authentication_result_response.go index d416446b1..e299e902b 100644 --- a/src/payments/model_authentication_result_response.go +++ b/src/payments/model_authentication_result_response.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AuthenticationResultResponse type satisfies the MappedNullable interface at compile time @@ -105,7 +104,7 @@ func (o *AuthenticationResultResponse) SetThreeDS2Result(v ThreeDS2Result) { } func (o AuthenticationResultResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableAuthenticationResultResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_bank_account.go b/src/payments/model_bank_account.go index 01d9d6077..863c61767 100644 --- a/src/payments/model_bank_account.go +++ b/src/payments/model_bank_account.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_browser_info.go b/src/payments/model_browser_info.go index f0807d1f0..5a883439e 100644 --- a/src/payments/model_browser_info.go +++ b/src/payments/model_browser_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BrowserInfo type satisfies the MappedNullable interface at compile time @@ -293,7 +292,7 @@ func (o *BrowserInfo) SetUserAgent(v string) { } func (o BrowserInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -351,3 +350,6 @@ func (v *NullableBrowserInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_cancel_or_refund_request.go b/src/payments/model_cancel_or_refund_request.go index c94efb32a..134537201 100644 --- a/src/payments/model_cancel_or_refund_request.go +++ b/src/payments/model_cancel_or_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CancelOrRefundRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type CancelOrRefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -329,7 +328,7 @@ func (o *CancelOrRefundRequest) SetUniqueTerminalId(v string) { } func (o CancelOrRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -399,3 +398,6 @@ func (v *NullableCancelOrRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_cancel_request.go b/src/payments/model_cancel_request.go index e0caf1df1..03c8da3c5 100644 --- a/src/payments/model_cancel_request.go +++ b/src/payments/model_cancel_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CancelRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type CancelRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -363,7 +362,7 @@ func (o *CancelRequest) SetUniqueTerminalId(v string) { } func (o CancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -436,3 +435,6 @@ func (v *NullableCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_capture_request.go b/src/payments/model_capture_request.go index 82a2338b8..976aaa683 100644 --- a/src/payments/model_capture_request.go +++ b/src/payments/model_capture_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CaptureRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type CaptureRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *CaptureRequest) SetUniqueTerminalId(v string) { } func (o CaptureRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableCaptureRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_card.go b/src/payments/model_card.go index 6e2b67323..abd372dcb 100644 --- a/src/payments/model_card.go +++ b/src/payments/model_card.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_common_field.go b/src/payments/model_common_field.go index 63fc98fd5..b7e9aca15 100644 --- a/src/payments/model_common_field.go +++ b/src/payments/model_common_field.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CommonField type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CommonField) SetVersion(v string) { } func (o CommonField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommonField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_device_render_options.go b/src/payments/model_device_render_options.go index 163d4eb38..13cca3c48 100644 --- a/src/payments/model_device_render_options.go +++ b/src/payments/model_device_render_options.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DeviceRenderOptions type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *DeviceRenderOptions) SetSdkUiType(v []string) { } func (o DeviceRenderOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableDeviceRenderOptions) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DeviceRenderOptions) isValidSdkInterface() bool { - var allowedEnumValues = []string{"native", "html", "both"} - for _, allowed := range allowedEnumValues { - if o.GetSdkInterface() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "native", "html", "both" } + for _, allowed := range allowedEnumValues { + if o.GetSdkInterface() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_donation_request.go b/src/payments/model_donation_request.go index 7ff4a6110..fba4df512 100644 --- a/src/payments/model_donation_request.go +++ b/src/payments/model_donation_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DonationRequest type satisfies the MappedNullable interface at compile time @@ -22,10 +21,10 @@ type DonationRequest struct { // The Adyen account name of the charity. DonationAccount string `json:"donationAccount"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` ModificationAmount Amount `json:"modificationAmount"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference *string `json:"originalReference,omitempty"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference *string `json:"originalReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -220,7 +219,7 @@ func (o *DonationRequest) SetReference(v string) { } func (o DonationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -279,3 +278,6 @@ func (v *NullableDonationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_external_platform.go b/src/payments/model_external_platform.go index e92c819b3..cba1b4303 100644 --- a/src/payments/model_external_platform.go +++ b/src/payments/model_external_platform.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ExternalPlatform type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ExternalPlatform) SetVersion(v string) { } func (o ExternalPlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableExternalPlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_forex_quote.go b/src/payments/model_forex_quote.go index cfc241961..a324fcd97 100644 --- a/src/payments/model_forex_quote.go +++ b/src/payments/model_forex_quote.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ForexQuote type satisfies the MappedNullable interface at compile time @@ -24,14 +23,14 @@ type ForexQuote struct { Account *string `json:"account,omitempty"` // The account type. AccountType *string `json:"accountType,omitempty"` - BaseAmount *Amount `json:"baseAmount,omitempty"` + BaseAmount *Amount `json:"baseAmount,omitempty"` // The base points. - BasePoints int32 `json:"basePoints"` - Buy *Amount `json:"buy,omitempty"` - Interbank *Amount `json:"interbank,omitempty"` + BasePoints int32 `json:"basePoints"` + Buy *Amount `json:"buy,omitempty"` + Interbank *Amount `json:"interbank,omitempty"` // The reference assigned to the forex quote request. Reference *string `json:"reference,omitempty"` - Sell *Amount `json:"sell,omitempty"` + Sell *Amount `json:"sell,omitempty"` // The signature to validate the integrity. Signature *string `json:"signature,omitempty"` // The source of the forex quote. @@ -430,7 +429,7 @@ func (o *ForexQuote) SetValidTill(v time.Time) { } func (o ForexQuote) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -509,3 +508,6 @@ func (v *NullableForexQuote) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_check_result.go b/src/payments/model_fraud_check_result.go index b93b4267a..a954d43ae 100644 --- a/src/payments/model_fraud_check_result.go +++ b/src/payments/model_fraud_check_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_check_result_wrapper.go b/src/payments/model_fraud_check_result_wrapper.go index 96096d75d..7166ab4ff 100644 --- a/src/payments/model_fraud_check_result_wrapper.go +++ b/src/payments/model_fraud_check_result_wrapper.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudCheckResultWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *FraudCheckResultWrapper) SetFraudCheckResult(v FraudCheckResult) { } func (o FraudCheckResultWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableFraudCheckResultWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_result.go b/src/payments/model_fraud_result.go index 840c01af3..096bc16c2 100644 --- a/src/payments/model_fraud_result.go +++ b/src/payments/model_fraud_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResultWrapper) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fund_destination.go b/src/payments/model_fund_destination.go index 1c591b39f..cf6361afe 100644 --- a/src/payments/model_fund_destination.go +++ b/src/payments/model_fund_destination.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FundDestination type satisfies the MappedNullable interface at compile time @@ -21,16 +20,16 @@ var _ common.MappedNullable = &FundDestination{} type FundDestination struct { // a map of name/value pairs for passing in additional/industry-specific data AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` // the email address of the person ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - ShopperReference *string `json:"shopperReference,omitempty"` - SubMerchant *SubMerchant `json:"subMerchant,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` + SubMerchant *SubMerchant `json:"subMerchant,omitempty"` // the telephone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -341,7 +340,7 @@ func (o *FundDestination) SetTelephoneNumber(v string) { } func (o FundDestination) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -415,3 +414,6 @@ func (v *NullableFundDestination) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fund_source.go b/src/payments/model_fund_source.go index f90cb78b2..3ff88ecb4 100644 --- a/src/payments/model_fund_source.go +++ b/src/payments/model_fund_source.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FundSource type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &FundSource{} type FundSource struct { // A map of name-value pairs for passing additional or industry-specific data. AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Email address of the person. ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Phone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -240,7 +239,7 @@ func (o *FundSource) SetTelephoneNumber(v string) { } func (o FundSource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -305,3 +304,6 @@ func (v *NullableFundSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_installments.go b/src/payments/model_installments.go index f4d09357b..7830f27a1 100644 --- a/src/payments/model_installments.go +++ b/src/payments/model_installments.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Installments type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Installments{} // Installments struct for Installments type Installments struct { - // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** Plan *string `json:"plan,omitempty"` // Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. Value int32 `json:"value"` @@ -100,7 +99,7 @@ func (o *Installments) SetValue(v int32) { } func (o Installments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableInstallments) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Installments) isValidPlan() bool { - var allowedEnumValues = []string{"regular", "revolving"} - for _, allowed := range allowedEnumValues { - if o.GetPlan() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "regular", "revolving" } + for _, allowed := range allowedEnumValues { + if o.GetPlan() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_mandate.go b/src/payments/model_mandate.go index 3f9f3c6c0..d2801c900 100644 --- a/src/payments/model_mandate.go +++ b/src/payments/model_mandate.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Mandate type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &Mandate{} type Mandate struct { // The billing amount (in minor units) of the recurring transactions. Amount string `json:"amount"` - // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. AmountRule *string `json:"amountRule,omitempty"` - // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. BillingAttemptsRule *string `json:"billingAttemptsRule,omitempty"` // The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. BillingDay *string `json:"billingDay,omitempty"` @@ -290,7 +289,7 @@ func (o *Mandate) SetStartsAt(v string) { } func (o Mandate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -356,30 +355,32 @@ func (v *NullableMandate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Mandate) isValidAmountRule() bool { - var allowedEnumValues = []string{"max", "exact"} - for _, allowed := range allowedEnumValues { - if o.GetAmountRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "max", "exact" } + for _, allowed := range allowedEnumValues { + if o.GetAmountRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidBillingAttemptsRule() bool { - var allowedEnumValues = []string{"on", "before", "after"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAttemptsRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "on", "before", "after" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAttemptsRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidFrequency() bool { - var allowedEnumValues = []string{"adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly"} - for _, allowed := range allowedEnumValues { - if o.GetFrequency() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly" } + for _, allowed := range allowedEnumValues { + if o.GetFrequency() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_merchant_device.go b/src/payments/model_merchant_device.go index 2367df5ff..0a03da907 100644 --- a/src/payments/model_merchant_device.go +++ b/src/payments/model_merchant_device.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDevice) SetReference(v string) { } func (o MerchantDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_merchant_risk_indicator.go b/src/payments/model_merchant_risk_indicator.go index 3446a0bff..cbe560834 100644 --- a/src/payments/model_merchant_risk_indicator.go +++ b/src/payments/model_merchant_risk_indicator.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantRiskIndicator type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type MerchantRiskIndicator struct { DeliveryEmailAddress *string `json:"deliveryEmailAddress,omitempty"` // The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` DeliveryTimeframe *string `json:"deliveryTimeframe,omitempty"` - GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` + GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` // For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. GiftCardCount *int32 `json:"giftCardCount,omitempty"` // For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. @@ -519,7 +518,7 @@ func (o *MerchantRiskIndicator) SetShipIndicator(v string) { } func (o MerchantRiskIndicator) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -609,21 +608,23 @@ func (v *NullableMerchantRiskIndicator) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MerchantRiskIndicator) isValidDeliveryAddressIndicator() bool { - var allowedEnumValues = []string{"shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressIndicator() == allowed { + return true + } + } + return false } func (o *MerchantRiskIndicator) isValidDeliveryTimeframe() bool { - var allowedEnumValues = []string{"electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryTimeframe() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryTimeframe() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_modification_result.go b/src/payments/model_modification_result.go index 3b6a155fd..02fab4c1b 100644 --- a/src/payments/model_modification_result.go +++ b/src/payments/model_modification_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ModificationResult type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModificationResult) SetResponse(v string) { } func (o ModificationResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableModificationResult) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ModificationResult) isValidResponse() bool { - var allowedEnumValues = []string{"[capture-received]", "[cancel-received]", "[refund-received]", "[cancelOrRefund-received]", "[adjustAuthorisation-received]", "[donation-received]", "[technical-cancel-received]", "[voidPendingRefund-received]"} - for _, allowed := range allowedEnumValues { - if o.GetResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "[capture-received]", "[cancel-received]", "[refund-received]", "[cancelOrRefund-received]", "[adjustAuthorisation-received]", "[donation-received]", "[technical-cancel-received]", "[voidPendingRefund-received]" } + for _, allowed := range allowedEnumValues { + if o.GetResponse() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_name.go b/src/payments/model_name.go index 6398b0b00..265abf02b 100644 --- a/src/payments/model_name.go +++ b/src/payments/model_name.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_payment_request.go b/src/payments/model_payment_request.go index 8e4e1fec7..d69ea8a5f 100644 --- a/src/payments/model_payment_request.go +++ b/src/payments/model_payment_request.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentRequest type satisfies the MappedNullable interface at compile time @@ -20,22 +19,22 @@ var _ common.MappedNullable = &PaymentRequest{} // PaymentRequest struct for PaymentRequest type PaymentRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BankAccount *BankAccount `json:"bankAccount,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BankAccount *BankAccount `json:"bankAccount,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). @@ -43,32 +42,32 @@ type PaymentRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` FundDestination *FundDestination `json:"fundDestination,omitempty"` - FundSource *FundSource `json:"fundSource,omitempty"` + FundSource *FundSource `json:"fundSource,omitempty"` // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - FundingSource *string `json:"fundingSource,omitempty"` - Installments *Installments `json:"installments,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Installments *Installments `json:"installments,omitempty"` // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The two-character country code of the shopper's nationality. Nationality *string `json:"nationality,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` + OrderReference *string `json:"orderReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` @@ -86,7 +85,7 @@ type PaymentRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -98,7 +97,7 @@ type PaymentRequest struct { // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -1805,7 +1804,7 @@ func (o *PaymentRequest) SetTrustedShopper(v bool) { } func (o PaymentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2006,39 +2005,41 @@ func (v *NullablePaymentRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_request3d.go b/src/payments/model_payment_request3d.go index 2d80908a3..c781d7756 100644 --- a/src/payments/model_payment_request3d.go +++ b/src/payments/model_payment_request3d.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentRequest3d type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &PaymentRequest3d{} // PaymentRequest3d struct for PaymentRequest3d type PaymentRequest3d struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount *Amount `json:"amount,omitempty"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -50,16 +49,16 @@ type PaymentRequest3d struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Payment authorisation response returned by the card issuer. The `paResponse` field holds the PaRes value received from the card issuer. - PaResponse string `json:"paResponse"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + PaResponse string `json:"paResponse"` + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -77,7 +76,7 @@ type PaymentRequest3d struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -89,7 +88,7 @@ type PaymentRequest3d struct { // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -1540,7 +1539,7 @@ func (o *PaymentRequest3d) SetTrustedShopper(v bool) { } func (o PaymentRequest3d) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1717,21 +1716,23 @@ func (v *NullablePaymentRequest3d) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest3d) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest3d) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_request3ds2.go b/src/payments/model_payment_request3ds2.go index deac4c3c8..bbe02538e 100644 --- a/src/payments/model_payment_request3ds2.go +++ b/src/payments/model_payment_request3ds2.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentRequest3ds2 type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &PaymentRequest3ds2{} // PaymentRequest3ds2 struct for PaymentRequest3ds2 type PaymentRequest3ds2 struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -48,14 +47,14 @@ type PaymentRequest3ds2 struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + OrderReference *string `json:"orderReference,omitempty"` + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` @@ -73,7 +72,7 @@ type PaymentRequest3ds2 struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -85,9 +84,9 @@ type PaymentRequest3ds2 struct { // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // The ThreeDS2Token that was returned in the /authorise call. ThreeDS2Token *string `json:"threeDS2Token,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. @@ -1539,7 +1538,7 @@ func (o *PaymentRequest3ds2) SetTrustedShopper(v bool) { } func (o PaymentRequest3ds2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1716,21 +1715,23 @@ func (v *NullablePaymentRequest3ds2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest3ds2) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest3ds2) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_result.go b/src/payments/model_payment_result.go index ceb4e5bb3..30db5d782 100644 --- a/src/payments/model_payment_result.go +++ b/src/payments/model_payment_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentResult type satisfies the MappedNullable interface at compile time @@ -22,11 +21,11 @@ type PaymentResult struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` // Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` DccAmount *Amount `json:"dccAmount,omitempty"` // Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - DccSignature *string `json:"dccSignature,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DccSignature *string `json:"dccSignature,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. IssuerUrl *string `json:"issuerUrl,omitempty"` // The payment session. @@ -411,7 +410,7 @@ func (o *PaymentResult) SetResultCode(v string) { } func (o PaymentResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -492,12 +491,14 @@ func (v *NullablePaymentResult) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentResult) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_phone.go b/src/payments/model_phone.go index afdb38d5c..ee9012673 100644 --- a/src/payments/model_phone.go +++ b/src/payments/model_phone.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Phone) SetSubscriber(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_platform_chargeback_logic.go b/src/payments/model_platform_chargeback_logic.go index 513009e58..39884cb2b 100644 --- a/src/payments/model_platform_chargeback_logic.go +++ b/src/payments/model_platform_chargeback_logic.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PlatformChargebackLogic type satisfies the MappedNullable interface at compile time @@ -19,9 +18,12 @@ var _ common.MappedNullable = &PlatformChargebackLogic{} // PlatformChargebackLogic struct for PlatformChargebackLogic type PlatformChargebackLogic struct { - Behavior *string `json:"behavior,omitempty"` + // The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + Behavior *string `json:"behavior,omitempty"` + // The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. CostAllocationAccount *string `json:"costAllocationAccount,omitempty"` - TargetAccount *string `json:"targetAccount,omitempty"` + // The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. + TargetAccount *string `json:"targetAccount,omitempty"` } // NewPlatformChargebackLogic instantiates a new PlatformChargebackLogic object @@ -138,7 +140,7 @@ func (o *PlatformChargebackLogic) SetTargetAccount(v string) { } func (o PlatformChargebackLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,12 +197,14 @@ func (v *NullablePlatformChargebackLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PlatformChargebackLogic) isValidBehavior() bool { - var allowedEnumValues = []string{"deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetBehavior() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetBehavior() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_recurring.go b/src/payments/model_recurring.go index 3aa5cf1e5..6c4436164 100644 --- a/src/payments/model_recurring.go +++ b/src/payments/model_recurring.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_refund_request.go b/src/payments/model_refund_request.go index 46a10037f..6997f9785 100644 --- a/src/payments/model_refund_request.go +++ b/src/payments/model_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RefundRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type RefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *RefundRequest) SetUniqueTerminalId(v string) { } func (o RefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data3_d_secure.go b/src/payments/model_response_additional_data3_d_secure.go index 3fbb11231..f894500ff 100644 --- a/src/payments/model_response_additional_data3_d_secure.go +++ b/src/payments/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_billing_address.go b/src/payments/model_response_additional_data_billing_address.go index f006a4b33..844636c7e 100644 --- a/src/payments/model_response_additional_data_billing_address.go +++ b/src/payments/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_card.go b/src/payments/model_response_additional_data_card.go index 04e01ac29..508804903 100644 --- a/src/payments/model_response_additional_data_card.go +++ b/src/payments/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_common.go b/src/payments/model_response_additional_data_common.go index bc25e1051..4ee6feade 100644 --- a/src/payments/model_response_additional_data_common.go +++ b/src/payments/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_response_additional_data_installments.go b/src/payments/model_response_additional_data_installments.go index bb5fc454a..2fa5f5143 100644 --- a/src/payments/model_response_additional_data_installments.go +++ b/src/payments/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_network_tokens.go b/src/payments/model_response_additional_data_network_tokens.go index d6ec8f8ed..b59c751c4 100644 --- a/src/payments/model_response_additional_data_network_tokens.go +++ b/src/payments/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_opi.go b/src/payments/model_response_additional_data_opi.go index 518940d6d..36738d140 100644 --- a/src/payments/model_response_additional_data_opi.go +++ b/src/payments/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_sepa.go b/src/payments/model_response_additional_data_sepa.go index e514e884e..5e969163b 100644 --- a/src/payments/model_response_additional_data_sepa.go +++ b/src/payments/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_sdk_ephem_pub_key.go b/src/payments/model_sdk_ephem_pub_key.go index 99032b6b7..0e88a4c61 100644 --- a/src/payments/model_sdk_ephem_pub_key.go +++ b/src/payments/model_sdk_ephem_pub_key.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SDKEphemPubKey type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *SDKEphemPubKey) SetY(v string) { } func (o SDKEphemPubKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSDKEphemPubKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_service_error.go b/src/payments/model_service_error.go index 071619a47..4cad98af4 100644 --- a/src/payments/model_service_error.go +++ b/src/payments/model_service_error.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_shopper_interaction_device.go b/src/payments/model_shopper_interaction_device.go index 9ba70771f..cebf45b0f 100644 --- a/src/payments/model_shopper_interaction_device.go +++ b/src/payments/model_shopper_interaction_device.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ShopperInteractionDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInteractionDevice) SetOsVersion(v string) { } func (o ShopperInteractionDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableShopperInteractionDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_split.go b/src/payments/model_split.go index 4e53eaa34..be16c2513 100644 --- a/src/payments/model_split.go +++ b/src/payments/model_split.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Split type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` + // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + Account *string `json:"account,omitempty"` + Amount SplitAmount `json:"amount"` // A description of this split. Description *string `json:"description,omitempty"` // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. @@ -194,7 +193,7 @@ func (o *Split) SetType(v string) { } func (o Split) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,12 +252,14 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_split_amount.go b/src/payments/model_split_amount.go index 8fde9239e..6548dd622 100644 --- a/src/payments/model_split_amount.go +++ b/src/payments/model_split_amount.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SplitAmount type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *SplitAmount) SetValue(v int64) { } func (o SplitAmount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableSplitAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_sub_merchant.go b/src/payments/model_sub_merchant.go index ae3a2ee97..f9facee81 100644 --- a/src/payments/model_sub_merchant.go +++ b/src/payments/model_sub_merchant.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SubMerchant type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *SubMerchant) SetTaxId(v string) { } func (o SubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_technical_cancel_request.go b/src/payments/model_technical_cancel_request.go index e55146143..13cec467e 100644 --- a/src/payments/model_technical_cancel_request.go +++ b/src/payments/model_technical_cancel_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TechnicalCancelRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type TechnicalCancelRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount *Amount `json:"modificationAmount,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount *Amount `json:"modificationAmount,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. - OriginalMerchantReference string `json:"originalMerchantReference"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + OriginalMerchantReference string `json:"originalMerchantReference"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). @@ -362,7 +361,7 @@ func (o *TechnicalCancelRequest) SetUniqueTerminalId(v string) { } func (o TechnicalCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -435,3 +434,6 @@ func (v *NullableTechnicalCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_d_secure_data.go b/src/payments/model_three_d_secure_data.go index e68cde610..08e37d021 100644 --- a/src/payments/model_three_d_secure_data.go +++ b/src/payments/model_three_d_secure_data.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSecureData type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ThreeDSecureData) SetXid(v string) { } func (o ThreeDSecureData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -531,30 +530,32 @@ func (v *NullableThreeDSecureData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSecureData) isValidAuthenticationResponse() bool { - var allowedEnumValues = []string{"Y", "N", "U", "A"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N", "U", "A" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationResponse() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidDirectoryResponse() bool { - var allowedEnumValues = []string{"A", "C", "D", "I", "N", "R", "U", "Y"} - for _, allowed := range allowedEnumValues { - if o.GetDirectoryResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "A", "C", "D", "I", "N", "R", "U", "Y" } + for _, allowed := range allowedEnumValues { + if o.GetDirectoryResponse() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds1_result.go b/src/payments/model_three_ds1_result.go index 5f170f2f7..41c1e041e 100644 --- a/src/payments/model_three_ds1_result.go +++ b/src/payments/model_three_ds1_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS1Result type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ThreeDS1Result) SetXid(v string) { } func (o ThreeDS1Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableThreeDS1Result) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds2_request_data.go b/src/payments/model_three_ds2_request_data.go index bbd2afa34..06bfa053a 100644 --- a/src/payments/model_three_ds2_request_data.go +++ b/src/payments/model_three_ds2_request_data.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2RequestData type satisfies the MappedNullable interface at compile time @@ -31,20 +30,20 @@ type ThreeDS2RequestData struct { // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` - // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` // Deprecated ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The environment of the shopper. Allowed values: * `app` * `browser` - DeviceChannel string `json:"deviceChannel"` + DeviceChannel string `json:"deviceChannel"` DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` - HomePhone *Phone `json:"homePhone,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. Mcc *string `json:"mcc,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. MerchantName *string `json:"merchantName,omitempty"` // The `messageVersion` value indicating the 3D Secure 2 protocol version. MessageVersion *string `json:"messageVersion,omitempty"` - MobilePhone *Phone `json:"mobilePhone,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. NotificationURL *string `json:"notificationURL,omitempty"` // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. @@ -60,7 +59,7 @@ type ThreeDS2RequestData struct { // The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. SdkAppID *string `json:"sdkAppID,omitempty"` // The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - SdkEncData *string `json:"sdkEncData,omitempty"` + SdkEncData *string `json:"sdkEncData,omitempty"` SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` @@ -73,14 +72,14 @@ type ThreeDS2RequestData struct { // Completion indicator for the device fingerprinting. ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` // Indicates the type of Authentication request. - ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` @@ -90,7 +89,7 @@ type ThreeDS2RequestData struct { TransactionType *string `json:"transactionType,omitempty"` // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. WhiteListStatus *string `json:"whiteListStatus,omitempty"` - WorkPhone *Phone `json:"workPhone,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` } // NewThreeDS2RequestData instantiates a new ThreeDS2RequestData object @@ -1370,7 +1369,7 @@ func (o *ThreeDS2RequestData) SetWorkPhone(v Phone) { } func (o ThreeDS2RequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1533,57 +1532,59 @@ func (v *NullableThreeDS2RequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2RequestData) isValidAcctType() bool { - var allowedEnumValues = []string{"01", "02", "03"} - for _, allowed := range allowedEnumValues { - if o.GetAcctType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidAddrMatch() bool { - var allowedEnumValues = []string{"Y", "N"} - for _, allowed := range allowedEnumValues { - if o.GetAddrMatch() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransType() bool { - var allowedEnumValues = []string{"01", "03", "10", "11", "28"} - for _, allowed := range allowedEnumValues { - if o.GetTransType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransactionType() bool { - var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} - for _, allowed := range allowedEnumValues { - if o.GetTransactionType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds2_result.go b/src/payments/model_three_ds2_result.go index 79e031a4f..ab2b934cc 100644 --- a/src/payments/model_three_ds2_result.go +++ b/src/payments/model_three_ds2_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2Result type satisfies the MappedNullable interface at compile time @@ -25,13 +24,13 @@ type ThreeDS2Result struct { CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` // Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). ChallengeCancel *string `json:"challengeCancel,omitempty"` - // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The `dsTransID` value as defined in the 3D Secure 2 specification. DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. Eci *string `json:"eci,omitempty"` - // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` // The `messageVersion` value as defined in the 3D Secure 2 specification. MessageVersion *string `json:"messageVersion,omitempty"` @@ -515,7 +514,7 @@ func (o *ThreeDS2Result) SetWhiteListStatus(v string) { } func (o ThreeDS2Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -605,30 +604,32 @@ func (v *NullableThreeDS2Result) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2Result) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} - for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis" } + for _, allowed := range allowedEnumValues { + if o.GetExemptionIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds2_result_request.go b/src/payments/model_three_ds2_result_request.go index e3b9bfef5..46f1474b0 100644 --- a/src/payments/model_three_ds2_result_request.go +++ b/src/payments/model_three_ds2_result_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2ResultRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *ThreeDS2ResultRequest) SetPspReference(v string) { } func (o ThreeDS2ResultRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableThreeDS2ResultRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds2_result_response.go b/src/payments/model_three_ds2_result_response.go index 0dafd2b95..ee88bef37 100644 --- a/src/payments/model_three_ds2_result_response.go +++ b/src/payments/model_three_ds2_result_response.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDS2ResultResponse type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *ThreeDS2ResultResponse) SetThreeDS2Result(v ThreeDS2Result) { } func (o ThreeDS2ResultResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableThreeDS2ResultResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds_requestor_authentication_info.go b/src/payments/model_three_ds_requestor_authentication_info.go index c65e77ff9..bd4c2aaee 100644 --- a/src/payments/model_three_ds_requestor_authentication_info.go +++ b/src/payments/model_three_ds_requestor_authentication_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSRequestorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ThreeDSRequestorAuthenticationInfo) SetThreeDSReqAuthTimestamp(v string } func (o ThreeDSRequestorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableThreeDSRequestorAuthenticationInfo) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorAuthenticationInfo) isValidThreeDSReqAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds_requestor_prior_authentication_info.go b/src/payments/model_three_ds_requestor_prior_authentication_info.go index 448ea7a76..d3cce78e0 100644 --- a/src/payments/model_three_ds_requestor_prior_authentication_info.go +++ b/src/payments/model_three_ds_requestor_prior_authentication_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ThreeDSRequestorPriorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestorPriorAuthenticationInfo) SetThreeDSReqPriorRef(v string } func (o ThreeDSRequestorPriorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableThreeDSRequestorPriorAuthenticationInfo) UnmarshalJSON(src []by return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorPriorAuthenticationInfo) isValidThreeDSReqPriorAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqPriorAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqPriorAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_void_pending_refund_request.go b/src/payments/model_void_pending_refund_request.go index 4a187ab1c..38983ce60 100644 --- a/src/payments/model_void_pending_refund_request.go +++ b/src/payments/model_void_pending_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the VoidPendingRefundRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type VoidPendingRefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount *Amount `json:"modificationAmount,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount *Amount `json:"modificationAmount,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference *string `json:"originalReference,omitempty"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference *string `json:"originalReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -403,7 +402,7 @@ func (o *VoidPendingRefundRequest) SetUniqueTerminalId(v string) { } func (o VoidPendingRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -481,3 +480,6 @@ func (v *NullableVoidPendingRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/api_initialization.go b/src/payout/api_initialization.go index 36505117a..574130598 100644 --- a/src/payout/api_initialization.go +++ b/src/payout/api_initialization.go @@ -10,17 +10,17 @@ package payout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // InitializationApi InitializationApi service type InitializationApi common.Service type InitializationApiStoreDetailConfig struct { - ctx context.Context + ctx context.Context storeDetailRequest *StoreDetailRequest } @@ -29,6 +29,7 @@ func (r InitializationApiStoreDetailConfig) StoreDetailRequest(storeDetailReques return r } + /* StoreDetail Store payout details @@ -46,32 +47,75 @@ func (a *InitializationApi) StoreDetailConfig(ctx context.Context) Initializatio /* Store payout details Stores payment details under the `PAYOUT` recurring contract. These payment details can be used later to submit a payout via the `/submitThirdParty` call. - * @param req StoreDetailRequest - reference of StoreDetailRequest). + * @param req StoreDetailRequest - reference of StoreDetailRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoreDetailResponse */ func (a *InitializationApi) StoreDetail(r InitializationApiStoreDetailConfig) (StoreDetailResponse, *_nethttp.Response, error) { - res := &StoreDetailResponse{} + var serviceError common.RestServiceError + res := &StoreDetailResponse{} path := "/storeDetail" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storeDetailRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storeDetailRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type InitializationApiStoreDetailAndSubmitThirdPartyConfig struct { - ctx context.Context + ctx context.Context storeDetailAndSubmitRequest *StoreDetailAndSubmitRequest } @@ -80,6 +124,7 @@ func (r InitializationApiStoreDetailAndSubmitThirdPartyConfig) StoreDetailAndSub return r } + /* StoreDetailAndSubmitThirdParty Store details and submit a payout @@ -99,32 +144,75 @@ func (a *InitializationApi) StoreDetailAndSubmitThirdPartyConfig(ctx context.Con /* Store details and submit a payout Submits a payout and stores its details for subsequent payouts. The submitted payout must be confirmed or declined either by a reviewer or via `/confirmThirdParty` or `/declineThirdParty` calls. - * @param req StoreDetailAndSubmitRequest - reference of StoreDetailAndSubmitRequest). + * @param req StoreDetailAndSubmitRequest - reference of StoreDetailAndSubmitRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoreDetailAndSubmitResponse */ func (a *InitializationApi) StoreDetailAndSubmitThirdParty(r InitializationApiStoreDetailAndSubmitThirdPartyConfig) (StoreDetailAndSubmitResponse, *_nethttp.Response, error) { - res := &StoreDetailAndSubmitResponse{} + var serviceError common.RestServiceError + res := &StoreDetailAndSubmitResponse{} path := "/storeDetailAndSubmitThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storeDetailAndSubmitRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storeDetailAndSubmitRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type InitializationApiSubmitThirdPartyConfig struct { - ctx context.Context + ctx context.Context submitRequest *SubmitRequest } @@ -133,6 +221,7 @@ func (r InitializationApiSubmitThirdPartyConfig) SubmitRequest(submitRequest Sub return r } + /* SubmitThirdParty Submit a payout @@ -152,26 +241,69 @@ func (a *InitializationApi) SubmitThirdPartyConfig(ctx context.Context) Initiali /* Submit a payout Submits a payout using the previously stored payment details. To store payment details, use the `/storeDetail` API call. The submitted payout must be confirmed or declined either by a reviewer or via `/confirmThirdParty` or `/declineThirdParty` calls. - * @param req SubmitRequest - reference of SubmitRequest). + * @param req SubmitRequest - reference of SubmitRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return SubmitResponse */ func (a *InitializationApi) SubmitThirdParty(r InitializationApiSubmitThirdPartyConfig) (SubmitResponse, *_nethttp.Response, error) { - res := &SubmitResponse{} + var serviceError common.RestServiceError + res := &SubmitResponse{} path := "/submitThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.submitRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.submitRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/payout/api_instant_payouts.go b/src/payout/api_instant_payouts.go index 122963112..b8970e45a 100644 --- a/src/payout/api_instant_payouts.go +++ b/src/payout/api_instant_payouts.go @@ -10,17 +10,17 @@ package payout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // InstantPayoutsApi InstantPayoutsApi service type InstantPayoutsApi common.Service type InstantPayoutsApiPayoutConfig struct { - ctx context.Context + ctx context.Context payoutRequest *PayoutRequest } @@ -29,6 +29,7 @@ func (r InstantPayoutsApiPayoutConfig) PayoutRequest(payoutRequest PayoutRequest return r } + /* Payout Make an instant card payout @@ -46,26 +47,69 @@ func (a *InstantPayoutsApi) PayoutConfig(ctx context.Context) InstantPayoutsApiP /* Make an instant card payout With this call, you can pay out to your customers, and funds will be made available within 30 minutes on the cardholder's bank account (this is dependent on whether the issuer supports this functionality). Instant card payouts are only supported for Visa and Mastercard cards. - * @param req PayoutRequest - reference of PayoutRequest). + * @param req PayoutRequest - reference of PayoutRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PayoutResponse */ func (a *InstantPayoutsApi) Payout(r InstantPayoutsApiPayoutConfig) (PayoutResponse, *_nethttp.Response, error) { - res := &PayoutResponse{} + var serviceError common.RestServiceError + res := &PayoutResponse{} path := "/payout" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.payoutRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.payoutRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/payout/api_reviewing.go b/src/payout/api_reviewing.go index 82e856a32..3c6b16a5a 100644 --- a/src/payout/api_reviewing.go +++ b/src/payout/api_reviewing.go @@ -10,17 +10,17 @@ package payout import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // ReviewingApi ReviewingApi service type ReviewingApi common.Service type ReviewingApiConfirmThirdPartyConfig struct { - ctx context.Context + ctx context.Context modifyRequest *ModifyRequest } @@ -29,6 +29,7 @@ func (r ReviewingApiConfirmThirdPartyConfig) ModifyRequest(modifyRequest ModifyR return r } + /* ConfirmThirdParty Confirm a payout @@ -48,32 +49,75 @@ func (a *ReviewingApi) ConfirmThirdPartyConfig(ctx context.Context) ReviewingApi /* Confirm a payout Confirms a previously submitted payout. To cancel a payout, use the `/declineThirdParty` endpoint. - * @param req ModifyRequest - reference of ModifyRequest). + * @param req ModifyRequest - reference of ModifyRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModifyResponse */ func (a *ReviewingApi) ConfirmThirdParty(r ReviewingApiConfirmThirdPartyConfig) (ModifyResponse, *_nethttp.Response, error) { - res := &ModifyResponse{} + var serviceError common.RestServiceError + res := &ModifyResponse{} path := "/confirmThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.modifyRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.modifyRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type ReviewingApiDeclineThirdPartyConfig struct { - ctx context.Context + ctx context.Context modifyRequest *ModifyRequest } @@ -82,6 +126,7 @@ func (r ReviewingApiDeclineThirdPartyConfig) ModifyRequest(modifyRequest ModifyR return r } + /* DeclineThirdParty Cancel a payout @@ -101,26 +146,69 @@ func (a *ReviewingApi) DeclineThirdPartyConfig(ctx context.Context) ReviewingApi /* Cancel a payout Cancels a previously submitted payout. To confirm and send a payout, use the `/confirmThirdParty` endpoint. - * @param req ModifyRequest - reference of ModifyRequest). + * @param req ModifyRequest - reference of ModifyRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ModifyResponse */ func (a *ReviewingApi) DeclineThirdParty(r ReviewingApiDeclineThirdPartyConfig) (ModifyResponse, *_nethttp.Response, error) { - res := &ModifyResponse{} + var serviceError common.RestServiceError + res := &ModifyResponse{} path := "/declineThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.modifyRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.modifyRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/payout/model_address.go b/src/payout/model_address.go index 3cc6ce03e..f590c4aeb 100644 --- a/src/payout/model_address.go +++ b/src/payout/model_address.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_amount.go b/src/payout/model_amount.go index e6f641948..4ede92338 100644 --- a/src/payout/model_amount.go +++ b/src/payout/model_amount.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_bank_account.go b/src/payout/model_bank_account.go index 37d0f2c0f..a3a50c59b 100644 --- a/src/payout/model_bank_account.go +++ b/src/payout/model_bank_account.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_card.go b/src/payout/model_card.go index dd39193c8..ea24054b8 100644 --- a/src/payout/model_card.go +++ b/src/payout/model_card.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_check_result.go b/src/payout/model_fraud_check_result.go index e7ccd101b..2211a45a0 100644 --- a/src/payout/model_fraud_check_result.go +++ b/src/payout/model_fraud_check_result.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_check_result_wrapper.go b/src/payout/model_fraud_check_result_wrapper.go index 5b8f8ac50..d81a83254 100644 --- a/src/payout/model_fraud_check_result_wrapper.go +++ b/src/payout/model_fraud_check_result_wrapper.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudCheckResultWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *FraudCheckResultWrapper) SetFraudCheckResult(v FraudCheckResult) { } func (o FraudCheckResultWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableFraudCheckResultWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_result.go b/src/payout/model_fraud_result.go index d34829556..574128880 100644 --- a/src/payout/model_fraud_result.go +++ b/src/payout/model_fraud_result.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResultWrapper) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fund_source.go b/src/payout/model_fund_source.go index b856efd7d..2227c9b90 100644 --- a/src/payout/model_fund_source.go +++ b/src/payout/model_fund_source.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FundSource type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &FundSource{} type FundSource struct { // A map of name-value pairs for passing additional or industry-specific data. AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Email address of the person. ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Phone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -240,7 +239,7 @@ func (o *FundSource) SetTelephoneNumber(v string) { } func (o FundSource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -305,3 +304,6 @@ func (v *NullableFundSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_modify_request.go b/src/payout/model_modify_request.go index 2568900c3..c9d1e66ac 100644 --- a/src/payout/model_modify_request.go +++ b/src/payout/model_modify_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ModifyRequest type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModifyRequest) SetOriginalReference(v string) { } func (o ModifyRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableModifyRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_modify_response.go b/src/payout/model_modify_response.go index edf734cb2..d7e271213 100644 --- a/src/payout/model_modify_response.go +++ b/src/payout/model_modify_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ModifyResponse type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModifyResponse) SetResponse(v string) { } func (o ModifyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableModifyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_name.go b/src/payout/model_name.go index dd2b317ae..fa632ddf2 100644 --- a/src/payout/model_name.go +++ b/src/payout/model_name.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_payout_request.go b/src/payout/model_payout_request.go index a849fdeb5..57852e51e 100644 --- a/src/payout/model_payout_request.go +++ b/src/payout/model_payout_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayoutRequest type satisfies the MappedNullable interface at compile time @@ -19,15 +18,15 @@ var _ common.MappedNullable = &PayoutRequest{} // PayoutRequest struct for PayoutRequest type PayoutRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - FundSource *FundSource `json:"fundSource,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` + FundSource *FundSource `json:"fundSource,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - Recurring *Recurring `json:"recurring,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Recurring *Recurring `json:"recurring,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. @@ -36,7 +35,7 @@ type PayoutRequest struct { ShopperEmail *string `json:"shopperEmail,omitempty"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The shopper's telephone number. @@ -488,7 +487,7 @@ func (o *PayoutRequest) SetTelephoneNumber(v string) { } func (o PayoutRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -572,12 +571,14 @@ func (v *NullablePayoutRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_payout_response.go b/src/payout/model_payout_response.go index df1059350..b7df0f55f 100644 --- a/src/payout/model_payout_response.go +++ b/src/payout/model_payout_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PayoutResponse type satisfies the MappedNullable interface at compile time @@ -22,11 +21,11 @@ type PayoutResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` // Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` DccAmount *Amount `json:"dccAmount,omitempty"` // Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - DccSignature *string `json:"dccSignature,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DccSignature *string `json:"dccSignature,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. IssuerUrl *string `json:"issuerUrl,omitempty"` // The payment session. @@ -411,7 +410,7 @@ func (o *PayoutResponse) SetResultCode(v string) { } func (o PayoutResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -492,12 +491,14 @@ func (v *NullablePayoutResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_recurring.go b/src/payout/model_recurring.go index b505c4394..84d883ad2 100644 --- a/src/payout/model_recurring.go +++ b/src/payout/model_recurring.go @@ -10,9 +10,8 @@ package payout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_response_additional_data3_d_secure.go b/src/payout/model_response_additional_data3_d_secure.go index 9dd5a538d..55a123c2d 100644 --- a/src/payout/model_response_additional_data3_d_secure.go +++ b/src/payout/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_billing_address.go b/src/payout/model_response_additional_data_billing_address.go index 08d9a9bf7..2adcebf1d 100644 --- a/src/payout/model_response_additional_data_billing_address.go +++ b/src/payout/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_card.go b/src/payout/model_response_additional_data_card.go index 79bd598c9..65ed9ad31 100644 --- a/src/payout/model_response_additional_data_card.go +++ b/src/payout/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_common.go b/src/payout/model_response_additional_data_common.go index b232c88ae..2dc93ee67 100644 --- a/src/payout/model_response_additional_data_common.go +++ b/src/payout/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_response_additional_data_installments.go b/src/payout/model_response_additional_data_installments.go index 24cb28ea2..a75ef05fb 100644 --- a/src/payout/model_response_additional_data_installments.go +++ b/src/payout/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_network_tokens.go b/src/payout/model_response_additional_data_network_tokens.go index 643e6ccd8..68dcac99d 100644 --- a/src/payout/model_response_additional_data_network_tokens.go +++ b/src/payout/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_opi.go b/src/payout/model_response_additional_data_opi.go index be9ed78ca..c22d78853 100644 --- a/src/payout/model_response_additional_data_opi.go +++ b/src/payout/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_sepa.go b/src/payout/model_response_additional_data_sepa.go index c012371ff..acf19f833 100644 --- a/src/payout/model_response_additional_data_sepa.go +++ b/src/payout/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_service_error.go b/src/payout/model_service_error.go index 5e682a5e8..4fe3d8235 100644 --- a/src/payout/model_service_error.go +++ b/src/payout/model_service_error.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_store_detail_and_submit_request.go b/src/payout/model_store_detail_and_submit_request.go index 593ddf013..9b5718198 100644 --- a/src/payout/model_store_detail_and_submit_request.go +++ b/src/payout/model_store_detail_and_submit_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreDetailAndSubmitRequest type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &StoreDetailAndSubmitRequest{} type StoreDetailAndSubmitRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Amount Amount `json:"amount"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. DateOfBirth string `json:"dateOfBirth"` // The type of the entity the payout is processed for. @@ -34,15 +33,15 @@ type StoreDetailAndSubmitRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). - Nationality string `json:"nationality"` - Recurring Recurring `json:"recurring"` + Nationality string `json:"nationality"` + Recurring Recurring `json:"recurring"` // The merchant reference for this payment. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. Reference string `json:"reference"` // The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. SelectedBrand *string `json:"selectedBrand,omitempty"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payment transaction. ShopperReference string `json:"shopperReference"` // The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). @@ -616,7 +615,7 @@ func (o *StoreDetailAndSubmitRequest) SetTelephoneNumber(v string) { } func (o StoreDetailAndSubmitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -703,12 +702,14 @@ func (v *NullableStoreDetailAndSubmitRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoreDetailAndSubmitRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_store_detail_and_submit_response.go b/src/payout/model_store_detail_and_submit_response.go index 834266d74..021532542 100644 --- a/src/payout/model_store_detail_and_submit_response.go +++ b/src/payout/model_store_detail_and_submit_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreDetailAndSubmitResponse type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *StoreDetailAndSubmitResponse) SetResultCode(v string) { } func (o StoreDetailAndSubmitResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableStoreDetailAndSubmitResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_store_detail_request.go b/src/payout/model_store_detail_request.go index 96beeb99f..7772dda37 100644 --- a/src/payout/model_store_detail_request.go +++ b/src/payout/model_store_detail_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreDetailRequest type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &StoreDetailRequest{} type StoreDetailRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. DateOfBirth string `json:"dateOfBirth"` // The type of the entity the payout is processed for. @@ -33,13 +32,13 @@ type StoreDetailRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). - Nationality string `json:"nationality"` - Recurring Recurring `json:"recurring"` + Nationality string `json:"nationality"` + Recurring Recurring `json:"recurring"` // The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. SelectedBrand *string `json:"selectedBrand,omitempty"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payment transaction. ShopperReference string `json:"shopperReference"` // The shopper's social security number. @@ -529,7 +528,7 @@ func (o *StoreDetailRequest) SetTelephoneNumber(v string) { } func (o StoreDetailRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -611,12 +610,14 @@ func (v *NullableStoreDetailRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoreDetailRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_store_detail_response.go b/src/payout/model_store_detail_response.go index 7dc91f395..6d0591387 100644 --- a/src/payout/model_store_detail_response.go +++ b/src/payout/model_store_detail_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoreDetailResponse type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *StoreDetailResponse) SetResultCode(v string) { } func (o StoreDetailResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -207,3 +206,6 @@ func (v *NullableStoreDetailResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_submit_request.go b/src/payout/model_submit_request.go index 6bc6b2b84..9d13e1509 100644 --- a/src/payout/model_submit_request.go +++ b/src/payout/model_submit_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SubmitRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SubmitRequest{} type SubmitRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` // The date of birth. Format: ISO-8601; example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. > This field is required to update the existing `dateOfBirth` that is associated with this recurring contract. DateOfBirth *string `json:"dateOfBirth,omitempty"` // The type of the entity the payout is processed for. Allowed values: * NaturalPerson * Company > This field is required to update the existing `entityType` that is associated with this recurring contract. @@ -31,15 +30,15 @@ type SubmitRequest struct { // The merchant account identifier you want to process the transaction request with. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). > This field is required to update the existing nationality that is associated with this recurring contract. - Nationality *string `json:"nationality,omitempty"` - Recurring Recurring `json:"recurring"` + Nationality *string `json:"nationality,omitempty"` + Recurring Recurring `json:"recurring"` // The merchant reference for this payout. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. Reference string `json:"reference"` // This is the `recurringDetailReference` you want to use for this payout. You can use the value LATEST to select the most recently used recurring detail. SelectedRecurringDetailReference string `json:"selectedRecurringDetailReference"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payout transaction. ShopperReference string `json:"shopperReference"` // The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). @@ -497,7 +496,7 @@ func (o *SubmitRequest) SetSocialSecurityNumber(v string) { } func (o SubmitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -576,12 +575,14 @@ func (v *NullableSubmitRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SubmitRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_submit_response.go b/src/payout/model_submit_response.go index 6a02142e1..a344a5ba1 100644 --- a/src/payout/model_submit_response.go +++ b/src/payout/model_submit_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SubmitResponse type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *SubmitResponse) SetResultCode(v string) { } func (o SubmitResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableSubmitResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/.openapi-generator/VERSION b/src/posterminalmanagement/.openapi-generator/VERSION index c0be8a799..4be2c727a 100644 --- a/src/posterminalmanagement/.openapi-generator/VERSION +++ b/src/posterminalmanagement/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +6.5.0 \ No newline at end of file diff --git a/src/posterminalmanagement/api_general.go b/src/posterminalmanagement/api_general.go index 4fe686143..dec5fc30c 100644 --- a/src/posterminalmanagement/api_general.go +++ b/src/posterminalmanagement/api_general.go @@ -10,17 +10,17 @@ package posterminalmanagement import ( "context" - _context "context" - _nethttp "net/http" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GeneralApi GeneralApi service type GeneralApi common.Service type GeneralApiAssignTerminalsConfig struct { - ctx context.Context + ctx context.Context assignTerminalsRequest *AssignTerminalsRequest } @@ -29,13 +29,14 @@ func (r GeneralApiAssignTerminalsConfig) AssignTerminalsRequest(assignTerminalsR return r } + /* AssignTerminals Assign terminals Assigns one or more payment terminals to a merchant account or a store. You can also use this endpoint to reassign terminals between merchant accounts or stores, and to unassign a terminal and return it to company inventory. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GeneralApiAssignTerminalsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GeneralApiAssignTerminalsConfig */ func (a *GeneralApi) AssignTerminalsConfig(ctx context.Context) GeneralApiAssignTerminalsConfig { return GeneralApiAssignTerminalsConfig{ @@ -46,20 +47,75 @@ func (a *GeneralApi) AssignTerminalsConfig(ctx context.Context) GeneralApiAssign /* Assign terminals Assigns one or more payment terminals to a merchant account or a store. You can also use this endpoint to reassign terminals between merchant accounts or stores, and to unassign a terminal and return it to company inventory. - * @param req AssignTerminalsRequest - reference of AssignTerminalsRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req AssignTerminalsRequest - reference of AssignTerminalsRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return AssignTerminalsResponse */ func (a *GeneralApi) AssignTerminals(r GeneralApiAssignTerminalsConfig) (AssignTerminalsResponse, *_nethttp.Response, error) { - res := &AssignTerminalsResponse{} + var serviceError common.RestServiceError + res := &AssignTerminalsResponse{} path := "/assignTerminals" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.assignTerminalsRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.assignTerminalsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiFindTerminalConfig struct { - ctx context.Context + ctx context.Context findTerminalRequest *FindTerminalRequest } @@ -68,13 +124,14 @@ func (r GeneralApiFindTerminalConfig) FindTerminalRequest(findTerminalRequest Fi return r } + /* FindTerminal Get the account or store of a terminal Returns the company account, merchant account, or store that a payment terminal is assigned to. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GeneralApiFindTerminalConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GeneralApiFindTerminalConfig */ func (a *GeneralApi) FindTerminalConfig(ctx context.Context) GeneralApiFindTerminalConfig { return GeneralApiFindTerminalConfig{ @@ -85,20 +142,75 @@ func (a *GeneralApi) FindTerminalConfig(ctx context.Context) GeneralApiFindTermi /* Get the account or store of a terminal Returns the company account, merchant account, or store that a payment terminal is assigned to. - * @param req FindTerminalRequest - reference of FindTerminalRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req FindTerminalRequest - reference of FindTerminalRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return FindTerminalResponse */ func (a *GeneralApi) FindTerminal(r GeneralApiFindTerminalConfig) (FindTerminalResponse, *_nethttp.Response, error) { - res := &FindTerminalResponse{} + var serviceError common.RestServiceError + res := &FindTerminalResponse{} path := "/findTerminal" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.findTerminalRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.findTerminalRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiGetStoresUnderAccountConfig struct { - ctx context.Context + ctx context.Context getStoresUnderAccountRequest *GetStoresUnderAccountRequest } @@ -107,13 +219,14 @@ func (r GeneralApiGetStoresUnderAccountConfig) GetStoresUnderAccountRequest(getS return r } + /* GetStoresUnderAccount Get the stores of an account Returns a list of stores associated with a company account or a merchant account, including the status of each store. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GeneralApiGetStoresUnderAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GeneralApiGetStoresUnderAccountConfig */ func (a *GeneralApi) GetStoresUnderAccountConfig(ctx context.Context) GeneralApiGetStoresUnderAccountConfig { return GeneralApiGetStoresUnderAccountConfig{ @@ -124,20 +237,75 @@ func (a *GeneralApi) GetStoresUnderAccountConfig(ctx context.Context) GeneralApi /* Get the stores of an account Returns a list of stores associated with a company account or a merchant account, including the status of each store. - * @param req GetStoresUnderAccountRequest - reference of GetStoresUnderAccountRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req GetStoresUnderAccountRequest - reference of GetStoresUnderAccountRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetStoresUnderAccountResponse */ func (a *GeneralApi) GetStoresUnderAccount(r GeneralApiGetStoresUnderAccountConfig) (GetStoresUnderAccountResponse, *_nethttp.Response, error) { - res := &GetStoresUnderAccountResponse{} + var serviceError common.RestServiceError + res := &GetStoresUnderAccountResponse{} path := "/getStoresUnderAccount" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.getStoresUnderAccountRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.getStoresUnderAccountRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiGetTerminalDetailsConfig struct { - ctx context.Context + ctx context.Context getTerminalDetailsRequest *GetTerminalDetailsRequest } @@ -146,13 +314,14 @@ func (r GeneralApiGetTerminalDetailsConfig) GetTerminalDetailsRequest(getTermina return r } + /* GetTerminalDetails Get the details of a terminal Returns the details of a payment terminal, including where the terminal is assigned to. The response returns the same details that are provided in the terminal list in your Customer Area and in the Terminal Fleet report. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GeneralApiGetTerminalDetailsConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GeneralApiGetTerminalDetailsConfig */ func (a *GeneralApi) GetTerminalDetailsConfig(ctx context.Context) GeneralApiGetTerminalDetailsConfig { return GeneralApiGetTerminalDetailsConfig{ @@ -163,20 +332,75 @@ func (a *GeneralApi) GetTerminalDetailsConfig(ctx context.Context) GeneralApiGet /* Get the details of a terminal Returns the details of a payment terminal, including where the terminal is assigned to. The response returns the same details that are provided in the terminal list in your Customer Area and in the Terminal Fleet report. - * @param req GetTerminalDetailsRequest - reference of GetTerminalDetailsRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req GetTerminalDetailsRequest - reference of GetTerminalDetailsRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetTerminalDetailsResponse */ func (a *GeneralApi) GetTerminalDetails(r GeneralApiGetTerminalDetailsConfig) (GetTerminalDetailsResponse, *_nethttp.Response, error) { - res := &GetTerminalDetailsResponse{} + var serviceError common.RestServiceError + res := &GetTerminalDetailsResponse{} path := "/getTerminalDetails" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.getTerminalDetailsRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.getTerminalDetailsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiGetTerminalsUnderAccountConfig struct { - ctx context.Context + ctx context.Context getTerminalsUnderAccountRequest *GetTerminalsUnderAccountRequest } @@ -185,13 +409,14 @@ func (r GeneralApiGetTerminalsUnderAccountConfig) GetTerminalsUnderAccountReques return r } + /* GetTerminalsUnderAccount Get the list of terminals Returns a list of payment terminals associated with a company account, merchant account, or store. The response shows whether the terminals are in the inventory, or in-store (ready for boarding or already boarded). - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return GeneralApiGetTerminalsUnderAccountConfig + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GeneralApiGetTerminalsUnderAccountConfig */ func (a *GeneralApi) GetTerminalsUnderAccountConfig(ctx context.Context) GeneralApiGetTerminalsUnderAccountConfig { return GeneralApiGetTerminalsUnderAccountConfig{ @@ -202,14 +427,69 @@ func (a *GeneralApi) GetTerminalsUnderAccountConfig(ctx context.Context) General /* Get the list of terminals Returns a list of payment terminals associated with a company account, merchant account, or store. The response shows whether the terminals are in the inventory, or in-store (ready for boarding or already boarded). - * @param req GetTerminalsUnderAccountRequest - reference of GetTerminalsUnderAccountRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req GetTerminalsUnderAccountRequest - reference of GetTerminalsUnderAccountRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return GetTerminalsUnderAccountResponse */ func (a *GeneralApi) GetTerminalsUnderAccount(r GeneralApiGetTerminalsUnderAccountConfig) (GetTerminalsUnderAccountResponse, *_nethttp.Response, error) { - res := &GetTerminalsUnderAccountResponse{} + var serviceError common.RestServiceError + res := &GetTerminalsUnderAccountResponse{} path := "/getTerminalsUnderAccount" - httpRes, err := common.CreateHTTPRequest(a.Client, _nethttp.MethodPost, r.getTerminalsUnderAccountRequest, res, a.BasePath()+path, []_context.Context{r.ctx}) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.getTerminalsUnderAccountRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/posterminalmanagement/model_address.go b/src/posterminalmanagement/model_address.go index 8d91c9725..21df11371 100644 --- a/src/posterminalmanagement/model_address.go +++ b/src/posterminalmanagement/model_address.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -19,12 +18,12 @@ var _ common.MappedNullable = &Address{} // Address struct for Address type Address struct { - City *string `json:"city,omitempty"` - CountryCode *string `json:"countryCode,omitempty"` - PostalCode *string `json:"postalCode,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + PostalCode *string `json:"postalCode,omitempty"` StateOrProvince *string `json:"stateOrProvince,omitempty"` - StreetAddress *string `json:"streetAddress,omitempty"` - StreetAddress2 *string `json:"streetAddress2,omitempty"` + StreetAddress *string `json:"streetAddress,omitempty"` + StreetAddress2 *string `json:"streetAddress2,omitempty"` } // NewAddress instantiates a new Address object @@ -237,7 +236,7 @@ func (o *Address) SetStreetAddress2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_assign_terminals_request.go b/src/posterminalmanagement/model_assign_terminals_request.go index 6fea580c2..2ec769e75 100644 --- a/src/posterminalmanagement/model_assign_terminals_request.go +++ b/src/posterminalmanagement/model_assign_terminals_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AssignTerminalsRequest type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *AssignTerminalsRequest) SetTerminals(v []string) { } func (o AssignTerminalsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableAssignTerminalsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_assign_terminals_response.go b/src/posterminalmanagement/model_assign_terminals_response.go index f67e3cf26..efdb48d75 100644 --- a/src/posterminalmanagement/model_assign_terminals_response.go +++ b/src/posterminalmanagement/model_assign_terminals_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AssignTerminalsResponse type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &AssignTerminalsResponse{} // AssignTerminalsResponse struct for AssignTerminalsResponse type AssignTerminalsResponse struct { - // Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. + // Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. Results map[string]string `json:"results"` } @@ -66,7 +65,7 @@ func (o *AssignTerminalsResponse) SetResults(v map[string]string) { } func (o AssignTerminalsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableAssignTerminalsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_find_terminal_request.go b/src/posterminalmanagement/model_find_terminal_request.go index 01ea44598..0c68d3272 100644 --- a/src/posterminalmanagement/model_find_terminal_request.go +++ b/src/posterminalmanagement/model_find_terminal_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FindTerminalRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *FindTerminalRequest) SetTerminal(v string) { } func (o FindTerminalRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableFindTerminalRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_find_terminal_response.go b/src/posterminalmanagement/model_find_terminal_response.go index 2d9d24e55..a5a05450f 100644 --- a/src/posterminalmanagement/model_find_terminal_response.go +++ b/src/posterminalmanagement/model_find_terminal_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the FindTerminalResponse type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *FindTerminalResponse) SetTerminal(v string) { } func (o FindTerminalResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableFindTerminalResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_stores_under_account_request.go b/src/posterminalmanagement/model_get_stores_under_account_request.go index 623b0cea2..cfaf6cb40 100644 --- a/src/posterminalmanagement/model_get_stores_under_account_request.go +++ b/src/posterminalmanagement/model_get_stores_under_account_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetStoresUnderAccountRequest type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *GetStoresUnderAccountRequest) SetMerchantAccount(v string) { } func (o GetStoresUnderAccountRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableGetStoresUnderAccountRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_stores_under_account_response.go b/src/posterminalmanagement/model_get_stores_under_account_response.go index 68cdc3735..bcb312de2 100644 --- a/src/posterminalmanagement/model_get_stores_under_account_response.go +++ b/src/posterminalmanagement/model_get_stores_under_account_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetStoresUnderAccountResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetStoresUnderAccountResponse) SetStores(v []Store) { } func (o GetStoresUnderAccountResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetStoresUnderAccountResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminal_details_request.go b/src/posterminalmanagement/model_get_terminal_details_request.go index e0ee847f9..fc878a846 100644 --- a/src/posterminalmanagement/model_get_terminal_details_request.go +++ b/src/posterminalmanagement/model_get_terminal_details_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTerminalDetailsRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GetTerminalDetailsRequest) SetTerminal(v string) { } func (o GetTerminalDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGetTerminalDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminal_details_response.go b/src/posterminalmanagement/model_get_terminal_details_response.go index 2e0f8e385..950354432 100644 --- a/src/posterminalmanagement/model_get_terminal_details_response.go +++ b/src/posterminalmanagement/model_get_terminal_details_response.go @@ -10,9 +10,8 @@ package posterminalmanagement import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTerminalDetailsResponse type satisfies the MappedNullable interface at compile time @@ -59,8 +58,8 @@ type GetTerminalDetailsResponse struct { // On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. SimStatus *string `json:"simStatus,omitempty"` // The store code of the store that the terminal is assigned to. - Store *string `json:"store,omitempty"` - StoreDetails *Store `json:"storeDetails,omitempty"` + Store *string `json:"store,omitempty"` + StoreDetails *Store `json:"storeDetails,omitempty"` // The unique terminal ID. Terminal string `json:"terminal"` // The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. @@ -875,7 +874,7 @@ func (o *GetTerminalDetailsResponse) SetWifiMac(v string) { } func (o GetTerminalDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -994,12 +993,14 @@ func (v *NullableGetTerminalDetailsResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GetTerminalDetailsResponse) isValidTerminalStatus() bool { - var allowedEnumValues = []string{"OnlineLast1Day", "OnlineLast2Days", "OnlineLast3Days", "OnlineLast4Days", "OnlineLast5Days", "OnlineLast6Days", "OnlineLast7Days", "OnlineToday", "ReAssignToInventoryPending", "ReAssignToMerchantInventoryPending", "ReAssignToStorePending", "SwitchedOff"} - for _, allowed := range allowedEnumValues { - if o.GetTerminalStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "OnlineLast1Day", "OnlineLast2Days", "OnlineLast3Days", "OnlineLast4Days", "OnlineLast5Days", "OnlineLast6Days", "OnlineLast7Days", "OnlineToday", "ReAssignToInventoryPending", "ReAssignToMerchantInventoryPending", "ReAssignToStorePending", "SwitchedOff" } + for _, allowed := range allowedEnumValues { + if o.GetTerminalStatus() == allowed { + return true + } + } + return false } + diff --git a/src/posterminalmanagement/model_get_terminals_under_account_request.go b/src/posterminalmanagement/model_get_terminals_under_account_request.go index 135094a3b..bdb0e065d 100644 --- a/src/posterminalmanagement/model_get_terminals_under_account_request.go +++ b/src/posterminalmanagement/model_get_terminals_under_account_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTerminalsUnderAccountRequest type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *GetTerminalsUnderAccountRequest) SetStore(v string) { } func (o GetTerminalsUnderAccountRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableGetTerminalsUnderAccountRequest) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminals_under_account_response.go b/src/posterminalmanagement/model_get_terminals_under_account_response.go index 8e697d338..cea0c0ef7 100644 --- a/src/posterminalmanagement/model_get_terminals_under_account_response.go +++ b/src/posterminalmanagement/model_get_terminals_under_account_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the GetTerminalsUnderAccountResponse type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *GetTerminalsUnderAccountResponse) SetMerchantAccounts(v []MerchantAccou } func (o GetTerminalsUnderAccountResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableGetTerminalsUnderAccountResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_merchant_account.go b/src/posterminalmanagement/model_merchant_account.go index dbe70fa5c..e44a1d483 100644 --- a/src/posterminalmanagement/model_merchant_account.go +++ b/src/posterminalmanagement/model_merchant_account.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantAccount type satisfies the MappedNullable interface at compile time @@ -168,7 +167,7 @@ func (o *MerchantAccount) SetStores(v []Store) { } func (o MerchantAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -225,3 +224,6 @@ func (v *NullableMerchantAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_service_error.go b/src/posterminalmanagement/model_service_error.go index 7035c852e..b57e6d5e1 100644 --- a/src/posterminalmanagement/model_service_error.go +++ b/src/posterminalmanagement/model_service_error.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_store.go b/src/posterminalmanagement/model_store.go index 460e2f6ee..c4a07177a 100644 --- a/src/posterminalmanagement/model_store.go +++ b/src/posterminalmanagement/model_store.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Store type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type Store struct { InStoreTerminals []string `json:"inStoreTerminals,omitempty"` // The code of the merchant account. MerchantAccountCode *string `json:"merchantAccountCode,omitempty"` - // The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. + // The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. Status *string `json:"status,omitempty"` // The code of the store. Store string `json:"store"` @@ -235,7 +234,7 @@ func (o *Store) SetStore(v string) { } func (o Store) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -298,3 +297,6 @@ func (v *NullableStore) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/api_general.go b/src/recurring/api_general.go index 8c25731e7..9d08b5b3c 100644 --- a/src/recurring/api_general.go +++ b/src/recurring/api_general.go @@ -10,34 +10,36 @@ package recurring import ( "context" - _nethttp "net/http" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GeneralApi GeneralApi service type GeneralApi common.Service -type CreatePermitConfig struct { - ctx context.Context +type GeneralApiCreatePermitConfig struct { + ctx context.Context createPermitRequest *CreatePermitRequest } -func (r CreatePermitConfig) CreatePermitRequest(createPermitRequest CreatePermitRequest) CreatePermitConfig { +func (r GeneralApiCreatePermitConfig) CreatePermitRequest(createPermitRequest CreatePermitRequest) GeneralApiCreatePermitConfig { r.createPermitRequest = &createPermitRequest return r } + /* CreatePermit Create new permits linked to a recurring contract. Create permits for a recurring contract, including support for defining restrictions. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreatePermitConfig + @return GeneralApiCreatePermitConfig */ -func (a *GeneralApi) CreatePermitConfig(ctx context.Context) CreatePermitConfig { - return CreatePermitConfig{ +func (a *GeneralApi) CreatePermitConfig(ctx context.Context) GeneralApiCreatePermitConfig { + return GeneralApiCreatePermitConfig{ ctx: ctx, } } @@ -45,28 +47,84 @@ func (a *GeneralApi) CreatePermitConfig(ctx context.Context) CreatePermitConfig /* Create new permits linked to a recurring contract. Create permits for a recurring contract, including support for defining restrictions. - * @param req CreatePermitRequest - reference of CreatePermitRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req CreatePermitRequest - reference of CreatePermitRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return CreatePermitResult */ -func (a *GeneralApi) CreatePermit(r CreatePermitConfig) (CreatePermitResult, *_nethttp.Response, error) { - res := &CreatePermitResult{} +func (a *GeneralApi) CreatePermit(r GeneralApiCreatePermitConfig) (CreatePermitResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &CreatePermitResult{} path := "/createPermit" - httpRes, err := a.Client.MakeHTTPPostRequest(r.createPermitRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.createPermitRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type DisableConfig struct { - ctx context.Context + +type GeneralApiDisableConfig struct { + ctx context.Context disableRequest *DisableRequest } -func (r DisableConfig) DisableRequest(disableRequest DisableRequest) DisableConfig { +func (r GeneralApiDisableConfig) DisableRequest(disableRequest DisableRequest) GeneralApiDisableConfig { r.disableRequest = &disableRequest return r } + /* Disable Disable stored payment details @@ -75,10 +133,10 @@ Disables stored payment details to stop charging a shopper with this particular For more information, refer to [Disable stored details](https://docs.adyen.com/classic-integration/recurring-payments/disable-stored-details/). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DisableConfig + @return GeneralApiDisableConfig */ -func (a *GeneralApi) DisableConfig(ctx context.Context) DisableConfig { - return DisableConfig{ +func (a *GeneralApi) DisableConfig(ctx context.Context) GeneralApiDisableConfig { + return GeneralApiDisableConfig{ ctx: ctx, } } @@ -86,38 +144,94 @@ func (a *GeneralApi) DisableConfig(ctx context.Context) DisableConfig { /* Disable stored payment details Disables stored payment details to stop charging a shopper with this particular recurring detail ID. For more information, refer to [Disable stored details](https://docs.adyen.com/classic-integration/recurring-payments/disable-stored-details/). - * @param req DisableRequest - reference of DisableRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req DisableRequest - reference of DisableRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return DisableResult */ -func (a *GeneralApi) Disable(r DisableConfig) (DisableResult, *_nethttp.Response, error) { - res := &DisableResult{} +func (a *GeneralApi) Disable(r GeneralApiDisableConfig) (DisableResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &DisableResult{} path := "/disable" - httpRes, err := a.Client.MakeHTTPPostRequest(r.disableRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.disableRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type DisablePermitConfig struct { - ctx context.Context + +type GeneralApiDisablePermitConfig struct { + ctx context.Context disablePermitRequest *DisablePermitRequest } -func (r DisablePermitConfig) DisablePermitRequest(disablePermitRequest DisablePermitRequest) DisablePermitConfig { +func (r GeneralApiDisablePermitConfig) DisablePermitRequest(disablePermitRequest DisablePermitRequest) GeneralApiDisablePermitConfig { r.disablePermitRequest = &disablePermitRequest return r } + /* DisablePermit Disable an existing permit. Disable a permit that was previously linked to a recurringDetailReference. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DisablePermitConfig + @return GeneralApiDisablePermitConfig */ -func (a *GeneralApi) DisablePermitConfig(ctx context.Context) DisablePermitConfig { - return DisablePermitConfig{ +func (a *GeneralApi) DisablePermitConfig(ctx context.Context) GeneralApiDisablePermitConfig { + return GeneralApiDisablePermitConfig{ ctx: ctx, } } @@ -125,28 +239,84 @@ func (a *GeneralApi) DisablePermitConfig(ctx context.Context) DisablePermitConfi /* Disable an existing permit. Disable a permit that was previously linked to a recurringDetailReference. - * @param req DisablePermitRequest - reference of DisablePermitRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req DisablePermitRequest - reference of DisablePermitRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return DisablePermitResult */ -func (a *GeneralApi) DisablePermit(r DisablePermitConfig) (DisablePermitResult, *_nethttp.Response, error) { - res := &DisablePermitResult{} +func (a *GeneralApi) DisablePermit(r GeneralApiDisablePermitConfig) (DisablePermitResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &DisablePermitResult{} path := "/disablePermit" - httpRes, err := a.Client.MakeHTTPPostRequest(r.disablePermitRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.disablePermitRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type ListRecurringDetailsConfig struct { - ctx context.Context + +type GeneralApiListRecurringDetailsConfig struct { + ctx context.Context recurringDetailsRequest *RecurringDetailsRequest } -func (r ListRecurringDetailsConfig) RecurringDetailsRequest(recurringDetailsRequest RecurringDetailsRequest) ListRecurringDetailsConfig { +func (r GeneralApiListRecurringDetailsConfig) RecurringDetailsRequest(recurringDetailsRequest RecurringDetailsRequest) GeneralApiListRecurringDetailsConfig { r.recurringDetailsRequest = &recurringDetailsRequest return r } + /* ListRecurringDetails Get stored payment details @@ -155,10 +325,10 @@ Lists the stored payment details for a shopper, if there are any available. The For more information, refer to [Retrieve stored details](https://docs.adyen.com/classic-integration/recurring-payments/retrieve-stored-details/). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ListRecurringDetailsConfig + @return GeneralApiListRecurringDetailsConfig */ -func (a *GeneralApi) ListRecurringDetailsConfig(ctx context.Context) ListRecurringDetailsConfig { - return ListRecurringDetailsConfig{ +func (a *GeneralApi) ListRecurringDetailsConfig(ctx context.Context) GeneralApiListRecurringDetailsConfig { + return GeneralApiListRecurringDetailsConfig{ ctx: ctx, } } @@ -166,38 +336,94 @@ func (a *GeneralApi) ListRecurringDetailsConfig(ctx context.Context) ListRecurri /* Get stored payment details Lists the stored payment details for a shopper, if there are any available. The recurring detail ID can be used with a regular authorisation request to charge the shopper. A summary of the payment detail is returned for presentation to the shopper. For more information, refer to [Retrieve stored details](https://docs.adyen.com/classic-integration/recurring-payments/retrieve-stored-details/). - * @param req RecurringDetailsRequest - reference of RecurringDetailsRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req RecurringDetailsRequest - reference of RecurringDetailsRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return RecurringDetailsResult */ -func (a *GeneralApi) ListRecurringDetails(r ListRecurringDetailsConfig) (RecurringDetailsResult, *_nethttp.Response, error) { - res := &RecurringDetailsResult{} +func (a *GeneralApi) ListRecurringDetails(r GeneralApiListRecurringDetailsConfig) (RecurringDetailsResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &RecurringDetailsResult{} path := "/listRecurringDetails" - httpRes, err := a.Client.MakeHTTPPostRequest(r.recurringDetailsRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.recurringDetailsRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type NotifyShopperConfig struct { - ctx context.Context + +type GeneralApiNotifyShopperConfig struct { + ctx context.Context notifyShopperRequest *NotifyShopperRequest } -func (r NotifyShopperConfig) NotifyShopperRequest(notifyShopperRequest NotifyShopperRequest) NotifyShopperConfig { +func (r GeneralApiNotifyShopperConfig) NotifyShopperRequest(notifyShopperRequest NotifyShopperRequest) GeneralApiNotifyShopperConfig { r.notifyShopperRequest = ¬ifyShopperRequest return r } + /* NotifyShopper Ask issuer to notify the shopper Sends a request to the issuer so they can inform the shopper about the upcoming recurring payment. This endpoint is used only for local acquiring in India. For more information, refer to [Recurring card payments in India](https://docs.adyen.com/payment-methods/cards/cards-recurring-india). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return NotifyShopperConfig + @return GeneralApiNotifyShopperConfig */ -func (a *GeneralApi) NotifyShopperConfig(ctx context.Context) NotifyShopperConfig { - return NotifyShopperConfig{ +func (a *GeneralApi) NotifyShopperConfig(ctx context.Context) GeneralApiNotifyShopperConfig { + return GeneralApiNotifyShopperConfig{ ctx: ctx, } } @@ -205,28 +431,84 @@ func (a *GeneralApi) NotifyShopperConfig(ctx context.Context) NotifyShopperConfi /* Ask issuer to notify the shopper Sends a request to the issuer so they can inform the shopper about the upcoming recurring payment. This endpoint is used only for local acquiring in India. For more information, refer to [Recurring card payments in India](https://docs.adyen.com/payment-methods/cards/cards-recurring-india). - * @param req NotifyShopperRequest - reference of NotifyShopperRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req NotifyShopperRequest - reference of NotifyShopperRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return NotifyShopperResult */ -func (a *GeneralApi) NotifyShopper(r NotifyShopperConfig) (NotifyShopperResult, *_nethttp.Response, error) { - res := &NotifyShopperResult{} +func (a *GeneralApi) NotifyShopper(r GeneralApiNotifyShopperConfig) (NotifyShopperResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &NotifyShopperResult{} path := "/notifyShopper" - httpRes, err := a.Client.MakeHTTPPostRequest(r.notifyShopperRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.notifyShopperRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } -type ScheduleAccountUpdaterConfig struct { - ctx context.Context + +type GeneralApiScheduleAccountUpdaterConfig struct { + ctx context.Context scheduleAccountUpdaterRequest *ScheduleAccountUpdaterRequest } -func (r ScheduleAccountUpdaterConfig) ScheduleAccountUpdaterRequest(scheduleAccountUpdaterRequest ScheduleAccountUpdaterRequest) ScheduleAccountUpdaterConfig { +func (r GeneralApiScheduleAccountUpdaterConfig) ScheduleAccountUpdaterRequest(scheduleAccountUpdaterRequest ScheduleAccountUpdaterRequest) GeneralApiScheduleAccountUpdaterConfig { r.scheduleAccountUpdaterRequest = &scheduleAccountUpdaterRequest return r } + /* ScheduleAccountUpdater Schedule running the Account Updater @@ -235,10 +517,10 @@ When making the API call, you can submit either the credit card information, or * If the recurring detail reference is provided, the fields for `shopperReference` and `selectedRecurringDetailReference` are mandatory. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ScheduleAccountUpdaterConfig + @return GeneralApiScheduleAccountUpdaterConfig */ -func (a *GeneralApi) ScheduleAccountUpdaterConfig(ctx context.Context) ScheduleAccountUpdaterConfig { - return ScheduleAccountUpdaterConfig{ +func (a *GeneralApi) ScheduleAccountUpdaterConfig(ctx context.Context) GeneralApiScheduleAccountUpdaterConfig { + return GeneralApiScheduleAccountUpdaterConfig{ ctx: ctx, } } @@ -246,14 +528,69 @@ func (a *GeneralApi) ScheduleAccountUpdaterConfig(ctx context.Context) ScheduleA /* Schedule running the Account Updater When making the API call, you can submit either the credit card information, or the recurring detail reference and the shopper reference: * If the card information is provided, all the sub-fields for `card` are mandatory. * If the recurring detail reference is provided, the fields for `shopperReference` and `selectedRecurringDetailReference` are mandatory. - * @param req ScheduleAccountUpdaterRequest - reference of ScheduleAccountUpdaterRequest). - * @param ctxs ..._context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param req ScheduleAccountUpdaterRequest - reference of ScheduleAccountUpdaterRequest). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ScheduleAccountUpdaterResult */ -func (a *GeneralApi) ScheduleAccountUpdater(r ScheduleAccountUpdaterConfig) (ScheduleAccountUpdaterResult, *_nethttp.Response, error) { - res := &ScheduleAccountUpdaterResult{} +func (a *GeneralApi) ScheduleAccountUpdater(r GeneralApiScheduleAccountUpdaterConfig) (ScheduleAccountUpdaterResult, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &ScheduleAccountUpdaterResult{} path := "/scheduleAccountUpdater" - httpRes, err := a.Client.MakeHTTPPostRequest(r.scheduleAccountUpdaterRequest, res, a.BasePath()+path, r.ctx) - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.scheduleAccountUpdaterRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/recurring/model_address.go b/src/recurring/model_address.go index 891112b35..3e6e58a50 100644 --- a/src/recurring/model_address.go +++ b/src/recurring/model_address.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_amount.go b/src/recurring/model_amount.go index 0cd5f18b4..27916a397 100644 --- a/src/recurring/model_amount.go +++ b/src/recurring/model_amount.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_bank_account.go b/src/recurring/model_bank_account.go index 4675c6e72..ad6b22d73 100644 --- a/src/recurring/model_bank_account.go +++ b/src/recurring/model_bank_account.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_card.go b/src/recurring/model_card.go index ce236c20f..93263cbee 100644 --- a/src/recurring/model_card.go +++ b/src/recurring/model_card.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_create_permit_request.go b/src/recurring/model_create_permit_request.go index 1808a76e3..102b8d772 100644 --- a/src/recurring/model_create_permit_request.go +++ b/src/recurring/model_create_permit_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePermitRequest type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *CreatePermitRequest) SetShopperReference(v string) { } func (o CreatePermitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableCreatePermitRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_create_permit_result.go b/src/recurring/model_create_permit_result.go index dd7858a66..88c1b111a 100644 --- a/src/recurring/model_create_permit_result.go +++ b/src/recurring/model_create_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CreatePermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CreatePermitResult) SetPspReference(v string) { } func (o CreatePermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCreatePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_permit_request.go b/src/recurring/model_disable_permit_request.go index fea894e33..f89852088 100644 --- a/src/recurring/model_disable_permit_request.go +++ b/src/recurring/model_disable_permit_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DisablePermitRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *DisablePermitRequest) SetToken(v string) { } func (o DisablePermitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableDisablePermitRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_permit_result.go b/src/recurring/model_disable_permit_result.go index 1b51bef99..e7b513316 100644 --- a/src/recurring/model_disable_permit_result.go +++ b/src/recurring/model_disable_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DisablePermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *DisablePermitResult) SetStatus(v string) { } func (o DisablePermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableDisablePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_request.go b/src/recurring/model_disable_request.go index f05ae065b..0290276b3 100644 --- a/src/recurring/model_disable_request.go +++ b/src/recurring/model_disable_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DisableRequest type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *DisableRequest) SetShopperReference(v string) { } func (o DisableRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableDisableRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_result.go b/src/recurring/model_disable_result.go index fe287a9f5..d31b077a3 100644 --- a/src/recurring/model_disable_result.go +++ b/src/recurring/model_disable_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DisableResult type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *DisableResult) SetResponse(v string) { } func (o DisableResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableDisableResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_name.go b/src/recurring/model_name.go index 2dcbd671c..55fd78b9e 100644 --- a/src/recurring/model_name.go +++ b/src/recurring/model_name.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_notify_shopper_request.go b/src/recurring/model_notify_shopper_request.go index 712cfa26b..f9609afd3 100644 --- a/src/recurring/model_notify_shopper_request.go +++ b/src/recurring/model_notify_shopper_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NotifyShopperRequest type satisfies the MappedNullable interface at compile time @@ -316,7 +315,7 @@ func (o *NotifyShopperRequest) SetStoredPaymentMethodId(v string) { } func (o NotifyShopperRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableNotifyShopperRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_notify_shopper_result.go b/src/recurring/model_notify_shopper_result.go index 1f56f4759..e10cd81e8 100644 --- a/src/recurring/model_notify_shopper_result.go +++ b/src/recurring/model_notify_shopper_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NotifyShopperResult type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *NotifyShopperResult) SetStoredPaymentMethodId(v string) { } func (o NotifyShopperResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableNotifyShopperResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit.go b/src/recurring/model_permit.go index 12dee4bcb..652ca3230 100644 --- a/src/recurring/model_permit.go +++ b/src/recurring/model_permit.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Permit type satisfies the MappedNullable interface at compile time @@ -23,8 +22,8 @@ type Permit struct { // Partner ID (when using the permit-per-partner token sharing model). PartnerId *string `json:"partnerId,omitempty"` // The profile to apply to this permit (when using the shared permits model). - ProfileReference *string `json:"profileReference,omitempty"` - Restriction *PermitRestriction `json:"restriction,omitempty"` + ProfileReference *string `json:"profileReference,omitempty"` + Restriction *PermitRestriction `json:"restriction,omitempty"` // The key to link permit requests to permit results. ResultKey *string `json:"resultKey,omitempty"` // The expiry date for this permit. @@ -209,7 +208,7 @@ func (o *Permit) SetValidTillDate(v time.Time) { } func (o Permit) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullablePermit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit_restriction.go b/src/recurring/model_permit_restriction.go index 21603ed08..eaaea4e72 100644 --- a/src/recurring/model_permit_restriction.go +++ b/src/recurring/model_permit_restriction.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PermitRestriction type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &PermitRestriction{} // PermitRestriction struct for PermitRestriction type PermitRestriction struct { - MaxAmount *Amount `json:"maxAmount,omitempty"` + MaxAmount *Amount `json:"maxAmount,omitempty"` SingleTransactionLimit *Amount `json:"singleTransactionLimit,omitempty"` // Only a single payment can be made using this permit if set to true, otherwise multiple payments are allowed. SingleUse *bool `json:"singleUse,omitempty"` @@ -139,7 +138,7 @@ func (o *PermitRestriction) SetSingleUse(v bool) { } func (o PermitRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,3 +194,6 @@ func (v *NullablePermitRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit_result.go b/src/recurring/model_permit_result.go index 08e1500fa..3d181d450 100644 --- a/src/recurring/model_permit_result.go +++ b/src/recurring/model_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PermitResult) SetToken(v string) { } func (o PermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring.go b/src/recurring/model_recurring.go index 389cd71b0..4ef181e7c 100644 --- a/src/recurring/model_recurring.go +++ b/src/recurring/model_recurring.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/recurring/model_recurring_detail.go b/src/recurring/model_recurring_detail.go index 43aa4ba2e..3e04510d6 100644 --- a/src/recurring/model_recurring_detail.go +++ b/src/recurring/model_recurring_detail.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RecurringDetail type satisfies the MappedNullable interface at compile time @@ -25,10 +24,10 @@ type RecurringDetail struct { // The alias of the credit card number. Applies only to recurring contracts storing credit card details Alias *string `json:"alias,omitempty"` // The alias type of the credit card number. Applies only to recurring contracts storing credit card details. - AliasType *string `json:"aliasType,omitempty"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + AliasType *string `json:"aliasType,omitempty"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Types of recurring contracts. ContractTypes []string `json:"contractTypes,omitempty"` // The date when the recurring details were created. @@ -43,10 +42,10 @@ type RecurringDetail struct { PaymentMethodVariant *string `json:"paymentMethodVariant,omitempty"` // The reference that uniquely identifies the recurring detail. RecurringDetailReference string `json:"recurringDetailReference"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // A shopper's social security number (only in countries where it is legal to collect). - SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - TokenDetails *TokenDetails `json:"tokenDetails,omitempty"` + SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` + TokenDetails *TokenDetails `json:"tokenDetails,omitempty"` // The payment method, such as “mc\", \"visa\", \"ideal\", \"paypal\". Variant string `json:"variant"` } @@ -599,7 +598,7 @@ func (o *RecurringDetail) SetVariant(v string) { } func (o RecurringDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -693,3 +692,6 @@ func (v *NullableRecurringDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_detail_wrapper.go b/src/recurring/model_recurring_detail_wrapper.go index 2b48f730d..57bc460ff 100644 --- a/src/recurring/model_recurring_detail_wrapper.go +++ b/src/recurring/model_recurring_detail_wrapper.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RecurringDetailWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *RecurringDetailWrapper) SetRecurringDetail(v RecurringDetail) { } func (o RecurringDetailWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableRecurringDetailWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_details_request.go b/src/recurring/model_recurring_details_request.go index da20b2760..9936aa02f 100644 --- a/src/recurring/model_recurring_details_request.go +++ b/src/recurring/model_recurring_details_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RecurringDetailsRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &RecurringDetailsRequest{} // RecurringDetailsRequest struct for RecurringDetailsRequest type RecurringDetailsRequest struct { // The merchant account identifier you want to process the (transaction) request with. - MerchantAccount string `json:"merchantAccount"` - Recurring *Recurring `json:"recurring,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Recurring *Recurring `json:"recurring,omitempty"` // The reference you use to uniquely identify the shopper (e.g. user ID or account ID). ShopperReference string `json:"shopperReference"` } @@ -126,7 +125,7 @@ func (o *RecurringDetailsRequest) SetShopperReference(v string) { } func (o RecurringDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -178,3 +177,6 @@ func (v *NullableRecurringDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_details_result.go b/src/recurring/model_recurring_details_result.go index 3ad81fd62..2a8b9d6b3 100644 --- a/src/recurring/model_recurring_details_result.go +++ b/src/recurring/model_recurring_details_result.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RecurringDetailsResult type satisfies the MappedNullable interface at compile time @@ -176,7 +175,7 @@ func (o *RecurringDetailsResult) SetShopperReference(v string) { } func (o RecurringDetailsResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableRecurringDetailsResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_schedule_account_updater_request.go b/src/recurring/model_schedule_account_updater_request.go index 721074743..366dd5e4d 100644 --- a/src/recurring/model_schedule_account_updater_request.go +++ b/src/recurring/model_schedule_account_updater_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ScheduleAccountUpdaterRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &ScheduleAccountUpdaterRequest{} type ScheduleAccountUpdaterRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // Account of the merchant. MerchantAccount string `json:"merchantAccount"` // A reference that merchants can apply for the call. @@ -228,7 +227,7 @@ func (o *ScheduleAccountUpdaterRequest) SetShopperReference(v string) { } func (o ScheduleAccountUpdaterRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -289,3 +288,6 @@ func (v *NullableScheduleAccountUpdaterRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_schedule_account_updater_result.go b/src/recurring/model_schedule_account_updater_result.go index 97b805e73..6561e8352 100644 --- a/src/recurring/model_schedule_account_updater_result.go +++ b/src/recurring/model_schedule_account_updater_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ScheduleAccountUpdaterResult type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *ScheduleAccountUpdaterResult) SetResult(v string) { } func (o ScheduleAccountUpdaterResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableScheduleAccountUpdaterResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_service_error.go b/src/recurring/model_service_error.go index 7bd09da77..64e87a384 100644 --- a/src/recurring/model_service_error.go +++ b/src/recurring/model_service_error.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_token_details.go b/src/recurring/model_token_details.go index bf59556dc..fbcc6512d 100644 --- a/src/recurring/model_token_details.go +++ b/src/recurring/model_token_details.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TokenDetails type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &TokenDetails{} // TokenDetails struct for TokenDetails type TokenDetails struct { - TokenData *map[string]string `json:"tokenData,omitempty"` - TokenDataType *string `json:"tokenDataType,omitempty"` + TokenData *map[string]string `json:"tokenData,omitempty"` + TokenDataType *string `json:"tokenDataType,omitempty"` } // NewTokenDetails instantiates a new TokenDetails object @@ -105,7 +104,7 @@ func (o *TokenDetails) SetTokenDataType(v string) { } func (o TokenDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableTokenDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/api_general.go b/src/storedvalue/api_general.go index e698dbb0c..463028e11 100644 --- a/src/storedvalue/api_general.go +++ b/src/storedvalue/api_general.go @@ -10,17 +10,17 @@ package storedvalue import ( "context" - _nethttp "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // GeneralApi GeneralApi service type GeneralApi common.Service type GeneralApiChangeStatusConfig struct { - ctx context.Context + ctx context.Context storedValueStatusChangeRequest *StoredValueStatusChangeRequest } @@ -29,6 +29,7 @@ func (r GeneralApiChangeStatusConfig) StoredValueStatusChangeRequest(storedValue return r } + /* ChangeStatus Changes the status of the payment method. @@ -46,32 +47,67 @@ func (a *GeneralApi) ChangeStatusConfig(ctx context.Context) GeneralApiChangeSta /* Changes the status of the payment method. Changes the status of the provided payment method to the specified status. - * @param req StoredValueStatusChangeRequest - reference of StoredValueStatusChangeRequest). + * @param req StoredValueStatusChangeRequest - reference of StoredValueStatusChangeRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueStatusChangeResponse */ func (a *GeneralApi) ChangeStatus(r GeneralApiChangeStatusConfig) (StoredValueStatusChangeResponse, *_nethttp.Response, error) { - res := &StoredValueStatusChangeResponse{} + var serviceError common.RestServiceError + res := &StoredValueStatusChangeResponse{} path := "/changeStatus" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueStatusChangeRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueStatusChangeRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiCheckBalanceConfig struct { - ctx context.Context + ctx context.Context storedValueBalanceCheckRequest *StoredValueBalanceCheckRequest } @@ -80,6 +116,7 @@ func (r GeneralApiCheckBalanceConfig) StoredValueBalanceCheckRequest(storedValue return r } + /* CheckBalance Checks the balance. @@ -97,32 +134,67 @@ func (a *GeneralApi) CheckBalanceConfig(ctx context.Context) GeneralApiCheckBala /* Checks the balance. Checks the balance of the provided payment method. - * @param req StoredValueBalanceCheckRequest - reference of StoredValueBalanceCheckRequest). + * @param req StoredValueBalanceCheckRequest - reference of StoredValueBalanceCheckRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueBalanceCheckResponse */ func (a *GeneralApi) CheckBalance(r GeneralApiCheckBalanceConfig) (StoredValueBalanceCheckResponse, *_nethttp.Response, error) { - res := &StoredValueBalanceCheckResponse{} + var serviceError common.RestServiceError + res := &StoredValueBalanceCheckResponse{} path := "/checkBalance" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueBalanceCheckRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueBalanceCheckRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiIssueConfig struct { - ctx context.Context + ctx context.Context storedValueIssueRequest *StoredValueIssueRequest } @@ -131,6 +203,7 @@ func (r GeneralApiIssueConfig) StoredValueIssueRequest(storedValueIssueRequest S return r } + /* Issue Issues a new card. @@ -148,32 +221,67 @@ func (a *GeneralApi) IssueConfig(ctx context.Context) GeneralApiIssueConfig { /* Issues a new card. Issues a new card of the given payment method. - * @param req StoredValueIssueRequest - reference of StoredValueIssueRequest). + * @param req StoredValueIssueRequest - reference of StoredValueIssueRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueIssueResponse */ func (a *GeneralApi) Issue(r GeneralApiIssueConfig) (StoredValueIssueResponse, *_nethttp.Response, error) { - res := &StoredValueIssueResponse{} + var serviceError common.RestServiceError + res := &StoredValueIssueResponse{} path := "/issue" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueIssueRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueIssueRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiLoadConfig struct { - ctx context.Context + ctx context.Context storedValueLoadRequest *StoredValueLoadRequest } @@ -182,6 +290,7 @@ func (r GeneralApiLoadConfig) StoredValueLoadRequest(storedValueLoadRequest Stor return r } + /* Load Loads the payment method. @@ -199,32 +308,67 @@ func (a *GeneralApi) LoadConfig(ctx context.Context) GeneralApiLoadConfig { /* Loads the payment method. Loads the payment method with the specified funds. - * @param req StoredValueLoadRequest - reference of StoredValueLoadRequest). + * @param req StoredValueLoadRequest - reference of StoredValueLoadRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueLoadResponse */ func (a *GeneralApi) Load(r GeneralApiLoadConfig) (StoredValueLoadResponse, *_nethttp.Response, error) { - res := &StoredValueLoadResponse{} + var serviceError common.RestServiceError + res := &StoredValueLoadResponse{} path := "/load" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueLoadRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueLoadRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiMergeBalanceConfig struct { - ctx context.Context + ctx context.Context storedValueBalanceMergeRequest *StoredValueBalanceMergeRequest } @@ -233,6 +377,7 @@ func (r GeneralApiMergeBalanceConfig) StoredValueBalanceMergeRequest(storedValue return r } + /* MergeBalance Merge the balance of two cards. @@ -250,32 +395,67 @@ func (a *GeneralApi) MergeBalanceConfig(ctx context.Context) GeneralApiMergeBala /* Merge the balance of two cards. Increases the balance of the paymentmethod by the full amount left on the source paymentmethod - * @param req StoredValueBalanceMergeRequest - reference of StoredValueBalanceMergeRequest). + * @param req StoredValueBalanceMergeRequest - reference of StoredValueBalanceMergeRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueBalanceMergeResponse */ func (a *GeneralApi) MergeBalance(r GeneralApiMergeBalanceConfig) (StoredValueBalanceMergeResponse, *_nethttp.Response, error) { - res := &StoredValueBalanceMergeResponse{} + var serviceError common.RestServiceError + res := &StoredValueBalanceMergeResponse{} path := "/mergeBalance" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueBalanceMergeRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueBalanceMergeRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + type GeneralApiVoidTransactionConfig struct { - ctx context.Context + ctx context.Context storedValueVoidRequest *StoredValueVoidRequest } @@ -284,6 +464,7 @@ func (r GeneralApiVoidTransactionConfig) StoredValueVoidRequest(storedValueVoidR return r } + /* VoidTransaction Voids a transaction. @@ -301,26 +482,61 @@ func (a *GeneralApi) VoidTransactionConfig(ctx context.Context) GeneralApiVoidTr /* Voids a transaction. Voids the referenced stored value transaction. - * @param req StoredValueVoidRequest - reference of StoredValueVoidRequest). + * @param req StoredValueVoidRequest - reference of StoredValueVoidRequest). * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return StoredValueVoidResponse */ func (a *GeneralApi) VoidTransaction(r GeneralApiVoidTransactionConfig) (StoredValueVoidResponse, *_nethttp.Response, error) { - res := &StoredValueVoidResponse{} + var serviceError common.RestServiceError + res := &StoredValueVoidResponse{} path := "/voidTransaction" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - r.ctx, - a.Client, - r.storedValueVoidRequest, - res, - _nethttp.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.storedValueVoidRequest, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 400 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err } + diff --git a/src/storedvalue/model_amount.go b/src/storedvalue/model_amount.go index de4259e20..45c4a1916 100644 --- a/src/storedvalue/model_amount.go +++ b/src/storedvalue/model_amount.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_service_error.go b/src/storedvalue/model_service_error.go index 8325e04c3..75093feeb 100644 --- a/src/storedvalue/model_service_error.go +++ b/src/storedvalue/model_service_error.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_stored_value_balance_check_request.go b/src/storedvalue/model_stored_value_balance_check_request.go index 475a391b6..9143f0ca1 100644 --- a/src/storedvalue/model_stored_value_balance_check_request.go +++ b/src/storedvalue/model_stored_value_balance_check_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueBalanceCheckRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueBalanceCheckRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -287,7 +286,7 @@ func (o *StoredValueBalanceCheckRequest) SetStore(v string) { } func (o StoredValueBalanceCheckRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -353,12 +352,14 @@ func (v *NullableStoredValueBalanceCheckRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceCheckRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_check_response.go b/src/storedvalue/model_stored_value_balance_check_response.go index beaabdff0..36ebacb27 100644 --- a/src/storedvalue/model_stored_value_balance_check_response.go +++ b/src/storedvalue/model_stored_value_balance_check_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueBalanceCheckResponse type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type StoredValueBalanceCheckResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -208,7 +207,7 @@ func (o *StoredValueBalanceCheckResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueBalanceCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableStoredValueBalanceCheckResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceCheckResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_merge_request.go b/src/storedvalue/model_stored_value_balance_merge_request.go index a3a6ba039..97a20334b 100644 --- a/src/storedvalue/model_stored_value_balance_merge_request.go +++ b/src/storedvalue/model_stored_value_balance_merge_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueBalanceMergeRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueBalanceMergeRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method SourcePaymentMethod map[string]string `json:"sourcePaymentMethod"` // The physical store, for which this payment is processed. @@ -314,7 +313,7 @@ func (o *StoredValueBalanceMergeRequest) SetStore(v string) { } func (o StoredValueBalanceMergeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,12 +380,14 @@ func (v *NullableStoredValueBalanceMergeRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceMergeRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_merge_response.go b/src/storedvalue/model_stored_value_balance_merge_response.go index 3477acc9c..6057270c1 100644 --- a/src/storedvalue/model_stored_value_balance_merge_response.go +++ b/src/storedvalue/model_stored_value_balance_merge_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueBalanceMergeResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueBalanceMergeResponse{} // StoredValueBalanceMergeResponse struct for StoredValueBalanceMergeResponse type StoredValueBalanceMergeResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueBalanceMergeResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueBalanceMergeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueBalanceMergeResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceMergeResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_issue_request.go b/src/storedvalue/model_stored_value_issue_request.go index c013fc7dd..08f96557c 100644 --- a/src/storedvalue/model_stored_value_issue_request.go +++ b/src/storedvalue/model_stored_value_issue_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueIssueRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueIssueRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -287,7 +286,7 @@ func (o *StoredValueIssueRequest) SetStore(v string) { } func (o StoredValueIssueRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -353,12 +352,14 @@ func (v *NullableStoredValueIssueRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueIssueRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_issue_response.go b/src/storedvalue/model_stored_value_issue_response.go index b79c734ec..31c891284 100644 --- a/src/storedvalue/model_stored_value_issue_response.go +++ b/src/storedvalue/model_stored_value_issue_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueIssueResponse type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &StoredValueIssueResponse{} // StoredValueIssueResponse struct for StoredValueIssueResponse type StoredValueIssueResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // The collection that contains the type of the payment method and its specific information if available PaymentMethod *map[string]string `json:"paymentMethod,omitempty"` @@ -28,7 +27,7 @@ type StoredValueIssueResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -276,7 +275,7 @@ func (o *StoredValueIssueResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueIssueResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,12 +344,14 @@ func (v *NullableStoredValueIssueResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueIssueResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_load_request.go b/src/storedvalue/model_stored_value_load_request.go index 220db7429..96b445c03 100644 --- a/src/storedvalue/model_stored_value_load_request.go +++ b/src/storedvalue/model_stored_value_load_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueLoadRequest type satisfies the MappedNullable interface at compile time @@ -25,13 +24,13 @@ type StoredValueLoadRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -314,7 +313,7 @@ func (o *StoredValueLoadRequest) SetStore(v string) { } func (o StoredValueLoadRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,21 +380,23 @@ func (v *NullableStoredValueLoadRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueLoadRequest) isValidLoadType() bool { - var allowedEnumValues = []string{"merchandiseReturn", "load"} - for _, allowed := range allowedEnumValues { - if o.GetLoadType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "merchandiseReturn", "load" } + for _, allowed := range allowedEnumValues { + if o.GetLoadType() == allowed { + return true + } + } + return false } func (o *StoredValueLoadRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_load_response.go b/src/storedvalue/model_stored_value_load_response.go index 366dc25ed..e99913cf9 100644 --- a/src/storedvalue/model_stored_value_load_response.go +++ b/src/storedvalue/model_stored_value_load_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueLoadResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueLoadResponse{} // StoredValueLoadResponse struct for StoredValueLoadResponse type StoredValueLoadResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueLoadResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueLoadResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueLoadResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueLoadResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_status_change_request.go b/src/storedvalue/model_stored_value_status_change_request.go index 8bd731da4..ad34a071e 100644 --- a/src/storedvalue/model_stored_value_status_change_request.go +++ b/src/storedvalue/model_stored_value_status_change_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueStatusChangeRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueStatusChangeRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The status you want to change to Status string `json:"status"` // The physical store, for which this payment is processed. @@ -314,7 +313,7 @@ func (o *StoredValueStatusChangeRequest) SetStore(v string) { } func (o StoredValueStatusChangeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,21 +380,23 @@ func (v *NullableStoredValueStatusChangeRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueStatusChangeRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *StoredValueStatusChangeRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_status_change_response.go b/src/storedvalue/model_stored_value_status_change_response.go index 696daec2a..01a658e8b 100644 --- a/src/storedvalue/model_stored_value_status_change_response.go +++ b/src/storedvalue/model_stored_value_status_change_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueStatusChangeResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueStatusChangeResponse{} // StoredValueStatusChangeResponse struct for StoredValueStatusChangeResponse type StoredValueStatusChangeResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueStatusChangeResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueStatusChangeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueStatusChangeResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueStatusChangeResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_void_request.go b/src/storedvalue/model_stored_value_void_request.go index e0089f45f..14e691f1e 100644 --- a/src/storedvalue/model_stored_value_void_request.go +++ b/src/storedvalue/model_stored_value_void_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueVoidRequest type satisfies the MappedNullable interface at compile time @@ -229,7 +228,7 @@ func (o *StoredValueVoidRequest) SetUniqueTerminalId(v string) { } func (o StoredValueVoidRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -290,3 +289,6 @@ func (v *NullableStoredValueVoidRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_stored_value_void_response.go b/src/storedvalue/model_stored_value_void_response.go index a736d2917..9c783eecc 100644 --- a/src/storedvalue/model_stored_value_void_response.go +++ b/src/storedvalue/model_stored_value_void_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the StoredValueVoidResponse type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type StoredValueVoidResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -208,7 +207,7 @@ func (o *StoredValueVoidResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueVoidResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableStoredValueVoidResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueVoidResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/.openapi-generator/VERSION b/src/transfers/.openapi-generator/VERSION index c0be8a799..4be2c727a 100644 --- a/src/transfers/.openapi-generator/VERSION +++ b/src/transfers/.openapi-generator/VERSION @@ -1 +1 @@ -6.4.0 \ No newline at end of file +6.5.0 \ No newline at end of file diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go new file mode 100644 index 000000000..410d12edf --- /dev/null +++ b/src/transfers/api_transactions.go @@ -0,0 +1,267 @@ +/* +Transfers API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "context" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// TransactionsApi TransactionsApi service +type TransactionsApi common.Service + +type TransactionsApiGetAllTransactionsConfig struct { + ctx context.Context + createdSince *time.Time + createdUntil *time.Time + balancePlatform *string + paymentInstrumentId *string + accountHolderId *string + balanceAccountId *string + cursor *string + limit *int32 +} + +// Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r TransactionsApiGetAllTransactionsConfig) CreatedSince(createdSince time.Time) TransactionsApiGetAllTransactionsConfig { + r.createdSince = &createdSince + return r +} + +// Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r TransactionsApiGetAllTransactionsConfig) CreatedUntil(createdUntil time.Time) TransactionsApiGetAllTransactionsConfig { + r.createdUntil = &createdUntil + return r +} + +// Unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). +func (r TransactionsApiGetAllTransactionsConfig) BalancePlatform(balancePlatform string) TransactionsApiGetAllTransactionsConfig { + r.balancePlatform = &balancePlatform + return r +} + +// Unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). +func (r TransactionsApiGetAllTransactionsConfig) PaymentInstrumentId(paymentInstrumentId string) TransactionsApiGetAllTransactionsConfig { + r.paymentInstrumentId = &paymentInstrumentId + return r +} + +// Unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). +func (r TransactionsApiGetAllTransactionsConfig) AccountHolderId(accountHolderId string) TransactionsApiGetAllTransactionsConfig { + r.accountHolderId = &accountHolderId + return r +} + +// Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). +func (r TransactionsApiGetAllTransactionsConfig) BalanceAccountId(balanceAccountId string) TransactionsApiGetAllTransactionsConfig { + r.balanceAccountId = &balanceAccountId + return r +} + +// The `cursor` returned in the links of the previous response. +func (r TransactionsApiGetAllTransactionsConfig) Cursor(cursor string) TransactionsApiGetAllTransactionsConfig { + r.cursor = &cursor + return r +} + +// The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. +func (r TransactionsApiGetAllTransactionsConfig) Limit(limit int32) TransactionsApiGetAllTransactionsConfig { + r.limit = &limit + return r +} + + +/* +GetAllTransactions Get all transactions + +Returns all transactions related to a balance account with a payment instrument of type **bankAccount**. + +This endpoint supports cursor-based pagination. The response returns the first page of results, and returns links to the next page when applicable. You can use the links to page through the results. The response also returns links to the previous page when applicable. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return TransactionsApiGetAllTransactionsConfig +*/ +func (a *TransactionsApi) GetAllTransactionsConfig(ctx context.Context) TransactionsApiGetAllTransactionsConfig { + return TransactionsApiGetAllTransactionsConfig{ + ctx: ctx, + } +} + +/* +Get all transactions +Returns all transactions related to a balance account with a payment instrument of type **bankAccount**. This endpoint supports cursor-based pagination. The response returns the first page of results, and returns links to the next page when applicable. You can use the links to page through the results. The response also returns links to the previous page when applicable. + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return TransactionSearchResponse +*/ + +func (a *TransactionsApi) GetAllTransactions(r TransactionsApiGetAllTransactionsConfig) (TransactionSearchResponse, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &TransactionSearchResponse{} + path := "/transactions" + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.balancePlatform != nil { + common.ParameterAddToQuery(queryParams, "balancePlatform", r.balancePlatform, "") + } + if r.paymentInstrumentId != nil { + common.ParameterAddToQuery(queryParams, "paymentInstrumentId", r.paymentInstrumentId, "") + } + if r.accountHolderId != nil { + common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") + } + if r.balanceAccountId != nil { + common.ParameterAddToQuery(queryParams, "balanceAccountId", r.balanceAccountId, "") + } + if r.cursor != nil { + common.ParameterAddToQuery(queryParams, "cursor", r.cursor, "") + } + if r.createdSince != nil { + common.ParameterAddToQuery(queryParams, "createdSince", r.createdSince, "") + } + if r.createdUntil != nil { + common.ParameterAddToQuery(queryParams, "createdUntil", r.createdUntil, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + + +type TransactionsApiGetTransactionConfig struct { + ctx context.Context + id string +} + + +/* +GetTransaction Get a transaction + +Returns a transaction. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Unique identifier of the transaction. + @return TransactionsApiGetTransactionConfig +*/ +func (a *TransactionsApi) GetTransactionConfig(ctx context.Context, id string) TransactionsApiGetTransactionConfig { + return TransactionsApiGetTransactionConfig{ + ctx: ctx, + id: id, + } +} + +/* +Get a transaction +Returns a transaction. + * @param id Unique identifier of the transaction. + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return Transaction +*/ + +func (a *TransactionsApi) GetTransaction(r TransactionsApiGetTransactionConfig) (Transaction, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &Transaction{} + path := "/transactions/{id}" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + nil, + res, + _nethttp.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go new file mode 100644 index 000000000..bbbb3e9c9 --- /dev/null +++ b/src/transfers/api_transfers.go @@ -0,0 +1,110 @@ +/* +Transfers API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "context" + _nethttp "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// TransfersApi TransfersApi service +type TransfersApi common.Service + +type TransfersApiTransferFundsConfig struct { + ctx context.Context + transferInfo *TransferInfo +} + +func (r TransfersApiTransferFundsConfig) TransferInfo(transferInfo TransferInfo) TransfersApiTransferFundsConfig { + r.transferInfo = &transferInfo + return r +} + + +/* +TransferFunds Transfer funds + +Starts a request to transfer funds to [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts), [transfer instruments](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments), or third-party bank accounts. Adyen sends the outcome of the transfer request through webhooks. + +To use this endpoint, you need an additional role for your API credential and transfers must be enabled for the source balance account. Your Adyen contact will set these up for you. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return TransfersApiTransferFundsConfig +*/ +func (a *TransfersApi) TransferFundsConfig(ctx context.Context) TransfersApiTransferFundsConfig { + return TransfersApiTransferFundsConfig{ + ctx: ctx, + } +} + +/* +Transfer funds +Starts a request to transfer funds to [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts), [transfer instruments](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments), or third-party bank accounts. Adyen sends the outcome of the transfer request through webhooks. To use this endpoint, you need an additional role for your API credential and transfers must be enabled for the source balance account. Your Adyen contact will set these up for you. + * @param req TransferInfo - reference of TransferInfo). + * @param ctxs ...context.Context - optional, for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return Transfer +*/ + +func (a *TransfersApi) TransferFunds(r TransfersApiTransferFundsConfig) (Transfer, *_nethttp.Response, error) { + var serviceError common.RestServiceError + res := &Transfer{} + path := "/transfers" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + r.ctx, + a.Client, + r.transferInfo, + res, + _nethttp.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + defer httpRes.Body.Close() + + + + + if httpRes.StatusCode == 401 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 403 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 422 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + + + if httpRes.StatusCode == 500 { + // Read the response body + body, _ := ioutil.ReadAll(httpRes.Body) + _ = json.Unmarshal([]byte(body), &serviceError) + return *res, httpRes, serviceError + } + return *res, httpRes, err +} + diff --git a/src/transfers/model_additional_bank_identification.go b/src/transfers/model_additional_bank_identification.go index b37f70c02..d8ede4b73 100644 --- a/src/transfers/model_additional_bank_identification.go +++ b/src/transfers/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_address_2.go b/src/transfers/model_address_2.go index d324610f1..10fb4b830 100644 --- a/src/transfers/model_address_2.go +++ b/src/transfers/model_address_2.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Address2 type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *Address2) SetStateOrProvince(v string) { } func (o Address2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableAddress2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_amount.go b/src/transfers/model_amount.go index 4fbcfaf21..054212050 100644 --- a/src/transfers/model_amount.go +++ b/src/transfers/model_amount.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_au_local_account_identification.go b/src/transfers/model_au_local_account_identification.go index 07f78a386..ad33cc40f 100644 --- a/src/transfers/model_au_local_account_identification.go +++ b/src/transfers/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_bank_account_v3.go b/src/transfers/model_bank_account_v3.go index 82890a652..96e2ab96d 100644 --- a/src/transfers/model_bank_account_v3.go +++ b/src/transfers/model_bank_account_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BankAccountV3 type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &BankAccountV3{} // BankAccountV3 struct for BankAccountV3 type BankAccountV3 struct { - AccountHolder PartyIdentification2 `json:"accountHolder"` + AccountHolder PartyIdentification2 `json:"accountHolder"` AccountIdentification BankAccountV3AccountIdentification `json:"accountIdentification"` } @@ -91,7 +90,7 @@ func (o *BankAccountV3) SetAccountIdentification(v BankAccountV3AccountIdentific } func (o BankAccountV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -140,3 +139,6 @@ func (v *NullableBankAccountV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_bank_account_v3_account_identification.go b/src/transfers/model_bank_account_v3_account_identification.go index cfee83349..1ebde1ec3 100644 --- a/src/transfers/model_bank_account_v3_account_identification.go +++ b/src/transfers/model_bank_account_v3_account_identification.go @@ -10,25 +10,26 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "fmt" ) // BankAccountV3AccountIdentification - Contains the bank account details. The fields required in this object depend on the country of the bank account and the currency of the transfer. type BankAccountV3AccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - BRLocalAccountIdentification *BRLocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountV3AccountIdentification @@ -129,6 +130,7 @@ func USLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *USLocal } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -139,7 +141,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -152,7 +154,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct dst.BRLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -165,7 +167,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -178,7 +180,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -191,7 +193,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -204,7 +206,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -217,7 +219,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -230,7 +232,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -243,7 +245,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -256,7 +258,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -269,7 +271,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -282,7 +284,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -295,7 +297,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -308,7 +310,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -402,7 +404,7 @@ func (src BankAccountV3AccountIdentification) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *BankAccountV3AccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountV3AccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -501,3 +503,5 @@ func (v *NullableBankAccountV3AccountIdentification) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/transfers/model_br_local_account_identification.go b/src/transfers/model_br_local_account_identification.go index 166076a61..7a77110f0 100644 --- a/src/transfers/model_br_local_account_identification.go +++ b/src/transfers/model_br_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the BRLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -149,7 +148,7 @@ func (o *BRLocalAccountIdentification) SetType(v string) { } func (o BRLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -201,12 +200,14 @@ func (v *NullableBRLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BRLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"brLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "brLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_ca_local_account_identification.go b/src/transfers/model_ca_local_account_identification.go index b7ae37a20..3d389e312 100644 --- a/src/transfers/model_ca_local_account_identification.go +++ b/src/transfers/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_counterparty_info_v3.go b/src/transfers/model_counterparty_info_v3.go index 0f1f2a58a..9907284ea 100644 --- a/src/transfers/model_counterparty_info_v3.go +++ b/src/transfers/model_counterparty_info_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CounterpartyInfoV3 type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &CounterpartyInfoV3{} // CounterpartyInfoV3 struct for CounterpartyInfoV3 type CounterpartyInfoV3 struct { // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } @@ -140,7 +139,7 @@ func (o *CounterpartyInfoV3) SetTransferInstrumentId(v string) { } func (o CounterpartyInfoV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableCounterpartyInfoV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_counterparty_v3.go b/src/transfers/model_counterparty_v3.go index d2a6d8c9d..a32c2f789 100644 --- a/src/transfers/model_counterparty_v3.go +++ b/src/transfers/model_counterparty_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CounterpartyV3 type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &CounterpartyV3{} // CounterpartyV3 struct for CounterpartyV3 type CounterpartyV3 struct { // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` - Merchant *MerchantData `json:"merchant,omitempty"` + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + Merchant *MerchantData `json:"merchant,omitempty"` // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } @@ -173,7 +172,7 @@ func (o *CounterpartyV3) SetTransferInstrumentId(v string) { } func (o CounterpartyV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,3 +231,6 @@ func (v *NullableCounterpartyV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_cz_local_account_identification.go b/src/transfers/model_cz_local_account_identification.go index 3ea888d5d..0296c16fe 100644 --- a/src/transfers/model_cz_local_account_identification.go +++ b/src/transfers/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_dk_local_account_identification.go b/src/transfers/model_dk_local_account_identification.go index 82d37af3e..ebdd95db5 100644 --- a/src/transfers/model_dk_local_account_identification.go +++ b/src/transfers/model_dk_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *DKLocalAccountIdentification) SetType(v string) { } func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"dkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_hu_local_account_identification.go b/src/transfers/model_hu_local_account_identification.go index 4376ccc9e..f3dca7add 100644 --- a/src/transfers/model_hu_local_account_identification.go +++ b/src/transfers/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_iban_account_identification.go b/src/transfers/model_iban_account_identification.go index d95ac49e6..991616279 100644 --- a/src/transfers/model_iban_account_identification.go +++ b/src/transfers/model_iban_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_invalid_field.go b/src/transfers/model_invalid_field.go index e4ec77527..c752d4b50 100644 --- a/src/transfers/model_invalid_field.go +++ b/src/transfers/model_invalid_field.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_json_object.go b/src/transfers/model_json_object.go index c0f9cfd2f..1efa9238e 100644 --- a/src/transfers/model_json_object.go +++ b/src/transfers/model_json_object.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONObject type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &JSONObject{} // JSONObject struct for JSONObject type JSONObject struct { - Paths []JSONPath `json:"paths,omitempty"` - RootPath *JSONPath `json:"rootPath,omitempty"` + Paths []JSONPath `json:"paths,omitempty"` + RootPath *JSONPath `json:"rootPath,omitempty"` } // NewJSONObject instantiates a new JSONObject object @@ -105,7 +104,7 @@ func (o *JSONObject) SetRootPath(v JSONPath) { } func (o JSONObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableJSONObject) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_json_path.go b/src/transfers/model_json_path.go index a22a367f6..217097db8 100644 --- a/src/transfers/model_json_path.go +++ b/src/transfers/model_json_path.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the JSONPath type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *JSONPath) SetContent(v []string) { } func (o JSONPath) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableJSONPath) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_link.go b/src/transfers/model_link.go index dea1d665a..32fdc7ab3 100644 --- a/src/transfers/model_link.go +++ b/src/transfers/model_link.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Link type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *Link) SetHref(v string) { } func (o Link) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableLink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_links.go b/src/transfers/model_links.go index 18d646ccf..757a48ab1 100644 --- a/src/transfers/model_links.go +++ b/src/transfers/model_links.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Links type satisfies the MappedNullable interface at compile time @@ -105,7 +104,7 @@ func (o *Links) SetPrev(v Link) { } func (o Links) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_merchant_data.go b/src/transfers/model_merchant_data.go index bf31f9f9e..b026429ed 100644 --- a/src/transfers/model_merchant_data.go +++ b/src/transfers/model_merchant_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the MerchantData type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type MerchantData struct { // The merchant category code. Mcc *string `json:"mcc,omitempty"` // The merchant identifier. - MerchantId *string `json:"merchantId,omitempty"` + MerchantId *string `json:"merchantId,omitempty"` NameLocation *NameLocation `json:"nameLocation,omitempty"` // The merchant postal code. PostalCode *string `json:"postalCode,omitempty"` @@ -174,7 +173,7 @@ func (o *MerchantData) SetPostalCode(v string) { } func (o MerchantData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -233,3 +232,6 @@ func (v *NullableMerchantData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_name_location.go b/src/transfers/model_name_location.go index e0f6be78d..1a7ac934b 100644 --- a/src/transfers/model_name_location.go +++ b/src/transfers/model_name_location.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NameLocation type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *NameLocation) SetState(v string) { } func (o NameLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableNameLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_no_local_account_identification.go b/src/transfers/model_no_local_account_identification.go index 689b35c78..bc6a2c286 100644 --- a/src/transfers/model_no_local_account_identification.go +++ b/src/transfers/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_number_and_bic_account_identification.go b/src/transfers/model_number_and_bic_account_identification.go index fa9bbc66d..1f11759ae 100644 --- a/src/transfers/model_number_and_bic_account_identification.go +++ b/src/transfers/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_party_identification_2.go b/src/transfers/model_party_identification_2.go index 1022ccbf3..ca59dabd6 100644 --- a/src/transfers/model_party_identification_2.go +++ b/src/transfers/model_party_identification_2.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PartyIdentification2 type satisfies the MappedNullable interface at compile time @@ -273,7 +272,7 @@ func (o *PartyIdentification2) SetType(v string) { } func (o PartyIdentification2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -340,12 +339,14 @@ func (v *NullablePartyIdentification2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PartyIdentification2) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_payment_instrument.go b/src/transfers/model_payment_instrument.go index 76e329e1e..d62746084 100644 --- a/src/transfers/model_payment_instrument.go +++ b/src/transfers/model_payment_instrument.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *PaymentInstrument) SetTokenType(v string) { } func (o PaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_pl_local_account_identification.go b/src/transfers/model_pl_local_account_identification.go index 3156f8368..3cd285b00 100644 --- a/src/transfers/model_pl_local_account_identification.go +++ b/src/transfers/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_resource_reference.go b/src/transfers/model_resource_reference.go index 14b8f1243..a5a3caa5c 100644 --- a/src/transfers/model_resource_reference.go +++ b/src/transfers/model_resource_reference.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the ResourceReference type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResourceReference) SetReference(v string) { } func (o ResourceReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_rest_service_error.go b/src/transfers/model_rest_service_error.go index d1a239f84..279df36d6 100644 --- a/src/transfers/model_rest_service_error.go +++ b/src/transfers/model_rest_service_error.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidField `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - Response *JSONObject `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response *JSONObject `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -309,7 +308,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -373,3 +372,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_se_local_account_identification.go b/src/transfers/model_se_local_account_identification.go index 3d86666e6..d138d6d7e 100644 --- a/src/transfers/model_se_local_account_identification.go +++ b/src/transfers/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_sg_local_account_identification.go b/src/transfers/model_sg_local_account_identification.go index 7e92c1ae3..0dbbb863e 100644 --- a/src/transfers/model_sg_local_account_identification.go +++ b/src/transfers/model_sg_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *SGLocalAccountIdentification) SetType(v string) { } func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,12 +183,14 @@ func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SGLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"sgLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transaction.go b/src/transfers/model_transaction.go index a1bfeb4b1..ba7e16d65 100644 --- a/src/transfers/model_transaction.go +++ b/src/transfers/model_transaction.go @@ -10,9 +10,8 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v7/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Transaction type satisfies the MappedNullable interface at compile time @@ -22,22 +21,22 @@ var _ common.MappedNullable = &Transaction{} type Transaction struct { // Unique identifier of the account holder. AccountHolderId string `json:"accountHolderId"` - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` // Unique identifier of the balance account. BalanceAccountId string `json:"balanceAccountId"` // Unique identifier of the balance platform. BalancePlatform string `json:"balancePlatform"` // The date the transaction was booked to the balance account. BookingDate time.Time `json:"bookingDate"` - // The category of the transaction indicating the type of activity. Possible values: * **platformPayment**: The transaction is a payment or payment modification made with an Adyen merchant account. * **internal**: The transaction resulted from an internal adjustment such as a deposit correction or invoice deduction. * **bank**: The transaction is a bank-related activity, such as sending a payout or receiving funds. * **issuedCard**: The transaction is a card-related activity, such as using an Adyen-issued card to pay online. - Category *string `json:"category,omitempty"` + // The category of the transaction indicating the type of activity. Possible values: * **platformPayment**: The transaction is a payment or payment modification made with an Adyen merchant account. * **internal**: The transaction resulted from an internal adjustment such as a deposit correction or invoice deduction. * **bank**: The transaction is a bank-related activity, such as sending a payout or receiving funds. * **issuedCard**: The transaction is a card-related activity, such as using an Adyen-issued card to pay online. + Category *string `json:"category,omitempty"` Counterparty CounterpartyV3 `json:"counterparty"` // The date the transaction was created. CreatedAt time.Time `json:"createdAt"` // The `description` from the `/transfers` request. Description *string `json:"description,omitempty"` // Unique identifier of the transaction. - Id string `json:"id"` + Id string `json:"id"` InstructedAmount *Amount `json:"instructedAmount,omitempty"` // Unique identifier of the payment instrument that was used for the transaction. PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` @@ -45,7 +44,7 @@ type Transaction struct { Reference string `json:"reference"` // The reference sent to or received from the counterparty. * For outgoing funds, this is the [`referenceForBeneficiary`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__resParam_referenceForBeneficiary) from the [`/transfers`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_referenceForBeneficiary) request. * For incoming funds, this is the reference from the sender. ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` - // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. + // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. Status string `json:"status"` // Unique identifier of the related transfer. TransferId *string `json:"transferId,omitempty"` @@ -572,7 +571,7 @@ func (o *Transaction) SetValueDate(v time.Time) { } func (o Transaction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -652,30 +651,32 @@ func (v *NullableTransaction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Transaction) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "grants", "internal", "issuedCard", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "grants", "internal", "issuedCard", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *Transaction) isValidStatus() bool { - var allowedEnumValues = []string{"booked", "pending"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "booked", "pending" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *Transaction) isValidType() bool { - var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceRollover", "bankTransfer", "capture", "captureReversal", "chargeback", "chargebackReversal", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceRollover", "bankTransfer", "capture", "captureReversal", "chargeback", "chargebackReversal", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transaction_search_response.go b/src/transfers/model_transaction_search_response.go index 82787a3f1..181d15fb0 100644 --- a/src/transfers/model_transaction_search_response.go +++ b/src/transfers/model_transaction_search_response.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransactionSearchResponse type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *TransactionSearchResponse) SetData(v []Transaction) { } func (o TransactionSearchResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableTransactionSearchResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_transfer.go b/src/transfers/model_transfer.go index 535e2076b..535dfabc7 100644 --- a/src/transfers/model_transfer.go +++ b/src/transfers/model_transfer.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the Transfer type satisfies the MappedNullable interface at compile time @@ -19,21 +18,21 @@ var _ common.MappedNullable = &Transfer{} // Transfer struct for Transfer type Transfer struct { - AccountHolder *ResourceReference `json:"accountHolder,omitempty"` - Amount Amount `json:"amount"` + AccountHolder *ResourceReference `json:"accountHolder,omitempty"` + Amount Amount `json:"amount"` BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). // Deprecated BalanceAccountId *string `json:"balanceAccountId,omitempty"` // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` + Category string `json:"category"` Counterparty CounterpartyV3 `json:"counterparty"` // Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** Description *string `json:"description,omitempty"` // The direction of the transfer. Possible values: **incoming**, **outgoing**. Direction *string `json:"direction,omitempty"` // The ID of the resource. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` // The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. // Deprecated @@ -558,7 +557,7 @@ func (o *Transfer) SetStatus(v string) { } func (o Transfer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -646,48 +645,50 @@ func (v *NullableTransfer) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Transfer) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "issuedCard", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "issuedCard", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *Transfer) isValidDirection() bool { - var allowedEnumValues = []string{"incoming", "outgoing"} - for _, allowed := range allowedEnumValues { - if o.GetDirection() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "incoming", "outgoing" } + for _, allowed := range allowedEnumValues { + if o.GetDirection() == allowed { + return true + } + } + return false } func (o *Transfer) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } func (o *Transfer) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *Transfer) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "chargeback", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "chargeback", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transfer_info.go b/src/transfers/model_transfer_info.go index 0c40da45f..d38011af1 100644 --- a/src/transfers/model_transfer_info.go +++ b/src/transfers/model_transfer_info.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the TransferInfo type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type TransferInfo struct { // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). BalanceAccountId *string `json:"balanceAccountId,omitempty"` // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` + Category string `json:"category"` Counterparty CounterpartyInfoV3 `json:"counterparty"` // Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** Description *string `json:"description,omitempty"` @@ -36,8 +35,8 @@ type TransferInfo struct { // Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. Reference *string `json:"reference,omitempty"` // A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. - ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` - UltimateParty *UltimatePartyIdentification `json:"ultimateParty,omitempty"` + ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` + UltimateParty *UltimatePartyIdentification `json:"ultimateParty,omitempty"` } // NewTransferInfo instantiates a new TransferInfo object @@ -389,7 +388,7 @@ func (o *TransferInfo) SetUltimateParty(v UltimatePartyIdentification) { } func (o TransferInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -464,21 +463,23 @@ func (v *NullableTransferInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInfo) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "issuedCard", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "issuedCard", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *TransferInfo) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_uk_local_account_identification.go b/src/transfers/model_uk_local_account_identification.go index c345fdad7..d1d024ac2 100644 --- a/src/transfers/model_uk_local_account_identification.go +++ b/src/transfers/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_ultimate_party_identification.go b/src/transfers/model_ultimate_party_identification.go index d99346bab..404dc5fa7 100644 --- a/src/transfers/model_ultimate_party_identification.go +++ b/src/transfers/model_ultimate_party_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the UltimatePartyIdentification type satisfies the MappedNullable interface at compile time @@ -273,7 +272,7 @@ func (o *UltimatePartyIdentification) SetType(v string) { } func (o UltimatePartyIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -340,12 +339,14 @@ func (v *NullableUltimatePartyIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UltimatePartyIdentification) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_us_local_account_identification.go b/src/transfers/model_us_local_account_identification.go index 9787d9b99..0bada7345 100644 --- a/src/transfers/model_us_local_account_identification.go +++ b/src/transfers/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v7/src/common" + "github.com/adyen/adyen-go-api-library/v7/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } +