diff --git a/src/balancecontrol/api_general.go b/src/balancecontrol/api_general.go index 0882945c4..2ef944408 100644 --- a/src/balancecontrol/api_general.go +++ b/src/balancecontrol/api_general.go @@ -72,5 +72,9 @@ func (a *GeneralApi) BalanceTransfer(ctx context.Context, r GeneralApiBalanceTra headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/balanceplatform/api_account_holders.go b/src/balanceplatform/api_account_holders.go index df253f605..0425fb8a3 100644 --- a/src/balanceplatform/api_account_holders.go +++ b/src/balanceplatform/api_account_holders.go @@ -336,6 +336,122 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con return *res, httpRes, err } +// All parameters accepted by AccountHoldersApi.GetTaxForm +type AccountHoldersApiGetTaxFormInput struct { + id string + formType *string + year *int32 +} + +// The type of tax form you want to retrieve. Accepted values are **us1099k** and **us1099nec** +func (r AccountHoldersApiGetTaxFormInput) FormType(formType string) AccountHoldersApiGetTaxFormInput { + r.formType = &formType + return r +} + +// The tax year in YYYY format for the tax form you want to retrieve +func (r AccountHoldersApiGetTaxFormInput) Year(year int32) AccountHoldersApiGetTaxFormInput { + r.year = &year + return r +} + +/* +Prepare a request for GetTaxForm +@param id The unique identifier of the account holder. +@return AccountHoldersApiGetTaxFormInput +*/ +func (a *AccountHoldersApi) GetTaxFormInput(id string) AccountHoldersApiGetTaxFormInput { + return AccountHoldersApiGetTaxFormInput{ + id: id, + } +} + +/* +GetTaxForm Get a tax form + +Generates a tax form for account holders operating in the US. For more information, refer to [Providing tax forms](https://docs.adyen.com/marketplaces-and-platforms/us-tax-forms/). + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r AccountHoldersApiGetTaxFormInput - Request parameters, see GetTaxFormInput +@return GetTaxFormResponse, *http.Response, error +*/ +func (a *AccountHoldersApi) GetTaxForm(ctx context.Context, r AccountHoldersApiGetTaxFormInput) (GetTaxFormResponse, *http.Response, error) { + res := &GetTaxFormResponse{} + path := "/accountHolders/{id}/taxForms" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.formType != nil { + common.ParameterAddToQuery(queryParams, "formType", r.formType, "") + } + if r.year != nil { + common.ParameterAddToQuery(queryParams, "year", r.year, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + // All parameters accepted by AccountHoldersApi.UpdateAccountHolder type AccountHoldersApiUpdateAccountHolderInput struct { id string diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index 3b72cf4e0..e4966281d 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -122,12 +122,12 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance // All parameters accepted by BalanceAccountsApi.CreateSweep type BalanceAccountsApiCreateSweepInput struct { - balanceAccountId string - sweepConfigurationV2 *SweepConfigurationV2 + balanceAccountId string + createSweepConfigurationV2 *CreateSweepConfigurationV2 } -func (r BalanceAccountsApiCreateSweepInput) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) BalanceAccountsApiCreateSweepInput { - r.sweepConfigurationV2 = &sweepConfigurationV2 +func (r BalanceAccountsApiCreateSweepInput) CreateSweepConfigurationV2(createSweepConfigurationV2 CreateSweepConfigurationV2) BalanceAccountsApiCreateSweepInput { + r.createSweepConfigurationV2 = &createSweepConfigurationV2 return r } @@ -162,7 +162,7 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.sweepConfigurationV2, + r.createSweepConfigurationV2, res, http.MethodPost, a.BasePath()+path, diff --git a/src/balanceplatform/api_transfer_routes.go b/src/balanceplatform/api_transfer_routes.go new file mode 100644 index 000000000..761548a8d --- /dev/null +++ b/src/balanceplatform/api_transfer_routes.go @@ -0,0 +1,111 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// TransferRoutesApi service +type TransferRoutesApi common.Service + +// All parameters accepted by TransferRoutesApi.CalculateTransferRoutes +type TransferRoutesApiCalculateTransferRoutesInput struct { + transferRouteRequest *TransferRouteRequest +} + +func (r TransferRoutesApiCalculateTransferRoutesInput) TransferRouteRequest(transferRouteRequest TransferRouteRequest) TransferRoutesApiCalculateTransferRoutesInput { + r.transferRouteRequest = &transferRouteRequest + return r +} + +/* +Prepare a request for CalculateTransferRoutes + +@return TransferRoutesApiCalculateTransferRoutesInput +*/ +func (a *TransferRoutesApi) CalculateTransferRoutesInput() TransferRoutesApiCalculateTransferRoutesInput { + return TransferRoutesApiCalculateTransferRoutesInput{} +} + +/* +CalculateTransferRoutes Calculate transfer routes + +Returns available transfer routes based on a combination of transfer `country`, `currency`, `counterparty`, and `priorities`. Use this endpoint to find optimal transfer priorities and associated requirements before you [make a transfer](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers). + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r TransferRoutesApiCalculateTransferRoutesInput - Request parameters, see CalculateTransferRoutesInput +@return TransferRouteResponse, *http.Response, error +*/ +func (a *TransferRoutesApi) CalculateTransferRoutes(ctx context.Context, r TransferRoutesApiCalculateTransferRoutesInput) (TransferRouteResponse, *http.Response, error) { + res := &TransferRouteResponse{} + path := "/transferRoutes/calculate" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferRouteRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} diff --git a/src/balanceplatform/client.go b/src/balanceplatform/client.go index 6597fce76..dca9eca1c 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -38,6 +38,8 @@ type APIClient struct { PlatformApi *PlatformApi TransactionRulesApi *TransactionRulesApi + + TransferRoutesApi *TransferRoutesApi } // NewAPIClient creates a new API client. @@ -59,6 +61,7 @@ func NewAPIClient(client *common.Client) *APIClient { c.PaymentInstrumentsApi = (*PaymentInstrumentsApi)(&c.common) c.PlatformApi = (*PlatformApi)(&c.common) c.TransactionRulesApi = (*TransactionRulesApi)(&c.common) + c.TransferRoutesApi = (*TransferRoutesApi)(&c.common) return c } \ No newline at end of file diff --git a/src/balanceplatform/model_address_requirement.go b/src/balanceplatform/model_address_requirement.go new file mode 100644 index 000000000..e0865fdfa --- /dev/null +++ b/src/balanceplatform/model_address_requirement.go @@ -0,0 +1,202 @@ +/* +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 AddressRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AddressRequirement{} + +// AddressRequirement struct for AddressRequirement +type AddressRequirement struct { + // Specifies the required address related fields for a particular route. + Description *string `json:"description,omitempty"` + // List of address fields. + RequiredAddressFields []string `json:"requiredAddressFields,omitempty"` + // **addressRequirement** + Type string `json:"type"` +} + +// NewAddressRequirement instantiates a new AddressRequirement 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 NewAddressRequirement(type_ string) *AddressRequirement { + this := AddressRequirement{} + this.Type = type_ + return &this +} + +// NewAddressRequirementWithDefaults instantiates a new AddressRequirement 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 NewAddressRequirementWithDefaults() *AddressRequirement { + this := AddressRequirement{} + var type_ string = "addressRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddressRequirement) 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 *AddressRequirement) 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 *AddressRequirement) 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 *AddressRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetRequiredAddressFields returns the RequiredAddressFields field value if set, zero value otherwise. +func (o *AddressRequirement) GetRequiredAddressFields() []string { + if o == nil || common.IsNil(o.RequiredAddressFields) { + var ret []string + return ret + } + return o.RequiredAddressFields +} + +// GetRequiredAddressFieldsOk returns a tuple with the RequiredAddressFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddressRequirement) GetRequiredAddressFieldsOk() ([]string, bool) { + if o == nil || common.IsNil(o.RequiredAddressFields) { + return nil, false + } + return o.RequiredAddressFields, true +} + +// HasRequiredAddressFields returns a boolean if a field has been set. +func (o *AddressRequirement) HasRequiredAddressFields() bool { + if o != nil && !common.IsNil(o.RequiredAddressFields) { + return true + } + + return false +} + +// SetRequiredAddressFields gets a reference to the given []string and assigns it to the RequiredAddressFields field. +func (o *AddressRequirement) SetRequiredAddressFields(v []string) { + o.RequiredAddressFields = v +} + +// GetType returns the Type field value +func (o *AddressRequirement) 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 *AddressRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AddressRequirement) SetType(v string) { + o.Type = v +} + +func (o AddressRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddressRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.RequiredAddressFields) { + toSerialize["requiredAddressFields"] = o.RequiredAddressFields + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAddressRequirement struct { + value *AddressRequirement + isSet bool +} + +func (v NullableAddressRequirement) Get() *AddressRequirement { + return v.value +} + +func (v *NullableAddressRequirement) Set(val *AddressRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAddressRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAddressRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddressRequirement(val *AddressRequirement) *NullableAddressRequirement { + return &NullableAddressRequirement{value: val, isSet: true} +} + +func (v NullableAddressRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddressRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *AddressRequirement) isValidType() bool { + var allowedEnumValues = []string{"addressRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_amount_min_max_requirement.go b/src/balanceplatform/model_amount_min_max_requirement.go new file mode 100644 index 000000000..2d9278a0f --- /dev/null +++ b/src/balanceplatform/model_amount_min_max_requirement.go @@ -0,0 +1,239 @@ +/* +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 AmountMinMaxRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AmountMinMaxRequirement{} + +// AmountMinMaxRequirement struct for AmountMinMaxRequirement +type AmountMinMaxRequirement struct { + // Specifies the eligible amounts for a particular route. + Description *string `json:"description,omitempty"` + // Maximum amount. + Max *int64 `json:"max,omitempty"` + // Minimum amount. + Min *int64 `json:"min,omitempty"` + // **amountMinMaxRequirement** + Type string `json:"type"` +} + +// NewAmountMinMaxRequirement instantiates a new AmountMinMaxRequirement 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 NewAmountMinMaxRequirement(type_ string) *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + this.Type = type_ + return &this +} + +// NewAmountMinMaxRequirementWithDefaults instantiates a new AmountMinMaxRequirement 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 NewAmountMinMaxRequirementWithDefaults() *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + var type_ string = "amountMinMaxRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMax() int64 { + if o == nil || common.IsNil(o.Max) { + var ret int64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMaxOk() (*int64, bool) { + if o == nil || common.IsNil(o.Max) { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMax() bool { + if o != nil && !common.IsNil(o.Max) { + return true + } + + return false +} + +// SetMax gets a reference to the given int64 and assigns it to the Max field. +func (o *AmountMinMaxRequirement) SetMax(v int64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMin() int64 { + if o == nil || common.IsNil(o.Min) { + var ret int64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMinOk() (*int64, bool) { + if o == nil || common.IsNil(o.Min) { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMin() bool { + if o != nil && !common.IsNil(o.Min) { + return true + } + + return false +} + +// SetMin gets a reference to the given int64 and assigns it to the Min field. +func (o *AmountMinMaxRequirement) SetMin(v int64) { + o.Min = &v +} + +// GetType returns the Type field value +func (o *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AmountMinMaxRequirement) SetType(v string) { + o.Type = v +} + +func (o AmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AmountMinMaxRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Max) { + toSerialize["max"] = o.Max + } + if !common.IsNil(o.Min) { + toSerialize["min"] = o.Min + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAmountMinMaxRequirement struct { + value *AmountMinMaxRequirement + isSet bool +} + +func (v NullableAmountMinMaxRequirement) Get() *AmountMinMaxRequirement { + return v.value +} + +func (v *NullableAmountMinMaxRequirement) Set(val *AmountMinMaxRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAmountMinMaxRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAmountMinMaxRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmountMinMaxRequirement(val *AmountMinMaxRequirement) *NullableAmountMinMaxRequirement { + return &NullableAmountMinMaxRequirement{value: val, isSet: true} +} + +func (v NullableAmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmountMinMaxRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *AmountMinMaxRequirement) isValidType() bool { + var allowedEnumValues = []string{"amountMinMaxRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_balance_account.go b/src/balanceplatform/model_balance_account.go index 6991cc963..f676b6fa9 100644 --- a/src/balanceplatform/model_balance_account.go +++ b/src/balanceplatform/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { AccountHolderId string `json:"accountHolderId"` // List of balances with the amount and currency. Balances []Balance `json:"balances,omitempty"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. 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"` diff --git a/src/balanceplatform/model_balance_account_base.go b/src/balanceplatform/model_balance_account_base.go index 4a2653da5..2ad510e8b 100644 --- a/src/balanceplatform/model_balance_account_base.go +++ b/src/balanceplatform/model_balance_account_base.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountBase{} type BalanceAccountBase struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId string `json:"accountHolderId"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. 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"` diff --git a/src/balanceplatform/model_balance_account_info.go b/src/balanceplatform/model_balance_account_info.go index 5f28e7f7a..9057466e0 100644 --- a/src/balanceplatform/model_balance_account_info.go +++ b/src/balanceplatform/model_balance_account_info.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountInfo{} type BalanceAccountInfo struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId string `json:"accountHolderId"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. 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"` diff --git a/src/balanceplatform/model_balance_account_update_request.go b/src/balanceplatform/model_balance_account_update_request.go index 6e8ebd4cc..0443c78f3 100644 --- a/src/balanceplatform/model_balance_account_update_request.go +++ b/src/balanceplatform/model_balance_account_update_request.go @@ -21,8 +21,6 @@ var _ common.MappedNullable = &BalanceAccountUpdateRequest{} type BalanceAccountUpdateRequest struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId *string `json:"accountHolderId,omitempty"` - // 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**. - 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. 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. @@ -85,38 +83,6 @@ func (o *BalanceAccountUpdateRequest) SetAccountHolderId(v string) { o.AccountHolderId = &v } -// GetDefaultCurrencyCode returns the DefaultCurrencyCode field value if set, zero value otherwise. -func (o *BalanceAccountUpdateRequest) GetDefaultCurrencyCode() string { - if o == nil || common.IsNil(o.DefaultCurrencyCode) { - var ret string - return ret - } - return *o.DefaultCurrencyCode -} - -// GetDefaultCurrencyCodeOk returns a tuple with the DefaultCurrencyCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BalanceAccountUpdateRequest) GetDefaultCurrencyCodeOk() (*string, bool) { - if o == nil || common.IsNil(o.DefaultCurrencyCode) { - return nil, false - } - return o.DefaultCurrencyCode, true -} - -// HasDefaultCurrencyCode returns a boolean if a field has been set. -func (o *BalanceAccountUpdateRequest) HasDefaultCurrencyCode() bool { - if o != nil && !common.IsNil(o.DefaultCurrencyCode) { - return true - } - - return false -} - -// SetDefaultCurrencyCode gets a reference to the given string and assigns it to the DefaultCurrencyCode field. -func (o *BalanceAccountUpdateRequest) SetDefaultCurrencyCode(v string) { - o.DefaultCurrencyCode = &v -} - // GetDescription returns the Description field value if set, zero value otherwise. func (o *BalanceAccountUpdateRequest) GetDescription() string { if o == nil || common.IsNil(o.Description) { @@ -322,9 +288,6 @@ func (o BalanceAccountUpdateRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountHolderId) { toSerialize["accountHolderId"] = o.AccountHolderId } - if !common.IsNil(o.DefaultCurrencyCode) { - toSerialize["defaultCurrencyCode"] = o.DefaultCurrencyCode - } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } diff --git a/src/balanceplatform/model_bank_account.go b/src/balanceplatform/model_bank_account.go new file mode 100644 index 000000000..434b70e33 --- /dev/null +++ b/src/balanceplatform/model_bank_account.go @@ -0,0 +1,115 @@ +/* +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 BankAccount type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccount{} + +// BankAccount struct for BankAccount +type BankAccount struct { + AccountIdentification BankAccountAccountIdentification `json:"accountIdentification"` +} + +// NewBankAccount instantiates a new BankAccount 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 NewBankAccount(accountIdentification BankAccountAccountIdentification) *BankAccount { + this := BankAccount{} + this.AccountIdentification = accountIdentification + return &this +} + +// NewBankAccountWithDefaults instantiates a new BankAccount 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 NewBankAccountWithDefaults() *BankAccount { + this := BankAccount{} + return &this +} + +// GetAccountIdentification returns the AccountIdentification field value +func (o *BankAccount) GetAccountIdentification() BankAccountAccountIdentification { + if o == nil { + var ret BankAccountAccountIdentification + return ret + } + + return o.AccountIdentification +} + +// GetAccountIdentificationOk returns a tuple with the AccountIdentification field value +// and a boolean to check if the value has been set. +func (o *BankAccount) GetAccountIdentificationOk() (*BankAccountAccountIdentification, bool) { + if o == nil { + return nil, false + } + return &o.AccountIdentification, true +} + +// SetAccountIdentification sets field value +func (o *BankAccount) SetAccountIdentification(v BankAccountAccountIdentification) { + o.AccountIdentification = v +} + +func (o BankAccount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountIdentification"] = o.AccountIdentification + return toSerialize, nil +} + +type NullableBankAccount struct { + value *BankAccount + isSet bool +} + +func (v NullableBankAccount) Get() *BankAccount { + return v.value +} + +func (v *NullableBankAccount) Set(val *BankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccount(val *BankAccount) *NullableBankAccount { + return &NullableBankAccount{value: val, isSet: true} +} + +func (v NullableBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_bank_account_account_identification.go b/src/balanceplatform/model_bank_account_account_identification.go new file mode 100644 index 000000000..3537d8b5a --- /dev/null +++ b/src/balanceplatform/model_bank_account_account_identification.go @@ -0,0 +1,563 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "fmt" +) + +// BankAccountAccountIdentification - 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 BankAccountAccountIdentification struct { + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification + NumberAndBicAccountIdentification *NumberAndBicAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification +} + +// AULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountAccountIdentification +func AULocalAccountIdentificationAsBankAccountAccountIdentification(v *AULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + AULocalAccountIdentification: v, + } +} + +// BRLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns BRLocalAccountIdentification wrapped in BankAccountAccountIdentification +func BRLocalAccountIdentificationAsBankAccountAccountIdentification(v *BRLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + BRLocalAccountIdentification: v, + } +} + +// CALocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CALocalAccountIdentification wrapped in BankAccountAccountIdentification +func CALocalAccountIdentificationAsBankAccountAccountIdentification(v *CALocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CALocalAccountIdentification: v, + } +} + +// CZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func CZLocalAccountIdentificationAsBankAccountAccountIdentification(v *CZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CZLocalAccountIdentification: v, + } +} + +// DKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns DKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func DKLocalAccountIdentificationAsBankAccountAccountIdentification(v *DKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + DKLocalAccountIdentification: v, + } +} + +// HKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func HKLocalAccountIdentificationAsBankAccountAccountIdentification(v *HKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HKLocalAccountIdentification: v, + } +} + +// HULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HULocalAccountIdentification wrapped in BankAccountAccountIdentification +func HULocalAccountIdentificationAsBankAccountAccountIdentification(v *HULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HULocalAccountIdentification: v, + } +} + +// IbanAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns IbanAccountIdentification wrapped in BankAccountAccountIdentification +func IbanAccountIdentificationAsBankAccountAccountIdentification(v *IbanAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + IbanAccountIdentification: v, + } +} + +// NOLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NOLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NOLocalAccountIdentificationAsBankAccountAccountIdentification(v *NOLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NOLocalAccountIdentification: v, + } +} + +// NZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NZLocalAccountIdentificationAsBankAccountAccountIdentification(v *NZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + +// NumberAndBicAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountAccountIdentification +func NumberAndBicAccountIdentificationAsBankAccountAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NumberAndBicAccountIdentification: v, + } +} + +// PLLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns PLLocalAccountIdentification wrapped in BankAccountAccountIdentification +func PLLocalAccountIdentificationAsBankAccountAccountIdentification(v *PLLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + PLLocalAccountIdentification: v, + } +} + +// SELocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SELocalAccountIdentification wrapped in BankAccountAccountIdentification +func SELocalAccountIdentificationAsBankAccountAccountIdentification(v *SELocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SELocalAccountIdentification: v, + } +} + +// SGLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SGLocalAccountIdentification wrapped in BankAccountAccountIdentification +func SGLocalAccountIdentificationAsBankAccountAccountIdentification(v *SGLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SGLocalAccountIdentification: v, + } +} + +// UKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns UKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func UKLocalAccountIdentificationAsBankAccountAccountIdentification(v *UKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + UKLocalAccountIdentification: v, + } +} + +// USLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns USLocalAccountIdentification wrapped in BankAccountAccountIdentification +func USLocalAccountIdentificationAsBankAccountAccountIdentification(v *USLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + USLocalAccountIdentification: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AULocalAccountIdentification + err = json.Unmarshal(data, &dst.AULocalAccountIdentification) + if err == nil { + jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) + if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct + dst.AULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.AULocalAccountIdentification = nil + } + + // try to unmarshal data into BRLocalAccountIdentification + err = json.Unmarshal(data, &dst.BRLocalAccountIdentification) + if err == nil { + jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) + if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct + dst.BRLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.BRLocalAccountIdentification = nil + } + + // try to unmarshal data into CALocalAccountIdentification + err = json.Unmarshal(data, &dst.CALocalAccountIdentification) + if err == nil { + jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) + if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct + dst.CALocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CALocalAccountIdentification = nil + } + + // try to unmarshal data into CZLocalAccountIdentification + err = json.Unmarshal(data, &dst.CZLocalAccountIdentification) + if err == nil { + jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) + if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct + dst.CZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CZLocalAccountIdentification = nil + } + + // try to unmarshal data into DKLocalAccountIdentification + err = json.Unmarshal(data, &dst.DKLocalAccountIdentification) + if err == nil { + jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) + if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct + dst.DKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.DKLocalAccountIdentification = nil + } + + // try to unmarshal data into HKLocalAccountIdentification + err = json.Unmarshal(data, &dst.HKLocalAccountIdentification) + if err == nil { + jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) + if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct + dst.HKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HKLocalAccountIdentification = nil + } + + // try to unmarshal data into HULocalAccountIdentification + err = json.Unmarshal(data, &dst.HULocalAccountIdentification) + if err == nil { + jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) + if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct + dst.HULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HULocalAccountIdentification = nil + } + + // try to unmarshal data into IbanAccountIdentification + err = json.Unmarshal(data, &dst.IbanAccountIdentification) + if err == nil { + jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) + if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct + dst.IbanAccountIdentification = nil + } else { + match++ + } + } else { + dst.IbanAccountIdentification = nil + } + + // try to unmarshal data into NOLocalAccountIdentification + err = json.Unmarshal(data, &dst.NOLocalAccountIdentification) + if err == nil { + jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) + if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct + dst.NOLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NOLocalAccountIdentification = nil + } + + // try to unmarshal data into NZLocalAccountIdentification + err = json.Unmarshal(data, &dst.NZLocalAccountIdentification) + if err == nil { + jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) + if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct + dst.NZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NZLocalAccountIdentification = nil + } + + // try to unmarshal data into NumberAndBicAccountIdentification + err = json.Unmarshal(data, &dst.NumberAndBicAccountIdentification) + if err == nil { + jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) + if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct + dst.NumberAndBicAccountIdentification = nil + } else { + match++ + } + } else { + dst.NumberAndBicAccountIdentification = nil + } + + // try to unmarshal data into PLLocalAccountIdentification + err = json.Unmarshal(data, &dst.PLLocalAccountIdentification) + if err == nil { + jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) + if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct + dst.PLLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.PLLocalAccountIdentification = nil + } + + // try to unmarshal data into SELocalAccountIdentification + err = json.Unmarshal(data, &dst.SELocalAccountIdentification) + if err == nil { + jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) + if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct + dst.SELocalAccountIdentification = nil + } 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 { + match++ + } + } else { + dst.UKLocalAccountIdentification = nil + } + + // try to unmarshal data into USLocalAccountIdentification + err = json.Unmarshal(data, &dst.USLocalAccountIdentification) + if err == nil { + jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) + if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct + dst.USLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.USLocalAccountIdentification = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AULocalAccountIdentification = nil + dst.BRLocalAccountIdentification = nil + dst.CALocalAccountIdentification = nil + dst.CZLocalAccountIdentification = nil + dst.DKLocalAccountIdentification = nil + dst.HKLocalAccountIdentification = nil + dst.HULocalAccountIdentification = nil + dst.IbanAccountIdentification = nil + dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil + dst.NumberAndBicAccountIdentification = nil + dst.PLLocalAccountIdentification = nil + dst.SELocalAccountIdentification = nil + dst.SGLocalAccountIdentification = nil + dst.UKLocalAccountIdentification = nil + dst.USLocalAccountIdentification = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BankAccountAccountIdentification)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BankAccountAccountIdentification)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BankAccountAccountIdentification) MarshalJSON() ([]byte, error) { + if src.AULocalAccountIdentification != nil { + return json.Marshal(&src.AULocalAccountIdentification) + } + + if src.BRLocalAccountIdentification != nil { + return json.Marshal(&src.BRLocalAccountIdentification) + } + + if src.CALocalAccountIdentification != nil { + return json.Marshal(&src.CALocalAccountIdentification) + } + + if src.CZLocalAccountIdentification != nil { + return json.Marshal(&src.CZLocalAccountIdentification) + } + + if src.DKLocalAccountIdentification != nil { + return json.Marshal(&src.DKLocalAccountIdentification) + } + + if src.HKLocalAccountIdentification != nil { + return json.Marshal(&src.HKLocalAccountIdentification) + } + + if src.HULocalAccountIdentification != nil { + return json.Marshal(&src.HULocalAccountIdentification) + } + + if src.IbanAccountIdentification != nil { + return json.Marshal(&src.IbanAccountIdentification) + } + + if src.NOLocalAccountIdentification != nil { + return json.Marshal(&src.NOLocalAccountIdentification) + } + + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + + if src.NumberAndBicAccountIdentification != nil { + return json.Marshal(&src.NumberAndBicAccountIdentification) + } + + if src.PLLocalAccountIdentification != nil { + return json.Marshal(&src.PLLocalAccountIdentification) + } + + if src.SELocalAccountIdentification != nil { + return json.Marshal(&src.SELocalAccountIdentification) + } + + if src.SGLocalAccountIdentification != nil { + return json.Marshal(&src.SGLocalAccountIdentification) + } + + if src.UKLocalAccountIdentification != nil { + return json.Marshal(&src.UKLocalAccountIdentification) + } + + if src.USLocalAccountIdentification != nil { + return json.Marshal(&src.USLocalAccountIdentification) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BankAccountAccountIdentification) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AULocalAccountIdentification != nil { + return obj.AULocalAccountIdentification + } + + if obj.BRLocalAccountIdentification != nil { + return obj.BRLocalAccountIdentification + } + + if obj.CALocalAccountIdentification != nil { + return obj.CALocalAccountIdentification + } + + if obj.CZLocalAccountIdentification != nil { + return obj.CZLocalAccountIdentification + } + + if obj.DKLocalAccountIdentification != nil { + return obj.DKLocalAccountIdentification + } + + if obj.HKLocalAccountIdentification != nil { + return obj.HKLocalAccountIdentification + } + + if obj.HULocalAccountIdentification != nil { + return obj.HULocalAccountIdentification + } + + if obj.IbanAccountIdentification != nil { + return obj.IbanAccountIdentification + } + + if obj.NOLocalAccountIdentification != nil { + return obj.NOLocalAccountIdentification + } + + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + + if obj.NumberAndBicAccountIdentification != nil { + return obj.NumberAndBicAccountIdentification + } + + if obj.PLLocalAccountIdentification != nil { + return obj.PLLocalAccountIdentification + } + + if obj.SELocalAccountIdentification != nil { + return obj.SELocalAccountIdentification + } + + if obj.SGLocalAccountIdentification != nil { + return obj.SGLocalAccountIdentification + } + + if obj.UKLocalAccountIdentification != nil { + return obj.UKLocalAccountIdentification + } + + if obj.USLocalAccountIdentification != nil { + return obj.USLocalAccountIdentification + } + + // all schemas are nil + return nil +} + +type NullableBankAccountAccountIdentification struct { + value *BankAccountAccountIdentification + isSet bool +} + +func (v NullableBankAccountAccountIdentification) Get() *BankAccountAccountIdentification { + return v.value +} + +func (v *NullableBankAccountAccountIdentification) Set(val *BankAccountAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountAccountIdentification(val *BankAccountAccountIdentification) *NullableBankAccountAccountIdentification { + return &NullableBankAccountAccountIdentification{value: val, isSet: true} +} + +func (v NullableBankAccountAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_bank_account_identification_type_requirement.go b/src/balanceplatform/model_bank_account_identification_type_requirement.go new file mode 100644 index 000000000..c00a75f6a --- /dev/null +++ b/src/balanceplatform/model_bank_account_identification_type_requirement.go @@ -0,0 +1,202 @@ +/* +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 BankAccountIdentificationTypeRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccountIdentificationTypeRequirement{} + +// BankAccountIdentificationTypeRequirement struct for BankAccountIdentificationTypeRequirement +type BankAccountIdentificationTypeRequirement struct { + // List of bank account identification types: eg.; [iban , numberAndBic] + BankAccountIdentificationTypes []string `json:"bankAccountIdentificationTypes,omitempty"` + // Specifies the bank account details for a particular route per required field in this object depending on the country of the bank account and the currency of the transfer. + Description *string `json:"description,omitempty"` + // **bankAccountIdentificationTypeRequirement** + Type string `json:"type"` +} + +// NewBankAccountIdentificationTypeRequirement instantiates a new BankAccountIdentificationTypeRequirement 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 NewBankAccountIdentificationTypeRequirement(type_ string) *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + this.Type = type_ + return &this +} + +// NewBankAccountIdentificationTypeRequirementWithDefaults instantiates a new BankAccountIdentificationTypeRequirement 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 NewBankAccountIdentificationTypeRequirementWithDefaults() *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + var type_ string = "bankAccountIdentificationTypeRequirement" + this.Type = type_ + return &this +} + +// GetBankAccountIdentificationTypes returns the BankAccountIdentificationTypes field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypes() []string { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + var ret []string + return ret + } + return o.BankAccountIdentificationTypes +} + +// GetBankAccountIdentificationTypesOk returns a tuple with the BankAccountIdentificationTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypesOk() ([]string, bool) { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + return nil, false + } + return o.BankAccountIdentificationTypes, true +} + +// HasBankAccountIdentificationTypes returns a boolean if a field has been set. +func (o *BankAccountIdentificationTypeRequirement) HasBankAccountIdentificationTypes() bool { + if o != nil && !common.IsNil(o.BankAccountIdentificationTypes) { + return true + } + + return false +} + +// SetBankAccountIdentificationTypes gets a reference to the given []string and assigns it to the BankAccountIdentificationTypes field. +func (o *BankAccountIdentificationTypeRequirement) SetBankAccountIdentificationTypes(v []string) { + o.BankAccountIdentificationTypes = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetType returns the Type field value +func (o *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BankAccountIdentificationTypeRequirement) SetType(v string) { + o.Type = v +} + +func (o BankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccountIdentificationTypeRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccountIdentificationTypes) { + toSerialize["bankAccountIdentificationTypes"] = o.BankAccountIdentificationTypes + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBankAccountIdentificationTypeRequirement struct { + value *BankAccountIdentificationTypeRequirement + isSet bool +} + +func (v NullableBankAccountIdentificationTypeRequirement) Get() *BankAccountIdentificationTypeRequirement { + return v.value +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Set(val *BankAccountIdentificationTypeRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountIdentificationTypeRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountIdentificationTypeRequirement(val *BankAccountIdentificationTypeRequirement) *NullableBankAccountIdentificationTypeRequirement { + return &NullableBankAccountIdentificationTypeRequirement{value: val, isSet: true} +} + +func (v NullableBankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountIdentificationTypeRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankAccountIdentificationTypeRequirement) isValidType() bool { + var allowedEnumValues = []string{"bankAccountIdentificationTypeRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_bank_identification.go b/src/balanceplatform/model_bank_identification.go new file mode 100644 index 000000000..33d3f90ba --- /dev/null +++ b/src/balanceplatform/model_bank_identification.go @@ -0,0 +1,206 @@ +/* +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 BankIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankIdentification{} + +// BankIdentification struct for BankIdentification +type BankIdentification struct { + Country *string `json:"country,omitempty"` + Identification *string `json:"identification,omitempty"` + IdentificationType *string `json:"identificationType,omitempty"` +} + +// NewBankIdentification instantiates a new BankIdentification 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 NewBankIdentification() *BankIdentification { + this := BankIdentification{} + return &this +} + +// NewBankIdentificationWithDefaults instantiates a new BankIdentification 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 NewBankIdentificationWithDefaults() *BankIdentification { + this := BankIdentification{} + return &this +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *BankIdentification) 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 *BankIdentification) 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 *BankIdentification) 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 *BankIdentification) SetCountry(v string) { + o.Country = &v +} + +// GetIdentification returns the Identification field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentification() string { + if o == nil || common.IsNil(o.Identification) { + var ret string + return ret + } + return *o.Identification +} + +// GetIdentificationOk returns a tuple with the Identification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationOk() (*string, bool) { + if o == nil || common.IsNil(o.Identification) { + return nil, false + } + return o.Identification, true +} + +// HasIdentification returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentification() bool { + if o != nil && !common.IsNil(o.Identification) { + return true + } + + return false +} + +// SetIdentification gets a reference to the given string and assigns it to the Identification field. +func (o *BankIdentification) SetIdentification(v string) { + o.Identification = &v +} + +// GetIdentificationType returns the IdentificationType field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentificationType() string { + if o == nil || common.IsNil(o.IdentificationType) { + var ret string + return ret + } + return *o.IdentificationType +} + +// GetIdentificationTypeOk returns a tuple with the IdentificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.IdentificationType) { + return nil, false + } + return o.IdentificationType, true +} + +// HasIdentificationType returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentificationType() bool { + if o != nil && !common.IsNil(o.IdentificationType) { + return true + } + + return false +} + +// SetIdentificationType gets a reference to the given string and assigns it to the IdentificationType field. +func (o *BankIdentification) SetIdentificationType(v string) { + o.IdentificationType = &v +} + +func (o BankIdentification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Identification) { + toSerialize["identification"] = o.Identification + } + if !common.IsNil(o.IdentificationType) { + toSerialize["identificationType"] = o.IdentificationType + } + return toSerialize, nil +} + +type NullableBankIdentification struct { + value *BankIdentification + isSet bool +} + +func (v NullableBankIdentification) Get() *BankIdentification { + return v.value +} + +func (v *NullableBankIdentification) Set(val *BankIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankIdentification(val *BankIdentification) *NullableBankIdentification { + return &NullableBankIdentification{value: val, isSet: true} +} + +func (v NullableBankIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankIdentification) isValidIdentificationType() bool { + var allowedEnumValues = []string{"iban", "routingNumber"} + for _, allowed := range allowedEnumValues { + if o.GetIdentificationType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_counterparty.go b/src/balanceplatform/model_counterparty.go new file mode 100644 index 000000000..cc23487d3 --- /dev/null +++ b/src/balanceplatform/model_counterparty.go @@ -0,0 +1,161 @@ +/* +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 Counterparty type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Counterparty{} + +// Counterparty struct for Counterparty +type Counterparty struct { + BankAccount *BankAccount `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"` +} + +// NewCounterparty instantiates a new Counterparty 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 NewCounterparty() *Counterparty { + this := Counterparty{} + return &this +} + +// NewCounterpartyWithDefaults instantiates a new Counterparty 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 NewCounterpartyWithDefaults() *Counterparty { + this := Counterparty{} + return &this +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *Counterparty) GetBankAccount() BankAccount { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccount + return ret + } + return *o.BankAccount +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Counterparty) GetBankAccountOk() (*BankAccount, bool) { + if o == nil || common.IsNil(o.BankAccount) { + return nil, false + } + return o.BankAccount, true +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *Counterparty) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccount and assigns it to the BankAccount field. +func (o *Counterparty) SetBankAccount(v BankAccount) { + o.BankAccount = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *Counterparty) GetTransferInstrumentId() string { + if o == nil || common.IsNil(o.TransferInstrumentId) { + var ret string + return ret + } + return *o.TransferInstrumentId +} + +// GetTransferInstrumentIdOk returns a tuple with the TransferInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Counterparty) GetTransferInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransferInstrumentId) { + return nil, false + } + return o.TransferInstrumentId, true +} + +// HasTransferInstrumentId returns a boolean if a field has been set. +func (o *Counterparty) HasTransferInstrumentId() bool { + if o != nil && !common.IsNil(o.TransferInstrumentId) { + return true + } + + return false +} + +// SetTransferInstrumentId gets a reference to the given string and assigns it to the TransferInstrumentId field. +func (o *Counterparty) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o Counterparty) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Counterparty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableCounterparty struct { + value *Counterparty + isSet bool +} + +func (v NullableCounterparty) Get() *Counterparty { + return v.value +} + +func (v *NullableCounterparty) Set(val *Counterparty) { + v.value = val + v.isSet = true +} + +func (v NullableCounterparty) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterparty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterparty(val *Counterparty) *NullableCounterparty { + return &NullableCounterparty{value: val, isSet: true} +} + +func (v NullableCounterparty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterparty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_counterparty_bank_restriction.go b/src/balanceplatform/model_counterparty_bank_restriction.go new file mode 100644 index 000000000..9cd3c2c14 --- /dev/null +++ b/src/balanceplatform/model_counterparty_bank_restriction.go @@ -0,0 +1,153 @@ +/* +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 CounterpartyBankRestriction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CounterpartyBankRestriction{} + +// CounterpartyBankRestriction struct for CounterpartyBankRestriction +type CounterpartyBankRestriction struct { + // Defines how the condition must be evaluated. + Operation string `json:"operation"` + // List of counterparty Bank Institutions and the operation. + Value []BankIdentification `json:"value,omitempty"` +} + +// NewCounterpartyBankRestriction instantiates a new CounterpartyBankRestriction 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 NewCounterpartyBankRestriction(operation string) *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + this.Operation = operation + return &this +} + +// NewCounterpartyBankRestrictionWithDefaults instantiates a new CounterpartyBankRestriction 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 NewCounterpartyBankRestrictionWithDefaults() *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + return &this +} + +// GetOperation returns the Operation field value +func (o *CounterpartyBankRestriction) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *CounterpartyBankRestriction) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *CounterpartyBankRestriction) SetOperation(v string) { + o.Operation = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CounterpartyBankRestriction) GetValue() []BankIdentification { + if o == nil || common.IsNil(o.Value) { + var ret []BankIdentification + 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 *CounterpartyBankRestriction) GetValueOk() ([]BankIdentification, 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 *CounterpartyBankRestriction) HasValue() bool { + if o != nil && !common.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given []BankIdentification and assigns it to the Value field. +func (o *CounterpartyBankRestriction) SetValue(v []BankIdentification) { + o.Value = v +} + +func (o CounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyBankRestriction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["operation"] = o.Operation + if !common.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableCounterpartyBankRestriction struct { + value *CounterpartyBankRestriction + isSet bool +} + +func (v NullableCounterpartyBankRestriction) Get() *CounterpartyBankRestriction { + return v.value +} + +func (v *NullableCounterpartyBankRestriction) Set(val *CounterpartyBankRestriction) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyBankRestriction) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyBankRestriction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyBankRestriction(val *CounterpartyBankRestriction) *NullableCounterpartyBankRestriction { + return &NullableCounterpartyBankRestriction{value: val, isSet: true} +} + +func (v NullableCounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyBankRestriction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_create_sweep_configuration_v2.go b/src/balanceplatform/model_create_sweep_configuration_v2.go new file mode 100644 index 000000000..dd05143e7 --- /dev/null +++ b/src/balanceplatform/model_create_sweep_configuration_v2.go @@ -0,0 +1,541 @@ +/* +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 CreateSweepConfigurationV2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CreateSweepConfigurationV2{} + +// CreateSweepConfigurationV2 struct for CreateSweepConfigurationV2 +type CreateSweepConfigurationV2 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"` + 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"` + // The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + Description *string `json:"description,omitempty"` + // 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"` + Schedule SweepSchedule `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"` + 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"` +} + +// NewCreateSweepConfigurationV2 instantiates a new CreateSweepConfigurationV2 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 NewCreateSweepConfigurationV2(counterparty SweepCounterparty, currency string, schedule SweepSchedule) *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + this.Counterparty = counterparty + this.Currency = currency + this.Schedule = schedule + var type_ string = "push" + this.Type = &type_ + return &this +} + +// NewCreateSweepConfigurationV2WithDefaults instantiates a new CreateSweepConfigurationV2 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 NewCreateSweepConfigurationV2WithDefaults() *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + var type_ string = "push" + this.Type = &type_ + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *CreateSweepConfigurationV2) SetCategory(v string) { + o.Category = &v +} + +// GetCounterparty returns the Counterparty field value +func (o *CreateSweepConfigurationV2) GetCounterparty() SweepCounterparty { + if o == nil { + var ret SweepCounterparty + return ret + } + + return o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCounterpartyOk() (*SweepCounterparty, bool) { + if o == nil { + return nil, false + } + return &o.Counterparty, true +} + +// SetCounterparty sets field value +func (o *CreateSweepConfigurationV2) SetCounterparty(v SweepCounterparty) { + o.Counterparty = v +} + +// GetCurrency returns the Currency field value +func (o *CreateSweepConfigurationV2) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *CreateSweepConfigurationV2) SetCurrency(v string) { + o.Currency = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetDescription(v string) { + o.Description = &v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *CreateSweepConfigurationV2) SetPriorities(v []string) { + o.Priorities = v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *CreateSweepConfigurationV2) SetReason(v string) { + o.Reason = &v +} + +// GetSchedule returns the Schedule field value +func (o *CreateSweepConfigurationV2) GetSchedule() SweepSchedule { + if o == nil { + var ret SweepSchedule + return ret + } + + return o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetScheduleOk() (*SweepSchedule, bool) { + if o == nil { + return nil, false + } + return &o.Schedule, true +} + +// SetSchedule sets field value +func (o *CreateSweepConfigurationV2) SetSchedule(v SweepSchedule) { + o.Schedule = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateSweepConfigurationV2) SetStatus(v string) { + o.Status = &v +} + +// GetSweepAmount returns the SweepAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetSweepAmount() Amount { + if o == nil || common.IsNil(o.SweepAmount) { + var ret Amount + return ret + } + return *o.SweepAmount +} + +// GetSweepAmountOk returns a tuple with the SweepAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetSweepAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.SweepAmount) { + return nil, false + } + return o.SweepAmount, true +} + +// HasSweepAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasSweepAmount() bool { + if o != nil && !common.IsNil(o.SweepAmount) { + return true + } + + return false +} + +// SetSweepAmount gets a reference to the given Amount and assigns it to the SweepAmount field. +func (o *CreateSweepConfigurationV2) SetSweepAmount(v Amount) { + o.SweepAmount = &v +} + +// GetTargetAmount returns the TargetAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetTargetAmount() Amount { + if o == nil || common.IsNil(o.TargetAmount) { + var ret Amount + return ret + } + return *o.TargetAmount +} + +// GetTargetAmountOk returns a tuple with the TargetAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetTargetAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TargetAmount) { + return nil, false + } + return o.TargetAmount, true +} + +// HasTargetAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasTargetAmount() bool { + if o != nil && !common.IsNil(o.TargetAmount) { + return true + } + + return false +} + +// SetTargetAmount gets a reference to the given Amount and assigns it to the TargetAmount field. +func (o *CreateSweepConfigurationV2) SetTargetAmount(v Amount) { + o.TargetAmount = &v +} + +// GetTriggerAmount returns the TriggerAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetTriggerAmount() Amount { + if o == nil || common.IsNil(o.TriggerAmount) { + var ret Amount + return ret + } + return *o.TriggerAmount +} + +// GetTriggerAmountOk returns a tuple with the TriggerAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetTriggerAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TriggerAmount) { + return nil, false + } + return o.TriggerAmount, true +} + +// HasTriggerAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasTriggerAmount() bool { + if o != nil && !common.IsNil(o.TriggerAmount) { + return true + } + + return false +} + +// SetTriggerAmount gets a reference to the given Amount and assigns it to the TriggerAmount field. +func (o *CreateSweepConfigurationV2) SetTriggerAmount(v Amount) { + o.TriggerAmount = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetType(v string) { + o.Type = &v +} + +func (o CreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSweepConfigurationV2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + toSerialize["counterparty"] = o.Counterparty + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + toSerialize["schedule"] = o.Schedule + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.SweepAmount) { + toSerialize["sweepAmount"] = o.SweepAmount + } + if !common.IsNil(o.TargetAmount) { + toSerialize["targetAmount"] = o.TargetAmount + } + if !common.IsNil(o.TriggerAmount) { + toSerialize["triggerAmount"] = o.TriggerAmount + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCreateSweepConfigurationV2 struct { + value *CreateSweepConfigurationV2 + isSet bool +} + +func (v NullableCreateSweepConfigurationV2) Get() *CreateSweepConfigurationV2 { + return v.value +} + +func (v *NullableCreateSweepConfigurationV2) Set(val *CreateSweepConfigurationV2) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSweepConfigurationV2) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSweepConfigurationV2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSweepConfigurationV2(val *CreateSweepConfigurationV2) *NullableCreateSweepConfigurationV2 { + return &NullableCreateSweepConfigurationV2{value: val, isSet: true} +} + +func (v NullableCreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSweepConfigurationV2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *CreateSweepConfigurationV2) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "internal", "platformPayment"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidReason() bool { + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidStatus() bool { + var allowedEnumValues = []string{"active", "inactive"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidType() bool { + var allowedEnumValues = []string{"pull", "push"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_delivery_address.go b/src/balanceplatform/model_delivery_address.go index 55b0d8fba..34da75413 100644 --- a/src/balanceplatform/model_delivery_address.go +++ b/src/balanceplatform/model_delivery_address.go @@ -23,11 +23,11 @@ type DeliveryAddress struct { 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. + // The street name. For example, if the address is \"Rokin 49\", provide \"Rokin\". Line1 *string `json:"line1,omitempty"` - // Second line of the address. + // The house number or name. For example, if the address is \"Rokin 49\", provide \"49\". Line2 *string `json:"line2,omitempty"` - // Third line of the address. + // Optional information about 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"` diff --git a/src/balanceplatform/model_get_tax_form_response.go b/src/balanceplatform/model_get_tax_form_response.go new file mode 100644 index 000000000..3b1072c5e --- /dev/null +++ b/src/balanceplatform/model_get_tax_form_response.go @@ -0,0 +1,163 @@ +/* +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 GetTaxFormResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &GetTaxFormResponse{} + +// GetTaxFormResponse struct for GetTaxFormResponse +type GetTaxFormResponse struct { + // The content of the tax form in Base64 format. + Content string `json:"content"` + // The content type of the tax form. Possible values: * **application/pdf** + ContentType *string `json:"contentType,omitempty"` +} + +// NewGetTaxFormResponse instantiates a new GetTaxFormResponse 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 NewGetTaxFormResponse(content string) *GetTaxFormResponse { + this := GetTaxFormResponse{} + this.Content = content + return &this +} + +// NewGetTaxFormResponseWithDefaults instantiates a new GetTaxFormResponse 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 NewGetTaxFormResponseWithDefaults() *GetTaxFormResponse { + this := GetTaxFormResponse{} + return &this +} + +// GetContent returns the Content field value +func (o *GetTaxFormResponse) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *GetTaxFormResponse) SetContent(v string) { + o.Content = v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *GetTaxFormResponse) GetContentType() string { + if o == nil || common.IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *GetTaxFormResponse) HasContentType() bool { + if o != nil && !common.IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *GetTaxFormResponse) SetContentType(v string) { + o.ContentType = &v +} + +func (o GetTaxFormResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTaxFormResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content"] = o.Content + if !common.IsNil(o.ContentType) { + toSerialize["contentType"] = o.ContentType + } + return toSerialize, nil +} + +type NullableGetTaxFormResponse struct { + value *GetTaxFormResponse + isSet bool +} + +func (v NullableGetTaxFormResponse) Get() *GetTaxFormResponse { + return v.value +} + +func (v *NullableGetTaxFormResponse) Set(val *GetTaxFormResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTaxFormResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTaxFormResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTaxFormResponse(val *GetTaxFormResponse) *NullableGetTaxFormResponse { + return &NullableGetTaxFormResponse{value: val, isSet: true} +} + +func (v NullableGetTaxFormResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTaxFormResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *GetTaxFormResponse) isValidContentType() bool { + var allowedEnumValues = []string{"application/pdf"} + for _, allowed := range allowedEnumValues { + if o.GetContentType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_hk_local_account_identification.go b/src/balanceplatform/model_hk_local_account_identification.go index 511889b98..c621c2053 100644 --- a/src/balanceplatform/model_hk_local_account_identification.go +++ b/src/balanceplatform/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification 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 NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_nz_local_account_identification.go b/src/balanceplatform/model_nz_local_account_identification.go index 91e80fb87..0bb386885 100644 --- a/src/balanceplatform/model_nz_local_account_identification.go +++ b/src/balanceplatform/model_nz_local_account_identification.go @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. AccountNumber string `json:"accountNumber"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification 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 NewNZLocalAccountIdentification(accountNumber string, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) GetBankCode() string { - if o == nil { - var ret string - return ret - } - - return o.BankCode -} - -// GetBankCodeOk returns a tuple with the BankCode field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_payment_instrument_requirement.go b/src/balanceplatform/model_payment_instrument_requirement.go new file mode 100644 index 000000000..179e17159 --- /dev/null +++ b/src/balanceplatform/model_payment_instrument_requirement.go @@ -0,0 +1,285 @@ +/* +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 PaymentInstrumentRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrumentRequirement{} + +// PaymentInstrumentRequirement struct for PaymentInstrumentRequirement +type PaymentInstrumentRequirement struct { + // Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + Description *string `json:"description,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + IssuingCountryCode *string `json:"issuingCountryCode,omitempty"` + // Specifies if the requirement only applies to transfers to another balance platform. + OnlyForCrossBalancePlatform *bool `json:"onlyForCrossBalancePlatform,omitempty"` + // The type of the payment instrument. For example, \"BankAccount\" or \"Card\". + PaymentInstrumentType *string `json:"paymentInstrumentType,omitempty"` + // **paymentInstrumentRequirement** + Type string `json:"type"` +} + +// NewPaymentInstrumentRequirement instantiates a new PaymentInstrumentRequirement 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 NewPaymentInstrumentRequirement(type_ string) *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + this.Type = type_ + return &this +} + +// NewPaymentInstrumentRequirementWithDefaults instantiates a new PaymentInstrumentRequirement 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 NewPaymentInstrumentRequirementWithDefaults() *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + var type_ string = "paymentInstrumentRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetIssuingCountryCode returns the IssuingCountryCode field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCode() string { + if o == nil || common.IsNil(o.IssuingCountryCode) { + var ret string + return ret + } + return *o.IssuingCountryCode +} + +// GetIssuingCountryCodeOk returns a tuple with the IssuingCountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.IssuingCountryCode) { + return nil, false + } + return o.IssuingCountryCode, true +} + +// HasIssuingCountryCode returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasIssuingCountryCode() bool { + if o != nil && !common.IsNil(o.IssuingCountryCode) { + return true + } + + return false +} + +// SetIssuingCountryCode gets a reference to the given string and assigns it to the IssuingCountryCode field. +func (o *PaymentInstrumentRequirement) SetIssuingCountryCode(v string) { + o.IssuingCountryCode = &v +} + +// GetOnlyForCrossBalancePlatform returns the OnlyForCrossBalancePlatform field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatform() bool { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + var ret bool + return ret + } + return *o.OnlyForCrossBalancePlatform +} + +// GetOnlyForCrossBalancePlatformOk returns a tuple with the OnlyForCrossBalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatformOk() (*bool, bool) { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + return nil, false + } + return o.OnlyForCrossBalancePlatform, true +} + +// HasOnlyForCrossBalancePlatform returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasOnlyForCrossBalancePlatform() bool { + if o != nil && !common.IsNil(o.OnlyForCrossBalancePlatform) { + return true + } + + return false +} + +// SetOnlyForCrossBalancePlatform gets a reference to the given bool and assigns it to the OnlyForCrossBalancePlatform field. +func (o *PaymentInstrumentRequirement) SetOnlyForCrossBalancePlatform(v bool) { + o.OnlyForCrossBalancePlatform = &v +} + +// GetPaymentInstrumentType returns the PaymentInstrumentType field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentType() string { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + var ret string + return ret + } + return *o.PaymentInstrumentType +} + +// GetPaymentInstrumentTypeOk returns a tuple with the PaymentInstrumentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + return nil, false + } + return o.PaymentInstrumentType, true +} + +// HasPaymentInstrumentType returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasPaymentInstrumentType() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentType) { + return true + } + + return false +} + +// SetPaymentInstrumentType gets a reference to the given string and assigns it to the PaymentInstrumentType field. +func (o *PaymentInstrumentRequirement) SetPaymentInstrumentType(v string) { + o.PaymentInstrumentType = &v +} + +// GetType returns the Type field value +func (o *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentInstrumentRequirement) SetType(v string) { + o.Type = v +} + +func (o PaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrumentRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.IssuingCountryCode) { + toSerialize["issuingCountryCode"] = o.IssuingCountryCode + } + if !common.IsNil(o.OnlyForCrossBalancePlatform) { + toSerialize["onlyForCrossBalancePlatform"] = o.OnlyForCrossBalancePlatform + } + if !common.IsNil(o.PaymentInstrumentType) { + toSerialize["paymentInstrumentType"] = o.PaymentInstrumentType + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePaymentInstrumentRequirement struct { + value *PaymentInstrumentRequirement + isSet bool +} + +func (v NullablePaymentInstrumentRequirement) Get() *PaymentInstrumentRequirement { + return v.value +} + +func (v *NullablePaymentInstrumentRequirement) Set(val *PaymentInstrumentRequirement) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentRequirement(val *PaymentInstrumentRequirement) *NullablePaymentInstrumentRequirement { + return &NullablePaymentInstrumentRequirement{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PaymentInstrumentRequirement) isValidPaymentInstrumentType() bool { + var allowedEnumValues = []string{"BankAccount", "Card"} + for _, allowed := range allowedEnumValues { + if o.GetPaymentInstrumentType() == allowed { + return true + } + } + return false +} +func (o *PaymentInstrumentRequirement) isValidType() bool { + var allowedEnumValues = []string{"paymentInstrumentRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_platform_payment_configuration.go b/src/balanceplatform/model_platform_payment_configuration.go index fdde64c29..2e1c54e26 100644 --- a/src/balanceplatform/model_platform_payment_configuration.go +++ b/src/balanceplatform/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &PlatformPaymentConfiguration{} // PlatformPaymentConfiguration struct for PlatformPaymentConfiguration type PlatformPaymentConfiguration struct { - // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. SalesDayClosingTime *string `json:"salesDayClosingTime,omitempty"` - // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. SettlementDelayDays *int32 `json:"settlementDelayDays,omitempty"` } diff --git a/src/balanceplatform/model_sweep_configuration_v2.go b/src/balanceplatform/model_sweep_configuration_v2.go index eddb6979d..804869b5e 100644 --- a/src/balanceplatform/model_sweep_configuration_v2.go +++ b/src/balanceplatform/model_sweep_configuration_v2.go @@ -541,7 +541,7 @@ func (o *SweepConfigurationV2) isValidCategory() bool { return false } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/balanceplatform/model_sweep_counterparty.go b/src/balanceplatform/model_sweep_counterparty.go index 5a14175f8..a6cdc0f89 100644 --- a/src/balanceplatform/model_sweep_counterparty.go +++ b/src/balanceplatform/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &SweepCounterparty{} type SweepCounterparty struct { // The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. BalanceAccountId *string `json:"balanceAccountId,omitempty"` - // The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. MerchantAccount *string `json:"merchantAccount,omitempty"` - // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } diff --git a/src/balanceplatform/model_transaction_rule.go b/src/balanceplatform/model_transaction_rule.go index 0410f75eb..035e5213b 100644 --- a/src/balanceplatform/model_transaction_rule.go +++ b/src/balanceplatform/model_transaction_rule.go @@ -33,7 +33,7 @@ type TransactionRule struct { 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**. + // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. 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**. diff --git a/src/balanceplatform/model_transaction_rule_info.go b/src/balanceplatform/model_transaction_rule_info.go index 7281ac01a..21df6c958 100644 --- a/src/balanceplatform/model_transaction_rule_info.go +++ b/src/balanceplatform/model_transaction_rule_info.go @@ -31,7 +31,7 @@ type TransactionRuleInfo struct { 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**. + // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. 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**. diff --git a/src/balanceplatform/model_transaction_rule_restrictions.go b/src/balanceplatform/model_transaction_rule_restrictions.go index 547a712a8..601238eeb 100644 --- a/src/balanceplatform/model_transaction_rule_restrictions.go +++ b/src/balanceplatform/model_transaction_rule_restrictions.go @@ -21,6 +21,7 @@ var _ common.MappedNullable = &TransactionRuleRestrictions{} type TransactionRuleRestrictions struct { ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` + CounterpartyBank *CounterpartyBankRestriction `json:"counterpartyBank,omitempty"` Countries *CountriesRestriction `json:"countries,omitempty"` DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` @@ -116,6 +117,38 @@ func (o *TransactionRuleRestrictions) SetBrandVariants(v BrandVariantsRestrictio o.BrandVariants = &v } +// GetCounterpartyBank returns the CounterpartyBank field value if set, zero value otherwise. +func (o *TransactionRuleRestrictions) GetCounterpartyBank() CounterpartyBankRestriction { + if o == nil || common.IsNil(o.CounterpartyBank) { + var ret CounterpartyBankRestriction + return ret + } + return *o.CounterpartyBank +} + +// GetCounterpartyBankOk returns a tuple with the CounterpartyBank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleRestrictions) GetCounterpartyBankOk() (*CounterpartyBankRestriction, bool) { + if o == nil || common.IsNil(o.CounterpartyBank) { + return nil, false + } + return o.CounterpartyBank, true +} + +// HasCounterpartyBank returns a boolean if a field has been set. +func (o *TransactionRuleRestrictions) HasCounterpartyBank() bool { + if o != nil && !common.IsNil(o.CounterpartyBank) { + return true + } + + return false +} + +// SetCounterpartyBank gets a reference to the given CounterpartyBankRestriction and assigns it to the CounterpartyBank field. +func (o *TransactionRuleRestrictions) SetCounterpartyBank(v CounterpartyBankRestriction) { + o.CounterpartyBank = &v +} + // GetCountries returns the Countries field value if set, zero value otherwise. func (o *TransactionRuleRestrictions) GetCountries() CountriesRestriction { if o == nil || common.IsNil(o.Countries) { @@ -516,6 +549,9 @@ func (o TransactionRuleRestrictions) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BrandVariants) { toSerialize["brandVariants"] = o.BrandVariants } + if !common.IsNil(o.CounterpartyBank) { + toSerialize["counterpartyBank"] = o.CounterpartyBank + } if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } diff --git a/src/balanceplatform/model_transfer_route.go b/src/balanceplatform/model_transfer_route.go new file mode 100644 index 000000000..6dc10bb59 --- /dev/null +++ b/src/balanceplatform/model_transfer_route.go @@ -0,0 +1,291 @@ +/* +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 TransferRoute type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRoute{} + +// TransferRoute struct for TransferRoute +type TransferRoute struct { + // 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. + Category *string `json:"category,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + Country *string `json:"country,omitempty"` + // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + Currency *string `json:"currency,omitempty"` + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. 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). + Priority *string `json:"priority,omitempty"` + Requirements *TransferRouteRequirements `json:"requirements,omitempty"` +} + +// NewTransferRoute instantiates a new TransferRoute 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 NewTransferRoute() *TransferRoute { + this := TransferRoute{} + return &this +} + +// NewTransferRouteWithDefaults instantiates a new TransferRoute 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 NewTransferRouteWithDefaults() *TransferRoute { + this := TransferRoute{} + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *TransferRoute) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *TransferRoute) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *TransferRoute) SetCategory(v string) { + o.Category = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) SetCurrency(v string) { + o.Currency = &v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *TransferRoute) GetPriority() string { + if o == nil || common.IsNil(o.Priority) { + var ret string + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetPriorityOk() (*string, bool) { + if o == nil || common.IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *TransferRoute) HasPriority() bool { + if o != nil && !common.IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given string and assigns it to the Priority field. +func (o *TransferRoute) SetPriority(v string) { + o.Priority = &v +} + +// GetRequirements returns the Requirements field value if set, zero value otherwise. +func (o *TransferRoute) GetRequirements() TransferRouteRequirements { + if o == nil || common.IsNil(o.Requirements) { + var ret TransferRouteRequirements + return ret + } + return *o.Requirements +} + +// GetRequirementsOk returns a tuple with the Requirements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetRequirementsOk() (*TransferRouteRequirements, bool) { + if o == nil || common.IsNil(o.Requirements) { + return nil, false + } + return o.Requirements, true +} + +// HasRequirements returns a boolean if a field has been set. +func (o *TransferRoute) HasRequirements() bool { + if o != nil && !common.IsNil(o.Requirements) { + return true + } + + return false +} + +// SetRequirements gets a reference to the given TransferRouteRequirements and assigns it to the Requirements field. +func (o *TransferRoute) SetRequirements(v TransferRouteRequirements) { + o.Requirements = &v +} + +func (o TransferRoute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRoute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !common.IsNil(o.Requirements) { + toSerialize["requirements"] = o.Requirements + } + return toSerialize, nil +} + +type NullableTransferRoute struct { + value *TransferRoute + isSet bool +} + +func (v NullableTransferRoute) Get() *TransferRoute { + return v.value +} + +func (v *NullableTransferRoute) Set(val *TransferRoute) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRoute(val *TransferRoute) *NullableTransferRoute { + return &NullableTransferRoute{value: val, isSet: true} +} + +func (v NullableTransferRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransferRoute) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "upgrade"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *TransferRoute) isValidPriority() bool { + var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_transfer_route_request.go b/src/balanceplatform/model_transfer_route_request.go new file mode 100644 index 000000000..c0c942b51 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_request.go @@ -0,0 +1,329 @@ +/* +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 TransferRouteRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteRequest{} + +// TransferRouteRequest struct for TransferRouteRequest +type TransferRouteRequest struct { + // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). Required if `counterparty` is **transferInstrumentId**. + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + // The unique identifier assigned to the balance platform associated with the account holder. + BalancePlatform string `json:"balancePlatform"` + // 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. + Category string `json:"category"` + Counterparty *Counterparty `json:"counterparty,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. > Either `counterparty` or `country` field must be provided in a transfer route request. + Country *string `json:"country,omitempty"` + // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + Currency string `json:"currency"` + // The list of priorities for the bank transfer. Priorities set the speed at which the transfer is sent and the fees that you have to pay. Multiple values can be provided. 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). + Priorities []string `json:"priorities,omitempty"` +} + +// NewTransferRouteRequest instantiates a new TransferRouteRequest 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 NewTransferRouteRequest(balancePlatform string, category string, currency string) *TransferRouteRequest { + this := TransferRouteRequest{} + this.BalancePlatform = balancePlatform + this.Category = category + this.Currency = currency + return &this +} + +// NewTransferRouteRequestWithDefaults instantiates a new TransferRouteRequest 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 NewTransferRouteRequestWithDefaults() *TransferRouteRequest { + this := TransferRouteRequest{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetBalanceAccountId() string { + if o == nil || common.IsNil(o.BalanceAccountId) { + var ret string + return ret + } + return *o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetBalanceAccountIdOk() (*string, bool) { + if o == nil || common.IsNil(o.BalanceAccountId) { + return nil, false + } + return o.BalanceAccountId, true +} + +// HasBalanceAccountId returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasBalanceAccountId() bool { + if o != nil && !common.IsNil(o.BalanceAccountId) { + return true + } + + return false +} + +// SetBalanceAccountId gets a reference to the given string and assigns it to the BalanceAccountId field. +func (o *TransferRouteRequest) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *TransferRouteRequest) GetBalancePlatform() string { + if o == nil { + var ret string + return ret + } + + return o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *TransferRouteRequest) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetCategory returns the Category field value +func (o *TransferRouteRequest) GetCategory() string { + if o == nil { + var ret string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *TransferRouteRequest) SetCategory(v string) { + o.Category = v +} + +// GetCounterparty returns the Counterparty field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetCounterparty() Counterparty { + if o == nil || common.IsNil(o.Counterparty) { + var ret Counterparty + return ret + } + return *o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCounterpartyOk() (*Counterparty, bool) { + if o == nil || common.IsNil(o.Counterparty) { + return nil, false + } + return o.Counterparty, true +} + +// HasCounterparty returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasCounterparty() bool { + if o != nil && !common.IsNil(o.Counterparty) { + return true + } + + return false +} + +// SetCounterparty gets a reference to the given Counterparty and assigns it to the Counterparty field. +func (o *TransferRouteRequest) SetCounterparty(v Counterparty) { + o.Counterparty = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value +func (o *TransferRouteRequest) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *TransferRouteRequest) SetCurrency(v string) { + o.Currency = v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *TransferRouteRequest) SetPriorities(v []string) { + o.Priorities = v +} + +func (o TransferRouteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["category"] = o.Category + if !common.IsNil(o.Counterparty) { + toSerialize["counterparty"] = o.Counterparty + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + return toSerialize, nil +} + +type NullableTransferRouteRequest struct { + value *TransferRouteRequest + isSet bool +} + +func (v NullableTransferRouteRequest) Get() *TransferRouteRequest { + return v.value +} + +func (v *NullableTransferRouteRequest) Set(val *TransferRouteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequest(val *TransferRouteRequest) *NullableTransferRouteRequest { + return &NullableTransferRouteRequest{value: val, isSet: true} +} + +func (v NullableTransferRouteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransferRouteRequest) isValidCategory() bool { + var allowedEnumValues = []string{"bank"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_transfer_route_requirements.go b/src/balanceplatform/model_transfer_route_requirements.go new file mode 100644 index 000000000..052b22446 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_requirements.go @@ -0,0 +1,203 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "fmt" +) + +// TransferRouteRequirements - A set of rules defined by clearing houses and banking partners. Your transfer request must adhere to these rules to ensure successful initiation of transfer. Based on the priority, one or more requirements may be returned. Each requirement is defined with a `type` and `description`. +type TransferRouteRequirements struct { + AddressRequirement *AddressRequirement + AmountMinMaxRequirement *AmountMinMaxRequirement + BankAccountIdentificationTypeRequirement *BankAccountIdentificationTypeRequirement + PaymentInstrumentRequirement *PaymentInstrumentRequirement +} + +// AddressRequirementAsTransferRouteRequirements is a convenience function that returns AddressRequirement wrapped in TransferRouteRequirements +func AddressRequirementAsTransferRouteRequirements(v *AddressRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AddressRequirement: v, + } +} + +// AmountMinMaxRequirementAsTransferRouteRequirements is a convenience function that returns AmountMinMaxRequirement wrapped in TransferRouteRequirements +func AmountMinMaxRequirementAsTransferRouteRequirements(v *AmountMinMaxRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AmountMinMaxRequirement: v, + } +} + +// BankAccountIdentificationTypeRequirementAsTransferRouteRequirements is a convenience function that returns BankAccountIdentificationTypeRequirement wrapped in TransferRouteRequirements +func BankAccountIdentificationTypeRequirementAsTransferRouteRequirements(v *BankAccountIdentificationTypeRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + BankAccountIdentificationTypeRequirement: v, + } +} + +// PaymentInstrumentRequirementAsTransferRouteRequirements is a convenience function that returns PaymentInstrumentRequirement wrapped in TransferRouteRequirements +func PaymentInstrumentRequirementAsTransferRouteRequirements(v *PaymentInstrumentRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + PaymentInstrumentRequirement: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AddressRequirement + err = json.Unmarshal(data, &dst.AddressRequirement) + if err == nil { + jsonAddressRequirement, _ := json.Marshal(dst.AddressRequirement) + if string(jsonAddressRequirement) == "{}" || !dst.AddressRequirement.isValidType() { // empty struct + dst.AddressRequirement = nil + } else { + match++ + } + } else { + dst.AddressRequirement = nil + } + + // try to unmarshal data into AmountMinMaxRequirement + err = json.Unmarshal(data, &dst.AmountMinMaxRequirement) + if err == nil { + jsonAmountMinMaxRequirement, _ := json.Marshal(dst.AmountMinMaxRequirement) + if string(jsonAmountMinMaxRequirement) == "{}" || !dst.AmountMinMaxRequirement.isValidType() { // empty struct + dst.AmountMinMaxRequirement = nil + } else { + match++ + } + } else { + dst.AmountMinMaxRequirement = nil + } + + // try to unmarshal data into BankAccountIdentificationTypeRequirement + err = json.Unmarshal(data, &dst.BankAccountIdentificationTypeRequirement) + if err == nil { + jsonBankAccountIdentificationTypeRequirement, _ := json.Marshal(dst.BankAccountIdentificationTypeRequirement) + if string(jsonBankAccountIdentificationTypeRequirement) == "{}" || !dst.BankAccountIdentificationTypeRequirement.isValidType() { // empty struct + dst.BankAccountIdentificationTypeRequirement = nil + } else { + match++ + } + } else { + dst.BankAccountIdentificationTypeRequirement = nil + } + + // try to unmarshal data into PaymentInstrumentRequirement + err = json.Unmarshal(data, &dst.PaymentInstrumentRequirement) + if err == nil { + jsonPaymentInstrumentRequirement, _ := json.Marshal(dst.PaymentInstrumentRequirement) + if string(jsonPaymentInstrumentRequirement) == "{}" || !dst.PaymentInstrumentRequirement.isValidType() { // empty struct + dst.PaymentInstrumentRequirement = nil + } else { + match++ + } + } else { + dst.PaymentInstrumentRequirement = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AddressRequirement = nil + dst.AmountMinMaxRequirement = nil + dst.BankAccountIdentificationTypeRequirement = nil + dst.PaymentInstrumentRequirement = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferRouteRequirements)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferRouteRequirements)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferRouteRequirements) MarshalJSON() ([]byte, error) { + if src.AddressRequirement != nil { + return json.Marshal(&src.AddressRequirement) + } + + if src.AmountMinMaxRequirement != nil { + return json.Marshal(&src.AmountMinMaxRequirement) + } + + if src.BankAccountIdentificationTypeRequirement != nil { + return json.Marshal(&src.BankAccountIdentificationTypeRequirement) + } + + if src.PaymentInstrumentRequirement != nil { + return json.Marshal(&src.PaymentInstrumentRequirement) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferRouteRequirements) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AddressRequirement != nil { + return obj.AddressRequirement + } + + if obj.AmountMinMaxRequirement != nil { + return obj.AmountMinMaxRequirement + } + + if obj.BankAccountIdentificationTypeRequirement != nil { + return obj.BankAccountIdentificationTypeRequirement + } + + if obj.PaymentInstrumentRequirement != nil { + return obj.PaymentInstrumentRequirement + } + + // all schemas are nil + return nil +} + +type NullableTransferRouteRequirements struct { + value *TransferRouteRequirements + isSet bool +} + +func (v NullableTransferRouteRequirements) Get() *TransferRouteRequirements { + return v.value +} + +func (v *NullableTransferRouteRequirements) Set(val *TransferRouteRequirements) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequirements) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequirements) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequirements(val *TransferRouteRequirements) *NullableTransferRouteRequirements { + return &NullableTransferRouteRequirements{value: val, isSet: true} +} + +func (v NullableTransferRouteRequirements) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteRequirements) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_transfer_route_response.go b/src/balanceplatform/model_transfer_route_response.go new file mode 100644 index 000000000..7c1bcc3e6 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_response.go @@ -0,0 +1,125 @@ +/* +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 TransferRouteResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteResponse{} + +// TransferRouteResponse struct for TransferRouteResponse +type TransferRouteResponse struct { + // List of available priorities for a transfer, along with requirements. Use this information to initiate a transfer. + TransferRoutes []TransferRoute `json:"transferRoutes,omitempty"` +} + +// NewTransferRouteResponse instantiates a new TransferRouteResponse 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 NewTransferRouteResponse() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// NewTransferRouteResponseWithDefaults instantiates a new TransferRouteResponse 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 NewTransferRouteResponseWithDefaults() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// GetTransferRoutes returns the TransferRoutes field value if set, zero value otherwise. +func (o *TransferRouteResponse) GetTransferRoutes() []TransferRoute { + if o == nil || common.IsNil(o.TransferRoutes) { + var ret []TransferRoute + return ret + } + return o.TransferRoutes +} + +// GetTransferRoutesOk returns a tuple with the TransferRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteResponse) GetTransferRoutesOk() ([]TransferRoute, bool) { + if o == nil || common.IsNil(o.TransferRoutes) { + return nil, false + } + return o.TransferRoutes, true +} + +// HasTransferRoutes returns a boolean if a field has been set. +func (o *TransferRouteResponse) HasTransferRoutes() bool { + if o != nil && !common.IsNil(o.TransferRoutes) { + return true + } + + return false +} + +// SetTransferRoutes gets a reference to the given []TransferRoute and assigns it to the TransferRoutes field. +func (o *TransferRouteResponse) SetTransferRoutes(v []TransferRoute) { + o.TransferRoutes = v +} + +func (o TransferRouteResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.TransferRoutes) { + toSerialize["transferRoutes"] = o.TransferRoutes + } + return toSerialize, nil +} + +type NullableTransferRouteResponse struct { + value *TransferRouteResponse + isSet bool +} + +func (v NullableTransferRouteResponse) Get() *TransferRouteResponse { + return v.value +} + +func (v *NullableTransferRouteResponse) Set(val *TransferRouteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteResponse(val *TransferRouteResponse) *NullableTransferRouteResponse { + return &NullableTransferRouteResponse{value: val, isSet: true} +} + +func (v NullableTransferRouteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_update_sweep_configuration_v2.go b/src/balanceplatform/model_update_sweep_configuration_v2.go index 9aae6448e..1afd5dfee 100644 --- a/src/balanceplatform/model_update_sweep_configuration_v2.go +++ b/src/balanceplatform/model_update_sweep_configuration_v2.go @@ -577,7 +577,7 @@ func (o *UpdateSweepConfigurationV2) isValidCategory() bool { return false } func (o *UpdateSweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/binlookup/api_general.go b/src/binlookup/api_general.go index aa7517d5d..49d9f529f 100644 --- a/src/binlookup/api_general.go +++ b/src/binlookup/api_general.go @@ -65,6 +65,10 @@ func (a *GeneralApi) Get3dsAvailability(ctx context.Context, r GeneralApiGet3dsA headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -118,5 +122,9 @@ func (a *GeneralApi) GetCostEstimate(ctx context.Context, r GeneralApiGetCostEst headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/binlookup/model_ds_public_key_detail.go b/src/binlookup/model_ds_public_key_detail.go index 53c7e090b..75a1ace16 100644 --- a/src/binlookup/model_ds_public_key_detail.go +++ b/src/binlookup/model_ds_public_key_detail.go @@ -27,6 +27,8 @@ type DSPublicKeyDetail struct { FromSDKVersion *string `json:"fromSDKVersion,omitempty"` // Public key. The 3D Secure 2 SDK encrypts the device information by using the DS public key. PublicKey *string `json:"publicKey,omitempty"` + // Directory Server root certificates. The 3D Secure 2 SDK verifies the ACS signed content using the rootCertificates. + RootCertificates *string `json:"rootCertificates,omitempty"` } // NewDSPublicKeyDetail instantiates a new DSPublicKeyDetail object @@ -174,6 +176,38 @@ func (o *DSPublicKeyDetail) SetPublicKey(v string) { o.PublicKey = &v } +// GetRootCertificates returns the RootCertificates field value if set, zero value otherwise. +func (o *DSPublicKeyDetail) GetRootCertificates() string { + if o == nil || common.IsNil(o.RootCertificates) { + var ret string + return ret + } + return *o.RootCertificates +} + +// GetRootCertificatesOk returns a tuple with the RootCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DSPublicKeyDetail) GetRootCertificatesOk() (*string, bool) { + if o == nil || common.IsNil(o.RootCertificates) { + return nil, false + } + return o.RootCertificates, true +} + +// HasRootCertificates returns a boolean if a field has been set. +func (o *DSPublicKeyDetail) HasRootCertificates() bool { + if o != nil && !common.IsNil(o.RootCertificates) { + return true + } + + return false +} + +// SetRootCertificates gets a reference to the given string and assigns it to the RootCertificates field. +func (o *DSPublicKeyDetail) SetRootCertificates(v string) { + o.RootCertificates = &v +} + func (o DSPublicKeyDetail) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -196,6 +230,9 @@ func (o DSPublicKeyDetail) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.PublicKey) { toSerialize["publicKey"] = o.PublicKey } + if !common.IsNil(o.RootCertificates) { + toSerialize["rootCertificates"] = o.RootCertificates + } return toSerialize, nil } diff --git a/src/checkout/api_classic_checkout_sdk.go b/src/checkout/api_classic_checkout_sdk.go index ad26c8c60..7ba7309f8 100644 --- a/src/checkout/api_classic_checkout_sdk.go +++ b/src/checkout/api_classic_checkout_sdk.go @@ -79,6 +79,10 @@ func (a *ClassicCheckoutSDKApi) PaymentSession(ctx context.Context, r ClassicChe headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -142,5 +146,9 @@ func (a *ClassicCheckoutSDKApi) VerifyPaymentResult(ctx context.Context, r Class headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_modifications.go b/src/checkout/api_modifications.go index a5f48aa97..d38af98ee 100644 --- a/src/checkout/api_modifications.go +++ b/src/checkout/api_modifications.go @@ -22,8 +22,8 @@ type ModificationsApi common.Service // All parameters accepted by ModificationsApi.CancelAuthorisedPayment type ModificationsApiCancelAuthorisedPaymentInput struct { - idempotencyKey *string - createStandalonePaymentCancelRequest *CreateStandalonePaymentCancelRequest + idempotencyKey *string + standalonePaymentCancelRequest *StandalonePaymentCancelRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -32,8 +32,8 @@ func (r ModificationsApiCancelAuthorisedPaymentInput) IdempotencyKey(idempotency return r } -func (r ModificationsApiCancelAuthorisedPaymentInput) CreateStandalonePaymentCancelRequest(createStandalonePaymentCancelRequest CreateStandalonePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentInput { - r.createStandalonePaymentCancelRequest = &createStandalonePaymentCancelRequest +func (r ModificationsApiCancelAuthorisedPaymentInput) StandalonePaymentCancelRequest(standalonePaymentCancelRequest StandalonePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentInput { + r.standalonePaymentCancelRequest = &standalonePaymentCancelRequest return r } @@ -59,10 +59,10 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCancelAuthorisedPaymentInput - Request parameters, see CancelAuthorisedPaymentInput -@return StandalonePaymentCancelResource, *http.Response, error +@return StandalonePaymentCancelResponse, *http.Response, error */ -func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentInput) (StandalonePaymentCancelResource, *http.Response, error) { - res := &StandalonePaymentCancelResource{} +func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentInput) (StandalonePaymentCancelResponse, *http.Response, error) { + res := &StandalonePaymentCancelResponse{} path := "/cancels" queryParams := url.Values{} headerParams := make(map[string]string) @@ -72,7 +72,7 @@ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r Modifi httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createStandalonePaymentCancelRequest, + r.standalonePaymentCancelRequest, res, http.MethodPost, a.BasePath()+path, @@ -80,14 +80,18 @@ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r Modifi headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by ModificationsApi.CancelAuthorisedPaymentByPspReference type ModificationsApiCancelAuthorisedPaymentByPspReferenceInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentCancelRequest *CreatePaymentCancelRequest + paymentPspReference string + idempotencyKey *string + paymentCancelRequest *PaymentCancelRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -96,8 +100,8 @@ func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) IdempotencyK return r } -func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) CreatePaymentCancelRequest(createPaymentCancelRequest CreatePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentByPspReferenceInput { - r.createPaymentCancelRequest = &createPaymentCancelRequest +func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) PaymentCancelRequest(paymentCancelRequest PaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentByPspReferenceInput { + r.paymentCancelRequest = &paymentCancelRequest return r } @@ -125,10 +129,10 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput - Request parameters, see CancelAuthorisedPaymentByPspReferenceInput -@return PaymentCancelResource, *http.Response, error +@return PaymentCancelResponse, *http.Response, error */ -func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) (PaymentCancelResource, *http.Response, error) { - res := &PaymentCancelResource{} +func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) (PaymentCancelResponse, *http.Response, error) { + res := &PaymentCancelResponse{} path := "/payments/{paymentPspReference}/cancels" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -139,7 +143,7 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Con httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentCancelRequest, + r.paymentCancelRequest, res, http.MethodPost, a.BasePath()+path, @@ -147,14 +151,18 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Con headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by ModificationsApi.CaptureAuthorisedPayment type ModificationsApiCaptureAuthorisedPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentCaptureRequest *CreatePaymentCaptureRequest + paymentPspReference string + idempotencyKey *string + paymentCaptureRequest *PaymentCaptureRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -163,8 +171,8 @@ func (r ModificationsApiCaptureAuthorisedPaymentInput) IdempotencyKey(idempotenc return r } -func (r ModificationsApiCaptureAuthorisedPaymentInput) CreatePaymentCaptureRequest(createPaymentCaptureRequest CreatePaymentCaptureRequest) ModificationsApiCaptureAuthorisedPaymentInput { - r.createPaymentCaptureRequest = &createPaymentCaptureRequest +func (r ModificationsApiCaptureAuthorisedPaymentInput) PaymentCaptureRequest(paymentCaptureRequest PaymentCaptureRequest) ModificationsApiCaptureAuthorisedPaymentInput { + r.paymentCaptureRequest = &paymentCaptureRequest return r } @@ -192,10 +200,10 @@ For more information, refer to [Capture](https://docs.adyen.com/online-payments/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCaptureAuthorisedPaymentInput - Request parameters, see CaptureAuthorisedPaymentInput -@return PaymentCaptureResource, *http.Response, error +@return PaymentCaptureResponse, *http.Response, error */ -func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r ModificationsApiCaptureAuthorisedPaymentInput) (PaymentCaptureResource, *http.Response, error) { - res := &PaymentCaptureResource{} +func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r ModificationsApiCaptureAuthorisedPaymentInput) (PaymentCaptureResponse, *http.Response, error) { + res := &PaymentCaptureResponse{} path := "/payments/{paymentPspReference}/captures" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -206,7 +214,7 @@ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r Modif httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentCaptureRequest, + r.paymentCaptureRequest, res, http.MethodPost, a.BasePath()+path, @@ -214,14 +222,18 @@ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r Modif headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by ModificationsApi.RefundCapturedPayment type ModificationsApiRefundCapturedPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentRefundRequest *CreatePaymentRefundRequest + paymentPspReference string + idempotencyKey *string + paymentRefundRequest *PaymentRefundRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -230,8 +242,8 @@ func (r ModificationsApiRefundCapturedPaymentInput) IdempotencyKey(idempotencyKe return r } -func (r ModificationsApiRefundCapturedPaymentInput) CreatePaymentRefundRequest(createPaymentRefundRequest CreatePaymentRefundRequest) ModificationsApiRefundCapturedPaymentInput { - r.createPaymentRefundRequest = &createPaymentRefundRequest +func (r ModificationsApiRefundCapturedPaymentInput) PaymentRefundRequest(paymentRefundRequest PaymentRefundRequest) ModificationsApiRefundCapturedPaymentInput { + r.paymentRefundRequest = &paymentRefundRequest return r } @@ -261,10 +273,10 @@ For more information, refer to [Refund](https://docs.adyen.com/online-payments/r @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiRefundCapturedPaymentInput - Request parameters, see RefundCapturedPaymentInput -@return PaymentRefundResource, *http.Response, error +@return PaymentRefundResponse, *http.Response, error */ -func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r ModificationsApiRefundCapturedPaymentInput) (PaymentRefundResource, *http.Response, error) { - res := &PaymentRefundResource{} +func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r ModificationsApiRefundCapturedPaymentInput) (PaymentRefundResponse, *http.Response, error) { + res := &PaymentRefundResponse{} path := "/payments/{paymentPspReference}/refunds" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -275,7 +287,7 @@ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r Modifica httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentRefundRequest, + r.paymentRefundRequest, res, http.MethodPost, a.BasePath()+path, @@ -283,14 +295,18 @@ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r Modifica headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by ModificationsApi.RefundOrCancelPayment type ModificationsApiRefundOrCancelPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentReversalRequest *CreatePaymentReversalRequest + paymentPspReference string + idempotencyKey *string + paymentReversalRequest *PaymentReversalRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -299,8 +315,8 @@ func (r ModificationsApiRefundOrCancelPaymentInput) IdempotencyKey(idempotencyKe return r } -func (r ModificationsApiRefundOrCancelPaymentInput) CreatePaymentReversalRequest(createPaymentReversalRequest CreatePaymentReversalRequest) ModificationsApiRefundOrCancelPaymentInput { - r.createPaymentReversalRequest = &createPaymentReversalRequest +func (r ModificationsApiRefundOrCancelPaymentInput) PaymentReversalRequest(paymentReversalRequest PaymentReversalRequest) ModificationsApiRefundOrCancelPaymentInput { + r.paymentReversalRequest = &paymentReversalRequest return r } @@ -327,10 +343,10 @@ For more information, refer to [Reversal](https://docs.adyen.com/online-payments @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiRefundOrCancelPaymentInput - Request parameters, see RefundOrCancelPaymentInput -@return PaymentReversalResource, *http.Response, error +@return PaymentReversalResponse, *http.Response, error */ -func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r ModificationsApiRefundOrCancelPaymentInput) (PaymentReversalResource, *http.Response, error) { - res := &PaymentReversalResource{} +func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r ModificationsApiRefundOrCancelPaymentInput) (PaymentReversalResponse, *http.Response, error) { + res := &PaymentReversalResponse{} path := "/payments/{paymentPspReference}/reversals" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -341,7 +357,7 @@ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r Modifica httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentReversalRequest, + r.paymentReversalRequest, res, http.MethodPost, a.BasePath()+path, @@ -349,14 +365,18 @@ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r Modifica headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by ModificationsApi.UpdateAuthorisedAmount type ModificationsApiUpdateAuthorisedAmountInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentAmountUpdateRequest *CreatePaymentAmountUpdateRequest + paymentPspReference string + idempotencyKey *string + paymentAmountUpdateRequest *PaymentAmountUpdateRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -365,8 +385,8 @@ func (r ModificationsApiUpdateAuthorisedAmountInput) IdempotencyKey(idempotencyK return r } -func (r ModificationsApiUpdateAuthorisedAmountInput) CreatePaymentAmountUpdateRequest(createPaymentAmountUpdateRequest CreatePaymentAmountUpdateRequest) ModificationsApiUpdateAuthorisedAmountInput { - r.createPaymentAmountUpdateRequest = &createPaymentAmountUpdateRequest +func (r ModificationsApiUpdateAuthorisedAmountInput) PaymentAmountUpdateRequest(paymentAmountUpdateRequest PaymentAmountUpdateRequest) ModificationsApiUpdateAuthorisedAmountInput { + r.paymentAmountUpdateRequest = &paymentAmountUpdateRequest return r } @@ -394,10 +414,10 @@ For more information, refer to [Authorisation adjustment](https://docs.adyen.com @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiUpdateAuthorisedAmountInput - Request parameters, see UpdateAuthorisedAmountInput -@return PaymentAmountUpdateResource, *http.Response, error +@return PaymentAmountUpdateResponse, *http.Response, error */ -func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r ModificationsApiUpdateAuthorisedAmountInput) (PaymentAmountUpdateResource, *http.Response, error) { - res := &PaymentAmountUpdateResource{} +func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r ModificationsApiUpdateAuthorisedAmountInput) (PaymentAmountUpdateResponse, *http.Response, error) { + res := &PaymentAmountUpdateResponse{} path := "/payments/{paymentPspReference}/amountUpdates" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -408,7 +428,7 @@ func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r Modific httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentAmountUpdateRequest, + r.paymentAmountUpdateRequest, res, http.MethodPost, a.BasePath()+path, @@ -416,5 +436,9 @@ func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r Modific headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index 2ab5367c0..f2e01444f 100644 --- a/src/checkout/api_orders.go +++ b/src/checkout/api_orders.go @@ -21,8 +21,8 @@ type OrdersApi common.Service // All parameters accepted by OrdersApi.CancelOrder type OrdersApiCancelOrderInput struct { - idempotencyKey *string - checkoutCancelOrderRequest *CheckoutCancelOrderRequest + idempotencyKey *string + cancelOrderRequest *CancelOrderRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -31,8 +31,8 @@ func (r OrdersApiCancelOrderInput) IdempotencyKey(idempotencyKey string) OrdersA return r } -func (r OrdersApiCancelOrderInput) CheckoutCancelOrderRequest(checkoutCancelOrderRequest CheckoutCancelOrderRequest) OrdersApiCancelOrderInput { - r.checkoutCancelOrderRequest = &checkoutCancelOrderRequest +func (r OrdersApiCancelOrderInput) CancelOrderRequest(cancelOrderRequest CancelOrderRequest) OrdersApiCancelOrderInput { + r.cancelOrderRequest = &cancelOrderRequest return r } @@ -52,10 +52,10 @@ Cancels an order. Cancellation of an order results in an automatic rollback of a @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiCancelOrderInput - Request parameters, see CancelOrderInput -@return CheckoutCancelOrderResponse, *http.Response, error +@return CancelOrderResponse, *http.Response, error */ -func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput) (CheckoutCancelOrderResponse, *http.Response, error) { - res := &CheckoutCancelOrderResponse{} +func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput) (CancelOrderResponse, *http.Response, error) { + res := &CancelOrderResponse{} path := "/orders/cancel" queryParams := url.Values{} headerParams := make(map[string]string) @@ -65,7 +65,7 @@ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutCancelOrderRequest, + r.cancelOrderRequest, res, http.MethodPost, a.BasePath()+path, @@ -73,13 +73,17 @@ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by OrdersApi.GetBalanceOfGiftCard type OrdersApiGetBalanceOfGiftCardInput struct { - idempotencyKey *string - checkoutBalanceCheckRequest *CheckoutBalanceCheckRequest + idempotencyKey *string + balanceCheckRequest *BalanceCheckRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -88,8 +92,8 @@ func (r OrdersApiGetBalanceOfGiftCardInput) IdempotencyKey(idempotencyKey string return r } -func (r OrdersApiGetBalanceOfGiftCardInput) CheckoutBalanceCheckRequest(checkoutBalanceCheckRequest CheckoutBalanceCheckRequest) OrdersApiGetBalanceOfGiftCardInput { - r.checkoutBalanceCheckRequest = &checkoutBalanceCheckRequest +func (r OrdersApiGetBalanceOfGiftCardInput) BalanceCheckRequest(balanceCheckRequest BalanceCheckRequest) OrdersApiGetBalanceOfGiftCardInput { + r.balanceCheckRequest = &balanceCheckRequest return r } @@ -109,10 +113,10 @@ Retrieves the balance remaining on a shopper's gift card. To check a gift card's @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiGetBalanceOfGiftCardInput - Request parameters, see GetBalanceOfGiftCardInput -@return CheckoutBalanceCheckResponse, *http.Response, error +@return BalanceCheckResponse, *http.Response, error */ -func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBalanceOfGiftCardInput) (CheckoutBalanceCheckResponse, *http.Response, error) { - res := &CheckoutBalanceCheckResponse{} +func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBalanceOfGiftCardInput) (BalanceCheckResponse, *http.Response, error) { + res := &BalanceCheckResponse{} path := "/paymentMethods/balance" queryParams := url.Values{} headerParams := make(map[string]string) @@ -122,7 +126,7 @@ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBala httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutBalanceCheckRequest, + r.balanceCheckRequest, res, http.MethodPost, a.BasePath()+path, @@ -130,13 +134,17 @@ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBala headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by OrdersApi.Orders type OrdersApiOrdersInput struct { - idempotencyKey *string - checkoutCreateOrderRequest *CheckoutCreateOrderRequest + idempotencyKey *string + createOrderRequest *CreateOrderRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -145,8 +153,8 @@ func (r OrdersApiOrdersInput) IdempotencyKey(idempotencyKey string) OrdersApiOrd return r } -func (r OrdersApiOrdersInput) CheckoutCreateOrderRequest(checkoutCreateOrderRequest CheckoutCreateOrderRequest) OrdersApiOrdersInput { - r.checkoutCreateOrderRequest = &checkoutCreateOrderRequest +func (r OrdersApiOrdersInput) CreateOrderRequest(createOrderRequest CreateOrderRequest) OrdersApiOrdersInput { + r.createOrderRequest = &createOrderRequest return r } @@ -166,10 +174,10 @@ Creates an order to be used for partial payments. Make a POST `/orders` call bef @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiOrdersInput - Request parameters, see OrdersInput -@return CheckoutCreateOrderResponse, *http.Response, error +@return CreateOrderResponse, *http.Response, error */ -func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (CheckoutCreateOrderResponse, *http.Response, error) { - res := &CheckoutCreateOrderResponse{} +func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (CreateOrderResponse, *http.Response, error) { + res := &CreateOrderResponse{} path := "/orders" queryParams := url.Values{} headerParams := make(map[string]string) @@ -179,7 +187,7 @@ func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (Checkou httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutCreateOrderRequest, + r.createOrderRequest, res, http.MethodPost, a.BasePath()+path, @@ -187,5 +195,9 @@ func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (Checkou headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index b9e0f4cb4..0f5a87f1a 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -62,13 +62,17 @@ func (a *PaymentLinksApi) GetPaymentLink(ctx context.Context, r PaymentLinksApiG headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by PaymentLinksApi.PaymentLinks type PaymentLinksApiPaymentLinksInput struct { - idempotencyKey *string - createPaymentLinkRequest *CreatePaymentLinkRequest + idempotencyKey *string + paymentLinkRequest *PaymentLinkRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -77,8 +81,8 @@ func (r PaymentLinksApiPaymentLinksInput) IdempotencyKey(idempotencyKey string) return r } -func (r PaymentLinksApiPaymentLinksInput) CreatePaymentLinkRequest(createPaymentLinkRequest CreatePaymentLinkRequest) PaymentLinksApiPaymentLinksInput { - r.createPaymentLinkRequest = &createPaymentLinkRequest +func (r PaymentLinksApiPaymentLinksInput) PaymentLinkRequest(paymentLinkRequest PaymentLinkRequest) PaymentLinksApiPaymentLinksInput { + r.paymentLinkRequest = &paymentLinkRequest return r } @@ -113,7 +117,7 @@ func (a *PaymentLinksApi) PaymentLinks(ctx context.Context, r PaymentLinksApiPay httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentLinkRequest, + r.paymentLinkRequest, res, http.MethodPost, a.BasePath()+path, @@ -121,6 +125,10 @@ func (a *PaymentLinksApi) PaymentLinks(ctx context.Context, r PaymentLinksApiPay headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -172,5 +180,9 @@ func (a *PaymentLinksApi) UpdatePaymentLink(ctx context.Context, r PaymentLinksA headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index df2cc88c3..708656b72 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -12,6 +12,7 @@ import ( "context" "net/http" "net/url" + "strings" "github.com/adyen/adyen-go-api-library/v7/src/common" ) @@ -77,13 +78,17 @@ func (a *PaymentsApi) CardDetails(ctx context.Context, r PaymentsApiCardDetailsI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by PaymentsApi.Donations type PaymentsApiDonationsInput struct { idempotencyKey *string - paymentDonationRequest *PaymentDonationRequest + donationPaymentRequest *DonationPaymentRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -92,8 +97,8 @@ func (r PaymentsApiDonationsInput) IdempotencyKey(idempotencyKey string) Payment return r } -func (r PaymentsApiDonationsInput) PaymentDonationRequest(paymentDonationRequest PaymentDonationRequest) PaymentsApiDonationsInput { - r.paymentDonationRequest = &paymentDonationRequest +func (r PaymentsApiDonationsInput) DonationPaymentRequest(donationPaymentRequest DonationPaymentRequest) PaymentsApiDonationsInput { + r.donationPaymentRequest = &donationPaymentRequest return r } @@ -115,10 +120,10 @@ For more information, see [Donations](https://docs.adyen.com/online-payments/don @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PaymentsApiDonationsInput - Request parameters, see DonationsInput -@return DonationResponse, *http.Response, error +@return DonationPaymentResponse, *http.Response, error */ -func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput) (DonationResponse, *http.Response, error) { - res := &DonationResponse{} +func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput) (DonationPaymentResponse, *http.Response, error) { + res := &DonationPaymentResponse{} path := "/donations" queryParams := url.Values{} headerParams := make(map[string]string) @@ -128,7 +133,7 @@ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.paymentDonationRequest, + r.donationPaymentRequest, res, http.MethodPost, a.BasePath()+path, @@ -136,6 +141,69 @@ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.GetResultOfPaymentSession +type PaymentsApiGetResultOfPaymentSessionInput struct { + sessionId string + sessionResult *string +} + +// The `sessionResult` value from the Drop-in or Component. +func (r PaymentsApiGetResultOfPaymentSessionInput) SessionResult(sessionResult string) PaymentsApiGetResultOfPaymentSessionInput { + r.sessionResult = &sessionResult + return r +} + +/* +Prepare a request for GetResultOfPaymentSession +@param sessionId A unique identifier of the session. +@return PaymentsApiGetResultOfPaymentSessionInput +*/ +func (a *PaymentsApi) GetResultOfPaymentSessionInput(sessionId string) PaymentsApiGetResultOfPaymentSessionInput { + return PaymentsApiGetResultOfPaymentSessionInput{ + sessionId: sessionId, + } +} + +/* +GetResultOfPaymentSession Get the result of a payment session + +Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiGetResultOfPaymentSessionInput - Request parameters, see GetResultOfPaymentSessionInput +@return SessionResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) GetResultOfPaymentSession(ctx context.Context, r PaymentsApiGetResultOfPaymentSessionInput) (SessionResultResponse, *http.Response, error) { + res := &SessionResultResponse{} + path := "/sessions/{sessionId}" + path = strings.Replace(path, "{"+"sessionId"+"}", url.PathEscape(common.ParameterValueToString(r.sessionId, "sessionId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.sessionResult != nil { + common.ParameterAddToQuery(queryParams, "sessionResult", r.sessionResult, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -195,6 +263,10 @@ func (a *PaymentsApi) PaymentMethods(ctx context.Context, r PaymentsApiPaymentMe headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -255,13 +327,17 @@ func (a *PaymentsApi) Payments(ctx context.Context, r PaymentsApiPaymentsInput) headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by PaymentsApi.PaymentsDetails type PaymentsApiPaymentsDetailsInput struct { - idempotencyKey *string - detailsRequest *DetailsRequest + idempotencyKey *string + paymentDetailsRequest *PaymentDetailsRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -270,8 +346,8 @@ func (r PaymentsApiPaymentsDetailsInput) IdempotencyKey(idempotencyKey string) P return r } -func (r PaymentsApiPaymentsDetailsInput) DetailsRequest(detailsRequest DetailsRequest) PaymentsApiPaymentsDetailsInput { - r.detailsRequest = &detailsRequest +func (r PaymentsApiPaymentsDetailsInput) PaymentDetailsRequest(paymentDetailsRequest PaymentDetailsRequest) PaymentsApiPaymentsDetailsInput { + r.paymentDetailsRequest = &paymentDetailsRequest return r } @@ -306,7 +382,7 @@ func (a *PaymentsApi) PaymentsDetails(ctx context.Context, r PaymentsApiPayments httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.detailsRequest, + r.paymentDetailsRequest, res, http.MethodPost, a.BasePath()+path, @@ -314,6 +390,10 @@ func (a *PaymentsApi) PaymentsDetails(ctx context.Context, r PaymentsApiPayments headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -375,5 +455,9 @@ func (a *PaymentsApi) Sessions(ctx context.Context, r PaymentsApiSessionsInput) headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index 2245a3e74..506d19140 100644 --- a/src/checkout/api_recurring.go +++ b/src/checkout/api_recurring.go @@ -22,9 +22,9 @@ type RecurringApi common.Service // All parameters accepted by RecurringApi.DeleteTokenForStoredPaymentDetails type RecurringApiDeleteTokenForStoredPaymentDetailsInput struct { - recurringId string - shopperReference *string - merchantAccount *string + storedPaymentMethodId string + shopperReference *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. @@ -41,12 +41,12 @@ func (r RecurringApiDeleteTokenForStoredPaymentDetailsInput) MerchantAccount(mer /* Prepare a request for DeleteTokenForStoredPaymentDetails -@param recurringId The unique identifier of the token. +@param storedPaymentMethodId The unique identifier of the token. @return RecurringApiDeleteTokenForStoredPaymentDetailsInput */ -func (a *RecurringApi) DeleteTokenForStoredPaymentDetailsInput(recurringId string) RecurringApiDeleteTokenForStoredPaymentDetailsInput { +func (a *RecurringApi) DeleteTokenForStoredPaymentDetailsInput(storedPaymentMethodId string) RecurringApiDeleteTokenForStoredPaymentDetailsInput { return RecurringApiDeleteTokenForStoredPaymentDetailsInput{ - recurringId: recurringId, + storedPaymentMethodId: storedPaymentMethodId, } } @@ -57,12 +57,12 @@ Deletes the token identified in the path. The token can no longer be used with p @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r RecurringApiDeleteTokenForStoredPaymentDetailsInput - Request parameters, see DeleteTokenForStoredPaymentDetailsInput -@return StoredPaymentMethodResource, *http.Response, error +@return *http.Response, error */ -func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r RecurringApiDeleteTokenForStoredPaymentDetailsInput) (StoredPaymentMethodResource, *http.Response, error) { - res := &StoredPaymentMethodResource{} - path := "/storedPaymentMethods/{recurringId}" - path = strings.Replace(path, "{"+"recurringId"+"}", url.PathEscape(common.ParameterValueToString(r.recurringId, "recurringId")), -1) +func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r RecurringApiDeleteTokenForStoredPaymentDetailsInput) (*http.Response, error) { + var res interface{} + path := "/storedPaymentMethods/{storedPaymentMethodId}" + path = strings.Replace(path, "{"+"storedPaymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.storedPaymentMethodId, "storedPaymentMethodId")), -1) queryParams := url.Values{} headerParams := make(map[string]string) if r.shopperReference != nil { @@ -82,7 +82,11 @@ func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r headerParams, ) - return *res, httpRes, err + if httpRes == nil { + return httpRes, err + } + + return httpRes, err } // All parameters accepted by RecurringApi.GetTokensForStoredPaymentDetails @@ -145,5 +149,9 @@ func (a *RecurringApi) GetTokensForStoredPaymentDetails(ctx context.Context, r R headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index d27ea8962..cb50409da 100644 --- a/src/checkout/api_utility.go +++ b/src/checkout/api_utility.go @@ -21,8 +21,8 @@ type UtilityApi common.Service // All parameters accepted by UtilityApi.GetApplePaySession type UtilityApiGetApplePaySessionInput struct { - idempotencyKey *string - createApplePaySessionRequest *CreateApplePaySessionRequest + idempotencyKey *string + applePaySessionRequest *ApplePaySessionRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -31,8 +31,8 @@ func (r UtilityApiGetApplePaySessionInput) IdempotencyKey(idempotencyKey string) return r } -func (r UtilityApiGetApplePaySessionInput) CreateApplePaySessionRequest(createApplePaySessionRequest CreateApplePaySessionRequest) UtilityApiGetApplePaySessionInput { - r.createApplePaySessionRequest = &createApplePaySessionRequest +func (r UtilityApiGetApplePaySessionInput) ApplePaySessionRequest(applePaySessionRequest ApplePaySessionRequest) UtilityApiGetApplePaySessionInput { + r.applePaySessionRequest = &applePaySessionRequest return r } @@ -67,7 +67,7 @@ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetAppl httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createApplePaySessionRequest, + r.applePaySessionRequest, res, http.MethodPost, a.BasePath()+path, @@ -75,13 +75,17 @@ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetAppl headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by UtilityApi.OriginKeys type UtilityApiOriginKeysInput struct { - idempotencyKey *string - checkoutUtilityRequest *CheckoutUtilityRequest + idempotencyKey *string + utilityRequest *UtilityRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -90,8 +94,8 @@ func (r UtilityApiOriginKeysInput) IdempotencyKey(idempotencyKey string) Utility return r } -func (r UtilityApiOriginKeysInput) CheckoutUtilityRequest(checkoutUtilityRequest CheckoutUtilityRequest) UtilityApiOriginKeysInput { - r.checkoutUtilityRequest = &checkoutUtilityRequest +func (r UtilityApiOriginKeysInput) UtilityRequest(utilityRequest UtilityRequest) UtilityApiOriginKeysInput { + r.utilityRequest = &utilityRequest return r } @@ -114,12 +118,12 @@ This operation takes the origin domains and returns a JSON object containing the @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r UtilityApiOriginKeysInput - Request parameters, see OriginKeysInput -@return CheckoutUtilityResponse, *http.Response, error +@return UtilityResponse, *http.Response, error Deprecated */ -func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput) (CheckoutUtilityResponse, *http.Response, error) { - res := &CheckoutUtilityResponse{} +func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput) (UtilityResponse, *http.Response, error) { + res := &UtilityResponse{} path := "/originKeys" queryParams := url.Values{} headerParams := make(map[string]string) @@ -129,7 +133,7 @@ func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutUtilityRequest, + r.utilityRequest, res, http.MethodPost, a.BasePath()+path, @@ -137,5 +141,9 @@ func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/checkout/model_ach_details.go b/src/checkout/model_ach_details.go index 37434f7fc..27ca2f82d 100644 --- a/src/checkout/model_ach_details.go +++ b/src/checkout/model_ach_details.go @@ -21,6 +21,8 @@ var _ common.MappedNullable = &AchDetails{} type AchDetails struct { // The bank account number (without separators). BankAccountNumber string `json:"bankAccountNumber"` + // The bank account type (checking, savings...). + BankAccountType *string `json:"bankAccountType,omitempty"` // The bank routing number of the account. The field value is `nil` in most cases. BankLocationId *string `json:"bankLocationId,omitempty"` // The checkout attempt identifier. @@ -86,6 +88,38 @@ func (o *AchDetails) SetBankAccountNumber(v string) { o.BankAccountNumber = v } +// GetBankAccountType returns the BankAccountType field value if set, zero value otherwise. +func (o *AchDetails) GetBankAccountType() string { + if o == nil || common.IsNil(o.BankAccountType) { + var ret string + return ret + } + return *o.BankAccountType +} + +// GetBankAccountTypeOk returns a tuple with the BankAccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AchDetails) GetBankAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.BankAccountType) { + return nil, false + } + return o.BankAccountType, true +} + +// HasBankAccountType returns a boolean if a field has been set. +func (o *AchDetails) HasBankAccountType() bool { + if o != nil && !common.IsNil(o.BankAccountType) { + return true + } + + return false +} + +// SetBankAccountType gets a reference to the given string and assigns it to the BankAccountType field. +func (o *AchDetails) SetBankAccountType(v string) { + o.BankAccountType = &v +} + // GetBankLocationId returns the BankLocationId field value if set, zero value otherwise. func (o *AchDetails) GetBankLocationId() string { if o == nil || common.IsNil(o.BankLocationId) { @@ -356,6 +390,9 @@ func (o AchDetails) MarshalJSON() ([]byte, error) { func (o AchDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["bankAccountNumber"] = o.BankAccountNumber + if !common.IsNil(o.BankAccountType) { + toSerialize["bankAccountType"] = o.BankAccountType + } if !common.IsNil(o.BankLocationId) { toSerialize["bankLocationId"] = o.BankLocationId } @@ -419,6 +456,15 @@ func (v *NullableAchDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } +func (o *AchDetails) isValidBankAccountType() bool { + var allowedEnumValues = []string{"balance", "checking", "deposit", "general", "other", "payment", "savings"} + for _, allowed := range allowedEnumValues { + if o.GetBankAccountType() == allowed { + return true + } + } + return false +} func (o *AchDetails) isValidType() bool { var allowedEnumValues = []string{"ach", "ach_plaid"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_additional_data_airline.go b/src/checkout/model_additional_data_airline.go index 7789046e6..abfe4803e 100644 --- a/src/checkout/model_additional_data_airline.go +++ b/src/checkout/model_additional_data_airline.go @@ -23,9 +23,9 @@ type AdditionalDataAirline struct { AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // 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 + // 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"` - // 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 + // 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"` // 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"` @@ -37,21 +37,21 @@ type AdditionalDataAirline struct { AirlineDocumentType *string `json:"airline.document_type,omitempty"` // 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"` - // 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 + // 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"` - // 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 + // 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 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + // 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"` // 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"` @@ -65,15 +65,15 @@ type AdditionalDataAirline struct { AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // 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 + // 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"` // 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 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros + // 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"` - // 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 + // 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. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + // 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"` } diff --git a/src/checkout/model_additional_data_car_rental.go b/src/checkout/model_additional_data_car_rental.go index 0cc091848..4c190eb31 100644 --- a/src/checkout/model_additional_data_car_rental.go +++ b/src/checkout/model_additional_data_car_rental.go @@ -21,19 +21,19 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} type AdditionalDataCarRental struct { // 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 * 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` // 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, 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 + // 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 where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // 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 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 where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros + // 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 didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` @@ -43,25 +43,25 @@ type AdditionalDataCarRental struct { CarRentalRate *string `json:"carRental.rate,omitempty"` // 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 for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros + // 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"` - // 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 + // 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 * 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 + // 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 * Must not start with a space or be all spaces * Must not be all zeros + // 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, 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` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // 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 + // 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 * Must not start with a space or be all spaces * Must not be all zeros + // 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 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 days the car is rented for. 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: 4 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 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/checkout/model_additional_data_level23.go b/src/checkout/model_additional_data_level23.go index ffb4b270c..fcff29252 100644 --- a/src/checkout/model_additional_data_level23.go +++ b/src/checkout/model_additional_data_level23.go @@ -19,39 +19,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // 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 + // The customer code. * 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"` - // 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 + // 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 the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + // 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 Must not start with a space + // Destination state or province code. * Encoding: ASCII * Max length: 3 characters * Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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 * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // The 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 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 + // 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 * Must not be all zeros. EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } diff --git a/src/checkout/model_additional_data_lodging.go b/src/checkout/model_additional_data_lodging.go index 25199929c..b44e48c36 100644 --- a/src/checkout/model_additional_data_lodging.go +++ b/src/checkout/model_additional_data_lodging.go @@ -23,13 +23,13 @@ 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: 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` // 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, 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. * Max length: 25 characters. * Must not start with a space * Must not be all zeros + // 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"` // 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"` @@ -37,9 +37,9 @@ type AdditionalDataLodging struct { LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` // 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"` @@ -47,7 +47,7 @@ type AdditionalDataLodging struct { LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` // 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: 4 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // 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"` diff --git a/src/checkout/model_additional_data_temporary_services.go b/src/checkout/model_additional_data_temporary_services.go index ba3041d42..28701fb3a 100644 --- a/src/checkout/model_additional_data_temporary_services.go +++ b/src/checkout/model_additional_data_temporary_services.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} type AdditionalDataTemporaryServices struct { // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` // 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"` diff --git a/src/checkout/model_afterpay_details.go b/src/checkout/model_afterpay_details.go index 2f689d57d..3cbafa8ff 100644 --- a/src/checkout/model_afterpay_details.go +++ b/src/checkout/model_afterpay_details.go @@ -344,7 +344,7 @@ func (v *NullableAfterpayDetails) UnmarshalJSON(src []byte) error { } func (o *AfterpayDetails) isValidType() bool { - var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b"} + var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b", "clearpay"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_amazon_pay_details.go b/src/checkout/model_amazon_pay_details.go index d5b8cd3ec..08ce560e4 100644 --- a/src/checkout/model_amazon_pay_details.go +++ b/src/checkout/model_amazon_pay_details.go @@ -19,10 +19,12 @@ var _ common.MappedNullable = &AmazonPayDetails{} // AmazonPayDetails struct for AmazonPayDetails type AmazonPayDetails struct { - // 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. + // 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. This token is used for API only integration specifically. AmazonPayToken *string `json:"amazonPayToken,omitempty"` // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. + CheckoutSessionId *string `json:"checkoutSessionId,omitempty"` // **amazonpay** Type *string `json:"type,omitempty"` } @@ -112,6 +114,38 @@ func (o *AmazonPayDetails) SetCheckoutAttemptId(v string) { o.CheckoutAttemptId = &v } +// GetCheckoutSessionId returns the CheckoutSessionId field value if set, zero value otherwise. +func (o *AmazonPayDetails) GetCheckoutSessionId() string { + if o == nil || common.IsNil(o.CheckoutSessionId) { + var ret string + return ret + } + return *o.CheckoutSessionId +} + +// GetCheckoutSessionIdOk returns a tuple with the CheckoutSessionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmazonPayDetails) GetCheckoutSessionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutSessionId) { + return nil, false + } + return o.CheckoutSessionId, true +} + +// HasCheckoutSessionId returns a boolean if a field has been set. +func (o *AmazonPayDetails) HasCheckoutSessionId() bool { + if o != nil && !common.IsNil(o.CheckoutSessionId) { + return true + } + + return false +} + +// SetCheckoutSessionId gets a reference to the given string and assigns it to the CheckoutSessionId field. +func (o *AmazonPayDetails) SetCheckoutSessionId(v string) { + o.CheckoutSessionId = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *AmazonPayDetails) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -160,6 +194,9 @@ func (o AmazonPayDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CheckoutAttemptId) { toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId } + if !common.IsNil(o.CheckoutSessionId) { + toSerialize["checkoutSessionId"] = o.CheckoutSessionId + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/checkout/model_balance_check_request.go b/src/checkout/model_balance_check_request.go index 253c8d424..6cf62b968 100644 --- a/src/checkout/model_balance_check_request.go +++ b/src/checkout/model_balance_check_request.go @@ -41,7 +41,7 @@ type BalanceCheckRequest struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,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"` diff --git a/src/checkout/model_billing_address.go b/src/checkout/model_billing_address.go new file mode 100644 index 000000000..ebf70d99a --- /dev/null +++ b/src/checkout/model_billing_address.go @@ -0,0 +1,265 @@ +/* +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 BillingAddress type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BillingAddress{} + +// BillingAddress struct for BillingAddress +type BillingAddress struct { + // The name of the city. Maximum length: 3000 characters. + City string `json:"city"` + // 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"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName string `json:"houseNumberOrName"` + // 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"` + // 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"` +} + +// NewBillingAddress instantiates a new BillingAddress 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 NewBillingAddress(city string, country string, houseNumberOrName string, postalCode string, street string) *BillingAddress { + this := BillingAddress{} + this.City = city + this.Country = country + this.HouseNumberOrName = houseNumberOrName + this.PostalCode = postalCode + this.Street = street + return &this +} + +// NewBillingAddressWithDefaults instantiates a new BillingAddress 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 NewBillingAddressWithDefaults() *BillingAddress { + this := BillingAddress{} + return &this +} + +// GetCity returns the City field value +func (o *BillingAddress) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +func (o *BillingAddress) SetCity(v string) { + o.City = v +} + +// GetCountry returns the Country field value +func (o *BillingAddress) 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 *BillingAddress) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *BillingAddress) SetCountry(v string) { + o.Country = v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value +func (o *BillingAddress) GetHouseNumberOrName() string { + if o == nil { + var ret string + return ret + } + + return o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HouseNumberOrName, true +} + +// SetHouseNumberOrName sets field value +func (o *BillingAddress) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = v +} + +// GetPostalCode returns the PostalCode field value +func (o *BillingAddress) GetPostalCode() string { + if o == nil { + var ret string + return ret + } + + return o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PostalCode, true +} + +// SetPostalCode sets field value +func (o *BillingAddress) SetPostalCode(v string) { + o.PostalCode = v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *BillingAddress) 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 *BillingAddress) 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 *BillingAddress) 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 *BillingAddress) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value +func (o *BillingAddress) GetStreet() string { + if o == nil { + var ret string + return ret + } + + return o.Street +} + +// GetStreetOk returns a tuple with the Street field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetStreetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Street, true +} + +// SetStreet sets field value +func (o *BillingAddress) SetStreet(v string) { + o.Street = v +} + +func (o BillingAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BillingAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["city"] = o.City + toSerialize["country"] = o.Country + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + toSerialize["postalCode"] = o.PostalCode + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + toSerialize["street"] = o.Street + return toSerialize, nil +} + +type NullableBillingAddress struct { + value *BillingAddress + isSet bool +} + +func (v NullableBillingAddress) Get() *BillingAddress { + return v.value +} + +func (v *NullableBillingAddress) Set(val *BillingAddress) { + v.value = val + v.isSet = true +} + +func (v NullableBillingAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableBillingAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBillingAddress(val *BillingAddress) *NullableBillingAddress { + return &NullableBillingAddress{value: val, isSet: true} +} + +func (v NullableBillingAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBillingAddress) 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..7b4dbdd0c 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -811,7 +811,7 @@ func (o *CardDetails) isValidFundingSource() bool { return false } func (o *CardDetails) isValidType() bool { - var allowedEnumValues = []string{"scheme", "networkToken", "giftcard", "alliancedata", "card"} + var allowedEnumValues = []string{"scheme", "networkToken", "card"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_checkout_voucher_action.go b/src/checkout/model_checkout_voucher_action.go index 42f41bf4c..04a4b6e5f 100644 --- a/src/checkout/model_checkout_voucher_action.go +++ b/src/checkout/model_checkout_voucher_action.go @@ -40,6 +40,8 @@ type CheckoutVoucherAction struct { MerchantName *string `json:"merchantName,omitempty"` // The merchant reference. MerchantReference *string `json:"merchantReference,omitempty"` + // A base64 encoded signature of all properties + PassCreationToken *string `json:"passCreationToken,omitempty"` // A value that must be submitted to the `/payments/details` endpoint to verify this payment. PaymentData *string `json:"paymentData,omitempty"` // Specifies the payment method. @@ -428,6 +430,38 @@ func (o *CheckoutVoucherAction) SetMerchantReference(v string) { o.MerchantReference = &v } +// GetPassCreationToken returns the PassCreationToken field value if set, zero value otherwise. +func (o *CheckoutVoucherAction) GetPassCreationToken() string { + if o == nil || common.IsNil(o.PassCreationToken) { + var ret string + return ret + } + return *o.PassCreationToken +} + +// GetPassCreationTokenOk returns a tuple with the PassCreationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutVoucherAction) GetPassCreationTokenOk() (*string, bool) { + if o == nil || common.IsNil(o.PassCreationToken) { + return nil, false + } + return o.PassCreationToken, true +} + +// HasPassCreationToken returns a boolean if a field has been set. +func (o *CheckoutVoucherAction) HasPassCreationToken() bool { + if o != nil && !common.IsNil(o.PassCreationToken) { + return true + } + + return false +} + +// SetPassCreationToken gets a reference to the given string and assigns it to the PassCreationToken field. +func (o *CheckoutVoucherAction) SetPassCreationToken(v string) { + o.PassCreationToken = &v +} + // GetPaymentData returns the PaymentData field value if set, zero value otherwise. func (o *CheckoutVoucherAction) GetPaymentData() string { if o == nil || common.IsNil(o.PaymentData) { @@ -751,6 +785,9 @@ func (o CheckoutVoucherAction) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MerchantReference) { toSerialize["merchantReference"] = o.MerchantReference } + if !common.IsNil(o.PassCreationToken) { + toSerialize["passCreationToken"] = o.PassCreationToken + } if !common.IsNil(o.PaymentData) { toSerialize["paymentData"] = o.PaymentData } diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index 282f80bb2..4c3a82882 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -29,7 +29,7 @@ type CreateCheckoutSessionRequest struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `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. @@ -42,8 +42,8 @@ type CreateCheckoutSessionRequest 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 *DeliveryAddress `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. @@ -66,8 +66,9 @@ type CreateCheckoutSessionRequest struct { // 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 *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,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. @@ -100,9 +101,9 @@ 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). + // 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 ecommerce or point-of-sale store that is processing the payment. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` @@ -363,9 +364,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() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -373,7 +374,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() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -389,8 +390,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 BillingAddress and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -619,9 +620,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() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -629,7 +630,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() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -645,8 +646,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 DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } @@ -1090,6 +1091,38 @@ func (o *CreateCheckoutSessionRequest) SetMpiData(v ThreeDSecureData) { o.MpiData = &v } +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) 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 *CreateCheckoutSessionRequest) 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 *CreateCheckoutSessionRequest) 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 *CreateCheckoutSessionRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + // GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetRecurringExpiry() string { if o == nil || common.IsNil(o.RecurringExpiry) { @@ -1941,6 +1974,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } if !common.IsNil(o.RecurringExpiry) { toSerialize["recurringExpiry"] = o.RecurringExpiry } diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index 9912d678e..58500a92f 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -29,7 +29,7 @@ type CreateCheckoutSessionResponse struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `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. @@ -39,11 +39,11 @@ type CreateCheckoutSessionResponse struct { 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 shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + DateOfBirth *time.Time `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 *DeliveryAddress `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. @@ -70,8 +70,9 @@ type CreateCheckoutSessionResponse struct { // 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"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Mode *string `json:"mode,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,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. @@ -106,9 +107,9 @@ 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). + // 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 ecommerce or point-of-sale store that is processing the payment. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` @@ -375,9 +376,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() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -385,7 +386,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() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -401,8 +402,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 BillingAddress and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionResponse) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -567,9 +568,9 @@ func (o *CreateCheckoutSessionResponse) SetCountryCode(v string) { } // GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetDateOfBirth() string { +func (o *CreateCheckoutSessionResponse) GetDateOfBirth() time.Time { if o == nil || common.IsNil(o.DateOfBirth) { - var ret string + var ret time.Time return ret } return *o.DateOfBirth @@ -577,7 +578,7 @@ func (o *CreateCheckoutSessionResponse) GetDateOfBirth() string { // 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 *CreateCheckoutSessionResponse) GetDateOfBirthOk() (*string, bool) { +func (o *CreateCheckoutSessionResponse) GetDateOfBirthOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DateOfBirth) { return nil, false } @@ -593,8 +594,8 @@ func (o *CreateCheckoutSessionResponse) HasDateOfBirth() bool { return false } -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *CreateCheckoutSessionResponse) SetDateOfBirth(v string) { +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *CreateCheckoutSessionResponse) SetDateOfBirth(v time.Time) { o.DateOfBirth = &v } @@ -631,9 +632,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() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -641,7 +642,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() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -657,8 +658,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 DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } @@ -1150,6 +1151,38 @@ func (o *CreateCheckoutSessionResponse) SetMpiData(v ThreeDSecureData) { o.MpiData = &v } +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CreateCheckoutSessionResponse) 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 *CreateCheckoutSessionResponse) 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 *CreateCheckoutSessionResponse) 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 *CreateCheckoutSessionResponse) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + // GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. func (o *CreateCheckoutSessionResponse) GetRecurringExpiry() string { if o == nil || common.IsNil(o.RecurringExpiry) { @@ -2035,6 +2068,9 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } if !common.IsNil(o.RecurringExpiry) { toSerialize["recurringExpiry"] = o.RecurringExpiry } diff --git a/src/checkout/model_delivery_address.go b/src/checkout/model_delivery_address.go new file mode 100644 index 000000000..8a56fe3d9 --- /dev/null +++ b/src/checkout/model_delivery_address.go @@ -0,0 +1,337 @@ +/* +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 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. Maximum length: 3000 characters. + City string `json:"city"` + // 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"` + FirstName *string `json:"firstName,omitempty"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName string `json:"houseNumberOrName"` + LastName *string `json:"lastName,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"` + // 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"` +} + +// 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(city string, country string, houseNumberOrName string, postalCode string, street string) *DeliveryAddress { + this := DeliveryAddress{} + this.City = city + this.Country = country + this.HouseNumberOrName = houseNumberOrName + this.PostalCode = postalCode + this.Street = street + 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 +func (o *DeliveryAddress) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +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 +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *DeliveryAddress) 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 *DeliveryAddress) 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 *DeliveryAddress) 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 *DeliveryAddress) SetFirstName(v string) { + o.FirstName = &v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value +func (o *DeliveryAddress) GetHouseNumberOrName() string { + if o == nil { + var ret string + return ret + } + + return o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HouseNumberOrName, true +} + +// SetHouseNumberOrName sets field value +func (o *DeliveryAddress) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *DeliveryAddress) 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 *DeliveryAddress) 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 *DeliveryAddress) 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 *DeliveryAddress) SetLastName(v string) { + o.LastName = &v +} + +// GetPostalCode returns the PostalCode field value +func (o *DeliveryAddress) GetPostalCode() string { + if o == nil { + var ret string + return ret + } + + return o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PostalCode, true +} + +// SetPostalCode sets field value +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 +} + +// GetStreet returns the Street field value +func (o *DeliveryAddress) GetStreet() string { + if o == nil { + var ret string + return ret + } + + return o.Street +} + +// GetStreetOk returns a tuple with the Street field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetStreetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Street, true +} + +// SetStreet sets field value +func (o *DeliveryAddress) SetStreet(v string) { + o.Street = 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{}{} + toSerialize["city"] = o.City + toSerialize["country"] = o.Country + if !common.IsNil(o.FirstName) { + toSerialize["firstName"] = o.FirstName + } + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + if !common.IsNil(o.LastName) { + toSerialize["lastName"] = o.LastName + } + toSerialize["postalCode"] = o.PostalCode + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + toSerialize["street"] = o.Street + 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/checkout/model_doku_details.go b/src/checkout/model_doku_details.go index 21a7a8504..198fa7d29 100644 --- a/src/checkout/model_doku_details.go +++ b/src/checkout/model_doku_details.go @@ -237,7 +237,7 @@ func (v *NullableDokuDetails) UnmarshalJSON(src []byte) error { } 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"} + 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", "doku_wallet", "doku_ovo"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index 036a8e4e0..6a2c91030 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -23,12 +23,16 @@ type DonationPaymentRequest struct { 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"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + 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 *BillingAddress `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"` + BrowserInfo *BrowserInfo `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 @@ -45,10 +49,9 @@ type DonationPaymentRequest struct { DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` DccQuote *ForexQuote `json:"dccQuote,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 - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `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 - // Deprecated 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"` @@ -70,12 +73,14 @@ type DonationPaymentRequest struct { FraudOffset *int32 `json:"fraudOffset,omitempty"` FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,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"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` Installments *Installments `json:"installments,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"` - // 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. 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. @@ -110,6 +115,8 @@ type DonationPaymentRequest struct { // 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"` + // 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 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. @@ -266,6 +273,38 @@ func (o *DonationPaymentRequest) SetAdditionalData(v map[string]string) { o.AdditionalData = &v } +// GetAllowedPaymentMethods returns the AllowedPaymentMethods field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetAllowedPaymentMethods() []string { + if o == nil || common.IsNil(o.AllowedPaymentMethods) { + var ret []string + return ret + } + return o.AllowedPaymentMethods +} + +// GetAllowedPaymentMethodsOk returns a tuple with the AllowedPaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetAllowedPaymentMethodsOk() ([]string, bool) { + if o == nil || common.IsNil(o.AllowedPaymentMethods) { + return nil, false + } + return o.AllowedPaymentMethods, true +} + +// HasAllowedPaymentMethods returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasAllowedPaymentMethods() bool { + if o != nil && !common.IsNil(o.AllowedPaymentMethods) { + return true + } + + return false +} + +// SetAllowedPaymentMethods gets a reference to the given []string and assigns it to the AllowedPaymentMethods field. +func (o *DonationPaymentRequest) SetAllowedPaymentMethods(v []string) { + o.AllowedPaymentMethods = v +} + // GetAmount returns the Amount field value func (o *DonationPaymentRequest) GetAmount() Amount { if o == nil { @@ -355,9 +394,9 @@ func (o *DonationPaymentRequest) SetAuthenticationData(v AuthenticationData) { } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetBillingAddress() Address { +func (o *DonationPaymentRequest) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -365,7 +404,7 @@ func (o *DonationPaymentRequest) 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 *DonationPaymentRequest) GetBillingAddressOk() (*Address, bool) { +func (o *DonationPaymentRequest) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -381,11 +420,43 @@ func (o *DonationPaymentRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *DonationPaymentRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *DonationPaymentRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } +// GetBlockedPaymentMethods returns the BlockedPaymentMethods field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetBlockedPaymentMethods() []string { + if o == nil || common.IsNil(o.BlockedPaymentMethods) { + var ret []string + return ret + } + return o.BlockedPaymentMethods +} + +// GetBlockedPaymentMethodsOk returns a tuple with the BlockedPaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetBlockedPaymentMethodsOk() ([]string, bool) { + if o == nil || common.IsNil(o.BlockedPaymentMethods) { + return nil, false + } + return o.BlockedPaymentMethods, true +} + +// HasBlockedPaymentMethods returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasBlockedPaymentMethods() bool { + if o != nil && !common.IsNil(o.BlockedPaymentMethods) { + return true + } + + return false +} + +// SetBlockedPaymentMethods gets a reference to the given []string and assigns it to the BlockedPaymentMethods field. +func (o *DonationPaymentRequest) SetBlockedPaymentMethods(v []string) { + o.BlockedPaymentMethods = v +} + // GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetBrowserInfo() BrowserInfo { if o == nil || common.IsNil(o.BrowserInfo) { @@ -710,9 +781,9 @@ func (o *DonationPaymentRequest) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetDeliveryAddress() Address { +func (o *DonationPaymentRequest) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -720,7 +791,7 @@ func (o *DonationPaymentRequest) 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 *DonationPaymentRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *DonationPaymentRequest) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -736,13 +807,12 @@ func (o *DonationPaymentRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *DonationPaymentRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *DonationPaymentRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } // GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. -// Deprecated func (o *DonationPaymentRequest) GetDeliveryDate() time.Time { if o == nil || common.IsNil(o.DeliveryDate) { var ret time.Time @@ -753,7 +823,6 @@ func (o *DonationPaymentRequest) GetDeliveryDate() time.Time { // GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// Deprecated func (o *DonationPaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DeliveryDate) { return nil, false @@ -771,7 +840,6 @@ func (o *DonationPaymentRequest) HasDeliveryDate() bool { } // SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. -// Deprecated func (o *DonationPaymentRequest) SetDeliveryDate(v time.Time) { o.DeliveryDate = &v } @@ -1120,6 +1188,38 @@ func (o *DonationPaymentRequest) SetFundRecipient(v FundRecipient) { o.FundRecipient = &v } +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *DonationPaymentRequest) 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 *DonationPaymentRequest) 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 *DonationPaymentRequest) 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 *DonationPaymentRequest) SetFundingSource(v string) { + o.FundingSource = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -1856,6 +1956,38 @@ func (o *DonationPaymentRequest) SetRiskData(v RiskData) { o.RiskData = &v } +// GetSelectedRecurringDetailReference returns the SelectedRecurringDetailReference field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetSelectedRecurringDetailReference() string { + if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { + var ret string + return ret + } + return *o.SelectedRecurringDetailReference +} + +// GetSelectedRecurringDetailReferenceOk returns a tuple with the SelectedRecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetSelectedRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { + return nil, false + } + return o.SelectedRecurringDetailReference, true +} + +// HasSelectedRecurringDetailReference returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasSelectedRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.SelectedRecurringDetailReference) { + return true + } + + return false +} + +// SetSelectedRecurringDetailReference gets a reference to the given string and assigns it to the SelectedRecurringDetailReference field. +func (o *DonationPaymentRequest) SetSelectedRecurringDetailReference(v string) { + o.SelectedRecurringDetailReference = &v +} + // GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetSessionValidity() string { if o == nil || common.IsNil(o.SessionValidity) { @@ -2390,6 +2522,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AdditionalData) { toSerialize["additionalData"] = o.AdditionalData } + if !common.IsNil(o.AllowedPaymentMethods) { + toSerialize["allowedPaymentMethods"] = o.AllowedPaymentMethods + } toSerialize["amount"] = o.Amount if !common.IsNil(o.ApplicationInfo) { toSerialize["applicationInfo"] = o.ApplicationInfo @@ -2400,6 +2535,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BillingAddress) { toSerialize["billingAddress"] = o.BillingAddress } + if !common.IsNil(o.BlockedPaymentMethods) { + toSerialize["blockedPaymentMethods"] = o.BlockedPaymentMethods + } if !common.IsNil(o.BrowserInfo) { toSerialize["browserInfo"] = o.BrowserInfo } @@ -2467,6 +2605,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FundRecipient) { toSerialize["fundRecipient"] = o.FundRecipient } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } @@ -2531,6 +2672,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskData) { toSerialize["riskData"] = o.RiskData } + if !common.IsNil(o.SelectedRecurringDetailReference) { + toSerialize["selectedRecurringDetailReference"] = o.SelectedRecurringDetailReference + } if !common.IsNil(o.SessionValidity) { toSerialize["sessionValidity"] = o.SessionValidity } @@ -2636,6 +2780,15 @@ func (o *DonationPaymentRequest) isValidEntityType() bool { } return false } +func (o *DonationPaymentRequest) isValidFundingSource() bool { + var allowedEnumValues = []string{"debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} func (o *DonationPaymentRequest) isValidIndustryUsage() bool { var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_donation_payment_request_payment_method.go b/src/checkout/model_donation_payment_request_payment_method.go index 40545737d..860241759 100644 --- a/src/checkout/model_donation_payment_request_payment_method.go +++ b/src/checkout/model_donation_payment_request_payment_method.go @@ -15,73 +15,11 @@ import ( // DonationPaymentRequestPaymentMethod - The type and required details of a payment method to use. type DonationPaymentRequestPaymentMethod 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 -} - -// AchDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AchDetails wrapped in DonationPaymentRequestPaymentMethod -func AchDetailsAsDonationPaymentRequestPaymentMethod(v *AchDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AchDetails: v, - } -} - -// AfterpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AfterpayDetails wrapped in DonationPaymentRequestPaymentMethod -func AfterpayDetailsAsDonationPaymentRequestPaymentMethod(v *AfterpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AfterpayDetails: v, - } -} - -// AmazonPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AmazonPayDetails wrapped in DonationPaymentRequestPaymentMethod -func AmazonPayDetailsAsDonationPaymentRequestPaymentMethod(v *AmazonPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AmazonPayDetails: v, - } -} - -// AndroidPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AndroidPayDetails wrapped in DonationPaymentRequestPaymentMethod -func AndroidPayDetailsAsDonationPaymentRequestPaymentMethod(v *AndroidPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AndroidPayDetails: v, - } + ApplePayDetails *ApplePayDetails + CardDetails *CardDetails + GooglePayDetails *GooglePayDetails + IdealDetails *IdealDetails + PayWithGoogleDetails *PayWithGoogleDetails } // ApplePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns ApplePayDetails wrapped in DonationPaymentRequestPaymentMethod @@ -91,27 +29,6 @@ func ApplePayDetailsAsDonationPaymentRequestPaymentMethod(v *ApplePayDetails) Do } } -// BacsDirectDebitDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BacsDirectDebitDetails wrapped in DonationPaymentRequestPaymentMethod -func BacsDirectDebitDetailsAsDonationPaymentRequestPaymentMethod(v *BacsDirectDebitDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BacsDirectDebitDetails: v, - } -} - -// BillDeskDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BillDeskDetails wrapped in DonationPaymentRequestPaymentMethod -func BillDeskDetailsAsDonationPaymentRequestPaymentMethod(v *BillDeskDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BillDeskDetails: v, - } -} - -// BlikDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BlikDetails wrapped in DonationPaymentRequestPaymentMethod -func BlikDetailsAsDonationPaymentRequestPaymentMethod(v *BlikDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BlikDetails: v, - } -} - // CardDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns CardDetails wrapped in DonationPaymentRequestPaymentMethod func CardDetailsAsDonationPaymentRequestPaymentMethod(v *CardDetails) DonationPaymentRequestPaymentMethod { return DonationPaymentRequestPaymentMethod{ @@ -119,55 +36,6 @@ func CardDetailsAsDonationPaymentRequestPaymentMethod(v *CardDetails) DonationPa } } -// CellulantDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns CellulantDetails wrapped in DonationPaymentRequestPaymentMethod -func CellulantDetailsAsDonationPaymentRequestPaymentMethod(v *CellulantDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - CellulantDetails: v, - } -} - -// DokuDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DokuDetails wrapped in DonationPaymentRequestPaymentMethod -func DokuDetailsAsDonationPaymentRequestPaymentMethod(v *DokuDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DokuDetails: v, - } -} - -// DotpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DotpayDetails wrapped in DonationPaymentRequestPaymentMethod -func DotpayDetailsAsDonationPaymentRequestPaymentMethod(v *DotpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DotpayDetails: v, - } -} - -// DragonpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DragonpayDetails wrapped in DonationPaymentRequestPaymentMethod -func DragonpayDetailsAsDonationPaymentRequestPaymentMethod(v *DragonpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DragonpayDetails: v, - } -} - -// EcontextVoucherDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns EcontextVoucherDetails wrapped in DonationPaymentRequestPaymentMethod -func EcontextVoucherDetailsAsDonationPaymentRequestPaymentMethod(v *EcontextVoucherDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - EcontextVoucherDetails: v, - } -} - -// GenericIssuerPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GenericIssuerPaymentMethodDetails wrapped in DonationPaymentRequestPaymentMethod -func GenericIssuerPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod(v *GenericIssuerPaymentMethodDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - GenericIssuerPaymentMethodDetails: v, - } -} - -// GiropayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GiropayDetails wrapped in DonationPaymentRequestPaymentMethod -func GiropayDetailsAsDonationPaymentRequestPaymentMethod(v *GiropayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - GiropayDetails: v, - } -} - // GooglePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GooglePayDetails wrapped in DonationPaymentRequestPaymentMethod func GooglePayDetailsAsDonationPaymentRequestPaymentMethod(v *GooglePayDetails) DonationPaymentRequestPaymentMethod { return DonationPaymentRequestPaymentMethod{ @@ -182,62 +50,6 @@ func IdealDetailsAsDonationPaymentRequestPaymentMethod(v *IdealDetails) Donation } } -// KlarnaDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns KlarnaDetails wrapped in DonationPaymentRequestPaymentMethod -func KlarnaDetailsAsDonationPaymentRequestPaymentMethod(v *KlarnaDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - KlarnaDetails: v, - } -} - -// MasterpassDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MasterpassDetails wrapped in DonationPaymentRequestPaymentMethod -func MasterpassDetailsAsDonationPaymentRequestPaymentMethod(v *MasterpassDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MasterpassDetails: v, - } -} - -// MbwayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MbwayDetails wrapped in DonationPaymentRequestPaymentMethod -func MbwayDetailsAsDonationPaymentRequestPaymentMethod(v *MbwayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MbwayDetails: v, - } -} - -// MobilePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MobilePayDetails wrapped in DonationPaymentRequestPaymentMethod -func MobilePayDetailsAsDonationPaymentRequestPaymentMethod(v *MobilePayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MobilePayDetails: v, - } -} - -// MolPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MolPayDetails wrapped in DonationPaymentRequestPaymentMethod -func MolPayDetailsAsDonationPaymentRequestPaymentMethod(v *MolPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MolPayDetails: v, - } -} - -// OpenInvoiceDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns OpenInvoiceDetails wrapped in DonationPaymentRequestPaymentMethod -func OpenInvoiceDetailsAsDonationPaymentRequestPaymentMethod(v *OpenInvoiceDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - OpenInvoiceDetails: v, - } -} - -// PayPalDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayPalDetails wrapped in DonationPaymentRequestPaymentMethod -func PayPalDetailsAsDonationPaymentRequestPaymentMethod(v *PayPalDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PayPalDetails: v, - } -} - -// PayUUpiDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayUUpiDetails wrapped in DonationPaymentRequestPaymentMethod -func PayUUpiDetailsAsDonationPaymentRequestPaymentMethod(v *PayUUpiDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PayUUpiDetails: v, - } -} - // PayWithGoogleDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in DonationPaymentRequestPaymentMethod func PayWithGoogleDetailsAsDonationPaymentRequestPaymentMethod(v *PayWithGoogleDetails) DonationPaymentRequestPaymentMethod { return DonationPaymentRequestPaymentMethod{ @@ -245,146 +57,10 @@ func PayWithGoogleDetailsAsDonationPaymentRequestPaymentMethod(v *PayWithGoogleD } } -// PaymentDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PaymentDetails wrapped in DonationPaymentRequestPaymentMethod -func PaymentDetailsAsDonationPaymentRequestPaymentMethod(v *PaymentDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PaymentDetails: v, - } -} - -// RatepayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns RatepayDetails wrapped in DonationPaymentRequestPaymentMethod -func RatepayDetailsAsDonationPaymentRequestPaymentMethod(v *RatepayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - RatepayDetails: v, - } -} - -// SamsungPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns SamsungPayDetails wrapped in DonationPaymentRequestPaymentMethod -func SamsungPayDetailsAsDonationPaymentRequestPaymentMethod(v *SamsungPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - SamsungPayDetails: v, - } -} - -// SepaDirectDebitDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns SepaDirectDebitDetails wrapped in DonationPaymentRequestPaymentMethod -func SepaDirectDebitDetailsAsDonationPaymentRequestPaymentMethod(v *SepaDirectDebitDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - SepaDirectDebitDetails: v, - } -} - -// StoredPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns StoredPaymentMethodDetails wrapped in DonationPaymentRequestPaymentMethod -func StoredPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod(v *StoredPaymentMethodDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - StoredPaymentMethodDetails: v, - } -} - -// UpiCollectDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns UpiCollectDetails wrapped in DonationPaymentRequestPaymentMethod -func UpiCollectDetailsAsDonationPaymentRequestPaymentMethod(v *UpiCollectDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - UpiCollectDetails: v, - } -} - -// UpiIntentDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns UpiIntentDetails wrapped in DonationPaymentRequestPaymentMethod -func UpiIntentDetailsAsDonationPaymentRequestPaymentMethod(v *UpiIntentDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - UpiIntentDetails: v, - } -} - -// VippsDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns VippsDetails wrapped in DonationPaymentRequestPaymentMethod -func VippsDetailsAsDonationPaymentRequestPaymentMethod(v *VippsDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - VippsDetails: v, - } -} - -// VisaCheckoutDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns VisaCheckoutDetails wrapped in DonationPaymentRequestPaymentMethod -func VisaCheckoutDetailsAsDonationPaymentRequestPaymentMethod(v *VisaCheckoutDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - VisaCheckoutDetails: v, - } -} - -// WeChatPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayDetails wrapped in DonationPaymentRequestPaymentMethod -func WeChatPayDetailsAsDonationPaymentRequestPaymentMethod(v *WeChatPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - WeChatPayDetails: v, - } -} - -// WeChatPayMiniProgramDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayMiniProgramDetails wrapped in DonationPaymentRequestPaymentMethod -func WeChatPayMiniProgramDetailsAsDonationPaymentRequestPaymentMethod(v *WeChatPayMiniProgramDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - WeChatPayMiniProgramDetails: v, - } -} - -// ZipDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns ZipDetails wrapped in DonationPaymentRequestPaymentMethod -func ZipDetailsAsDonationPaymentRequestPaymentMethod(v *ZipDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - ZipDetails: v, - } -} - // Unmarshal JSON data into one of the pointers in the struct func (dst *DonationPaymentRequestPaymentMethod) 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 { @@ -398,45 +74,6 @@ func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error 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 { @@ -450,97 +87,6 @@ func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error 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 { @@ -567,110 +113,6 @@ func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error 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 { @@ -684,203 +126,13 @@ func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error 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(DonationPaymentRequestPaymentMethod)") } else if match == 1 { @@ -892,70 +144,14 @@ func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error // Marshal data from the first non-nil pointers in the struct to JSON func (src DonationPaymentRequestPaymentMethod) 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) } @@ -964,90 +160,10 @@ func (src DonationPaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { 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 } @@ -1056,70 +172,14 @@ func (obj *DonationPaymentRequestPaymentMethod) 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 } @@ -1128,90 +188,10 @@ func (obj *DonationPaymentRequestPaymentMethod) GetActualInstance() interface{} 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 } diff --git a/src/checkout/model_klarna_details.go b/src/checkout/model_klarna_details.go index 82f0c4623..ae688b233 100644 --- a/src/checkout/model_klarna_details.go +++ b/src/checkout/model_klarna_details.go @@ -32,6 +32,8 @@ type KlarnaDetails struct { RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // The type of flow to initiate. + Subtype *string `json:"subtype,omitempty"` // **klarna** Type string `json:"type"` } @@ -251,6 +253,38 @@ func (o *KlarnaDetails) SetStoredPaymentMethodId(v string) { o.StoredPaymentMethodId = &v } +// GetSubtype returns the Subtype field value if set, zero value otherwise. +func (o *KlarnaDetails) GetSubtype() string { + if o == nil || common.IsNil(o.Subtype) { + var ret string + return ret + } + return *o.Subtype +} + +// GetSubtypeOk returns a tuple with the Subtype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KlarnaDetails) GetSubtypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Subtype) { + return nil, false + } + return o.Subtype, true +} + +// HasSubtype returns a boolean if a field has been set. +func (o *KlarnaDetails) HasSubtype() bool { + if o != nil && !common.IsNil(o.Subtype) { + return true + } + + return false +} + +// SetSubtype gets a reference to the given string and assigns it to the Subtype field. +func (o *KlarnaDetails) SetSubtype(v string) { + o.Subtype = &v +} + // GetType returns the Type field value func (o *KlarnaDetails) GetType() string { if o == nil { @@ -303,6 +337,9 @@ func (o KlarnaDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.StoredPaymentMethodId) { toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId } + if !common.IsNil(o.Subtype) { + toSerialize["subtype"] = o.Subtype + } toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/checkout/model_line_item.go b/src/checkout/model_line_item.go index 1d789cdb4..2562dae7c 100644 --- a/src/checkout/model_line_item.go +++ b/src/checkout/model_line_item.go @@ -33,7 +33,7 @@ type LineItem struct { Id *string `json:"id,omitempty"` // Link to the picture of the purchased item. ImageUrl *string `json:"imageUrl,omitempty"` - // Item category, used by the RatePay payment method. + // Item category, used by the payment methods PayPal and Ratepay. ItemCategory *string `json:"itemCategory,omitempty"` // Manufacturer of the item. Manufacturer *string `json:"manufacturer,omitempty"` diff --git a/src/checkout/model_pay_pal_details.go b/src/checkout/model_pay_pal_details.go index 79debca03..1813cf75e 100644 --- a/src/checkout/model_pay_pal_details.go +++ b/src/checkout/model_pay_pal_details.go @@ -23,8 +23,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 +124,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 +188,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 { @@ -291,9 +359,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 } diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 0baadc3cb..91ffea351 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -30,7 +30,7 @@ type PaymentCaptureRequest struct { // 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). Splits []Split `json:"splits,omitempty"` // A List of sub-merchants. - SubMerchants []SubMerchant2 `json:"subMerchants,omitempty"` + SubMerchants []SubMerchantInfo `json:"subMerchants,omitempty"` } // NewPaymentCaptureRequest instantiates a new PaymentCaptureRequest object @@ -229,9 +229,9 @@ func (o *PaymentCaptureRequest) SetSplits(v []Split) { } // GetSubMerchants returns the SubMerchants field value if set, zero value otherwise. -func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchant2 { +func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchantInfo { if o == nil || common.IsNil(o.SubMerchants) { - var ret []SubMerchant2 + var ret []SubMerchantInfo return ret } return o.SubMerchants @@ -239,7 +239,7 @@ func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchant2 { // GetSubMerchantsOk returns a tuple with the SubMerchants field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentCaptureRequest) GetSubMerchantsOk() ([]SubMerchant2, bool) { +func (o *PaymentCaptureRequest) GetSubMerchantsOk() ([]SubMerchantInfo, bool) { if o == nil || common.IsNil(o.SubMerchants) { return nil, false } @@ -255,8 +255,8 @@ func (o *PaymentCaptureRequest) HasSubMerchants() bool { return false } -// SetSubMerchants gets a reference to the given []SubMerchant2 and assigns it to the SubMerchants field. -func (o *PaymentCaptureRequest) SetSubMerchants(v []SubMerchant2) { +// SetSubMerchants gets a reference to the given []SubMerchantInfo and assigns it to the SubMerchants field. +func (o *PaymentCaptureRequest) SetSubMerchants(v []SubMerchantInfo) { o.SubMerchants = v } diff --git a/src/checkout/model_payment_capture_response.go b/src/checkout/model_payment_capture_response.go index 58f42fdae..f205cafc9 100644 --- a/src/checkout/model_payment_capture_response.go +++ b/src/checkout/model_payment_capture_response.go @@ -36,7 +36,7 @@ type PaymentCaptureResponse struct { // The status of your request. This will always have the value **received**. Status string `json:"status"` // List of sub-merchants. - SubMerchants []SubMerchant2 `json:"subMerchants,omitempty"` + SubMerchants []SubMerchantInfo `json:"subMerchants,omitempty"` } // NewPaymentCaptureResponse instantiates a new PaymentCaptureResponse object @@ -310,9 +310,9 @@ func (o *PaymentCaptureResponse) SetStatus(v string) { } // GetSubMerchants returns the SubMerchants field value if set, zero value otherwise. -func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchant2 { +func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchantInfo { if o == nil || common.IsNil(o.SubMerchants) { - var ret []SubMerchant2 + var ret []SubMerchantInfo return ret } return o.SubMerchants @@ -320,7 +320,7 @@ func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchant2 { // GetSubMerchantsOk returns a tuple with the SubMerchants field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentCaptureResponse) GetSubMerchantsOk() ([]SubMerchant2, bool) { +func (o *PaymentCaptureResponse) GetSubMerchantsOk() ([]SubMerchantInfo, bool) { if o == nil || common.IsNil(o.SubMerchants) { return nil, false } @@ -336,8 +336,8 @@ func (o *PaymentCaptureResponse) HasSubMerchants() bool { return false } -// SetSubMerchants gets a reference to the given []SubMerchant2 and assigns it to the SubMerchants field. -func (o *PaymentCaptureResponse) SetSubMerchants(v []SubMerchant2) { +// SetSubMerchants gets a reference to the given []SubMerchantInfo and assigns it to the SubMerchants field. +func (o *PaymentCaptureResponse) SetSubMerchants(v []SubMerchantInfo) { o.SubMerchants = v } diff --git a/src/checkout/model_payment_completion_details.go b/src/checkout/model_payment_completion_details.go index 8572ba719..c4daac3b4 100644 --- a/src/checkout/model_payment_completion_details.go +++ b/src/checkout/model_payment_completion_details.go @@ -24,7 +24,8 @@ type PaymentCompletionDetails struct { // (3D) Payment Authentication Request data for the card issuer. PaReq *string `json:"PaReq,omitempty"` // (3D) Payment Authentication Response data by the card issuer. - PaRes *string `json:"PaRes,omitempty"` + PaRes *string `json:"PaRes,omitempty"` + AuthorizationToken *string `json:"authorization_token,omitempty"` // PayPal-generated token for recurring payments. BillingToken *string `json:"billingToken,omitempty"` // The SMS verification code collected from the shopper. @@ -168,6 +169,38 @@ func (o *PaymentCompletionDetails) SetPaRes(v string) { o.PaRes = &v } +// GetAuthorizationToken returns the AuthorizationToken field value if set, zero value otherwise. +func (o *PaymentCompletionDetails) GetAuthorizationToken() string { + if o == nil || common.IsNil(o.AuthorizationToken) { + var ret string + return ret + } + return *o.AuthorizationToken +} + +// GetAuthorizationTokenOk returns a tuple with the AuthorizationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCompletionDetails) GetAuthorizationTokenOk() (*string, bool) { + if o == nil || common.IsNil(o.AuthorizationToken) { + return nil, false + } + return o.AuthorizationToken, true +} + +// HasAuthorizationToken returns a boolean if a field has been set. +func (o *PaymentCompletionDetails) HasAuthorizationToken() bool { + if o != nil && !common.IsNil(o.AuthorizationToken) { + return true + } + + return false +} + +// SetAuthorizationToken gets a reference to the given string and assigns it to the AuthorizationToken field. +func (o *PaymentCompletionDetails) SetAuthorizationToken(v string) { + o.AuthorizationToken = &v +} + // GetBillingToken returns the BillingToken field value if set, zero value otherwise. func (o *PaymentCompletionDetails) GetBillingToken() string { if o == nil || common.IsNil(o.BillingToken) { @@ -635,6 +668,9 @@ func (o PaymentCompletionDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.PaRes) { toSerialize["PaRes"] = o.PaRes } + if !common.IsNil(o.AuthorizationToken) { + toSerialize["authorization_token"] = o.AuthorizationToken + } if !common.IsNil(o.BillingToken) { toSerialize["billingToken"] = o.BillingToken } diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 1509cb1fe..6bd32214a 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -162,7 +162,7 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { } 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"} + 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", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "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 diff --git a/src/checkout/model_payment_details_response.go b/src/checkout/model_payment_details_response.go index b333d6719..a7b2e11c3 100644 --- a/src/checkout/model_payment_details_response.go +++ b/src/checkout/model_payment_details_response.go @@ -35,7 +35,7 @@ type PaymentDetailsResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // 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. + // 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. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **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"` @@ -637,7 +637,7 @@ func (v *NullablePaymentDetailsResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentDetailsResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_payment_link_response.go b/src/checkout/model_payment_link_response.go index 701d56cc7..ede4d2082 100644 --- a/src/checkout/model_payment_link_response.go +++ b/src/checkout/model_payment_link_response.go @@ -38,7 +38,7 @@ type PaymentLinkResponse struct { 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 with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. 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. ExpiresAt *string `json:"expiresAt,omitempty"` // A unique identifier of the payment link. Id string `json:"id"` @@ -56,7 +56,7 @@ 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"` @@ -82,13 +82,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"` diff --git a/src/checkout/model_payment_methods_request.go b/src/checkout/model_payment_methods_request.go index 2259128b1..3d32f63d6 100644 --- a/src/checkout/model_payment_methods_request.go +++ b/src/checkout/model_payment_methods_request.go @@ -39,7 +39,7 @@ type PaymentMethodsRequest struct { ShopperReference *string `json:"shopperReference,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,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. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` } diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index 31ca4b8f6..d6145aa5e 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -27,7 +27,7 @@ type PaymentRequest struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `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"` @@ -42,10 +42,13 @@ type PaymentRequest struct { // 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 *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,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 + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `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 + // Deprecated 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"` @@ -58,13 +61,15 @@ 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"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,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. + // 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"` - // 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. 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. @@ -81,9 +86,9 @@ type PaymentRequest struct { // 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 CheckoutPaymentMethod `json:"paymentMethod"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + Origin *string `json:"origin,omitempty"` + PaymentMethod PaymentRequestPaymentMethod `json:"paymentMethod"` + 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. @@ -116,15 +121,15 @@ type PaymentRequest struct { ShopperStatement *string `json:"shopperStatement,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + // 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 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. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-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 *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` + 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"` @@ -136,7 +141,7 @@ type PaymentRequest 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 NewPaymentRequest(amount Amount, merchantAccount string, paymentMethod CheckoutPaymentMethod, reference string, returnUrl string) *PaymentRequest { +func NewPaymentRequest(amount Amount, merchantAccount string, paymentMethod PaymentRequestPaymentMethod, reference string, returnUrl string) *PaymentRequest { this := PaymentRequest{} this.Amount = amount this.MerchantAccount = merchantAccount @@ -343,9 +348,9 @@ func (o *PaymentRequest) SetAuthenticationData(v AuthenticationData) { } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *PaymentRequest) GetBillingAddress() Address { +func (o *PaymentRequest) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -353,7 +358,7 @@ func (o *PaymentRequest) 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 *PaymentRequest) GetBillingAddressOk() (*Address, bool) { +func (o *PaymentRequest) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -369,8 +374,8 @@ func (o *PaymentRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *PaymentRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *PaymentRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -602,9 +607,9 @@ func (o *PaymentRequest) SetCountryCode(v string) { } // GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *PaymentRequest) GetDateOfBirth() string { +func (o *PaymentRequest) GetDateOfBirth() time.Time { if o == nil || common.IsNil(o.DateOfBirth) { - var ret string + var ret time.Time return ret } return *o.DateOfBirth @@ -612,7 +617,7 @@ func (o *PaymentRequest) GetDateOfBirth() string { // 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 *PaymentRequest) GetDateOfBirthOk() (*string, bool) { +func (o *PaymentRequest) GetDateOfBirthOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DateOfBirth) { return nil, false } @@ -628,8 +633,8 @@ func (o *PaymentRequest) HasDateOfBirth() bool { return false } -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *PaymentRequest) SetDateOfBirth(v string) { +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *PaymentRequest) SetDateOfBirth(v time.Time) { o.DateOfBirth = &v } @@ -665,10 +670,42 @@ func (o *PaymentRequest) SetDccQuote(v ForexQuote) { o.DccQuote = &v } +// GetDeliverAt returns the DeliverAt field value if set, zero value otherwise. +func (o *PaymentRequest) GetDeliverAt() time.Time { + if o == nil || common.IsNil(o.DeliverAt) { + var ret time.Time + return ret + } + return *o.DeliverAt +} + +// GetDeliverAtOk returns a tuple with the DeliverAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetDeliverAtOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DeliverAt) { + return nil, false + } + return o.DeliverAt, true +} + +// HasDeliverAt returns a boolean if a field has been set. +func (o *PaymentRequest) HasDeliverAt() bool { + if o != nil && !common.IsNil(o.DeliverAt) { + return true + } + + return false +} + +// SetDeliverAt gets a reference to the given time.Time and assigns it to the DeliverAt field. +func (o *PaymentRequest) SetDeliverAt(v time.Time) { + o.DeliverAt = &v +} + // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *PaymentRequest) GetDeliveryAddress() Address { +func (o *PaymentRequest) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -676,7 +713,7 @@ func (o *PaymentRequest) 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 *PaymentRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *PaymentRequest) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -692,12 +729,13 @@ func (o *PaymentRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *PaymentRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *PaymentRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } // GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. +// Deprecated func (o *PaymentRequest) GetDeliveryDate() time.Time { if o == nil || common.IsNil(o.DeliveryDate) { var ret time.Time @@ -708,6 +746,7 @@ func (o *PaymentRequest) GetDeliveryDate() time.Time { // GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *PaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DeliveryDate) { return nil, false @@ -725,6 +764,7 @@ func (o *PaymentRequest) HasDeliveryDate() bool { } // SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. +// Deprecated func (o *PaymentRequest) SetDeliveryDate(v time.Time) { o.DeliveryDate = &v } @@ -921,6 +961,70 @@ func (o *PaymentRequest) SetFraudOffset(v int32) { o.FraudOffset = &v } +// GetFundOrigin returns the FundOrigin field value if set, zero value otherwise. +func (o *PaymentRequest) GetFundOrigin() FundOrigin { + if o == nil || common.IsNil(o.FundOrigin) { + var ret FundOrigin + return ret + } + return *o.FundOrigin +} + +// GetFundOriginOk returns a tuple with the FundOrigin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetFundOriginOk() (*FundOrigin, bool) { + if o == nil || common.IsNil(o.FundOrigin) { + return nil, false + } + return o.FundOrigin, true +} + +// HasFundOrigin returns a boolean if a field has been set. +func (o *PaymentRequest) HasFundOrigin() bool { + if o != nil && !common.IsNil(o.FundOrigin) { + return true + } + + return false +} + +// SetFundOrigin gets a reference to the given FundOrigin and assigns it to the FundOrigin field. +func (o *PaymentRequest) SetFundOrigin(v FundOrigin) { + o.FundOrigin = &v +} + +// GetFundRecipient returns the FundRecipient field value if set, zero value otherwise. +func (o *PaymentRequest) GetFundRecipient() FundRecipient { + if o == nil || common.IsNil(o.FundRecipient) { + var ret FundRecipient + return ret + } + return *o.FundRecipient +} + +// GetFundRecipientOk returns a tuple with the FundRecipient field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetFundRecipientOk() (*FundRecipient, bool) { + if o == nil || common.IsNil(o.FundRecipient) { + return nil, false + } + return o.FundRecipient, true +} + +// HasFundRecipient returns a boolean if a field has been set. +func (o *PaymentRequest) HasFundRecipient() bool { + if o != nil && !common.IsNil(o.FundRecipient) { + return true + } + + return false +} + +// SetFundRecipient gets a reference to the given FundRecipient and assigns it to the FundRecipient field. +func (o *PaymentRequest) SetFundRecipient(v FundRecipient) { + o.FundRecipient = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *PaymentRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -1362,9 +1466,9 @@ func (o *PaymentRequest) SetOrigin(v string) { } // GetPaymentMethod returns the PaymentMethod field value -func (o *PaymentRequest) GetPaymentMethod() CheckoutPaymentMethod { +func (o *PaymentRequest) GetPaymentMethod() PaymentRequestPaymentMethod { if o == nil { - var ret CheckoutPaymentMethod + var ret PaymentRequestPaymentMethod return ret } @@ -1373,7 +1477,7 @@ func (o *PaymentRequest) GetPaymentMethod() CheckoutPaymentMethod { // GetPaymentMethodOk returns a tuple with the PaymentMethod field value // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetPaymentMethodOk() (*CheckoutPaymentMethod, bool) { +func (o *PaymentRequest) GetPaymentMethodOk() (*PaymentRequestPaymentMethod, bool) { if o == nil { return nil, false } @@ -1381,7 +1485,7 @@ func (o *PaymentRequest) GetPaymentMethodOk() (*CheckoutPaymentMethod, bool) { } // SetPaymentMethod sets field value -func (o *PaymentRequest) SetPaymentMethod(v CheckoutPaymentMethod) { +func (o *PaymentRequest) SetPaymentMethod(v PaymentRequestPaymentMethod) { o.PaymentMethod = v } @@ -2074,9 +2178,9 @@ func (o *PaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData { +func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData + var ret ThreeDS2RequestData2 return ret } return *o.ThreeDS2RequestData @@ -2084,7 +2188,7 @@ func (o *PaymentRequest) GetThreeDS2RequestData() 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 *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData, bool) { +func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2100,8 +2204,8 @@ func (o *PaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData and assigns it to the ThreeDS2RequestData field. -func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. +func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { o.ThreeDS2RequestData = &v } @@ -2228,6 +2332,9 @@ func (o PaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DccQuote) { toSerialize["dccQuote"] = o.DccQuote } + if !common.IsNil(o.DeliverAt) { + toSerialize["deliverAt"] = o.DeliverAt + } if !common.IsNil(o.DeliveryAddress) { toSerialize["deliveryAddress"] = o.DeliveryAddress } @@ -2252,6 +2359,12 @@ func (o PaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FraudOffset) { toSerialize["fraudOffset"] = o.FraudOffset } + if !common.IsNil(o.FundOrigin) { + toSerialize["fundOrigin"] = o.FundOrigin + } + if !common.IsNil(o.FundRecipient) { + toSerialize["fundRecipient"] = o.FundRecipient + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } diff --git a/src/checkout/model_payment_request_payment_method.go b/src/checkout/model_payment_request_payment_method.go new file mode 100644 index 000000000..49c0975fa --- /dev/null +++ b/src/checkout/model_payment_request_payment_method.go @@ -0,0 +1,1253 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "fmt" +) + +// PaymentRequestPaymentMethod - The type and required details of a payment method to use. +type PaymentRequestPaymentMethod 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 +} + +// AchDetailsAsPaymentRequestPaymentMethod is a convenience function that returns AchDetails wrapped in PaymentRequestPaymentMethod +func AchDetailsAsPaymentRequestPaymentMethod(v *AchDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + AchDetails: v, + } +} + +// AfterpayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns AfterpayDetails wrapped in PaymentRequestPaymentMethod +func AfterpayDetailsAsPaymentRequestPaymentMethod(v *AfterpayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + AfterpayDetails: v, + } +} + +// AmazonPayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns AmazonPayDetails wrapped in PaymentRequestPaymentMethod +func AmazonPayDetailsAsPaymentRequestPaymentMethod(v *AmazonPayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + AmazonPayDetails: v, + } +} + +// AndroidPayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns AndroidPayDetails wrapped in PaymentRequestPaymentMethod +func AndroidPayDetailsAsPaymentRequestPaymentMethod(v *AndroidPayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + AndroidPayDetails: v, + } +} + +// ApplePayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns ApplePayDetails wrapped in PaymentRequestPaymentMethod +func ApplePayDetailsAsPaymentRequestPaymentMethod(v *ApplePayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + ApplePayDetails: v, + } +} + +// BacsDirectDebitDetailsAsPaymentRequestPaymentMethod is a convenience function that returns BacsDirectDebitDetails wrapped in PaymentRequestPaymentMethod +func BacsDirectDebitDetailsAsPaymentRequestPaymentMethod(v *BacsDirectDebitDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + BacsDirectDebitDetails: v, + } +} + +// BillDeskDetailsAsPaymentRequestPaymentMethod is a convenience function that returns BillDeskDetails wrapped in PaymentRequestPaymentMethod +func BillDeskDetailsAsPaymentRequestPaymentMethod(v *BillDeskDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + BillDeskDetails: v, + } +} + +// BlikDetailsAsPaymentRequestPaymentMethod is a convenience function that returns BlikDetails wrapped in PaymentRequestPaymentMethod +func BlikDetailsAsPaymentRequestPaymentMethod(v *BlikDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + BlikDetails: v, + } +} + +// CardDetailsAsPaymentRequestPaymentMethod is a convenience function that returns CardDetails wrapped in PaymentRequestPaymentMethod +func CardDetailsAsPaymentRequestPaymentMethod(v *CardDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + CardDetails: v, + } +} + +// CellulantDetailsAsPaymentRequestPaymentMethod is a convenience function that returns CellulantDetails wrapped in PaymentRequestPaymentMethod +func CellulantDetailsAsPaymentRequestPaymentMethod(v *CellulantDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + CellulantDetails: v, + } +} + +// DokuDetailsAsPaymentRequestPaymentMethod is a convenience function that returns DokuDetails wrapped in PaymentRequestPaymentMethod +func DokuDetailsAsPaymentRequestPaymentMethod(v *DokuDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + DokuDetails: v, + } +} + +// DotpayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns DotpayDetails wrapped in PaymentRequestPaymentMethod +func DotpayDetailsAsPaymentRequestPaymentMethod(v *DotpayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + DotpayDetails: v, + } +} + +// DragonpayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns DragonpayDetails wrapped in PaymentRequestPaymentMethod +func DragonpayDetailsAsPaymentRequestPaymentMethod(v *DragonpayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + DragonpayDetails: v, + } +} + +// EcontextVoucherDetailsAsPaymentRequestPaymentMethod is a convenience function that returns EcontextVoucherDetails wrapped in PaymentRequestPaymentMethod +func EcontextVoucherDetailsAsPaymentRequestPaymentMethod(v *EcontextVoucherDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + EcontextVoucherDetails: v, + } +} + +// GenericIssuerPaymentMethodDetailsAsPaymentRequestPaymentMethod is a convenience function that returns GenericIssuerPaymentMethodDetails wrapped in PaymentRequestPaymentMethod +func GenericIssuerPaymentMethodDetailsAsPaymentRequestPaymentMethod(v *GenericIssuerPaymentMethodDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + GenericIssuerPaymentMethodDetails: v, + } +} + +// GiropayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns GiropayDetails wrapped in PaymentRequestPaymentMethod +func GiropayDetailsAsPaymentRequestPaymentMethod(v *GiropayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + GiropayDetails: v, + } +} + +// GooglePayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns GooglePayDetails wrapped in PaymentRequestPaymentMethod +func GooglePayDetailsAsPaymentRequestPaymentMethod(v *GooglePayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + GooglePayDetails: v, + } +} + +// IdealDetailsAsPaymentRequestPaymentMethod is a convenience function that returns IdealDetails wrapped in PaymentRequestPaymentMethod +func IdealDetailsAsPaymentRequestPaymentMethod(v *IdealDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + IdealDetails: v, + } +} + +// KlarnaDetailsAsPaymentRequestPaymentMethod is a convenience function that returns KlarnaDetails wrapped in PaymentRequestPaymentMethod +func KlarnaDetailsAsPaymentRequestPaymentMethod(v *KlarnaDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + KlarnaDetails: v, + } +} + +// MasterpassDetailsAsPaymentRequestPaymentMethod is a convenience function that returns MasterpassDetails wrapped in PaymentRequestPaymentMethod +func MasterpassDetailsAsPaymentRequestPaymentMethod(v *MasterpassDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + MasterpassDetails: v, + } +} + +// MbwayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns MbwayDetails wrapped in PaymentRequestPaymentMethod +func MbwayDetailsAsPaymentRequestPaymentMethod(v *MbwayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + MbwayDetails: v, + } +} + +// MobilePayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns MobilePayDetails wrapped in PaymentRequestPaymentMethod +func MobilePayDetailsAsPaymentRequestPaymentMethod(v *MobilePayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + MobilePayDetails: v, + } +} + +// MolPayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns MolPayDetails wrapped in PaymentRequestPaymentMethod +func MolPayDetailsAsPaymentRequestPaymentMethod(v *MolPayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + MolPayDetails: v, + } +} + +// OpenInvoiceDetailsAsPaymentRequestPaymentMethod is a convenience function that returns OpenInvoiceDetails wrapped in PaymentRequestPaymentMethod +func OpenInvoiceDetailsAsPaymentRequestPaymentMethod(v *OpenInvoiceDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + OpenInvoiceDetails: v, + } +} + +// PayPalDetailsAsPaymentRequestPaymentMethod is a convenience function that returns PayPalDetails wrapped in PaymentRequestPaymentMethod +func PayPalDetailsAsPaymentRequestPaymentMethod(v *PayPalDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + PayPalDetails: v, + } +} + +// PayUUpiDetailsAsPaymentRequestPaymentMethod is a convenience function that returns PayUUpiDetails wrapped in PaymentRequestPaymentMethod +func PayUUpiDetailsAsPaymentRequestPaymentMethod(v *PayUUpiDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + PayUUpiDetails: v, + } +} + +// PayWithGoogleDetailsAsPaymentRequestPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in PaymentRequestPaymentMethod +func PayWithGoogleDetailsAsPaymentRequestPaymentMethod(v *PayWithGoogleDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + PayWithGoogleDetails: v, + } +} + +// PaymentDetailsAsPaymentRequestPaymentMethod is a convenience function that returns PaymentDetails wrapped in PaymentRequestPaymentMethod +func PaymentDetailsAsPaymentRequestPaymentMethod(v *PaymentDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + PaymentDetails: v, + } +} + +// RatepayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns RatepayDetails wrapped in PaymentRequestPaymentMethod +func RatepayDetailsAsPaymentRequestPaymentMethod(v *RatepayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + RatepayDetails: v, + } +} + +// SamsungPayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns SamsungPayDetails wrapped in PaymentRequestPaymentMethod +func SamsungPayDetailsAsPaymentRequestPaymentMethod(v *SamsungPayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + SamsungPayDetails: v, + } +} + +// SepaDirectDebitDetailsAsPaymentRequestPaymentMethod is a convenience function that returns SepaDirectDebitDetails wrapped in PaymentRequestPaymentMethod +func SepaDirectDebitDetailsAsPaymentRequestPaymentMethod(v *SepaDirectDebitDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + SepaDirectDebitDetails: v, + } +} + +// StoredPaymentMethodDetailsAsPaymentRequestPaymentMethod is a convenience function that returns StoredPaymentMethodDetails wrapped in PaymentRequestPaymentMethod +func StoredPaymentMethodDetailsAsPaymentRequestPaymentMethod(v *StoredPaymentMethodDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + StoredPaymentMethodDetails: v, + } +} + +// UpiCollectDetailsAsPaymentRequestPaymentMethod is a convenience function that returns UpiCollectDetails wrapped in PaymentRequestPaymentMethod +func UpiCollectDetailsAsPaymentRequestPaymentMethod(v *UpiCollectDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + UpiCollectDetails: v, + } +} + +// UpiIntentDetailsAsPaymentRequestPaymentMethod is a convenience function that returns UpiIntentDetails wrapped in PaymentRequestPaymentMethod +func UpiIntentDetailsAsPaymentRequestPaymentMethod(v *UpiIntentDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + UpiIntentDetails: v, + } +} + +// VippsDetailsAsPaymentRequestPaymentMethod is a convenience function that returns VippsDetails wrapped in PaymentRequestPaymentMethod +func VippsDetailsAsPaymentRequestPaymentMethod(v *VippsDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + VippsDetails: v, + } +} + +// VisaCheckoutDetailsAsPaymentRequestPaymentMethod is a convenience function that returns VisaCheckoutDetails wrapped in PaymentRequestPaymentMethod +func VisaCheckoutDetailsAsPaymentRequestPaymentMethod(v *VisaCheckoutDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + VisaCheckoutDetails: v, + } +} + +// WeChatPayDetailsAsPaymentRequestPaymentMethod is a convenience function that returns WeChatPayDetails wrapped in PaymentRequestPaymentMethod +func WeChatPayDetailsAsPaymentRequestPaymentMethod(v *WeChatPayDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + WeChatPayDetails: v, + } +} + +// WeChatPayMiniProgramDetailsAsPaymentRequestPaymentMethod is a convenience function that returns WeChatPayMiniProgramDetails wrapped in PaymentRequestPaymentMethod +func WeChatPayMiniProgramDetailsAsPaymentRequestPaymentMethod(v *WeChatPayMiniProgramDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + WeChatPayMiniProgramDetails: v, + } +} + +// ZipDetailsAsPaymentRequestPaymentMethod is a convenience function that returns ZipDetails wrapped in PaymentRequestPaymentMethod +func ZipDetailsAsPaymentRequestPaymentMethod(v *ZipDetails) PaymentRequestPaymentMethod { + return PaymentRequestPaymentMethod{ + ZipDetails: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PaymentRequestPaymentMethod) 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(PaymentRequestPaymentMethod)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(PaymentRequestPaymentMethod)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PaymentRequestPaymentMethod) 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 *PaymentRequestPaymentMethod) 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 NullablePaymentRequestPaymentMethod struct { + value *PaymentRequestPaymentMethod + isSet bool +} + +func (v NullablePaymentRequestPaymentMethod) Get() *PaymentRequestPaymentMethod { + return v.value +} + +func (v *NullablePaymentRequestPaymentMethod) Set(val *PaymentRequestPaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestPaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestPaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestPaymentMethod(val *PaymentRequestPaymentMethod) *NullablePaymentRequestPaymentMethod { + return &NullablePaymentRequestPaymentMethod{value: val, isSet: true} +} + +func (v NullablePaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestPaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/checkout/model_payment_response.go b/src/checkout/model_payment_response.go index 4b2daf2d6..3c7889a44 100644 --- a/src/checkout/model_payment_response.go +++ b/src/checkout/model_payment_response.go @@ -36,7 +36,7 @@ type PaymentResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // 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. + // 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. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **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"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` @@ -636,7 +636,7 @@ func (v *NullablePaymentResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_payment_response_action.go b/src/checkout/model_payment_response_action.go index 8f3f16605..be125e42c 100644 --- a/src/checkout/model_payment_response_action.go +++ b/src/checkout/model_payment_response_action.go @@ -15,13 +15,14 @@ import ( // PaymentResponseAction - Action to be taken for completing the payment. type PaymentResponseAction struct { - CheckoutAwaitAction *CheckoutAwaitAction - CheckoutNativeRedirectAction *CheckoutNativeRedirectAction - CheckoutQrCodeAction *CheckoutQrCodeAction - CheckoutRedirectAction *CheckoutRedirectAction - CheckoutSDKAction *CheckoutSDKAction - CheckoutThreeDS2Action *CheckoutThreeDS2Action - CheckoutVoucherAction *CheckoutVoucherAction + CheckoutAwaitAction *CheckoutAwaitAction + CheckoutDelegatedAuthenticationAction *CheckoutDelegatedAuthenticationAction + CheckoutNativeRedirectAction *CheckoutNativeRedirectAction + CheckoutQrCodeAction *CheckoutQrCodeAction + CheckoutRedirectAction *CheckoutRedirectAction + CheckoutSDKAction *CheckoutSDKAction + CheckoutThreeDS2Action *CheckoutThreeDS2Action + CheckoutVoucherAction *CheckoutVoucherAction } // CheckoutAwaitActionAsPaymentResponseAction is a convenience function that returns CheckoutAwaitAction wrapped in PaymentResponseAction @@ -31,6 +32,13 @@ func CheckoutAwaitActionAsPaymentResponseAction(v *CheckoutAwaitAction) PaymentR } } +// CheckoutDelegatedAuthenticationActionAsPaymentResponseAction is a convenience function that returns CheckoutDelegatedAuthenticationAction wrapped in PaymentResponseAction +func CheckoutDelegatedAuthenticationActionAsPaymentResponseAction(v *CheckoutDelegatedAuthenticationAction) PaymentResponseAction { + return PaymentResponseAction{ + CheckoutDelegatedAuthenticationAction: v, + } +} + // CheckoutNativeRedirectActionAsPaymentResponseAction is a convenience function that returns CheckoutNativeRedirectAction wrapped in PaymentResponseAction func CheckoutNativeRedirectActionAsPaymentResponseAction(v *CheckoutNativeRedirectAction) PaymentResponseAction { return PaymentResponseAction{ @@ -90,6 +98,19 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { dst.CheckoutAwaitAction = nil } + // try to unmarshal data into CheckoutDelegatedAuthenticationAction + err = json.Unmarshal(data, &dst.CheckoutDelegatedAuthenticationAction) + if err == nil { + jsonCheckoutDelegatedAuthenticationAction, _ := json.Marshal(dst.CheckoutDelegatedAuthenticationAction) + if string(jsonCheckoutDelegatedAuthenticationAction) == "{}" || !dst.CheckoutDelegatedAuthenticationAction.isValidType() { // empty struct + dst.CheckoutDelegatedAuthenticationAction = nil + } else { + match++ + } + } else { + dst.CheckoutDelegatedAuthenticationAction = nil + } + // try to unmarshal data into CheckoutNativeRedirectAction err = json.Unmarshal(data, &dst.CheckoutNativeRedirectAction) if err == nil { @@ -171,6 +192,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { if match > 1 { // more than 1 match // reset to nil dst.CheckoutAwaitAction = nil + dst.CheckoutDelegatedAuthenticationAction = nil dst.CheckoutNativeRedirectAction = nil dst.CheckoutQrCodeAction = nil dst.CheckoutRedirectAction = nil @@ -192,6 +214,10 @@ func (src PaymentResponseAction) MarshalJSON() ([]byte, error) { return json.Marshal(&src.CheckoutAwaitAction) } + if src.CheckoutDelegatedAuthenticationAction != nil { + return json.Marshal(&src.CheckoutDelegatedAuthenticationAction) + } + if src.CheckoutNativeRedirectAction != nil { return json.Marshal(&src.CheckoutNativeRedirectAction) } @@ -228,6 +254,10 @@ func (obj *PaymentResponseAction) GetActualInstance() interface{} { return obj.CheckoutAwaitAction } + if obj.CheckoutDelegatedAuthenticationAction != nil { + return obj.CheckoutDelegatedAuthenticationAction + } + if obj.CheckoutNativeRedirectAction != nil { return obj.CheckoutNativeRedirectAction } diff --git a/src/checkout/model_payment_setup_request.go b/src/checkout/model_payment_setup_request.go index bad324c51..8c8e4bd43 100644 --- a/src/checkout/model_payment_setup_request.go +++ b/src/checkout/model_payment_setup_request.go @@ -62,7 +62,7 @@ type PaymentSetupRequest struct { 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. 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. @@ -108,7 +108,7 @@ type PaymentSetupRequest struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). Splits []Split `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. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When true and `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 348ea2f74..1127e3bcb 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -31,7 +31,7 @@ type PaymentVerificationResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // 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. + // 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. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **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"` ServiceError *ServiceError2 `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. @@ -437,7 +437,7 @@ func (v *NullablePaymentVerificationResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentVerificationResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_platform_chargeback_logic.go b/src/checkout/model_platform_chargeback_logic.go index 204ad64da..63e8d7590 100644 --- a/src/checkout/model_platform_chargeback_logic.go +++ b/src/checkout/model_platform_chargeback_logic.go @@ -19,9 +19,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 diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index 7e29feb1c..4e92acfba 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -254,7 +254,7 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { } func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} + var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_stored_payment_method_details.go b/src/checkout/model_stored_payment_method_details.go index 5b70e5053..84a205eec 100644 --- a/src/checkout/model_stored_payment_method_details.go +++ b/src/checkout/model_stored_payment_method_details.go @@ -240,7 +240,7 @@ func (v *NullableStoredPaymentMethodDetails) UnmarshalJSON(src []byte) error { } 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"} + 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", "dana", "kakaopay", "truemoney"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_sub_merchant_info.go b/src/checkout/model_sub_merchant_info.go index c08c3c46b..63729e7fe 100644 --- a/src/checkout/model_sub_merchant_info.go +++ b/src/checkout/model_sub_merchant_info.go @@ -19,11 +19,11 @@ var _ common.MappedNullable = &SubMerchantInfo{} // SubMerchantInfo struct for SubMerchantInfo type SubMerchantInfo struct { - Address *Address `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Mcc *string `json:"mcc,omitempty"` - Name *string `json:"name,omitempty"` - TaxId *string `json:"taxId,omitempty"` + Address *BillingAddress `json:"address,omitempty"` + Id *string `json:"id,omitempty"` + Mcc *string `json:"mcc,omitempty"` + Name *string `json:"name,omitempty"` + TaxId *string `json:"taxId,omitempty"` } // NewSubMerchantInfo instantiates a new SubMerchantInfo object @@ -44,9 +44,9 @@ func NewSubMerchantInfoWithDefaults() *SubMerchantInfo { } // GetAddress returns the Address field value if set, zero value otherwise. -func (o *SubMerchantInfo) GetAddress() Address { +func (o *SubMerchantInfo) GetAddress() BillingAddress { if o == nil || common.IsNil(o.Address) { - var ret Address + var ret BillingAddress return ret } return *o.Address @@ -54,7 +54,7 @@ func (o *SubMerchantInfo) GetAddress() Address { // GetAddressOk returns a tuple with the Address field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SubMerchantInfo) GetAddressOk() (*Address, bool) { +func (o *SubMerchantInfo) GetAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.Address) { return nil, false } @@ -70,8 +70,8 @@ func (o *SubMerchantInfo) HasAddress() bool { return false } -// SetAddress gets a reference to the given Address and assigns it to the Address field. -func (o *SubMerchantInfo) SetAddress(v Address) { +// SetAddress gets a reference to the given BillingAddress and assigns it to the Address field. +func (o *SubMerchantInfo) SetAddress(v BillingAddress) { o.Address = &v } diff --git a/src/checkout/model_three_ds2_request_data.go b/src/checkout/model_three_ds2_request_data.go index dec46ff98..c6abb06ae 100644 --- a/src/checkout/model_three_ds2_request_data.go +++ b/src/checkout/model_three_ds2_request_data.go @@ -102,8 +102,6 @@ func NewThreeDS2RequestData(deviceChannel string) *ThreeDS2RequestData { var authenticationOnly bool = false this.AuthenticationOnly = &authenticationOnly this.DeviceChannel = deviceChannel - var messageVersion string = "2.1.0" - this.MessageVersion = &messageVersion var sdkMaxTimeout int32 = 60 this.SdkMaxTimeout = &sdkMaxTimeout return &this @@ -116,8 +114,6 @@ func NewThreeDS2RequestDataWithDefaults() *ThreeDS2RequestData { this := ThreeDS2RequestData{} 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 diff --git a/src/checkout/model_three_ds2_result.go b/src/checkout/model_three_ds2_result.go index 44a3c84aa..44492d087 100644 --- a/src/checkout/model_three_ds2_result.go +++ b/src/checkout/model_three_ds2_result.go @@ -25,8 +25,6 @@ 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` - 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. @@ -37,6 +35,8 @@ type ThreeDS2Result struct { MessageVersion *string `json:"messageVersion,omitempty"` // Risk score calculated by Cartes Bancaires Directory Server (DS). RiskScore *string `json:"riskScore,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"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` // The `timestamp` value of the 3D Secure 2 authentication. @@ -162,38 +162,6 @@ func (o *ThreeDS2Result) SetChallengeCancel(v string) { o.ChallengeCancel = &v } -// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. -func (o *ThreeDS2Result) 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. -func (o *ThreeDS2Result) 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 *ThreeDS2Result) 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. -func (o *ThreeDS2Result) SetChallengeIndicator(v string) { - o.ChallengeIndicator = &v -} - // GetDsTransID returns the DsTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetDsTransID() string { if o == nil || common.IsNil(o.DsTransID) { @@ -354,6 +322,38 @@ func (o *ThreeDS2Result) SetRiskScore(v string) { o.RiskScore = &v } +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2Result) 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 *ThreeDS2Result) 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 *ThreeDS2Result) 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 *ThreeDS2Result) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + // GetThreeDSServerTransID returns the ThreeDSServerTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetThreeDSServerTransID() string { if o == nil || common.IsNil(o.ThreeDSServerTransID) { @@ -533,9 +533,6 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ChallengeCancel) { toSerialize["challengeCancel"] = o.ChallengeCancel } - if !common.IsNil(o.ChallengeIndicator) { - toSerialize["challengeIndicator"] = o.ChallengeIndicator - } if !common.IsNil(o.DsTransID) { toSerialize["dsTransID"] = o.DsTransID } @@ -551,6 +548,9 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskScore) { toSerialize["riskScore"] = o.RiskScore } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } if !common.IsNil(o.ThreeDSServerTransID) { toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID } @@ -614,19 +614,19 @@ func (o *ThreeDS2Result) isValidChallengeCancel() bool { } return false } -func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} +func (o *ThreeDS2Result) isValidExemptionIndicator() bool { + var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { + if o.GetExemptionIndicator() == allowed { return true } } return false } -func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} +func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { + if o.GetThreeDSRequestorChallengeInd() == allowed { return true } } diff --git a/src/configurationwebhook/model_account_holder_capability.go b/src/configurationwebhook/model_account_holder_capability.go index a8f6cfbeb..b16a380ab 100644 --- a/src/configurationwebhook/model_account_holder_capability.go +++ b/src/configurationwebhook/model_account_holder_capability.go @@ -33,8 +33,6 @@ type AccountHolderCapability struct { // 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 *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. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -312,38 +310,6 @@ func (o *AccountHolderCapability) SetRequestedSettings(v CapabilitySettings) { o.RequestedSettings = &v } -// GetTransferInstruments returns the TransferInstruments field value if set, zero value otherwise. -func (o *AccountHolderCapability) GetTransferInstruments() []AccountSupportingEntityCapability { - if o == nil || common.IsNil(o.TransferInstruments) { - var ret []AccountSupportingEntityCapability - return ret - } - return o.TransferInstruments -} - -// GetTransferInstrumentsOk returns a tuple with the TransferInstruments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AccountHolderCapability) GetTransferInstrumentsOk() ([]AccountSupportingEntityCapability, bool) { - if o == nil || common.IsNil(o.TransferInstruments) { - return nil, false - } - return o.TransferInstruments, true -} - -// HasTransferInstruments returns a boolean if a field has been set. -func (o *AccountHolderCapability) HasTransferInstruments() bool { - if o != nil && !common.IsNil(o.TransferInstruments) { - return true - } - - return false -} - -// SetTransferInstruments gets a reference to the given []AccountSupportingEntityCapability and assigns it to the TransferInstruments field. -func (o *AccountHolderCapability) SetTransferInstruments(v []AccountSupportingEntityCapability) { - o.TransferInstruments = v -} - // GetVerificationStatus returns the VerificationStatus field value if set, zero value otherwise. func (o *AccountHolderCapability) GetVerificationStatus() string { if o == nil || common.IsNil(o.VerificationStatus) { @@ -410,9 +376,6 @@ func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RequestedSettings) { toSerialize["requestedSettings"] = o.RequestedSettings } - if !common.IsNil(o.TransferInstruments) { - toSerialize["transferInstruments"] = o.TransferInstruments - } if !common.IsNil(o.VerificationStatus) { toSerialize["verificationStatus"] = o.VerificationStatus } diff --git a/src/configurationwebhook/model_balance_account.go b/src/configurationwebhook/model_balance_account.go index e2efee71b..1d3ac1478 100644 --- a/src/configurationwebhook/model_balance_account.go +++ b/src/configurationwebhook/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { AccountHolderId string `json:"accountHolderId"` // List of balances with the amount and currency. Balances []Balance `json:"balances,omitempty"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. 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"` diff --git a/src/configurationwebhook/model_platform_payment_configuration.go b/src/configurationwebhook/model_platform_payment_configuration.go index a2a2bf069..1cb75ec53 100644 --- a/src/configurationwebhook/model_platform_payment_configuration.go +++ b/src/configurationwebhook/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &PlatformPaymentConfiguration{} // PlatformPaymentConfiguration struct for PlatformPaymentConfiguration type PlatformPaymentConfiguration struct { - // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. SalesDayClosingTime *string `json:"salesDayClosingTime,omitempty"` - // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. SettlementDelayDays *int32 `json:"settlementDelayDays,omitempty"` } diff --git a/src/configurationwebhook/model_sweep_configuration_v2.go b/src/configurationwebhook/model_sweep_configuration_v2.go index 47df1d0aa..54c006c55 100644 --- a/src/configurationwebhook/model_sweep_configuration_v2.go +++ b/src/configurationwebhook/model_sweep_configuration_v2.go @@ -458,7 +458,7 @@ func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/configurationwebhook/model_sweep_counterparty.go b/src/configurationwebhook/model_sweep_counterparty.go index d6c0d6fcf..b816965af 100644 --- a/src/configurationwebhook/model_sweep_counterparty.go +++ b/src/configurationwebhook/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &SweepCounterparty{} type SweepCounterparty struct { // The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. BalanceAccountId *string `json:"balanceAccountId,omitempty"` - // The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. MerchantAccount *string `json:"merchantAccount,omitempty"` - // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } diff --git a/src/dataprotection/api_general.go b/src/dataprotection/api_general.go index 6a14e60cb..91dbbb862 100644 --- a/src/dataprotection/api_general.go +++ b/src/dataprotection/api_general.go @@ -63,5 +63,9 @@ func (a *GeneralApi) RequestSubjectErasure(ctx context.Context, r GeneralApiRequ headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_business_lines.go b/src/legalentity/api_business_lines.go index dd0ddd842..ebb26144c 100644 --- a/src/legalentity/api_business_lines.go +++ b/src/legalentity/api_business_lines.go @@ -70,6 +70,10 @@ func (a *BusinessLinesApi) CreateBusinessLine(ctx context.Context, r BusinessLin headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -117,6 +121,10 @@ func (a *BusinessLinesApi) DeleteBusinessLine(ctx context.Context, r BusinessLin headerParams, ) + if httpRes == nil { + return httpRes, err + } + return httpRes, err } @@ -162,6 +170,10 @@ func (a *BusinessLinesApi) GetBusinessLine(ctx context.Context, r BusinessLinesA headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -213,5 +225,9 @@ func (a *BusinessLinesApi) UpdateBusinessLine(ctx context.Context, r BusinessLin headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_documents.go b/src/legalentity/api_documents.go index aeaf86ff0..60336da22 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -62,6 +62,10 @@ func (a *DocumentsApi) DeleteDocument(ctx context.Context, r DocumentsApiDeleteD headerParams, ) + if httpRes == nil { + return httpRes, err + } + return httpRes, err } @@ -107,13 +111,24 @@ func (a *DocumentsApi) GetDocument(ctx context.Context, r DocumentsApiGetDocumen headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by DocumentsApi.UpdateDocument type DocumentsApiUpdateDocumentInput struct { - id string - document *Document + id string + xRequestedVerificationCode *string + document *Document +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the document. Requested verification codes can only be used in your test environment. +func (r DocumentsApiUpdateDocumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) DocumentsApiUpdateDocumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r DocumentsApiUpdateDocumentInput) Document(document Document) DocumentsApiUpdateDocumentInput { @@ -137,6 +152,8 @@ UpdateDocument Update a document Updates a document. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUpdateDocumentInput - Request parameters, see UpdateDocumentInput @return Document, *http.Response, error @@ -147,6 +164,9 @@ func (a *DocumentsApi) UpdateDocument(ctx context.Context, r DocumentsApiUpdateD path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, @@ -158,6 +178,10 @@ func (a *DocumentsApi) UpdateDocument(ctx context.Context, r DocumentsApiUpdateD headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -196,6 +220,8 @@ Uploads a document for verification checks. You should only upload documents when Adyen requests additional information for the legal entity. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUploadDocumentForVerificationChecksInput - Request parameters, see UploadDocumentForVerificationChecksInput @return Document, *http.Response, error @@ -219,5 +245,9 @@ func (a *DocumentsApi) UploadDocumentForVerificationChecks(ctx context.Context, headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_hosted_onboarding.go b/src/legalentity/api_hosted_onboarding.go index d62843581..477e37ada 100644 --- a/src/legalentity/api_hosted_onboarding.go +++ b/src/legalentity/api_hosted_onboarding.go @@ -72,6 +72,10 @@ func (a *HostedOnboardingApi) GetLinkToAdyenhostedOnboardingPage(ctx context.Con headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -119,6 +123,10 @@ func (a *HostedOnboardingApi) GetOnboardingLinkTheme(ctx context.Context, r Host headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -164,5 +172,9 @@ func (a *HostedOnboardingApi) ListHostedOnboardingPageThemes(ctx context.Context headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index b19f07809..aebc3020f 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -62,6 +62,10 @@ func (a *LegalEntitiesApi) CheckLegalEntitysVerificationErrors(ctx context.Conte headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -125,6 +129,10 @@ func (a *LegalEntitiesApi) CreateLegalEntity(ctx context.Context, r LegalEntitie headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -170,6 +178,10 @@ func (a *LegalEntitiesApi) GetAllBusinessLinesUnderLegalEntity(ctx context.Conte headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -215,13 +227,24 @@ func (a *LegalEntitiesApi) GetLegalEntity(ctx context.Context, r LegalEntitiesAp headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by LegalEntitiesApi.UpdateLegalEntity type LegalEntitiesApiUpdateLegalEntityInput struct { - id string - legalEntityInfo *LegalEntityInfo + id string + xRequestedVerificationCode *string + legalEntityInfo *LegalEntityInfo +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the legal entity. Requested verification codes can only be used in your test environment. +func (r LegalEntitiesApiUpdateLegalEntityInput) XRequestedVerificationCode(xRequestedVerificationCode string) LegalEntitiesApiUpdateLegalEntityInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r LegalEntitiesApiUpdateLegalEntityInput) LegalEntityInfo(legalEntityInfo LegalEntityInfo) LegalEntitiesApiUpdateLegalEntityInput { @@ -257,6 +280,9 @@ func (a *LegalEntitiesApi) UpdateLegalEntity(ctx context.Context, r LegalEntitie path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, @@ -268,5 +294,9 @@ func (a *LegalEntitiesApi) UpdateLegalEntity(ctx context.Context, r LegalEntitie headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index 314372646..530b8e422 100644 --- a/src/legalentity/api_pci_questionnaires.go +++ b/src/legalentity/api_pci_questionnaires.go @@ -33,7 +33,7 @@ func (r PCIQuestionnairesApiGeneratePciQuestionnaireInput) GeneratePciDescriptio /* Prepare a request for GeneratePciQuestionnaire -@param id The legal entity ID of the individual who will sign the PCI questionnaire. +@param id The unique identifier of the legal entity to get PCI questionnaire information. @return PCIQuestionnairesApiGeneratePciQuestionnaireInput */ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuestionnairesApiGeneratePciQuestionnaireInput { @@ -45,7 +45,7 @@ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuest /* GeneratePciQuestionnaire 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. +Generates the required PCI questionnaires based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PCIQuestionnairesApiGeneratePciQuestionnaireInput - Request parameters, see GeneratePciQuestionnaireInput @@ -68,6 +68,10 @@ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaire(ctx context.Context, r P headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -116,6 +120,10 @@ func (a *PCIQuestionnairesApi) GetPciQuestionnaire(ctx context.Context, r PCIQue headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -161,6 +169,10 @@ func (a *PCIQuestionnairesApi) GetPciQuestionnaireDetails(ctx context.Context, r headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -212,5 +224,9 @@ func (a *PCIQuestionnairesApi) SignPciQuestionnaire(ctx context.Context, r PCIQu headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index 8b9737f89..4fe62803c 100644 --- a/src/legalentity/api_terms_of_service.go +++ b/src/legalentity/api_terms_of_service.go @@ -34,7 +34,7 @@ func (r TermsOfServiceApiAcceptTermsOfServiceInput) AcceptTermsOfServiceRequest( /* Prepare a request for AcceptTermsOfService -@param id The unique identifier of the legal entity.@param termsofservicedocumentid The unique identifier of the Terms of Service document. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.@param termsofservicedocumentid The unique identifier of the Terms of Service document. @return TermsOfServiceApiAcceptTermsOfServiceInput */ func (a *TermsOfServiceApi) AcceptTermsOfServiceInput(id string, termsofservicedocumentid string) TermsOfServiceApiAcceptTermsOfServiceInput { @@ -71,6 +71,10 @@ func (a *TermsOfServiceApi) AcceptTermsOfService(ctx context.Context, r TermsOfS headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -87,7 +91,7 @@ func (r TermsOfServiceApiGetTermsOfServiceDocumentInput) GetTermsOfServiceDocume /* Prepare a request for GetTermsOfServiceDocument -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceDocumentInput */ func (a *TermsOfServiceApi) GetTermsOfServiceDocumentInput(id string) TermsOfServiceApiGetTermsOfServiceDocumentInput { @@ -122,6 +126,10 @@ func (a *TermsOfServiceApi) GetTermsOfServiceDocument(ctx context.Context, r Ter headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -132,7 +140,7 @@ type TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput struct { /* Prepare a request for GetTermsOfServiceInformationForLegalEntity -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput */ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntityInput(id string) TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput { @@ -167,6 +175,10 @@ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntity(ctx conte headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -177,7 +189,7 @@ type TermsOfServiceApiGetTermsOfServiceStatusInput struct { /* Prepare a request for GetTermsOfServiceStatus -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceStatusInput */ func (a *TermsOfServiceApi) GetTermsOfServiceStatusInput(id string) TermsOfServiceApiGetTermsOfServiceStatusInput { @@ -212,5 +224,9 @@ func (a *TermsOfServiceApi) GetTermsOfServiceStatus(ctx context.Context, r Terms headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index 794dabd38..0e00904af 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -78,6 +78,10 @@ func (a *TransferInstrumentsApi) CreateTransferInstrument(ctx context.Context, r headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -123,6 +127,10 @@ func (a *TransferInstrumentsApi) DeleteTransferInstrument(ctx context.Context, r headerParams, ) + if httpRes == nil { + return httpRes, err + } + return httpRes, err } @@ -168,13 +176,24 @@ func (a *TransferInstrumentsApi) GetTransferInstrument(ctx context.Context, r Tr headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } // All parameters accepted by TransferInstrumentsApi.UpdateTransferInstrument type TransferInstrumentsApiUpdateTransferInstrumentInput struct { - id string - transferInstrumentInfo *TransferInstrumentInfo + id string + xRequestedVerificationCode *string + transferInstrumentInfo *TransferInstrumentInfo +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the transfer instrument. Requested verification codes can only be used in your test environment. +func (r TransferInstrumentsApiUpdateTransferInstrumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) TransferInstrumentsApiUpdateTransferInstrumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r TransferInstrumentsApiUpdateTransferInstrumentInput) TransferInstrumentInfo(transferInstrumentInfo TransferInstrumentInfo) TransferInstrumentsApiUpdateTransferInstrumentInput { @@ -208,6 +227,9 @@ func (a *TransferInstrumentsApi) UpdateTransferInstrument(ctx context.Context, r path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, @@ -219,5 +241,9 @@ func (a *TransferInstrumentsApi) UpdateTransferInstrument(ctx context.Context, r headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/legalentity/model_accept_terms_of_service_request.go b/src/legalentity/model_accept_terms_of_service_request.go index eb996c3ab..9901270bc 100644 --- a/src/legalentity/model_accept_terms_of_service_request.go +++ b/src/legalentity/model_accept_terms_of_service_request.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &AcceptTermsOfServiceRequest{} // AcceptTermsOfServiceRequest struct for AcceptTermsOfServiceRequest type AcceptTermsOfServiceRequest struct { - // The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. + // The legal entity ID of the user accepting the Terms of Service. For organizations, this must be the individual legal entity ID of an authorized signatory for the organization. For sole proprietorships, this must be the individual legal entity ID of the owner. AcceptedBy string `json:"acceptedBy"` // The IP address of the user accepting the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 1dc20d196..24c6ece77 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -25,7 +25,7 @@ type AcceptTermsOfServiceResponse struct { Id *string `json:"id,omitempty"` // The IP address of the user that accepted the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` - // The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. + // The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` diff --git a/src/legalentity/model_bank_account_info.go b/src/legalentity/model_bank_account_info.go index b043aaa67..03c6503ed 100644 --- a/src/legalentity/model_bank_account_info.go +++ b/src/legalentity/model_bank_account_info.go @@ -23,6 +23,8 @@ type BankAccountInfo struct { // The type of bank account. // Deprecated AccountType *string `json:"accountType,omitempty"` + // The name of the banking institution where the bank account is held. + BankName *string `json:"bankName,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). @@ -113,6 +115,38 @@ func (o *BankAccountInfo) SetAccountType(v string) { o.AccountType = &v } +// GetBankName returns the BankName field value if set, zero value otherwise. +func (o *BankAccountInfo) GetBankName() string { + if o == nil || common.IsNil(o.BankName) { + var ret string + return ret + } + return *o.BankName +} + +// GetBankNameOk returns a tuple with the BankName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountInfo) GetBankNameOk() (*string, bool) { + if o == nil || common.IsNil(o.BankName) { + return nil, false + } + return o.BankName, true +} + +// HasBankName returns a boolean if a field has been set. +func (o *BankAccountInfo) HasBankName() bool { + if o != nil && !common.IsNil(o.BankName) { + return true + } + + return false +} + +// SetBankName gets a reference to the given string and assigns it to the BankName field. +func (o *BankAccountInfo) SetBankName(v string) { + o.BankName = &v +} + // GetCountryCode returns the CountryCode field value if set, zero value otherwise. func (o *BankAccountInfo) GetCountryCode() string { if o == nil || common.IsNil(o.CountryCode) { @@ -193,6 +227,9 @@ func (o BankAccountInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountType) { toSerialize["accountType"] = o.AccountType } + if !common.IsNil(o.BankName) { + toSerialize["bankName"] = o.BankName + } if !common.IsNil(o.CountryCode) { toSerialize["countryCode"] = o.CountryCode } diff --git a/src/legalentity/model_bank_account_info_account_identification.go b/src/legalentity/model_bank_account_info_account_identification.go index 207e2462b..6d0f54e95 100644 --- a/src/legalentity/model_bank_account_info_account_identification.go +++ b/src/legalentity/model_bank_account_info_account_identification.go @@ -23,6 +23,7 @@ type BankAccountInfoAccountIdentification struct { HULocalAccountIdentification *HULocalAccountIdentification IbanAccountIdentification *IbanAccountIdentification NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification PLLocalAccountIdentification *PLLocalAccountIdentification SELocalAccountIdentification *SELocalAccountIdentification @@ -87,6 +88,13 @@ func NOLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NOLoc } } +// NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountInfoAccountIdentification +func NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NZLocalAccountIdentification) BankAccountInfoAccountIdentification { + return BankAccountInfoAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + // NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountInfoAccountIdentification func NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountInfoAccountIdentification { return BankAccountInfoAccountIdentification{ @@ -237,6 +245,19 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.NOLocalAccountIdentification = nil } + // try to unmarshal data into NZLocalAccountIdentification + err = json.Unmarshal(data, &dst.NZLocalAccountIdentification) + if err == nil { + jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) + if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct + dst.NZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NZLocalAccountIdentification = nil + } + // try to unmarshal data into NumberAndBicAccountIdentification err = json.Unmarshal(data, &dst.NumberAndBicAccountIdentification) if err == nil { @@ -325,6 +346,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.HULocalAccountIdentification = nil dst.IbanAccountIdentification = nil dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil dst.NumberAndBicAccountIdentification = nil dst.PLLocalAccountIdentification = nil dst.SELocalAccountIdentification = nil @@ -374,6 +396,10 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { return json.Marshal(&src.NOLocalAccountIdentification) } + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + if src.NumberAndBicAccountIdentification != nil { return json.Marshal(&src.NumberAndBicAccountIdentification) } @@ -438,6 +464,10 @@ func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} return obj.NOLocalAccountIdentification } + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + if obj.NumberAndBicAccountIdentification != nil { return obj.NumberAndBicAccountIdentification } diff --git a/src/legalentity/model_business_line.go b/src/legalentity/model_business_line.go index bab73178f..d1ef504d6 100644 --- a/src/legalentity/model_business_line.go +++ b/src/legalentity/model_business_line.go @@ -28,7 +28,7 @@ type BusinessLine struct { IndustryCode string `json:"industryCode"` // Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this supporting entity. 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"` diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index a0683c79f..3f4226d94 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -19,6 +19,8 @@ var _ common.MappedNullable = &GeneratePciDescriptionRequest{} // GeneratePciDescriptionRequest struct for GeneratePciDescriptionRequest type GeneratePciDescriptionRequest struct { + // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) for your user. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** + AdditionalSalesChannels []string `json:"additionalSalesChannels,omitempty"` // Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. Language *string `json:"language,omitempty"` } @@ -40,6 +42,38 @@ func NewGeneratePciDescriptionRequestWithDefaults() *GeneratePciDescriptionReque return &this } +// GetAdditionalSalesChannels returns the AdditionalSalesChannels field value if set, zero value otherwise. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannels() []string { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + var ret []string + return ret + } + return o.AdditionalSalesChannels +} + +// GetAdditionalSalesChannelsOk returns a tuple with the AdditionalSalesChannels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannelsOk() ([]string, bool) { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + return nil, false + } + return o.AdditionalSalesChannels, true +} + +// HasAdditionalSalesChannels returns a boolean if a field has been set. +func (o *GeneratePciDescriptionRequest) HasAdditionalSalesChannels() bool { + if o != nil && !common.IsNil(o.AdditionalSalesChannels) { + return true + } + + return false +} + +// SetAdditionalSalesChannels gets a reference to the given []string and assigns it to the AdditionalSalesChannels field. +func (o *GeneratePciDescriptionRequest) SetAdditionalSalesChannels(v []string) { + o.AdditionalSalesChannels = v +} + // GetLanguage returns the Language field value if set, zero value otherwise. func (o *GeneratePciDescriptionRequest) GetLanguage() string { if o == nil || common.IsNil(o.Language) { @@ -82,6 +116,9 @@ func (o GeneratePciDescriptionRequest) MarshalJSON() ([]byte, error) { func (o GeneratePciDescriptionRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AdditionalSalesChannels) { + toSerialize["additionalSalesChannels"] = o.AdditionalSalesChannels + } if !common.IsNil(o.Language) { toSerialize["language"] = o.Language } 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..f23c214fe 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -19,18 +19,20 @@ var _ common.MappedNullable = &GetTermsOfServiceDocumentRequest{} // GetTermsOfServiceDocumentRequest struct for GetTermsOfServiceDocumentRequest type GetTermsOfServiceDocumentRequest struct { - // The language to be used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. - Language *string `json:"language,omitempty"` + // The language to be used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. + Language string `json:"language"` // The type of Terms of Service. - Type *string `json:"type,omitempty"` + Type string `json:"type"` } // NewGetTermsOfServiceDocumentRequest instantiates a new GetTermsOfServiceDocumentRequest 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 NewGetTermsOfServiceDocumentRequest() *GetTermsOfServiceDocumentRequest { +func NewGetTermsOfServiceDocumentRequest(language string, type_ string) *GetTermsOfServiceDocumentRequest { this := GetTermsOfServiceDocumentRequest{} + this.Language = language + this.Type = type_ return &this } @@ -42,68 +44,52 @@ func NewGetTermsOfServiceDocumentRequestWithDefaults() *GetTermsOfServiceDocumen return &this } -// GetLanguage returns the Language field value if set, zero value otherwise. +// GetLanguage returns the Language field value func (o *GetTermsOfServiceDocumentRequest) GetLanguage() string { - if o == nil || common.IsNil(o.Language) { + if o == nil { var ret string return ret } - return *o.Language + + return o.Language } -// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// GetLanguageOk returns a tuple with the Language field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetLanguageOk() (*string, bool) { - if o == nil || common.IsNil(o.Language) { + if o == nil { return nil, false } - return o.Language, true + return &o.Language, true } -// HasLanguage returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) 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. +// SetLanguage sets field value func (o *GetTermsOfServiceDocumentRequest) SetLanguage(v string) { - o.Language = &v + o.Language = v } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *GetTermsOfServiceDocumentRequest) GetType() string { - if o == nil || common.IsNil(o.Type) { + if o == nil { var ret string return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + return &o.Type, true } -// HasType returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) 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. +// SetType sets field value func (o *GetTermsOfServiceDocumentRequest) SetType(v string) { - o.Type = &v + o.Type = v } func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { @@ -116,12 +102,8 @@ func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { func (o GetTermsOfServiceDocumentRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.Language) { - toSerialize["language"] = o.Language - } - if !common.IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["language"] = o.Language + toSerialize["type"] = o.Type return toSerialize, nil } 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..cc739919e 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -23,7 +23,7 @@ type GetTermsOfServiceDocumentResponse struct { Document *string `json:"document,omitempty"` // The unique identifier of the legal entity. Id *string `json:"id,omitempty"` - // The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. + // The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` diff --git a/src/legalentity/model_hk_local_account_identification.go b/src/legalentity/model_hk_local_account_identification.go index da6196a1f..9e52194cc 100644 --- a/src/legalentity/model_hk_local_account_identification.go +++ b/src/legalentity/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification 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 NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index b77ccc581..261093ffc 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -33,7 +33,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. * 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 of identity data. For **individual**, the `type` value is **nationalIdNumber**. Type string `json:"type"` } @@ -346,7 +346,7 @@ func (v *NullableIdentificationData) UnmarshalJSON(src []byte) error { } func (o *IdentificationData) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource"} + var allowedEnumValues = []string{"nationalIdNumber"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index 0d2bf6ef6..1c03ff84b 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -32,7 +32,7 @@ type LegalEntity struct { 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. + // List of verification errors related to capabilities for the legal entity. Problems []CapabilityProblem `json:"problems,omitempty"` // Your reference for the legal entity, maximum 150 characters. Reference *string `json:"reference,omitempty"` diff --git a/src/legalentity/model_legal_entity_capability.go b/src/legalentity/model_legal_entity_capability.go index a988221b9..4727ec56f 100644 --- a/src/legalentity/model_legal_entity_capability.go +++ b/src/legalentity/model_legal_entity_capability.go @@ -19,17 +19,17 @@ 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"` 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, 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 *CapabilitySettings `json:"requestedSettings,omitempty"` - // Capability status for transfer instruments associated with legal entity + // The capability status of transfer instruments associated with the 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. VerificationStatus *string `json:"verificationStatus,omitempty"` diff --git a/src/legalentity/model_nz_local_account_identification.go b/src/legalentity/model_nz_local_account_identification.go new file mode 100644 index 000000000..3613d9098 --- /dev/null +++ b/src/legalentity/model_nz_local_account_identification.go @@ -0,0 +1,156 @@ +/* +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 NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NZLocalAccountIdentification{} + +// NZLocalAccountIdentification struct for NZLocalAccountIdentification +type NZLocalAccountIdentification struct { + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. + AccountNumber string `json:"accountNumber"` + // **nzLocal** + Type string `json:"type"` +} + +// NewNZLocalAccountIdentification instantiates a new NZLocalAccountIdentification 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 NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewNZLocalAccountIdentificationWithDefaults instantiates a new NZLocalAccountIdentification 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 NewNZLocalAccountIdentificationWithDefaults() *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + var type_ string = "nzLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *NZLocalAccountIdentification) 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 *NZLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *NZLocalAccountIdentification) 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 *NZLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NZLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableNZLocalAccountIdentification struct { + value *NZLocalAccountIdentification + isSet bool +} + +func (v NullableNZLocalAccountIdentification) Get() *NZLocalAccountIdentification { + return v.value +} + +func (v *NullableNZLocalAccountIdentification) Set(val *NZLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableNZLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableNZLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNZLocalAccountIdentification(val *NZLocalAccountIdentification) *NullableNZLocalAccountIdentification { + return &NullableNZLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableNZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *NZLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{"nzLocal"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/legalentity/model_onboarding_link_info.go b/src/legalentity/model_onboarding_link_info.go index bcd7eb358..7e00e42a8 100644 --- a/src/legalentity/model_onboarding_link_info.go +++ b/src/legalentity/model_onboarding_link_info.go @@ -23,7 +23,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. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **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. By default, this value is set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. + // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **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. By default, these values are set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. By default, these value are set to **false**. Set the following values to **true** to require the user to sign PCI questionnaires based on their sales channels. The user must sign PCI questionnaires for all relevant sales channels. - **requirePciSignEcommerce** - **requirePciSignPos** - **requirePciSignEcomMoto** - **requirePciSignPosMoto** Settings *map[string]bool `json:"settings,omitempty"` // The unique identifier of the hosted onboarding theme. ThemeId *string `json:"themeId,omitempty"` diff --git a/src/legalentity/model_supporting_entity_capability.go b/src/legalentity/model_supporting_entity_capability.go index c0bd5fef3..90ba807cd 100644 --- a/src/legalentity/model_supporting_entity_capability.go +++ b/src/legalentity/model_supporting_entity_capability.go @@ -19,13 +19,13 @@ var _ common.MappedNullable = &SupportingEntityCapability{} // SupportingEntityCapability struct for 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** + // Indicates whether the capability is allowed for the supporting entity. If a capability is allowed for a supporting entity but not for the parent legal entity, this means the legal entity has other supporting entities that failed verification. **You can use the allowed supporting entity** regardless of the verification status of other supporting entities. Allowed *bool `json:"allowed,omitempty"` // Supporting entity reference Id *string `json:"id,omitempty"` // 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 capability of the supporting entity. 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"` } diff --git a/src/legalentity/model_transfer_instrument.go b/src/legalentity/model_transfer_instrument.go index 950860b9b..76c2b6419 100644 --- a/src/legalentity/model_transfer_instrument.go +++ b/src/legalentity/model_transfer_instrument.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &TransferInstrument{} // TransferInstrument struct for TransferInstrument type TransferInstrument struct { BankAccount BankAccountInfo `json:"bankAccount"` - // List of capabilities for this supporting entity. + // List of capabilities for this transfer instrument. Capabilities *map[string]SupportingEntityCapability `json:"capabilities,omitempty"` // List of documents uploaded for the transfer instrument. DocumentDetails []DocumentReference `json:"documentDetails,omitempty"` @@ -28,7 +28,7 @@ type TransferInstrument struct { Id string `json:"id"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) that owns the transfer instrument. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this transfer instrument. Problems []CapabilityProblem `json:"problems,omitempty"` // The type of transfer instrument. Possible value: **bankAccount**. Type string `json:"type"` diff --git a/src/management/api_android_files_company_level.go b/src/management/api_android_files_company_level.go new file mode 100644 index 000000000..8d7dd66a4 --- /dev/null +++ b/src/management/api_android_files_company_level.go @@ -0,0 +1,403 @@ +/* +Management API + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// AndroidFilesCompanyLevelApi service +type AndroidFilesCompanyLevelApi common.Service + +// All parameters accepted by AndroidFilesCompanyLevelApi.GetAndroidApp +type AndroidFilesCompanyLevelApiGetAndroidAppInput struct { + companyId string + id string +} + +/* +Prepare a request for GetAndroidApp +@param companyId The unique identifier of the company account.@param id The unique identifier of the app. +@return AndroidFilesCompanyLevelApiGetAndroidAppInput +*/ +func (a *AndroidFilesCompanyLevelApi) GetAndroidAppInput(companyId string, id string) AndroidFilesCompanyLevelApiGetAndroidAppInput { + return AndroidFilesCompanyLevelApiGetAndroidAppInput{ + companyId: companyId, + id: id, + } +} + +/* +GetAndroidApp Get Android app + +Returns the details of the Android app 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—Android files read +* Management API—Android files read and write + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r AndroidFilesCompanyLevelApiGetAndroidAppInput - Request parameters, see GetAndroidAppInput +@return AndroidApp, *http.Response, error +*/ +func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r AndroidFilesCompanyLevelApiGetAndroidAppInput) (AndroidApp, *http.Response, error) { + res := &AndroidApp{} + path := "/companies/{companyId}/androidApps/{id}" + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + 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( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + +// All parameters accepted by AndroidFilesCompanyLevelApi.ListAndroidApps +type AndroidFilesCompanyLevelApiListAndroidAppsInput struct { + companyId string + pageNumber *int32 + pageSize *int32 + packageName *string + versionCode *int32 +} + +// The number of the page to fetch. +func (r AndroidFilesCompanyLevelApiListAndroidAppsInput) PageNumber(pageNumber int32) AndroidFilesCompanyLevelApiListAndroidAppsInput { + r.pageNumber = &pageNumber + return r +} + +// The number of items to have on a page, maximum 100. The default is 20 items on a page. +func (r AndroidFilesCompanyLevelApiListAndroidAppsInput) PageSize(pageSize int32) AndroidFilesCompanyLevelApiListAndroidAppsInput { + r.pageSize = &pageSize + return r +} + +// The package name that uniquely identifies the Android app. +func (r AndroidFilesCompanyLevelApiListAndroidAppsInput) PackageName(packageName string) AndroidFilesCompanyLevelApiListAndroidAppsInput { + r.packageName = &packageName + return r +} + +// The version number of the app. +func (r AndroidFilesCompanyLevelApiListAndroidAppsInput) VersionCode(versionCode int32) AndroidFilesCompanyLevelApiListAndroidAppsInput { + r.versionCode = &versionCode + return r +} + +/* +Prepare a request for ListAndroidApps +@param companyId The unique identifier of the company account. +@return AndroidFilesCompanyLevelApiListAndroidAppsInput +*/ +func (a *AndroidFilesCompanyLevelApi) ListAndroidAppsInput(companyId string) AndroidFilesCompanyLevelApiListAndroidAppsInput { + return AndroidFilesCompanyLevelApiListAndroidAppsInput{ + companyId: companyId, + } +} + +/* +ListAndroidApps Get a list of Android apps + +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—Android files read +* Management API—Android files read and write +* 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 r AndroidFilesCompanyLevelApiListAndroidAppsInput - Request parameters, see ListAndroidAppsInput +@return AndroidAppsResponse, *http.Response, error +*/ +func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r AndroidFilesCompanyLevelApiListAndroidAppsInput) (AndroidAppsResponse, *http.Response, error) { + 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( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + +// All parameters accepted by AndroidFilesCompanyLevelApi.ListAndroidCertificates +type AndroidFilesCompanyLevelApiListAndroidCertificatesInput struct { + companyId string + pageNumber *int32 + pageSize *int32 + certificateName *string +} + +// The number of the page to fetch. +func (r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) PageNumber(pageNumber int32) AndroidFilesCompanyLevelApiListAndroidCertificatesInput { + r.pageNumber = &pageNumber + return r +} + +// The number of items to have on a page, maximum 100. The default is 20 items on a page. +func (r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) PageSize(pageSize int32) AndroidFilesCompanyLevelApiListAndroidCertificatesInput { + r.pageSize = &pageSize + return r +} + +// The name of the certificate. +func (r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) CertificateName(certificateName string) AndroidFilesCompanyLevelApiListAndroidCertificatesInput { + r.certificateName = &certificateName + return r +} + +/* +Prepare a request for ListAndroidCertificates +@param companyId The unique identifier of the company account. +@return AndroidFilesCompanyLevelApiListAndroidCertificatesInput +*/ +func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificatesInput(companyId string) AndroidFilesCompanyLevelApiListAndroidCertificatesInput { + return AndroidFilesCompanyLevelApiListAndroidCertificatesInput{ + companyId: companyId, + } +} + +/* +ListAndroidCertificates Get a list of Android certificates + +Returns a list of the Android certificates that are available for the company identified in the path. +Typically, these certificates enable running apps on Android payment terminals. The certifcates in the list have been uploaded to Adyen and can be installed or uninstalled on Android 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—Android files read +* Management API—Android files read and write +* 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 r AndroidFilesCompanyLevelApiListAndroidCertificatesInput - Request parameters, see ListAndroidCertificatesInput +@return AndroidCertificatesResponse, *http.Response, error +*/ +func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Context, r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) (AndroidCertificatesResponse, *http.Response, error) { + 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( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + 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 021334e29..e99ccf151 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -124,278 +124,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, return *res, httpRes, err } -// All parameters accepted by TerminalActionsCompanyLevelApi.ListAndroidApps -type TerminalActionsCompanyLevelApiListAndroidAppsInput struct { - companyId string - pageNumber *int32 - pageSize *int32 - packageName *string - versionCode *int32 -} - -// The number of the page to fetch. -func (r TerminalActionsCompanyLevelApiListAndroidAppsInput) PageNumber(pageNumber int32) TerminalActionsCompanyLevelApiListAndroidAppsInput { - r.pageNumber = &pageNumber - return r -} - -// The number of items to have on a page, maximum 100. The default is 20 items on a page. -func (r TerminalActionsCompanyLevelApiListAndroidAppsInput) PageSize(pageSize int32) TerminalActionsCompanyLevelApiListAndroidAppsInput { - r.pageSize = &pageSize - return r -} - -// The package name that uniquely identifies the Android app. -func (r TerminalActionsCompanyLevelApiListAndroidAppsInput) PackageName(packageName string) TerminalActionsCompanyLevelApiListAndroidAppsInput { - r.packageName = &packageName - return r -} - -// The version number of the app. -func (r TerminalActionsCompanyLevelApiListAndroidAppsInput) VersionCode(versionCode int32) TerminalActionsCompanyLevelApiListAndroidAppsInput { - r.versionCode = &versionCode - return r -} - -/* -Prepare a request for ListAndroidApps -@param companyId The unique identifier of the company account. -@return TerminalActionsCompanyLevelApiListAndroidAppsInput -*/ -func (a *TerminalActionsCompanyLevelApi) ListAndroidAppsInput(companyId string) TerminalActionsCompanyLevelApiListAndroidAppsInput { - return TerminalActionsCompanyLevelApiListAndroidAppsInput{ - companyId: companyId, - } -} - -/* -ListAndroidApps Get a list of Android apps - -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 r TerminalActionsCompanyLevelApiListAndroidAppsInput - Request parameters, see ListAndroidAppsInput -@return AndroidAppsResponse, *http.Response, error -*/ -func (a *TerminalActionsCompanyLevelApi) ListAndroidApps(ctx context.Context, r TerminalActionsCompanyLevelApiListAndroidAppsInput) (AndroidAppsResponse, *http.Response, error) { - 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( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err -} - -// All parameters accepted by TerminalActionsCompanyLevelApi.ListAndroidCertificates -type TerminalActionsCompanyLevelApiListAndroidCertificatesInput struct { - companyId string - pageNumber *int32 - pageSize *int32 - certificateName *string -} - -// The number of the page to fetch. -func (r TerminalActionsCompanyLevelApiListAndroidCertificatesInput) PageNumber(pageNumber int32) TerminalActionsCompanyLevelApiListAndroidCertificatesInput { - r.pageNumber = &pageNumber - return r -} - -// The number of items to have on a page, maximum 100. The default is 20 items on a page. -func (r TerminalActionsCompanyLevelApiListAndroidCertificatesInput) PageSize(pageSize int32) TerminalActionsCompanyLevelApiListAndroidCertificatesInput { - r.pageSize = &pageSize - return r -} - -// The name of the certificate. -func (r TerminalActionsCompanyLevelApiListAndroidCertificatesInput) CertificateName(certificateName string) TerminalActionsCompanyLevelApiListAndroidCertificatesInput { - r.certificateName = &certificateName - return r -} - -/* -Prepare a request for ListAndroidCertificates -@param companyId The unique identifier of the company account. -@return TerminalActionsCompanyLevelApiListAndroidCertificatesInput -*/ -func (a *TerminalActionsCompanyLevelApi) ListAndroidCertificatesInput(companyId string) TerminalActionsCompanyLevelApiListAndroidCertificatesInput { - return TerminalActionsCompanyLevelApiListAndroidCertificatesInput{ - companyId: companyId, - } -} - -/* -ListAndroidCertificates Get a list of Android certificates - -Returns a list of the Android certificates that are available for the company identified in the path. -Typically, these certificates enable running apps on Android payment terminals. The certifcates in the list have been uploaded to Adyen and can be installed or uninstalled on Android 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 r TerminalActionsCompanyLevelApiListAndroidCertificatesInput - Request parameters, see ListAndroidCertificatesInput -@return AndroidCertificatesResponse, *http.Response, error -*/ -func (a *TerminalActionsCompanyLevelApi) ListAndroidCertificates(ctx context.Context, r TerminalActionsCompanyLevelApiListAndroidCertificatesInput) (AndroidCertificatesResponse, *http.Response, error) { - 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( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err -} - // All parameters accepted by TerminalActionsCompanyLevelApi.ListTerminalActions type TerminalActionsCompanyLevelApiListTerminalActionsInput struct { companyId string diff --git a/src/management/client.go b/src/management/client.go index 7463855c3..7ef87d503 100644 --- a/src/management/client.go +++ b/src/management/client.go @@ -37,6 +37,8 @@ type APIClient struct { AllowedOriginsMerchantLevelApi *AllowedOriginsMerchantLevelApi + AndroidFilesCompanyLevelApi *AndroidFilesCompanyLevelApi + ClientKeyCompanyLevelApi *ClientKeyCompanyLevelApi ClientKeyMerchantLevelApi *ClientKeyMerchantLevelApi @@ -94,6 +96,7 @@ func NewAPIClient(client *common.Client) *APIClient { c.AccountStoreLevelApi = (*AccountStoreLevelApi)(&c.common) c.AllowedOriginsCompanyLevelApi = (*AllowedOriginsCompanyLevelApi)(&c.common) c.AllowedOriginsMerchantLevelApi = (*AllowedOriginsMerchantLevelApi)(&c.common) + c.AndroidFilesCompanyLevelApi = (*AndroidFilesCompanyLevelApi)(&c.common) c.ClientKeyCompanyLevelApi = (*ClientKeyCompanyLevelApi)(&c.common) c.ClientKeyMerchantLevelApi = (*ClientKeyMerchantLevelApi)(&c.common) c.MyAPICredentialApi = (*MyAPICredentialApi)(&c.common) diff --git a/src/management/model_android_app.go b/src/management/model_android_app.go index 67f84b5b7..eac50a22d 100644 --- a/src/management/model_android_app.go +++ b/src/management/model_android_app.go @@ -21,13 +21,15 @@ var _ common.MappedNullable = &AndroidApp{} type AndroidApp struct { // The description that was provided when uploading the app. The description is not shown on the terminal. Description *string `json:"description,omitempty"` + // The error code of the app. It exists if the status is error or invalid. + ErrorCode *string `json:"errorCode,omitempty"` // The unique identifier of the app. Id string `json:"id"` // The app name that is shown on the terminal. Label *string `json:"label,omitempty"` // The package name that uniquely identifies the Android app. PackageName *string `json:"packageName,omitempty"` - // The status of the app. Possible values: * `processing`: The app is being signed and converted to a format that the terminal can handle. * `error`: Something went wrong. Check that the app matches the [requirements](https://docs.adyen.com/point-of-sale/android-terminals/app-requirements). * `invalid`: There is something wrong with the APK file of the app. * `ready`: The app has been signed and converted. * `archived`: The app is no longer available. + // The status of the app. Possible values: * `processing`: the app is being signed and converted to a format that the terminal can handle. * `error`: something went wrong. Check that the app matches the [requirements](https://docs.adyen.com/point-of-sale/android-terminals/app-requirements). * `invalid`: there is something wrong with the APK file of the app. * `ready`: the app has been signed and converted. * `archived`: the app is no longer available. Status string `json:"status"` // The version number of the app. VersionCode *int32 `json:"versionCode,omitempty"` @@ -86,6 +88,38 @@ func (o *AndroidApp) SetDescription(v string) { o.Description = &v } +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *AndroidApp) GetErrorCode() string { + if o == nil || common.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AndroidApp) GetErrorCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *AndroidApp) HasErrorCode() bool { + if o != nil && !common.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *AndroidApp) SetErrorCode(v string) { + o.ErrorCode = &v +} + // GetId returns the Id field value func (o *AndroidApp) GetId() string { if o == nil { @@ -275,6 +309,9 @@ func (o AndroidApp) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } + if !common.IsNil(o.ErrorCode) { + toSerialize["errorCode"] = o.ErrorCode + } toSerialize["id"] = o.Id if !common.IsNil(o.Label) { toSerialize["label"] = o.Label diff --git a/src/management/model_apple_pay_info.go b/src/management/model_apple_pay_info.go index 6f4a46db2..26522531a 100644 --- a/src/management/model_apple_pay_info.go +++ b/src/management/model_apple_pay_info.go @@ -20,15 +20,16 @@ var _ common.MappedNullable = &ApplePayInfo{} // ApplePayInfo struct for ApplePayInfo type ApplePayInfo struct { // The list of merchant domains. Maximum: 99 domains per request. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/web-drop-in?tab=adyen-certificate-live_1#going-live). - Domains []string `json:"domains,omitempty"` + Domains []string `json:"domains"` } // NewApplePayInfo instantiates a new ApplePayInfo 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 NewApplePayInfo() *ApplePayInfo { +func NewApplePayInfo(domains []string) *ApplePayInfo { this := ApplePayInfo{} + this.Domains = domains return &this } @@ -40,34 +41,26 @@ func NewApplePayInfoWithDefaults() *ApplePayInfo { return &this } -// GetDomains returns the Domains field value if set, zero value otherwise. +// GetDomains returns the Domains field value func (o *ApplePayInfo) GetDomains() []string { - if o == nil || common.IsNil(o.Domains) { + if o == nil { var ret []string return ret } + return o.Domains } -// GetDomainsOk returns a tuple with the Domains field value if set, nil otherwise +// GetDomainsOk returns a tuple with the Domains field value // and a boolean to check if the value has been set. func (o *ApplePayInfo) GetDomainsOk() ([]string, bool) { - if o == nil || common.IsNil(o.Domains) { + if o == nil { return nil, false } return o.Domains, true } -// HasDomains returns a boolean if a field has been set. -func (o *ApplePayInfo) HasDomains() bool { - if o != nil && !common.IsNil(o.Domains) { - return true - } - - return false -} - -// SetDomains gets a reference to the given []string and assigns it to the Domains field. +// SetDomains sets field value func (o *ApplePayInfo) SetDomains(v []string) { o.Domains = v } @@ -82,9 +75,7 @@ func (o ApplePayInfo) MarshalJSON() ([]byte, error) { func (o ApplePayInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.Domains) { - toSerialize["domains"] = o.Domains - } + toSerialize["domains"] = o.Domains return toSerialize, nil } diff --git a/src/management/model_bcmc_info.go b/src/management/model_bcmc_info.go index 68f211fb4..c7b6046a0 100644 --- a/src/management/model_bcmc_info.go +++ b/src/management/model_bcmc_info.go @@ -20,7 +20,8 @@ var _ common.MappedNullable = &BcmcInfo{} // BcmcInfo struct for BcmcInfo type BcmcInfo struct { // Indicates if [Bancontact mobile](https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile) is enabled. - EnableBcmcMobile *bool `json:"enableBcmcMobile,omitempty"` + EnableBcmcMobile *bool `json:"enableBcmcMobile,omitempty"` + TransactionDescription *TransactionDescriptionInfo `json:"transactionDescription,omitempty"` } // NewBcmcInfo instantiates a new BcmcInfo object @@ -72,6 +73,38 @@ func (o *BcmcInfo) SetEnableBcmcMobile(v bool) { o.EnableBcmcMobile = &v } +// GetTransactionDescription returns the TransactionDescription field value if set, zero value otherwise. +func (o *BcmcInfo) GetTransactionDescription() TransactionDescriptionInfo { + if o == nil || common.IsNil(o.TransactionDescription) { + var ret TransactionDescriptionInfo + return ret + } + return *o.TransactionDescription +} + +// GetTransactionDescriptionOk returns a tuple with the TransactionDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BcmcInfo) GetTransactionDescriptionOk() (*TransactionDescriptionInfo, bool) { + if o == nil || common.IsNil(o.TransactionDescription) { + return nil, false + } + return o.TransactionDescription, true +} + +// HasTransactionDescription returns a boolean if a field has been set. +func (o *BcmcInfo) HasTransactionDescription() bool { + if o != nil && !common.IsNil(o.TransactionDescription) { + return true + } + + return false +} + +// SetTransactionDescription gets a reference to the given TransactionDescriptionInfo and assigns it to the TransactionDescription field. +func (o *BcmcInfo) SetTransactionDescription(v TransactionDescriptionInfo) { + o.TransactionDescription = &v +} + func (o BcmcInfo) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -85,6 +118,9 @@ func (o BcmcInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.EnableBcmcMobile) { toSerialize["enableBcmcMobile"] = o.EnableBcmcMobile } + if !common.IsNil(o.TransactionDescription) { + toSerialize["transactionDescription"] = o.TransactionDescription + } return toSerialize, nil } diff --git a/src/management/model_cartes_bancaires_info.go b/src/management/model_cartes_bancaires_info.go index dbb303bbd..be64c7a64 100644 --- a/src/management/model_cartes_bancaires_info.go +++ b/src/management/model_cartes_bancaires_info.go @@ -20,7 +20,8 @@ var _ common.MappedNullable = &CartesBancairesInfo{} // CartesBancairesInfo struct for CartesBancairesInfo type CartesBancairesInfo struct { // Cartes Bancaires SIRET. Format: 14 digits. - Siret string `json:"siret"` + Siret string `json:"siret"` + TransactionDescription *TransactionDescriptionInfo `json:"transactionDescription,omitempty"` } // NewCartesBancairesInfo instantiates a new CartesBancairesInfo object @@ -65,6 +66,38 @@ func (o *CartesBancairesInfo) SetSiret(v string) { o.Siret = v } +// GetTransactionDescription returns the TransactionDescription field value if set, zero value otherwise. +func (o *CartesBancairesInfo) GetTransactionDescription() TransactionDescriptionInfo { + if o == nil || common.IsNil(o.TransactionDescription) { + var ret TransactionDescriptionInfo + return ret + } + return *o.TransactionDescription +} + +// GetTransactionDescriptionOk returns a tuple with the TransactionDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CartesBancairesInfo) GetTransactionDescriptionOk() (*TransactionDescriptionInfo, bool) { + if o == nil || common.IsNil(o.TransactionDescription) { + return nil, false + } + return o.TransactionDescription, true +} + +// HasTransactionDescription returns a boolean if a field has been set. +func (o *CartesBancairesInfo) HasTransactionDescription() bool { + if o != nil && !common.IsNil(o.TransactionDescription) { + return true + } + + return false +} + +// SetTransactionDescription gets a reference to the given TransactionDescriptionInfo and assigns it to the TransactionDescription field. +func (o *CartesBancairesInfo) SetTransactionDescription(v TransactionDescriptionInfo) { + o.TransactionDescription = &v +} + func (o CartesBancairesInfo) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -76,6 +109,9 @@ func (o CartesBancairesInfo) MarshalJSON() ([]byte, error) { func (o CartesBancairesInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["siret"] = o.Siret + if !common.IsNil(o.TransactionDescription) { + toSerialize["transactionDescription"] = o.TransactionDescription + } return toSerialize, nil } diff --git a/src/management/model_create_company_webhook_request.go b/src/management/model_create_company_webhook_request.go index 58d6b2eab..41af68ddd 100644 --- a/src/management/model_create_company_webhook_request.go +++ b/src/management/model_create_company_webhook_request.go @@ -32,7 +32,7 @@ type CreateCompanyWebhookRequest struct { CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` - // Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **includeAccounts**: The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts**: The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. * **allAccounts**: Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. + // Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **allAccounts** : Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. * **includeAccounts** : The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts** : The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. FilterMerchantAccountType string `json:"filterMerchantAccountType"` // A list of merchant account names that are included or excluded from receiving the webhook. Inclusion or exclusion is based on the value defined for `filterMerchantAccountType`. Required if `filterMerchantAccountType` is either: * **includeAccounts** * **excludeAccounts** Not needed for `filterMerchantAccountType`: **allAccounts**. FilterMerchantAccounts []string `json:"filterMerchantAccounts"` @@ -44,7 +44,7 @@ type CreateCompanyWebhookRequest struct { PopulateSoapActionHeader *bool `json:"populateSoapActionHeader,omitempty"` // SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. SslVersion *string `json:"sslVersion,omitempty"` - // The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + // The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). Type string `json:"type"` // Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. Url string `json:"url"` diff --git a/src/management/model_create_merchant_webhook_request.go b/src/management/model_create_merchant_webhook_request.go index e07ec5633..89eae9e17 100644 --- a/src/management/model_create_merchant_webhook_request.go +++ b/src/management/model_create_merchant_webhook_request.go @@ -40,7 +40,7 @@ type CreateMerchantWebhookRequest struct { PopulateSoapActionHeader *bool `json:"populateSoapActionHeader,omitempty"` // SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. SslVersion *string `json:"sslVersion,omitempty"` - // The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + // The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). Type string `json:"type"` // Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. Url string `json:"url"` diff --git a/src/management/model_custom_notification.go b/src/management/model_custom_notification.go index 405d2f79d..5ccb77dc4 100644 --- a/src/management/model_custom_notification.go +++ b/src/management/model_custom_notification.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &CustomNotification{} // CustomNotification struct for CustomNotification type CustomNotification struct { Amount *Amount `json:"amount,omitempty"` - // The event that caused the notification to be sent.Currently supported values: * **AUTHORISATION** * **CANCELLATION** * **REFUND** * **CAPTURE** * **DEACTIVATE_RECURRING** * **REPORT_AVAILABLE** * **CHARGEBACK** * **REQUEST_FOR_INFORMATION** * **NOTIFICATION_OF_CHARGEBACK** * **NOTIFICATIONTEST** * **ORDER_OPENED** * **ORDER_CLOSED** * **CHARGEBACK_REVERSED** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** + // The event that caused the notification to be sent.Currently supported values: * **AUTHORISATION** * **CANCELLATION** * **REFUND** * **CAPTURE** * **REPORT_AVAILABLE** * **CHARGEBACK** * **REQUEST_FOR_INFORMATION** * **NOTIFICATION_OF_CHARGEBACK** * **NOTIFICATIONTEST** * **ORDER_OPENED** * **ORDER_CLOSED** * **CHARGEBACK_REVERSED** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** EventCode *string `json:"eventCode,omitempty"` // The time of the event. Format: [ISO 8601](http://www.w3.org/TR/NOTE-datetime), YYYY-MM-DDThh:mm:ssTZD. EventDate *time.Time `json:"eventDate,omitempty"` diff --git a/src/management/model_generic_pm_with_tdi_info.go b/src/management/model_generic_pm_with_tdi_info.go new file mode 100644 index 000000000..d5f76433c --- /dev/null +++ b/src/management/model_generic_pm_with_tdi_info.go @@ -0,0 +1,124 @@ +/* +Management API + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the GenericPmWithTdiInfo type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &GenericPmWithTdiInfo{} + +// GenericPmWithTdiInfo struct for GenericPmWithTdiInfo +type GenericPmWithTdiInfo struct { + TransactionDescription *TransactionDescriptionInfo `json:"transactionDescription,omitempty"` +} + +// NewGenericPmWithTdiInfo instantiates a new GenericPmWithTdiInfo 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 NewGenericPmWithTdiInfo() *GenericPmWithTdiInfo { + this := GenericPmWithTdiInfo{} + return &this +} + +// NewGenericPmWithTdiInfoWithDefaults instantiates a new GenericPmWithTdiInfo 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 NewGenericPmWithTdiInfoWithDefaults() *GenericPmWithTdiInfo { + this := GenericPmWithTdiInfo{} + return &this +} + +// GetTransactionDescription returns the TransactionDescription field value if set, zero value otherwise. +func (o *GenericPmWithTdiInfo) GetTransactionDescription() TransactionDescriptionInfo { + if o == nil || common.IsNil(o.TransactionDescription) { + var ret TransactionDescriptionInfo + return ret + } + return *o.TransactionDescription +} + +// GetTransactionDescriptionOk returns a tuple with the TransactionDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericPmWithTdiInfo) GetTransactionDescriptionOk() (*TransactionDescriptionInfo, bool) { + if o == nil || common.IsNil(o.TransactionDescription) { + return nil, false + } + return o.TransactionDescription, true +} + +// HasTransactionDescription returns a boolean if a field has been set. +func (o *GenericPmWithTdiInfo) HasTransactionDescription() bool { + if o != nil && !common.IsNil(o.TransactionDescription) { + return true + } + + return false +} + +// SetTransactionDescription gets a reference to the given TransactionDescriptionInfo and assigns it to the TransactionDescription field. +func (o *GenericPmWithTdiInfo) SetTransactionDescription(v TransactionDescriptionInfo) { + o.TransactionDescription = &v +} + +func (o GenericPmWithTdiInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericPmWithTdiInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.TransactionDescription) { + toSerialize["transactionDescription"] = o.TransactionDescription + } + return toSerialize, nil +} + +type NullableGenericPmWithTdiInfo struct { + value *GenericPmWithTdiInfo + isSet bool +} + +func (v NullableGenericPmWithTdiInfo) Get() *GenericPmWithTdiInfo { + return v.value +} + +func (v *NullableGenericPmWithTdiInfo) Set(val *GenericPmWithTdiInfo) { + v.value = val + v.isSet = true +} + +func (v NullableGenericPmWithTdiInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericPmWithTdiInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericPmWithTdiInfo(val *GenericPmWithTdiInfo) *NullableGenericPmWithTdiInfo { + return &NullableGenericPmWithTdiInfo{value: val, isSet: true} +} + +func (v NullableGenericPmWithTdiInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericPmWithTdiInfo) 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..5a5c76064 100644 --- a/src/management/model_hardware.go +++ b/src/management/model_hardware.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &Hardware{} type Hardware struct { // The brightness of the display when the terminal is being used, expressed as a percentage. DisplayMaximumBackLight *int32 `json:"displayMaximumBackLight,omitempty"` - // The hour (0 - 23) in which the device will reboot, reboot will happen in the timezone of the device + // The hour of the day when the terminal is set to reboot to apply the configuration and software updates. By default, the restart hour is at 6:00 AM in the timezone of the terminal Minimum vaoue: 0, maximum value: 23. RestartHour *int32 `json:"restartHour,omitempty"` } diff --git a/src/management/model_klarna_info.go b/src/management/model_klarna_info.go index 1b03d25ca..6c44bd496 100644 --- a/src/management/model_klarna_info.go +++ b/src/management/model_klarna_info.go @@ -24,7 +24,7 @@ type KlarnaInfo struct { // The email address for disputes. DisputeEmail string `json:"disputeEmail"` // The region of operation. For example, **NA**, **EU**, **CH**, **AU**. - Region *string `json:"region,omitempty"` + Region string `json:"region"` // The email address of merchant support. SupportEmail string `json:"supportEmail"` } @@ -33,9 +33,10 @@ type KlarnaInfo 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 NewKlarnaInfo(disputeEmail string, supportEmail string) *KlarnaInfo { +func NewKlarnaInfo(disputeEmail string, region string, supportEmail string) *KlarnaInfo { this := KlarnaInfo{} this.DisputeEmail = disputeEmail + this.Region = region this.SupportEmail = supportEmail return &this } @@ -104,36 +105,28 @@ func (o *KlarnaInfo) SetDisputeEmail(v string) { o.DisputeEmail = v } -// GetRegion returns the Region field value if set, zero value otherwise. +// GetRegion returns the Region field value func (o *KlarnaInfo) GetRegion() string { - if o == nil || common.IsNil(o.Region) { + if o == nil { var ret string return ret } - return *o.Region + + return o.Region } -// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// GetRegionOk returns a tuple with the Region field value // and a boolean to check if the value has been set. func (o *KlarnaInfo) GetRegionOk() (*string, bool) { - if o == nil || common.IsNil(o.Region) { + if o == nil { return nil, false } - return o.Region, true -} - -// HasRegion returns a boolean if a field has been set. -func (o *KlarnaInfo) HasRegion() bool { - if o != nil && !common.IsNil(o.Region) { - return true - } - - return false + return &o.Region, true } -// SetRegion gets a reference to the given string and assigns it to the Region field. +// SetRegion sets field value func (o *KlarnaInfo) SetRegion(v string) { - o.Region = &v + o.Region = v } // GetSupportEmail returns the SupportEmail field value @@ -174,9 +167,7 @@ func (o KlarnaInfo) ToMap() (map[string]interface{}, error) { toSerialize["autoCapture"] = o.AutoCapture } toSerialize["disputeEmail"] = o.DisputeEmail - if !common.IsNil(o.Region) { - toSerialize["region"] = o.Region - } + toSerialize["region"] = o.Region toSerialize["supportEmail"] = o.SupportEmail return toSerialize, nil } diff --git a/src/management/model_list_terminals_response.go b/src/management/model_list_terminals_response.go index 316933217..2051ff319 100644 --- a/src/management/model_list_terminals_response.go +++ b/src/management/model_list_terminals_response.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &ListTerminalsResponse{} // ListTerminalsResponse struct for ListTerminalsResponse type ListTerminalsResponse struct { Links *PaginationLinks `json:"_links,omitempty"` - // The list of terminals. + // The list of terminals and their details. Data []Terminal `json:"data,omitempty"` // Total number of items. ItemsTotal int32 `json:"itemsTotal"` diff --git a/src/management/model_meal_voucher_fr_info.go b/src/management/model_meal_voucher_fr_info.go index 745edfd65..b949c764b 100644 --- a/src/management/model_meal_voucher_fr_info.go +++ b/src/management/model_meal_voucher_fr_info.go @@ -23,7 +23,7 @@ type MealVoucherFRInfo struct { ConecsId string `json:"conecsId"` // Meal Voucher siret. Format: 14 digits. Siret string `json:"siret"` - // The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. + // The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. SubTypes []string `json:"subTypes"` } diff --git a/src/management/model_notification.go b/src/management/model_notification.go index f1ecccc48..32247550b 100644 --- a/src/management/model_notification.go +++ b/src/management/model_notification.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &Notification{} // Notification struct for Notification type Notification struct { - // Toggle to show or hide Notification button on the terminal + // Shows or hides the event notification button on the terminal screen. ShowButton *bool `json:"showButton,omitempty"` } diff --git a/src/management/model_payment.go b/src/management/model_payment.go index 1307a5b31..4ba7e3bc4 100644 --- a/src/management/model_payment.go +++ b/src/management/model_payment.go @@ -19,6 +19,8 @@ var _ common.MappedNullable = &Payment{} // Payment struct for Payment type Payment struct { + // The default currency for contactless payments on the payment terminal, as the three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. + ContactlessCurrency *string `json:"contactlessCurrency,omitempty"` // Hides the minor units for the listed [ISO currency codes](https://en.wikipedia.org/wiki/ISO_4217). HideMinorUnitsInCurrencies []string `json:"hideMinorUnitsInCurrencies,omitempty"` } @@ -40,6 +42,38 @@ func NewPaymentWithDefaults() *Payment { return &this } +// GetContactlessCurrency returns the ContactlessCurrency field value if set, zero value otherwise. +func (o *Payment) GetContactlessCurrency() string { + if o == nil || common.IsNil(o.ContactlessCurrency) { + var ret string + return ret + } + return *o.ContactlessCurrency +} + +// GetContactlessCurrencyOk returns a tuple with the ContactlessCurrency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payment) GetContactlessCurrencyOk() (*string, bool) { + if o == nil || common.IsNil(o.ContactlessCurrency) { + return nil, false + } + return o.ContactlessCurrency, true +} + +// HasContactlessCurrency returns a boolean if a field has been set. +func (o *Payment) HasContactlessCurrency() bool { + if o != nil && !common.IsNil(o.ContactlessCurrency) { + return true + } + + return false +} + +// SetContactlessCurrency gets a reference to the given string and assigns it to the ContactlessCurrency field. +func (o *Payment) SetContactlessCurrency(v string) { + o.ContactlessCurrency = &v +} + // GetHideMinorUnitsInCurrencies returns the HideMinorUnitsInCurrencies field value if set, zero value otherwise. func (o *Payment) GetHideMinorUnitsInCurrencies() []string { if o == nil || common.IsNil(o.HideMinorUnitsInCurrencies) { @@ -82,6 +116,9 @@ func (o Payment) MarshalJSON() ([]byte, error) { func (o Payment) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ContactlessCurrency) { + toSerialize["contactlessCurrency"] = o.ContactlessCurrency + } if !common.IsNil(o.HideMinorUnitsInCurrencies) { toSerialize["hideMinorUnitsInCurrencies"] = o.HideMinorUnitsInCurrencies } diff --git a/src/management/model_payment_method.go b/src/management/model_payment_method.go index b179f45c4..b39035942 100644 --- a/src/management/model_payment_method.go +++ b/src/management/model_payment_method.go @@ -29,20 +29,30 @@ type PaymentMethod struct { CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,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"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,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"` + CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). - Enabled *bool `json:"enabled,omitempty"` - GiroPay *GiroPayInfo `json:"giroPay,omitempty"` - GooglePay *GooglePayInfo `json:"googlePay,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + GooglePay *GooglePayInfo `json:"googlePay,omitempty"` // The identifier of the resource. - Id string `json:"id"` - Klarna *KlarnaInfo `json:"klarna,omitempty"` - MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` - Paypal *PayPalInfo `json:"paypal,omitempty"` + Id string `json:"id"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,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. @@ -55,8 +65,9 @@ type PaymentMethod struct { // 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"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewPaymentMethod instantiates a new PaymentMethod object @@ -333,6 +344,38 @@ func (o *PaymentMethod) SetCountries(v []string) { o.Countries = v } +// GetCup returns the Cup field value if set, zero value otherwise. +func (o *PaymentMethod) GetCup() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Cup) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Cup +} + +// GetCupOk returns a tuple with the Cup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCupOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Cup) { + return nil, false + } + return o.Cup, true +} + +// HasCup returns a boolean if a field has been set. +func (o *PaymentMethod) HasCup() bool { + if o != nil && !common.IsNil(o.Cup) { + return true + } + + return false +} + +// SetCup gets a reference to the given GenericPmWithTdiInfo and assigns it to the Cup field. +func (o *PaymentMethod) SetCup(v GenericPmWithTdiInfo) { + o.Cup = &v +} + // GetCurrencies returns the Currencies field value if set, zero value otherwise. func (o *PaymentMethod) GetCurrencies() []string { if o == nil || common.IsNil(o.Currencies) { @@ -397,6 +440,102 @@ func (o *PaymentMethod) SetCustomRoutingFlags(v []string) { o.CustomRoutingFlags = v } +// GetDiners returns the Diners field value if set, zero value otherwise. +func (o *PaymentMethod) GetDiners() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Diners) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Diners +} + +// GetDinersOk returns a tuple with the Diners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetDinersOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Diners) { + return nil, false + } + return o.Diners, true +} + +// HasDiners returns a boolean if a field has been set. +func (o *PaymentMethod) HasDiners() bool { + if o != nil && !common.IsNil(o.Diners) { + return true + } + + return false +} + +// SetDiners gets a reference to the given GenericPmWithTdiInfo and assigns it to the Diners field. +func (o *PaymentMethod) SetDiners(v GenericPmWithTdiInfo) { + o.Diners = &v +} + +// GetDiscover returns the Discover field value if set, zero value otherwise. +func (o *PaymentMethod) GetDiscover() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Discover) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Discover +} + +// GetDiscoverOk returns a tuple with the Discover field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetDiscoverOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Discover) { + return nil, false + } + return o.Discover, true +} + +// HasDiscover returns a boolean if a field has been set. +func (o *PaymentMethod) HasDiscover() bool { + if o != nil && !common.IsNil(o.Discover) { + return true + } + + return false +} + +// SetDiscover gets a reference to the given GenericPmWithTdiInfo and assigns it to the Discover field. +func (o *PaymentMethod) SetDiscover(v GenericPmWithTdiInfo) { + o.Discover = &v +} + +// GetEftposAustralia returns the EftposAustralia field value if set, zero value otherwise. +func (o *PaymentMethod) GetEftposAustralia() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.EftposAustralia) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.EftposAustralia +} + +// GetEftposAustraliaOk returns a tuple with the EftposAustralia field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetEftposAustraliaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.EftposAustralia) { + return nil, false + } + return o.EftposAustralia, true +} + +// HasEftposAustralia returns a boolean if a field has been set. +func (o *PaymentMethod) HasEftposAustralia() bool { + if o != nil && !common.IsNil(o.EftposAustralia) { + return true + } + + return false +} + +// SetEftposAustralia gets a reference to the given GenericPmWithTdiInfo and assigns it to the EftposAustralia field. +func (o *PaymentMethod) SetEftposAustralia(v GenericPmWithTdiInfo) { + o.EftposAustralia = &v +} + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *PaymentMethod) GetEnabled() bool { if o == nil || common.IsNil(o.Enabled) { @@ -461,6 +600,38 @@ func (o *PaymentMethod) SetGiroPay(v GiroPayInfo) { o.GiroPay = &v } +// GetGirocard returns the Girocard field value if set, zero value otherwise. +func (o *PaymentMethod) GetGirocard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Girocard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Girocard +} + +// GetGirocardOk returns a tuple with the Girocard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetGirocardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Girocard) { + return nil, false + } + return o.Girocard, true +} + +// HasGirocard returns a boolean if a field has been set. +func (o *PaymentMethod) HasGirocard() bool { + if o != nil && !common.IsNil(o.Girocard) { + return true + } + + return false +} + +// SetGirocard gets a reference to the given GenericPmWithTdiInfo and assigns it to the Girocard field. +func (o *PaymentMethod) SetGirocard(v GenericPmWithTdiInfo) { + o.Girocard = &v +} + // GetGooglePay returns the GooglePay field value if set, zero value otherwise. func (o *PaymentMethod) GetGooglePay() GooglePayInfo { if o == nil || common.IsNil(o.GooglePay) { @@ -517,6 +688,102 @@ func (o *PaymentMethod) SetId(v string) { o.Id = v } +// GetIdeal returns the Ideal field value if set, zero value otherwise. +func (o *PaymentMethod) GetIdeal() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Ideal) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Ideal +} + +// GetIdealOk returns a tuple with the Ideal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetIdealOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Ideal) { + return nil, false + } + return o.Ideal, true +} + +// HasIdeal returns a boolean if a field has been set. +func (o *PaymentMethod) HasIdeal() bool { + if o != nil && !common.IsNil(o.Ideal) { + return true + } + + return false +} + +// SetIdeal gets a reference to the given GenericPmWithTdiInfo and assigns it to the Ideal field. +func (o *PaymentMethod) SetIdeal(v GenericPmWithTdiInfo) { + o.Ideal = &v +} + +// GetInteracCard returns the InteracCard field value if set, zero value otherwise. +func (o *PaymentMethod) GetInteracCard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.InteracCard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.InteracCard +} + +// GetInteracCardOk returns a tuple with the InteracCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetInteracCardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.InteracCard) { + return nil, false + } + return o.InteracCard, true +} + +// HasInteracCard returns a boolean if a field has been set. +func (o *PaymentMethod) HasInteracCard() bool { + if o != nil && !common.IsNil(o.InteracCard) { + return true + } + + return false +} + +// SetInteracCard gets a reference to the given GenericPmWithTdiInfo and assigns it to the InteracCard field. +func (o *PaymentMethod) SetInteracCard(v GenericPmWithTdiInfo) { + o.InteracCard = &v +} + +// GetJcb returns the Jcb field value if set, zero value otherwise. +func (o *PaymentMethod) GetJcb() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Jcb) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Jcb +} + +// GetJcbOk returns a tuple with the Jcb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetJcbOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Jcb) { + return nil, false + } + return o.Jcb, true +} + +// HasJcb returns a boolean if a field has been set. +func (o *PaymentMethod) HasJcb() bool { + if o != nil && !common.IsNil(o.Jcb) { + return true + } + + return false +} + +// SetJcb gets a reference to the given GenericPmWithTdiInfo and assigns it to the Jcb field. +func (o *PaymentMethod) SetJcb(v GenericPmWithTdiInfo) { + o.Jcb = &v +} + // GetKlarna returns the Klarna field value if set, zero value otherwise. func (o *PaymentMethod) GetKlarna() KlarnaInfo { if o == nil || common.IsNil(o.Klarna) { @@ -549,6 +816,70 @@ func (o *PaymentMethod) SetKlarna(v KlarnaInfo) { o.Klarna = &v } +// GetMaestro returns the Maestro field value if set, zero value otherwise. +func (o *PaymentMethod) GetMaestro() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Maestro) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Maestro +} + +// GetMaestroOk returns a tuple with the Maestro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetMaestroOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Maestro) { + return nil, false + } + return o.Maestro, true +} + +// HasMaestro returns a boolean if a field has been set. +func (o *PaymentMethod) HasMaestro() bool { + if o != nil && !common.IsNil(o.Maestro) { + return true + } + + return false +} + +// SetMaestro gets a reference to the given GenericPmWithTdiInfo and assigns it to the Maestro field. +func (o *PaymentMethod) SetMaestro(v GenericPmWithTdiInfo) { + o.Maestro = &v +} + +// GetMc returns the Mc field value if set, zero value otherwise. +func (o *PaymentMethod) GetMc() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Mc) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Mc +} + +// GetMcOk returns a tuple with the Mc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetMcOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Mc) { + return nil, false + } + return o.Mc, true +} + +// HasMc returns a boolean if a field has been set. +func (o *PaymentMethod) HasMc() bool { + if o != nil && !common.IsNil(o.Mc) { + return true + } + + return false +} + +// SetMc gets a reference to the given GenericPmWithTdiInfo and assigns it to the Mc field. +func (o *PaymentMethod) SetMc(v GenericPmWithTdiInfo) { + o.Mc = &v +} + // GetMealVoucherFR returns the MealVoucherFR field value if set, zero value otherwise. func (o *PaymentMethod) GetMealVoucherFR() MealVoucherFRInfo { if o == nil || common.IsNil(o.MealVoucherFR) { @@ -901,6 +1232,38 @@ func (o *PaymentMethod) SetVipps(v VippsInfo) { o.Vipps = &v } +// GetVisa returns the Visa field value if set, zero value otherwise. +func (o *PaymentMethod) GetVisa() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Visa) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Visa +} + +// GetVisaOk returns a tuple with the Visa field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetVisaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Visa) { + return nil, false + } + return o.Visa, true +} + +// HasVisa returns a boolean if a field has been set. +func (o *PaymentMethod) HasVisa() bool { + if o != nil && !common.IsNil(o.Visa) { + return true + } + + return false +} + +// SetVisa gets a reference to the given GenericPmWithTdiInfo and assigns it to the Visa field. +func (o *PaymentMethod) SetVisa(v GenericPmWithTdiInfo) { + o.Visa = &v +} + func (o PaymentMethod) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -935,25 +1298,55 @@ func (o PaymentMethod) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } + if !common.IsNil(o.Cup) { + toSerialize["cup"] = o.Cup + } if !common.IsNil(o.Currencies) { toSerialize["currencies"] = o.Currencies } if !common.IsNil(o.CustomRoutingFlags) { toSerialize["customRoutingFlags"] = o.CustomRoutingFlags } + if !common.IsNil(o.Diners) { + toSerialize["diners"] = o.Diners + } + if !common.IsNil(o.Discover) { + toSerialize["discover"] = o.Discover + } + if !common.IsNil(o.EftposAustralia) { + toSerialize["eftpos_australia"] = o.EftposAustralia + } if !common.IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } if !common.IsNil(o.GiroPay) { toSerialize["giroPay"] = o.GiroPay } + if !common.IsNil(o.Girocard) { + toSerialize["girocard"] = o.Girocard + } if !common.IsNil(o.GooglePay) { toSerialize["googlePay"] = o.GooglePay } toSerialize["id"] = o.Id + if !common.IsNil(o.Ideal) { + toSerialize["ideal"] = o.Ideal + } + if !common.IsNil(o.InteracCard) { + toSerialize["interac_card"] = o.InteracCard + } + if !common.IsNil(o.Jcb) { + toSerialize["jcb"] = o.Jcb + } if !common.IsNil(o.Klarna) { toSerialize["klarna"] = o.Klarna } + if !common.IsNil(o.Maestro) { + toSerialize["maestro"] = o.Maestro + } + if !common.IsNil(o.Mc) { + toSerialize["mc"] = o.Mc + } if !common.IsNil(o.MealVoucherFR) { toSerialize["mealVoucher_FR"] = o.MealVoucherFR } @@ -987,6 +1380,9 @@ func (o PaymentMethod) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Vipps) { toSerialize["vipps"] = o.Vipps } + if !common.IsNil(o.Visa) { + toSerialize["visa"] = o.Visa + } return toSerialize, nil } diff --git a/src/management/model_payment_method_response.go b/src/management/model_payment_method_response.go index 499a26822..0fe525591 100644 --- a/src/management/model_payment_method_response.go +++ b/src/management/model_payment_method_response.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &PaymentMethodResponse{} // PaymentMethodResponse struct for PaymentMethodResponse type PaymentMethodResponse struct { Links *PaginationLinks `json:"_links,omitempty"` - // Payment methods details. + // The list of supported payment methods and their details. Data []PaymentMethodWrapper `json:"data,omitempty"` // Total number of items. ItemsTotal int32 `json:"itemsTotal"` diff --git a/src/management/model_payment_method_setup_info.go b/src/management/model_payment_method_setup_info.go index 9f9d3e443..ba51da31e 100644 --- a/src/management/model_payment_method_setup_info.go +++ b/src/management/model_payment_method_setup_info.go @@ -27,16 +27,26 @@ type PaymentMethodSetupInfo struct { CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,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"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,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"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + GooglePay *GooglePayInfo `json:"googlePay,omitempty"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,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**. @@ -47,16 +57,18 @@ type PaymentMethodSetupInfo struct { 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"` - Vipps *VippsInfo `json:"vipps,omitempty"` + Type string `json:"type"` + Vipps *VippsInfo `json:"vipps,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewPaymentMethodSetupInfo instantiates a new PaymentMethodSetupInfo 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 NewPaymentMethodSetupInfo() *PaymentMethodSetupInfo { +func NewPaymentMethodSetupInfo(type_ string) *PaymentMethodSetupInfo { this := PaymentMethodSetupInfo{} + this.Type = type_ return &this } @@ -292,6 +304,38 @@ func (o *PaymentMethodSetupInfo) SetCountries(v []string) { o.Countries = v } +// GetCup returns the Cup field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetCup() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Cup) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Cup +} + +// GetCupOk returns a tuple with the Cup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetCupOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Cup) { + return nil, false + } + return o.Cup, true +} + +// HasCup returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasCup() bool { + if o != nil && !common.IsNil(o.Cup) { + return true + } + + return false +} + +// SetCup gets a reference to the given GenericPmWithTdiInfo and assigns it to the Cup field. +func (o *PaymentMethodSetupInfo) SetCup(v GenericPmWithTdiInfo) { + o.Cup = &v +} + // GetCurrencies returns the Currencies field value if set, zero value otherwise. func (o *PaymentMethodSetupInfo) GetCurrencies() []string { if o == nil || common.IsNil(o.Currencies) { @@ -356,6 +400,102 @@ func (o *PaymentMethodSetupInfo) SetCustomRoutingFlags(v []string) { o.CustomRoutingFlags = v } +// GetDiners returns the Diners field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetDiners() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Diners) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Diners +} + +// GetDinersOk returns a tuple with the Diners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetDinersOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Diners) { + return nil, false + } + return o.Diners, true +} + +// HasDiners returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasDiners() bool { + if o != nil && !common.IsNil(o.Diners) { + return true + } + + return false +} + +// SetDiners gets a reference to the given GenericPmWithTdiInfo and assigns it to the Diners field. +func (o *PaymentMethodSetupInfo) SetDiners(v GenericPmWithTdiInfo) { + o.Diners = &v +} + +// GetDiscover returns the Discover field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetDiscover() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Discover) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Discover +} + +// GetDiscoverOk returns a tuple with the Discover field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetDiscoverOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Discover) { + return nil, false + } + return o.Discover, true +} + +// HasDiscover returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasDiscover() bool { + if o != nil && !common.IsNil(o.Discover) { + return true + } + + return false +} + +// SetDiscover gets a reference to the given GenericPmWithTdiInfo and assigns it to the Discover field. +func (o *PaymentMethodSetupInfo) SetDiscover(v GenericPmWithTdiInfo) { + o.Discover = &v +} + +// GetEftposAustralia returns the EftposAustralia field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetEftposAustralia() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.EftposAustralia) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.EftposAustralia +} + +// GetEftposAustraliaOk returns a tuple with the EftposAustralia field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetEftposAustraliaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.EftposAustralia) { + return nil, false + } + return o.EftposAustralia, true +} + +// HasEftposAustralia returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasEftposAustralia() bool { + if o != nil && !common.IsNil(o.EftposAustralia) { + return true + } + + return false +} + +// SetEftposAustralia gets a reference to the given GenericPmWithTdiInfo and assigns it to the EftposAustralia field. +func (o *PaymentMethodSetupInfo) SetEftposAustralia(v GenericPmWithTdiInfo) { + o.EftposAustralia = &v +} + // GetGiroPay returns the GiroPay field value if set, zero value otherwise. func (o *PaymentMethodSetupInfo) GetGiroPay() GiroPayInfo { if o == nil || common.IsNil(o.GiroPay) { @@ -388,6 +528,38 @@ func (o *PaymentMethodSetupInfo) SetGiroPay(v GiroPayInfo) { o.GiroPay = &v } +// GetGirocard returns the Girocard field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetGirocard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Girocard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Girocard +} + +// GetGirocardOk returns a tuple with the Girocard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetGirocardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Girocard) { + return nil, false + } + return o.Girocard, true +} + +// HasGirocard returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasGirocard() bool { + if o != nil && !common.IsNil(o.Girocard) { + return true + } + + return false +} + +// SetGirocard gets a reference to the given GenericPmWithTdiInfo and assigns it to the Girocard field. +func (o *PaymentMethodSetupInfo) SetGirocard(v GenericPmWithTdiInfo) { + o.Girocard = &v +} + // GetGooglePay returns the GooglePay field value if set, zero value otherwise. func (o *PaymentMethodSetupInfo) GetGooglePay() GooglePayInfo { if o == nil || common.IsNil(o.GooglePay) { @@ -420,6 +592,102 @@ func (o *PaymentMethodSetupInfo) SetGooglePay(v GooglePayInfo) { o.GooglePay = &v } +// GetIdeal returns the Ideal field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetIdeal() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Ideal) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Ideal +} + +// GetIdealOk returns a tuple with the Ideal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetIdealOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Ideal) { + return nil, false + } + return o.Ideal, true +} + +// HasIdeal returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasIdeal() bool { + if o != nil && !common.IsNil(o.Ideal) { + return true + } + + return false +} + +// SetIdeal gets a reference to the given GenericPmWithTdiInfo and assigns it to the Ideal field. +func (o *PaymentMethodSetupInfo) SetIdeal(v GenericPmWithTdiInfo) { + o.Ideal = &v +} + +// GetInteracCard returns the InteracCard field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetInteracCard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.InteracCard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.InteracCard +} + +// GetInteracCardOk returns a tuple with the InteracCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetInteracCardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.InteracCard) { + return nil, false + } + return o.InteracCard, true +} + +// HasInteracCard returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasInteracCard() bool { + if o != nil && !common.IsNil(o.InteracCard) { + return true + } + + return false +} + +// SetInteracCard gets a reference to the given GenericPmWithTdiInfo and assigns it to the InteracCard field. +func (o *PaymentMethodSetupInfo) SetInteracCard(v GenericPmWithTdiInfo) { + o.InteracCard = &v +} + +// GetJcb returns the Jcb field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetJcb() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Jcb) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Jcb +} + +// GetJcbOk returns a tuple with the Jcb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetJcbOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Jcb) { + return nil, false + } + return o.Jcb, true +} + +// HasJcb returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasJcb() bool { + if o != nil && !common.IsNil(o.Jcb) { + return true + } + + return false +} + +// SetJcb gets a reference to the given GenericPmWithTdiInfo and assigns it to the Jcb field. +func (o *PaymentMethodSetupInfo) SetJcb(v GenericPmWithTdiInfo) { + o.Jcb = &v +} + // GetKlarna returns the Klarna field value if set, zero value otherwise. func (o *PaymentMethodSetupInfo) GetKlarna() KlarnaInfo { if o == nil || common.IsNil(o.Klarna) { @@ -452,6 +720,70 @@ func (o *PaymentMethodSetupInfo) SetKlarna(v KlarnaInfo) { o.Klarna = &v } +// GetMaestro returns the Maestro field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetMaestro() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Maestro) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Maestro +} + +// GetMaestroOk returns a tuple with the Maestro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetMaestroOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Maestro) { + return nil, false + } + return o.Maestro, true +} + +// HasMaestro returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasMaestro() bool { + if o != nil && !common.IsNil(o.Maestro) { + return true + } + + return false +} + +// SetMaestro gets a reference to the given GenericPmWithTdiInfo and assigns it to the Maestro field. +func (o *PaymentMethodSetupInfo) SetMaestro(v GenericPmWithTdiInfo) { + o.Maestro = &v +} + +// GetMc returns the Mc field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetMc() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Mc) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Mc +} + +// GetMcOk returns a tuple with the Mc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetMcOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Mc) { + return nil, false + } + return o.Mc, true +} + +// HasMc returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasMc() bool { + if o != nil && !common.IsNil(o.Mc) { + return true + } + + return false +} + +// SetMc gets a reference to the given GenericPmWithTdiInfo and assigns it to the Mc field. +func (o *PaymentMethodSetupInfo) SetMc(v GenericPmWithTdiInfo) { + o.Mc = &v +} + // GetMealVoucherFR returns the MealVoucherFR field value if set, zero value otherwise. func (o *PaymentMethodSetupInfo) GetMealVoucherFR() MealVoucherFRInfo { if o == nil || common.IsNil(o.MealVoucherFR) { @@ -708,36 +1040,28 @@ func (o *PaymentMethodSetupInfo) SetTwint(v TwintInfo) { o.Twint = &v } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *PaymentMethodSetupInfo) GetType() string { - if o == nil || common.IsNil(o.Type) { + if o == nil { var ret string return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *PaymentMethodSetupInfo) GetTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + return &o.Type, true } -// HasType returns a boolean if a field has been set. -func (o *PaymentMethodSetupInfo) 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. +// SetType sets field value func (o *PaymentMethodSetupInfo) SetType(v string) { - o.Type = &v + o.Type = v } // GetVipps returns the Vipps field value if set, zero value otherwise. @@ -772,6 +1096,38 @@ func (o *PaymentMethodSetupInfo) SetVipps(v VippsInfo) { o.Vipps = &v } +// GetVisa returns the Visa field value if set, zero value otherwise. +func (o *PaymentMethodSetupInfo) GetVisa() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Visa) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Visa +} + +// GetVisaOk returns a tuple with the Visa field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodSetupInfo) GetVisaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Visa) { + return nil, false + } + return o.Visa, true +} + +// HasVisa returns a boolean if a field has been set. +func (o *PaymentMethodSetupInfo) HasVisa() bool { + if o != nil && !common.IsNil(o.Visa) { + return true + } + + return false +} + +// SetVisa gets a reference to the given GenericPmWithTdiInfo and assigns it to the Visa field. +func (o *PaymentMethodSetupInfo) SetVisa(v GenericPmWithTdiInfo) { + o.Visa = &v +} + func (o PaymentMethodSetupInfo) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -803,21 +1159,51 @@ func (o PaymentMethodSetupInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } + if !common.IsNil(o.Cup) { + toSerialize["cup"] = o.Cup + } if !common.IsNil(o.Currencies) { toSerialize["currencies"] = o.Currencies } if !common.IsNil(o.CustomRoutingFlags) { toSerialize["customRoutingFlags"] = o.CustomRoutingFlags } + if !common.IsNil(o.Diners) { + toSerialize["diners"] = o.Diners + } + if !common.IsNil(o.Discover) { + toSerialize["discover"] = o.Discover + } + if !common.IsNil(o.EftposAustralia) { + toSerialize["eftpos_australia"] = o.EftposAustralia + } if !common.IsNil(o.GiroPay) { toSerialize["giroPay"] = o.GiroPay } + if !common.IsNil(o.Girocard) { + toSerialize["girocard"] = o.Girocard + } if !common.IsNil(o.GooglePay) { toSerialize["googlePay"] = o.GooglePay } + if !common.IsNil(o.Ideal) { + toSerialize["ideal"] = o.Ideal + } + if !common.IsNil(o.InteracCard) { + toSerialize["interac_card"] = o.InteracCard + } + if !common.IsNil(o.Jcb) { + toSerialize["jcb"] = o.Jcb + } if !common.IsNil(o.Klarna) { toSerialize["klarna"] = o.Klarna } + if !common.IsNil(o.Maestro) { + toSerialize["maestro"] = o.Maestro + } + if !common.IsNil(o.Mc) { + toSerialize["mc"] = o.Mc + } if !common.IsNil(o.MealVoucherFR) { toSerialize["mealVoucher_FR"] = o.MealVoucherFR } @@ -842,12 +1228,13 @@ func (o PaymentMethodSetupInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Twint) { toSerialize["twint"] = o.Twint } - if !common.IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["type"] = o.Type if !common.IsNil(o.Vipps) { toSerialize["vipps"] = o.Vipps } + if !common.IsNil(o.Visa) { + toSerialize["visa"] = o.Visa + } return toSerialize, nil } @@ -897,7 +1284,7 @@ func (o *PaymentMethodSetupInfo) isValidShopperInteraction() bool { 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", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paybybank", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos"} + var allowedEnumValues = []string{"afterpaytouch", "alipay", "alipay_hk", "amex", "applepay", "bcmc", "blik", "cartebancaire", "clearpay", "cup", "diners", "directdebit_GB", "discover", "ebanking_FI", "eftpos_australia", "elo", "elocredit", "elodebit", "girocard", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paybybank", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/management/model_split_configuration_logic.go b/src/management/model_split_configuration_logic.go index 6b153010c..9e20c0b25 100644 --- a/src/management/model_split_configuration_logic.go +++ b/src/management/model_split_configuration_logic.go @@ -19,14 +19,28 @@ var _ common.MappedNullable = &SplitConfigurationLogic{} // SplitConfigurationLogic struct for SplitConfigurationLogic type SplitConfigurationLogic struct { + // Specifies the logic to apply when booking the transaction fees. Should be combined with adyenFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AcquiringFees *string `json:"acquiringFees,omitempty"` AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, interchange & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenCommission *string `json:"adyenCommission,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with acquiringFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenFees *string `json:"adyenFees,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & interchange. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenMarkup *string `json:"adyenMarkup,omitempty"` // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - 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"` + Chargeback *string `json:"chargeback,omitempty"` + // Specifies the logic to apply when allocating the chargeback costs. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount** + ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` + Commission Commission `json:"commission"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + Interchange *string `json:"interchange,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Cannot be combined with other fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + PaymentFee *string `json:"paymentFee,omitempty"` // Specifies the logic to apply when booking the amount left over after currency conversion. Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. Remainder *string `json:"remainder,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with interchange, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + SchemeFee *string `json:"schemeFee,omitempty"` // Unique identifier of the split logic that is applied when the split configuration conditions are met. SplitLogicId *string `json:"splitLogicId,omitempty"` // Specifies the logic to apply when booking the surcharge amount. Possible values: **addToLiableAccount**, **addToOneBalanceAccount** @@ -39,10 +53,9 @@ type SplitConfigurationLogic 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 NewSplitConfigurationLogic(commission Commission, paymentFee string) *SplitConfigurationLogic { +func NewSplitConfigurationLogic(commission Commission) *SplitConfigurationLogic { this := SplitConfigurationLogic{} this.Commission = commission - this.PaymentFee = paymentFee return &this } @@ -54,6 +67,38 @@ func NewSplitConfigurationLogicWithDefaults() *SplitConfigurationLogic { return &this } +// GetAcquiringFees returns the AcquiringFees field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetAcquiringFees() string { + if o == nil || common.IsNil(o.AcquiringFees) { + var ret string + return ret + } + return *o.AcquiringFees +} + +// GetAcquiringFeesOk returns a tuple with the AcquiringFees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetAcquiringFeesOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquiringFees) { + return nil, false + } + return o.AcquiringFees, true +} + +// HasAcquiringFees returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasAcquiringFees() bool { + if o != nil && !common.IsNil(o.AcquiringFees) { + return true + } + + return false +} + +// SetAcquiringFees gets a reference to the given string and assigns it to the AcquiringFees field. +func (o *SplitConfigurationLogic) SetAcquiringFees(v string) { + o.AcquiringFees = &v +} + // GetAdditionalCommission returns the AdditionalCommission field value if set, zero value otherwise. func (o *SplitConfigurationLogic) GetAdditionalCommission() AdditionalCommission { if o == nil || common.IsNil(o.AdditionalCommission) { @@ -86,6 +131,102 @@ func (o *SplitConfigurationLogic) SetAdditionalCommission(v AdditionalCommission o.AdditionalCommission = &v } +// GetAdyenCommission returns the AdyenCommission field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetAdyenCommission() string { + if o == nil || common.IsNil(o.AdyenCommission) { + var ret string + return ret + } + return *o.AdyenCommission +} + +// GetAdyenCommissionOk returns a tuple with the AdyenCommission field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetAdyenCommissionOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenCommission) { + return nil, false + } + return o.AdyenCommission, true +} + +// HasAdyenCommission returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasAdyenCommission() bool { + if o != nil && !common.IsNil(o.AdyenCommission) { + return true + } + + return false +} + +// SetAdyenCommission gets a reference to the given string and assigns it to the AdyenCommission field. +func (o *SplitConfigurationLogic) SetAdyenCommission(v string) { + o.AdyenCommission = &v +} + +// GetAdyenFees returns the AdyenFees field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetAdyenFees() string { + if o == nil || common.IsNil(o.AdyenFees) { + var ret string + return ret + } + return *o.AdyenFees +} + +// GetAdyenFeesOk returns a tuple with the AdyenFees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetAdyenFeesOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenFees) { + return nil, false + } + return o.AdyenFees, true +} + +// HasAdyenFees returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasAdyenFees() bool { + if o != nil && !common.IsNil(o.AdyenFees) { + return true + } + + return false +} + +// SetAdyenFees gets a reference to the given string and assigns it to the AdyenFees field. +func (o *SplitConfigurationLogic) SetAdyenFees(v string) { + o.AdyenFees = &v +} + +// GetAdyenMarkup returns the AdyenMarkup field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetAdyenMarkup() string { + if o == nil || common.IsNil(o.AdyenMarkup) { + var ret string + return ret + } + return *o.AdyenMarkup +} + +// GetAdyenMarkupOk returns a tuple with the AdyenMarkup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetAdyenMarkupOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenMarkup) { + return nil, false + } + return o.AdyenMarkup, true +} + +// HasAdyenMarkup returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasAdyenMarkup() bool { + if o != nil && !common.IsNil(o.AdyenMarkup) { + return true + } + + return false +} + +// SetAdyenMarkup gets a reference to the given string and assigns it to the AdyenMarkup field. +func (o *SplitConfigurationLogic) SetAdyenMarkup(v string) { + o.AdyenMarkup = &v +} + // GetChargeback returns the Chargeback field value if set, zero value otherwise. func (o *SplitConfigurationLogic) GetChargeback() string { if o == nil || common.IsNil(o.Chargeback) { @@ -118,6 +259,38 @@ func (o *SplitConfigurationLogic) SetChargeback(v string) { o.Chargeback = &v } +// GetChargebackCostAllocation returns the ChargebackCostAllocation field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetChargebackCostAllocation() string { + if o == nil || common.IsNil(o.ChargebackCostAllocation) { + var ret string + return ret + } + return *o.ChargebackCostAllocation +} + +// GetChargebackCostAllocationOk returns a tuple with the ChargebackCostAllocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetChargebackCostAllocationOk() (*string, bool) { + if o == nil || common.IsNil(o.ChargebackCostAllocation) { + return nil, false + } + return o.ChargebackCostAllocation, true +} + +// HasChargebackCostAllocation returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasChargebackCostAllocation() bool { + if o != nil && !common.IsNil(o.ChargebackCostAllocation) { + return true + } + + return false +} + +// SetChargebackCostAllocation gets a reference to the given string and assigns it to the ChargebackCostAllocation field. +func (o *SplitConfigurationLogic) SetChargebackCostAllocation(v string) { + o.ChargebackCostAllocation = &v +} + // GetCommission returns the Commission field value func (o *SplitConfigurationLogic) GetCommission() Commission { if o == nil { @@ -142,28 +315,68 @@ func (o *SplitConfigurationLogic) SetCommission(v Commission) { o.Commission = v } -// GetPaymentFee returns the PaymentFee field value -func (o *SplitConfigurationLogic) GetPaymentFee() string { - if o == nil { +// GetInterchange returns the Interchange field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetInterchange() string { + if o == nil || common.IsNil(o.Interchange) { var ret string return ret } + return *o.Interchange +} + +// GetInterchangeOk returns a tuple with the Interchange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetInterchangeOk() (*string, bool) { + if o == nil || common.IsNil(o.Interchange) { + return nil, false + } + return o.Interchange, true +} + +// HasInterchange returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasInterchange() bool { + if o != nil && !common.IsNil(o.Interchange) { + return true + } + + return false +} + +// SetInterchange gets a reference to the given string and assigns it to the Interchange field. +func (o *SplitConfigurationLogic) SetInterchange(v string) { + o.Interchange = &v +} - return o.PaymentFee +// GetPaymentFee returns the PaymentFee field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetPaymentFee() string { + if o == nil || common.IsNil(o.PaymentFee) { + var ret string + return ret + } + return *o.PaymentFee } -// GetPaymentFeeOk returns a tuple with the PaymentFee field value +// GetPaymentFeeOk returns a tuple with the PaymentFee field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SplitConfigurationLogic) GetPaymentFeeOk() (*string, bool) { - if o == nil { + if o == nil || common.IsNil(o.PaymentFee) { return nil, false } - return &o.PaymentFee, true + return o.PaymentFee, true +} + +// HasPaymentFee returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasPaymentFee() bool { + if o != nil && !common.IsNil(o.PaymentFee) { + return true + } + + return false } -// SetPaymentFee sets field value +// SetPaymentFee gets a reference to the given string and assigns it to the PaymentFee field. func (o *SplitConfigurationLogic) SetPaymentFee(v string) { - o.PaymentFee = v + o.PaymentFee = &v } // GetRemainder returns the Remainder field value if set, zero value otherwise. @@ -198,6 +411,38 @@ func (o *SplitConfigurationLogic) SetRemainder(v string) { o.Remainder = &v } +// GetSchemeFee returns the SchemeFee field value if set, zero value otherwise. +func (o *SplitConfigurationLogic) GetSchemeFee() string { + if o == nil || common.IsNil(o.SchemeFee) { + var ret string + return ret + } + return *o.SchemeFee +} + +// GetSchemeFeeOk returns a tuple with the SchemeFee field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SplitConfigurationLogic) GetSchemeFeeOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeFee) { + return nil, false + } + return o.SchemeFee, true +} + +// HasSchemeFee returns a boolean if a field has been set. +func (o *SplitConfigurationLogic) HasSchemeFee() bool { + if o != nil && !common.IsNil(o.SchemeFee) { + return true + } + + return false +} + +// SetSchemeFee gets a reference to the given string and assigns it to the SchemeFee field. +func (o *SplitConfigurationLogic) SetSchemeFee(v string) { + o.SchemeFee = &v +} + // GetSplitLogicId returns the SplitLogicId field value if set, zero value otherwise. func (o *SplitConfigurationLogic) GetSplitLogicId() string { if o == nil || common.IsNil(o.SplitLogicId) { @@ -304,17 +549,40 @@ func (o SplitConfigurationLogic) MarshalJSON() ([]byte, error) { func (o SplitConfigurationLogic) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquiringFees) { + toSerialize["acquiringFees"] = o.AcquiringFees + } if !common.IsNil(o.AdditionalCommission) { toSerialize["additionalCommission"] = o.AdditionalCommission } + if !common.IsNil(o.AdyenCommission) { + toSerialize["adyenCommission"] = o.AdyenCommission + } + if !common.IsNil(o.AdyenFees) { + toSerialize["adyenFees"] = o.AdyenFees + } + if !common.IsNil(o.AdyenMarkup) { + toSerialize["adyenMarkup"] = o.AdyenMarkup + } if !common.IsNil(o.Chargeback) { toSerialize["chargeback"] = o.Chargeback } + if !common.IsNil(o.ChargebackCostAllocation) { + toSerialize["chargebackCostAllocation"] = o.ChargebackCostAllocation + } toSerialize["commission"] = o.Commission - toSerialize["paymentFee"] = o.PaymentFee + if !common.IsNil(o.Interchange) { + toSerialize["interchange"] = o.Interchange + } + if !common.IsNil(o.PaymentFee) { + toSerialize["paymentFee"] = o.PaymentFee + } if !common.IsNil(o.Remainder) { toSerialize["remainder"] = o.Remainder } + if !common.IsNil(o.SchemeFee) { + toSerialize["schemeFee"] = o.SchemeFee + } if !common.IsNil(o.SplitLogicId) { toSerialize["splitLogicId"] = o.SplitLogicId } @@ -363,6 +631,42 @@ func (v *NullableSplitConfigurationLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } +func (o *SplitConfigurationLogic) isValidAcquiringFees() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAcquiringFees() == allowed { + return true + } + } + return false +} +func (o *SplitConfigurationLogic) isValidAdyenCommission() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenCommission() == allowed { + return true + } + } + return false +} +func (o *SplitConfigurationLogic) isValidAdyenFees() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenFees() == allowed { + return true + } + } + return false +} +func (o *SplitConfigurationLogic) isValidAdyenMarkup() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenMarkup() == allowed { + return true + } + } + return false +} func (o *SplitConfigurationLogic) isValidChargeback() bool { var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} for _, allowed := range allowedEnumValues { @@ -372,6 +676,24 @@ func (o *SplitConfigurationLogic) isValidChargeback() bool { } return false } +func (o *SplitConfigurationLogic) isValidChargebackCostAllocation() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetChargebackCostAllocation() == allowed { + return true + } + } + return false +} +func (o *SplitConfigurationLogic) isValidInterchange() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetInterchange() == allowed { + return true + } + } + return false +} func (o *SplitConfigurationLogic) isValidPaymentFee() bool { var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} for _, allowed := range allowedEnumValues { @@ -390,6 +712,15 @@ func (o *SplitConfigurationLogic) isValidRemainder() bool { } return false } +func (o *SplitConfigurationLogic) isValidSchemeFee() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetSchemeFee() == allowed { + return true + } + } + return false +} func (o *SplitConfigurationLogic) isValidSurcharge() bool { var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} for _, allowed := range allowedEnumValues { diff --git a/src/management/model_store.go b/src/management/model_store.go index 50fdc7484..1e5fa819a 100644 --- a/src/management/model_store.go +++ b/src/management/model_store.go @@ -33,7 +33,7 @@ type Store struct { MerchantId *string `json:"merchantId,omitempty"` // The phone number of the store, including '+' and country code. PhoneNumber *string `json:"phoneNumber,omitempty"` - // 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 (_) + // 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"` diff --git a/src/management/model_store_creation_request.go b/src/management/model_store_creation_request.go index b3cc54c44..b4aba67e2 100644 --- a/src/management/model_store_creation_request.go +++ b/src/management/model_store_creation_request.go @@ -24,7 +24,7 @@ type StoreCreationRequest struct { BusinessLineIds []string `json:"businessLineIds,omitempty"` // Your description of the store. Description string `json:"description"` - // Used by certain payment methods and tax authorities to uniquely identify the store. For CNPJ in Brazil, ZIP in Australia and SIRET in France. This field is conditionally required if the store is in Brazil, Australia or France. For CNPJ the format is 00.000.000/0000-00, can be submitted as just digits, or with dots, slash & hyphen. For Australian stores ZIP an optional field used by the Zip payment method. For SIRET the format is 14 digits. + // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. ExternalReferenceId *string `json:"externalReferenceId,omitempty"` // The phone number of the store, including '+' and country code. PhoneNumber string `json:"phoneNumber"` 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 52d42346c..29430ae8e 100644 --- a/src/management/model_store_creation_with_merchant_code_request.go +++ b/src/management/model_store_creation_with_merchant_code_request.go @@ -24,7 +24,7 @@ type StoreCreationWithMerchantCodeRequest struct { BusinessLineIds []string `json:"businessLineIds,omitempty"` // Your description of the store. Description string `json:"description"` - // Used by certain payment methods and tax authorities to uniquely identify the store. For CNPJ in Brazil, ZIP in Australia and SIRET in France. This field is conditionally required if the store is in Brazil, Australia or France. For CNPJ the format is 00.000.000/0000-00, can be submitted as just digits, or with dots, slash & hyphen. For Australian stores ZIP an optional field used by the Zip payment method. For SIRET the format is 14 digits. + // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. ExternalReferenceId *string `json:"externalReferenceId,omitempty"` // The unique identifier of the merchant account that the store belongs to. MerchantId string `json:"merchantId"` diff --git a/src/management/model_swish_info.go b/src/management/model_swish_info.go index d2a7d95d9..9b8a793a6 100644 --- a/src/management/model_swish_info.go +++ b/src/management/model_swish_info.go @@ -20,15 +20,16 @@ var _ common.MappedNullable = &SwishInfo{} // SwishInfo struct for SwishInfo type SwishInfo struct { // Swish number. Format: 10 digits without spaces. For example, **1231111111**. - SwishNumber *string `json:"swishNumber,omitempty"` + SwishNumber string `json:"swishNumber"` } // NewSwishInfo instantiates a new SwishInfo 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 NewSwishInfo() *SwishInfo { +func NewSwishInfo(swishNumber string) *SwishInfo { this := SwishInfo{} + this.SwishNumber = swishNumber return &this } @@ -40,36 +41,28 @@ func NewSwishInfoWithDefaults() *SwishInfo { return &this } -// GetSwishNumber returns the SwishNumber field value if set, zero value otherwise. +// GetSwishNumber returns the SwishNumber field value func (o *SwishInfo) GetSwishNumber() string { - if o == nil || common.IsNil(o.SwishNumber) { + if o == nil { var ret string return ret } - return *o.SwishNumber + + return o.SwishNumber } -// GetSwishNumberOk returns a tuple with the SwishNumber field value if set, nil otherwise +// GetSwishNumberOk returns a tuple with the SwishNumber field value // and a boolean to check if the value has been set. func (o *SwishInfo) GetSwishNumberOk() (*string, bool) { - if o == nil || common.IsNil(o.SwishNumber) { + if o == nil { return nil, false } - return o.SwishNumber, true -} - -// HasSwishNumber returns a boolean if a field has been set. -func (o *SwishInfo) HasSwishNumber() bool { - if o != nil && !common.IsNil(o.SwishNumber) { - return true - } - - return false + return &o.SwishNumber, true } -// SetSwishNumber gets a reference to the given string and assigns it to the SwishNumber field. +// SetSwishNumber sets field value func (o *SwishInfo) SetSwishNumber(v string) { - o.SwishNumber = &v + o.SwishNumber = v } func (o SwishInfo) MarshalJSON() ([]byte, error) { @@ -82,9 +75,7 @@ func (o SwishInfo) MarshalJSON() ([]byte, error) { func (o SwishInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.SwishNumber) { - toSerialize["swishNumber"] = o.SwishNumber - } + toSerialize["swishNumber"] = o.SwishNumber return toSerialize, nil } diff --git a/src/management/model_terminal.go b/src/management/model_terminal.go index 6567d399c..4e737c9ac 100644 --- a/src/management/model_terminal.go +++ b/src/management/model_terminal.go @@ -21,48 +21,67 @@ var _ common.MappedNullable = &Terminal{} // Terminal struct for Terminal type Terminal struct { // The [assignment status](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api) of the terminal. If true, the terminal is assigned. If false, the terminal is in inventory and can't be boarded. + // Deprecated Assigned *bool `json:"assigned,omitempty"` // The Bluetooth IP address of the terminal. + // Deprecated BluetoothIp *string `json:"bluetoothIp,omitempty"` // The Bluetooth MAC address of the terminal. + // Deprecated BluetoothMac *string `json:"bluetoothMac,omitempty"` // The city where the terminal is located. + // Deprecated City *string `json:"city,omitempty"` // The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + // Deprecated CompanyAccount *string `json:"companyAccount,omitempty"` // The country code of the country where the terminal is located. + // Deprecated CountryCode *string `json:"countryCode,omitempty"` // The model name of the terminal. + // Deprecated DeviceModel *string `json:"deviceModel,omitempty"` // The ethernet IP address of the terminal. + // Deprecated EthernetIp *string `json:"ethernetIp,omitempty"` // The ethernet MAC address of the terminal. + // Deprecated EthernetMac *string `json:"ethernetMac,omitempty"` // The software release currently in use on the terminal. FirmwareVersion *string `json:"firmwareVersion,omitempty"` // The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + // Deprecated Iccid *string `json:"iccid,omitempty"` // The unique identifier of the terminal. Id *string `json:"id,omitempty"` // Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. + // Deprecated LastActivityDateTime *time.Time `json:"lastActivityDateTime,omitempty"` - // Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. + // Date and time of the last transaction on the terminal. + // Deprecated LastTransactionDateTime *time.Time `json:"lastTransactionDateTime,omitempty"` // The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex + // Deprecated LinkNegotiation *string `json:"linkNegotiation,omitempty"` // The serial number of the terminal. SerialNumber *string `json:"serialNumber,omitempty"` // On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. + // Deprecated SimStatus *string `json:"simStatus,omitempty"` // Indicates when the terminal was last online, whether the terminal is being reassigned, or whether the terminal is turned off. If the terminal was last online more that a week ago, it is also shown as turned off. + // Deprecated Status *string `json:"status,omitempty"` // The status of the store that the terminal is assigned to. + // Deprecated StoreStatus *string `json:"storeStatus,omitempty"` // The terminal's IP address in your Wi-Fi network. + // Deprecated WifiIp *string `json:"wifiIp,omitempty"` // The terminal's MAC address in your Wi-Fi network. + // Deprecated WifiMac *string `json:"wifiMac,omitempty"` // The SSID of the Wi-Fi network that your terminal is connected to. + // Deprecated WifiSsid *string `json:"wifiSsid,omitempty"` } @@ -84,6 +103,7 @@ func NewTerminalWithDefaults() *Terminal { } // GetAssigned returns the Assigned field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetAssigned() bool { if o == nil || common.IsNil(o.Assigned) { var ret bool @@ -94,6 +114,7 @@ func (o *Terminal) GetAssigned() bool { // GetAssignedOk returns a tuple with the Assigned field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetAssignedOk() (*bool, bool) { if o == nil || common.IsNil(o.Assigned) { return nil, false @@ -111,11 +132,13 @@ func (o *Terminal) HasAssigned() bool { } // SetAssigned gets a reference to the given bool and assigns it to the Assigned field. +// Deprecated func (o *Terminal) SetAssigned(v bool) { o.Assigned = &v } // GetBluetoothIp returns the BluetoothIp field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetBluetoothIp() string { if o == nil || common.IsNil(o.BluetoothIp) { var ret string @@ -126,6 +149,7 @@ func (o *Terminal) GetBluetoothIp() string { // GetBluetoothIpOk returns a tuple with the BluetoothIp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetBluetoothIpOk() (*string, bool) { if o == nil || common.IsNil(o.BluetoothIp) { return nil, false @@ -143,11 +167,13 @@ func (o *Terminal) HasBluetoothIp() bool { } // SetBluetoothIp gets a reference to the given string and assigns it to the BluetoothIp field. +// Deprecated func (o *Terminal) SetBluetoothIp(v string) { o.BluetoothIp = &v } // GetBluetoothMac returns the BluetoothMac field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetBluetoothMac() string { if o == nil || common.IsNil(o.BluetoothMac) { var ret string @@ -158,6 +184,7 @@ func (o *Terminal) GetBluetoothMac() string { // GetBluetoothMacOk returns a tuple with the BluetoothMac field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetBluetoothMacOk() (*string, bool) { if o == nil || common.IsNil(o.BluetoothMac) { return nil, false @@ -175,11 +202,13 @@ func (o *Terminal) HasBluetoothMac() bool { } // SetBluetoothMac gets a reference to the given string and assigns it to the BluetoothMac field. +// Deprecated func (o *Terminal) SetBluetoothMac(v string) { o.BluetoothMac = &v } // GetCity returns the City field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetCity() string { if o == nil || common.IsNil(o.City) { var ret string @@ -190,6 +219,7 @@ func (o *Terminal) GetCity() string { // GetCityOk returns a tuple with the City field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetCityOk() (*string, bool) { if o == nil || common.IsNil(o.City) { return nil, false @@ -207,11 +237,13 @@ func (o *Terminal) HasCity() bool { } // SetCity gets a reference to the given string and assigns it to the City field. +// Deprecated func (o *Terminal) SetCity(v string) { o.City = &v } // GetCompanyAccount returns the CompanyAccount field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetCompanyAccount() string { if o == nil || common.IsNil(o.CompanyAccount) { var ret string @@ -222,6 +254,7 @@ func (o *Terminal) GetCompanyAccount() string { // GetCompanyAccountOk returns a tuple with the CompanyAccount field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetCompanyAccountOk() (*string, bool) { if o == nil || common.IsNil(o.CompanyAccount) { return nil, false @@ -239,11 +272,13 @@ func (o *Terminal) HasCompanyAccount() bool { } // SetCompanyAccount gets a reference to the given string and assigns it to the CompanyAccount field. +// Deprecated func (o *Terminal) SetCompanyAccount(v string) { o.CompanyAccount = &v } // GetCountryCode returns the CountryCode field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetCountryCode() string { if o == nil || common.IsNil(o.CountryCode) { var ret string @@ -254,6 +289,7 @@ func (o *Terminal) GetCountryCode() string { // GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetCountryCodeOk() (*string, bool) { if o == nil || common.IsNil(o.CountryCode) { return nil, false @@ -271,11 +307,13 @@ func (o *Terminal) HasCountryCode() bool { } // SetCountryCode gets a reference to the given string and assigns it to the CountryCode field. +// Deprecated func (o *Terminal) SetCountryCode(v string) { o.CountryCode = &v } // GetDeviceModel returns the DeviceModel field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetDeviceModel() string { if o == nil || common.IsNil(o.DeviceModel) { var ret string @@ -286,6 +324,7 @@ func (o *Terminal) GetDeviceModel() string { // GetDeviceModelOk returns a tuple with the DeviceModel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetDeviceModelOk() (*string, bool) { if o == nil || common.IsNil(o.DeviceModel) { return nil, false @@ -303,11 +342,13 @@ func (o *Terminal) HasDeviceModel() bool { } // SetDeviceModel gets a reference to the given string and assigns it to the DeviceModel field. +// Deprecated func (o *Terminal) SetDeviceModel(v string) { o.DeviceModel = &v } // GetEthernetIp returns the EthernetIp field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetEthernetIp() string { if o == nil || common.IsNil(o.EthernetIp) { var ret string @@ -318,6 +359,7 @@ func (o *Terminal) GetEthernetIp() string { // GetEthernetIpOk returns a tuple with the EthernetIp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetEthernetIpOk() (*string, bool) { if o == nil || common.IsNil(o.EthernetIp) { return nil, false @@ -335,11 +377,13 @@ func (o *Terminal) HasEthernetIp() bool { } // SetEthernetIp gets a reference to the given string and assigns it to the EthernetIp field. +// Deprecated func (o *Terminal) SetEthernetIp(v string) { o.EthernetIp = &v } // GetEthernetMac returns the EthernetMac field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetEthernetMac() string { if o == nil || common.IsNil(o.EthernetMac) { var ret string @@ -350,6 +394,7 @@ func (o *Terminal) GetEthernetMac() string { // GetEthernetMacOk returns a tuple with the EthernetMac field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetEthernetMacOk() (*string, bool) { if o == nil || common.IsNil(o.EthernetMac) { return nil, false @@ -367,6 +412,7 @@ func (o *Terminal) HasEthernetMac() bool { } // SetEthernetMac gets a reference to the given string and assigns it to the EthernetMac field. +// Deprecated func (o *Terminal) SetEthernetMac(v string) { o.EthernetMac = &v } @@ -404,6 +450,7 @@ func (o *Terminal) SetFirmwareVersion(v string) { } // GetIccid returns the Iccid field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetIccid() string { if o == nil || common.IsNil(o.Iccid) { var ret string @@ -414,6 +461,7 @@ func (o *Terminal) GetIccid() string { // GetIccidOk returns a tuple with the Iccid field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetIccidOk() (*string, bool) { if o == nil || common.IsNil(o.Iccid) { return nil, false @@ -431,6 +479,7 @@ func (o *Terminal) HasIccid() bool { } // SetIccid gets a reference to the given string and assigns it to the Iccid field. +// Deprecated func (o *Terminal) SetIccid(v string) { o.Iccid = &v } @@ -468,6 +517,7 @@ func (o *Terminal) SetId(v string) { } // GetLastActivityDateTime returns the LastActivityDateTime field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetLastActivityDateTime() time.Time { if o == nil || common.IsNil(o.LastActivityDateTime) { var ret time.Time @@ -478,6 +528,7 @@ func (o *Terminal) GetLastActivityDateTime() time.Time { // GetLastActivityDateTimeOk returns a tuple with the LastActivityDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetLastActivityDateTimeOk() (*time.Time, bool) { if o == nil || common.IsNil(o.LastActivityDateTime) { return nil, false @@ -495,11 +546,13 @@ func (o *Terminal) HasLastActivityDateTime() bool { } // SetLastActivityDateTime gets a reference to the given time.Time and assigns it to the LastActivityDateTime field. +// Deprecated func (o *Terminal) SetLastActivityDateTime(v time.Time) { o.LastActivityDateTime = &v } // GetLastTransactionDateTime returns the LastTransactionDateTime field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetLastTransactionDateTime() time.Time { if o == nil || common.IsNil(o.LastTransactionDateTime) { var ret time.Time @@ -510,6 +563,7 @@ func (o *Terminal) GetLastTransactionDateTime() time.Time { // GetLastTransactionDateTimeOk returns a tuple with the LastTransactionDateTime field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetLastTransactionDateTimeOk() (*time.Time, bool) { if o == nil || common.IsNil(o.LastTransactionDateTime) { return nil, false @@ -527,11 +581,13 @@ func (o *Terminal) HasLastTransactionDateTime() bool { } // SetLastTransactionDateTime gets a reference to the given time.Time and assigns it to the LastTransactionDateTime field. +// Deprecated func (o *Terminal) SetLastTransactionDateTime(v time.Time) { o.LastTransactionDateTime = &v } // GetLinkNegotiation returns the LinkNegotiation field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetLinkNegotiation() string { if o == nil || common.IsNil(o.LinkNegotiation) { var ret string @@ -542,6 +598,7 @@ func (o *Terminal) GetLinkNegotiation() string { // GetLinkNegotiationOk returns a tuple with the LinkNegotiation field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetLinkNegotiationOk() (*string, bool) { if o == nil || common.IsNil(o.LinkNegotiation) { return nil, false @@ -559,6 +616,7 @@ func (o *Terminal) HasLinkNegotiation() bool { } // SetLinkNegotiation gets a reference to the given string and assigns it to the LinkNegotiation field. +// Deprecated func (o *Terminal) SetLinkNegotiation(v string) { o.LinkNegotiation = &v } @@ -596,6 +654,7 @@ func (o *Terminal) SetSerialNumber(v string) { } // GetSimStatus returns the SimStatus field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetSimStatus() string { if o == nil || common.IsNil(o.SimStatus) { var ret string @@ -606,6 +665,7 @@ func (o *Terminal) GetSimStatus() string { // GetSimStatusOk returns a tuple with the SimStatus field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetSimStatusOk() (*string, bool) { if o == nil || common.IsNil(o.SimStatus) { return nil, false @@ -623,11 +683,13 @@ func (o *Terminal) HasSimStatus() bool { } // SetSimStatus gets a reference to the given string and assigns it to the SimStatus field. +// Deprecated func (o *Terminal) SetSimStatus(v string) { o.SimStatus = &v } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetStatus() string { if o == nil || common.IsNil(o.Status) { var ret string @@ -638,6 +700,7 @@ func (o *Terminal) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetStatusOk() (*string, bool) { if o == nil || common.IsNil(o.Status) { return nil, false @@ -655,11 +718,13 @@ func (o *Terminal) HasStatus() bool { } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated func (o *Terminal) SetStatus(v string) { o.Status = &v } // GetStoreStatus returns the StoreStatus field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetStoreStatus() string { if o == nil || common.IsNil(o.StoreStatus) { var ret string @@ -670,6 +735,7 @@ func (o *Terminal) GetStoreStatus() string { // GetStoreStatusOk returns a tuple with the StoreStatus field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetStoreStatusOk() (*string, bool) { if o == nil || common.IsNil(o.StoreStatus) { return nil, false @@ -687,11 +753,13 @@ func (o *Terminal) HasStoreStatus() bool { } // SetStoreStatus gets a reference to the given string and assigns it to the StoreStatus field. +// Deprecated func (o *Terminal) SetStoreStatus(v string) { o.StoreStatus = &v } // GetWifiIp returns the WifiIp field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetWifiIp() string { if o == nil || common.IsNil(o.WifiIp) { var ret string @@ -702,6 +770,7 @@ func (o *Terminal) GetWifiIp() string { // GetWifiIpOk returns a tuple with the WifiIp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetWifiIpOk() (*string, bool) { if o == nil || common.IsNil(o.WifiIp) { return nil, false @@ -719,11 +788,13 @@ func (o *Terminal) HasWifiIp() bool { } // SetWifiIp gets a reference to the given string and assigns it to the WifiIp field. +// Deprecated func (o *Terminal) SetWifiIp(v string) { o.WifiIp = &v } // GetWifiMac returns the WifiMac field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetWifiMac() string { if o == nil || common.IsNil(o.WifiMac) { var ret string @@ -734,6 +805,7 @@ func (o *Terminal) GetWifiMac() string { // GetWifiMacOk returns a tuple with the WifiMac field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetWifiMacOk() (*string, bool) { if o == nil || common.IsNil(o.WifiMac) { return nil, false @@ -751,11 +823,13 @@ func (o *Terminal) HasWifiMac() bool { } // SetWifiMac gets a reference to the given string and assigns it to the WifiMac field. +// Deprecated func (o *Terminal) SetWifiMac(v string) { o.WifiMac = &v } // GetWifiSsid returns the WifiSsid field value if set, zero value otherwise. +// Deprecated func (o *Terminal) GetWifiSsid() string { if o == nil || common.IsNil(o.WifiSsid) { var ret string @@ -766,6 +840,7 @@ func (o *Terminal) GetWifiSsid() string { // GetWifiSsidOk returns a tuple with the WifiSsid field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *Terminal) GetWifiSsidOk() (*string, bool) { if o == nil || common.IsNil(o.WifiSsid) { return nil, false @@ -783,6 +858,7 @@ func (o *Terminal) HasWifiSsid() bool { } // SetWifiSsid gets a reference to the given string and assigns it to the WifiSsid field. +// Deprecated func (o *Terminal) SetWifiSsid(v string) { o.WifiSsid = &v } diff --git a/src/management/model_transaction_description_info.go b/src/management/model_transaction_description_info.go new file mode 100644 index 000000000..119aa2284 --- /dev/null +++ b/src/management/model_transaction_description_info.go @@ -0,0 +1,176 @@ +/* +Management API + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the TransactionDescriptionInfo type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionDescriptionInfo{} + +// TransactionDescriptionInfo struct for TransactionDescriptionInfo +type TransactionDescriptionInfo struct { + // 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 **. , ' _ - ? + * /_**. + DoingBusinessAsName *string `json:"doingBusinessAsName,omitempty"` + // The type of transaction description you want to use: - **fixed**: The transaction description set in this request is used for all payments with this payment method. - **append**: The transaction description set in this request is used as a base for all payments with this payment method. The [transaction description set in the request to process the payment](https://docs.adyen.com/api-explorer/Checkout/70/post/sessions#request-shopperStatement) is appended to this base description. Note that if the combined length exceeds 22 characters, banks may truncate the string. - **dynamic**: Only the [transaction description set in the request to process the payment](https://docs.adyen.com/api-explorer/Checkout/70/post/sessions#request-shopperStatement) is used for payments with this payment method. + Type *string `json:"type,omitempty"` +} + +// NewTransactionDescriptionInfo instantiates a new TransactionDescriptionInfo 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 NewTransactionDescriptionInfo() *TransactionDescriptionInfo { + this := TransactionDescriptionInfo{} + var type_ string = "dynamic" + this.Type = &type_ + return &this +} + +// NewTransactionDescriptionInfoWithDefaults instantiates a new TransactionDescriptionInfo 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 NewTransactionDescriptionInfoWithDefaults() *TransactionDescriptionInfo { + this := TransactionDescriptionInfo{} + var type_ string = "dynamic" + this.Type = &type_ + return &this +} + +// GetDoingBusinessAsName returns the DoingBusinessAsName field value if set, zero value otherwise. +func (o *TransactionDescriptionInfo) GetDoingBusinessAsName() string { + if o == nil || common.IsNil(o.DoingBusinessAsName) { + var ret string + return ret + } + return *o.DoingBusinessAsName +} + +// GetDoingBusinessAsNameOk returns a tuple with the DoingBusinessAsName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionDescriptionInfo) GetDoingBusinessAsNameOk() (*string, bool) { + if o == nil || common.IsNil(o.DoingBusinessAsName) { + return nil, false + } + return o.DoingBusinessAsName, true +} + +// HasDoingBusinessAsName returns a boolean if a field has been set. +func (o *TransactionDescriptionInfo) HasDoingBusinessAsName() bool { + if o != nil && !common.IsNil(o.DoingBusinessAsName) { + return true + } + + return false +} + +// SetDoingBusinessAsName gets a reference to the given string and assigns it to the DoingBusinessAsName field. +func (o *TransactionDescriptionInfo) SetDoingBusinessAsName(v string) { + o.DoingBusinessAsName = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionDescriptionInfo) 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 *TransactionDescriptionInfo) 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 *TransactionDescriptionInfo) 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 *TransactionDescriptionInfo) SetType(v string) { + o.Type = &v +} + +func (o TransactionDescriptionInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionDescriptionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.DoingBusinessAsName) { + toSerialize["doingBusinessAsName"] = o.DoingBusinessAsName + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransactionDescriptionInfo struct { + value *TransactionDescriptionInfo + isSet bool +} + +func (v NullableTransactionDescriptionInfo) Get() *TransactionDescriptionInfo { + return v.value +} + +func (v *NullableTransactionDescriptionInfo) Set(val *TransactionDescriptionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionDescriptionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionDescriptionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionDescriptionInfo(val *TransactionDescriptionInfo) *NullableTransactionDescriptionInfo { + return &NullableTransactionDescriptionInfo{value: val, isSet: true} +} + +func (v NullableTransactionDescriptionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionDescriptionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransactionDescriptionInfo) isValidType() bool { + var allowedEnumValues = []string{"append", "dynamic", "fixed"} + for _, allowed := range allowedEnumValues { + if o.GetType() == 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..ec4adfe6b 100644 --- a/src/management/model_update_payment_method_info.go +++ b/src/management/model_update_payment_method_info.go @@ -22,13 +22,24 @@ type UpdatePaymentMethodInfo struct { 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"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. - Currencies []string `json:"currencies,omitempty"` + Currencies []string `json:"currencies,omitempty"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` // The list of stores for this payment method - StoreIds []string `json:"storeIds,omitempty"` + StoreIds []string `json:"storeIds,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewUpdatePaymentMethodInfo instantiates a new UpdatePaymentMethodInfo object @@ -144,6 +155,38 @@ func (o *UpdatePaymentMethodInfo) SetCountries(v []string) { o.Countries = v } +// GetCup returns the Cup field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetCup() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Cup) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Cup +} + +// GetCupOk returns a tuple with the Cup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetCupOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Cup) { + return nil, false + } + return o.Cup, true +} + +// HasCup returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasCup() bool { + if o != nil && !common.IsNil(o.Cup) { + return true + } + + return false +} + +// SetCup gets a reference to the given GenericPmWithTdiInfo and assigns it to the Cup field. +func (o *UpdatePaymentMethodInfo) SetCup(v GenericPmWithTdiInfo) { + o.Cup = &v +} + // GetCurrencies returns the Currencies field value if set, zero value otherwise. func (o *UpdatePaymentMethodInfo) GetCurrencies() []string { if o == nil || common.IsNil(o.Currencies) { @@ -176,6 +219,102 @@ func (o *UpdatePaymentMethodInfo) SetCurrencies(v []string) { o.Currencies = v } +// GetDiners returns the Diners field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetDiners() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Diners) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Diners +} + +// GetDinersOk returns a tuple with the Diners field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetDinersOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Diners) { + return nil, false + } + return o.Diners, true +} + +// HasDiners returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasDiners() bool { + if o != nil && !common.IsNil(o.Diners) { + return true + } + + return false +} + +// SetDiners gets a reference to the given GenericPmWithTdiInfo and assigns it to the Diners field. +func (o *UpdatePaymentMethodInfo) SetDiners(v GenericPmWithTdiInfo) { + o.Diners = &v +} + +// GetDiscover returns the Discover field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetDiscover() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Discover) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Discover +} + +// GetDiscoverOk returns a tuple with the Discover field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetDiscoverOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Discover) { + return nil, false + } + return o.Discover, true +} + +// HasDiscover returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasDiscover() bool { + if o != nil && !common.IsNil(o.Discover) { + return true + } + + return false +} + +// SetDiscover gets a reference to the given GenericPmWithTdiInfo and assigns it to the Discover field. +func (o *UpdatePaymentMethodInfo) SetDiscover(v GenericPmWithTdiInfo) { + o.Discover = &v +} + +// GetEftposAustralia returns the EftposAustralia field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetEftposAustralia() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.EftposAustralia) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.EftposAustralia +} + +// GetEftposAustraliaOk returns a tuple with the EftposAustralia field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetEftposAustraliaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.EftposAustralia) { + return nil, false + } + return o.EftposAustralia, true +} + +// HasEftposAustralia returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasEftposAustralia() bool { + if o != nil && !common.IsNil(o.EftposAustralia) { + return true + } + + return false +} + +// SetEftposAustralia gets a reference to the given GenericPmWithTdiInfo and assigns it to the EftposAustralia field. +func (o *UpdatePaymentMethodInfo) SetEftposAustralia(v GenericPmWithTdiInfo) { + o.EftposAustralia = &v +} + // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *UpdatePaymentMethodInfo) GetEnabled() bool { if o == nil || common.IsNil(o.Enabled) { @@ -208,6 +347,198 @@ func (o *UpdatePaymentMethodInfo) SetEnabled(v bool) { o.Enabled = &v } +// GetGirocard returns the Girocard field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetGirocard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Girocard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Girocard +} + +// GetGirocardOk returns a tuple with the Girocard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetGirocardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Girocard) { + return nil, false + } + return o.Girocard, true +} + +// HasGirocard returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasGirocard() bool { + if o != nil && !common.IsNil(o.Girocard) { + return true + } + + return false +} + +// SetGirocard gets a reference to the given GenericPmWithTdiInfo and assigns it to the Girocard field. +func (o *UpdatePaymentMethodInfo) SetGirocard(v GenericPmWithTdiInfo) { + o.Girocard = &v +} + +// GetIdeal returns the Ideal field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetIdeal() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Ideal) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Ideal +} + +// GetIdealOk returns a tuple with the Ideal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetIdealOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Ideal) { + return nil, false + } + return o.Ideal, true +} + +// HasIdeal returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasIdeal() bool { + if o != nil && !common.IsNil(o.Ideal) { + return true + } + + return false +} + +// SetIdeal gets a reference to the given GenericPmWithTdiInfo and assigns it to the Ideal field. +func (o *UpdatePaymentMethodInfo) SetIdeal(v GenericPmWithTdiInfo) { + o.Ideal = &v +} + +// GetInteracCard returns the InteracCard field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetInteracCard() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.InteracCard) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.InteracCard +} + +// GetInteracCardOk returns a tuple with the InteracCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetInteracCardOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.InteracCard) { + return nil, false + } + return o.InteracCard, true +} + +// HasInteracCard returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasInteracCard() bool { + if o != nil && !common.IsNil(o.InteracCard) { + return true + } + + return false +} + +// SetInteracCard gets a reference to the given GenericPmWithTdiInfo and assigns it to the InteracCard field. +func (o *UpdatePaymentMethodInfo) SetInteracCard(v GenericPmWithTdiInfo) { + o.InteracCard = &v +} + +// GetJcb returns the Jcb field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetJcb() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Jcb) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Jcb +} + +// GetJcbOk returns a tuple with the Jcb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetJcbOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Jcb) { + return nil, false + } + return o.Jcb, true +} + +// HasJcb returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasJcb() bool { + if o != nil && !common.IsNil(o.Jcb) { + return true + } + + return false +} + +// SetJcb gets a reference to the given GenericPmWithTdiInfo and assigns it to the Jcb field. +func (o *UpdatePaymentMethodInfo) SetJcb(v GenericPmWithTdiInfo) { + o.Jcb = &v +} + +// GetMaestro returns the Maestro field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetMaestro() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Maestro) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Maestro +} + +// GetMaestroOk returns a tuple with the Maestro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetMaestroOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Maestro) { + return nil, false + } + return o.Maestro, true +} + +// HasMaestro returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasMaestro() bool { + if o != nil && !common.IsNil(o.Maestro) { + return true + } + + return false +} + +// SetMaestro gets a reference to the given GenericPmWithTdiInfo and assigns it to the Maestro field. +func (o *UpdatePaymentMethodInfo) SetMaestro(v GenericPmWithTdiInfo) { + o.Maestro = &v +} + +// GetMc returns the Mc field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetMc() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Mc) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Mc +} + +// GetMcOk returns a tuple with the Mc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetMcOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Mc) { + return nil, false + } + return o.Mc, true +} + +// HasMc returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasMc() bool { + if o != nil && !common.IsNil(o.Mc) { + return true + } + + return false +} + +// SetMc gets a reference to the given GenericPmWithTdiInfo and assigns it to the Mc field. +func (o *UpdatePaymentMethodInfo) SetMc(v GenericPmWithTdiInfo) { + o.Mc = &v +} + // GetStoreIds returns the StoreIds field value if set, zero value otherwise. func (o *UpdatePaymentMethodInfo) GetStoreIds() []string { if o == nil || common.IsNil(o.StoreIds) { @@ -240,6 +571,38 @@ func (o *UpdatePaymentMethodInfo) SetStoreIds(v []string) { o.StoreIds = v } +// GetVisa returns the Visa field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetVisa() GenericPmWithTdiInfo { + if o == nil || common.IsNil(o.Visa) { + var ret GenericPmWithTdiInfo + return ret + } + return *o.Visa +} + +// GetVisaOk returns a tuple with the Visa field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetVisaOk() (*GenericPmWithTdiInfo, bool) { + if o == nil || common.IsNil(o.Visa) { + return nil, false + } + return o.Visa, true +} + +// HasVisa returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasVisa() bool { + if o != nil && !common.IsNil(o.Visa) { + return true + } + + return false +} + +// SetVisa gets a reference to the given GenericPmWithTdiInfo and assigns it to the Visa field. +func (o *UpdatePaymentMethodInfo) SetVisa(v GenericPmWithTdiInfo) { + o.Visa = &v +} + func (o UpdatePaymentMethodInfo) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -259,15 +622,48 @@ func (o UpdatePaymentMethodInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } + if !common.IsNil(o.Cup) { + toSerialize["cup"] = o.Cup + } if !common.IsNil(o.Currencies) { toSerialize["currencies"] = o.Currencies } + if !common.IsNil(o.Diners) { + toSerialize["diners"] = o.Diners + } + if !common.IsNil(o.Discover) { + toSerialize["discover"] = o.Discover + } + if !common.IsNil(o.EftposAustralia) { + toSerialize["eftpos_australia"] = o.EftposAustralia + } if !common.IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } + if !common.IsNil(o.Girocard) { + toSerialize["girocard"] = o.Girocard + } + if !common.IsNil(o.Ideal) { + toSerialize["ideal"] = o.Ideal + } + if !common.IsNil(o.InteracCard) { + toSerialize["interac_card"] = o.InteracCard + } + if !common.IsNil(o.Jcb) { + toSerialize["jcb"] = o.Jcb + } + if !common.IsNil(o.Maestro) { + toSerialize["maestro"] = o.Maestro + } + if !common.IsNil(o.Mc) { + toSerialize["mc"] = o.Mc + } if !common.IsNil(o.StoreIds) { toSerialize["storeIds"] = o.StoreIds } + if !common.IsNil(o.Visa) { + toSerialize["visa"] = o.Visa + } return toSerialize, nil } diff --git a/src/management/model_update_split_configuration_logic_request.go b/src/management/model_update_split_configuration_logic_request.go index 14b39b581..f5ecc7991 100644 --- a/src/management/model_update_split_configuration_logic_request.go +++ b/src/management/model_update_split_configuration_logic_request.go @@ -19,14 +19,28 @@ var _ common.MappedNullable = &UpdateSplitConfigurationLogicRequest{} // UpdateSplitConfigurationLogicRequest struct for UpdateSplitConfigurationLogicRequest type UpdateSplitConfigurationLogicRequest struct { + // Specifies the logic to apply when booking the transaction fees. Should be combined with adyenFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AcquiringFees *string `json:"acquiringFees,omitempty"` AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, interchange & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenCommission *string `json:"adyenCommission,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with acquiringFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenFees *string `json:"adyenFees,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & interchange. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + AdyenMarkup *string `json:"adyenMarkup,omitempty"` // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - 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"` + Chargeback *string `json:"chargeback,omitempty"` + // Specifies the logic to apply when allocating the chargeback costs. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount** + ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` + Commission Commission `json:"commission"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + Interchange *string `json:"interchange,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Cannot be combined with other fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + PaymentFee *string `json:"paymentFee,omitempty"` // Specifies the logic to apply when booking the amount left over after currency conversion. Possible values: **addToLiableAccount**, **addToOneBalanceAccount**. Remainder *string `json:"remainder,omitempty"` + // Specifies the logic to apply when booking the transaction fees. Should be combined with interchange, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. + SchemeFee *string `json:"schemeFee,omitempty"` // Unique identifier of the split logic that is applied when the split configuration conditions are met. SplitLogicId *string `json:"splitLogicId,omitempty"` // Specifies the logic to apply when booking the surcharge amount. Possible values: **addToLiableAccount**, **addToOneBalanceAccount** @@ -39,10 +53,9 @@ type UpdateSplitConfigurationLogicRequest 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 NewUpdateSplitConfigurationLogicRequest(commission Commission, paymentFee string) *UpdateSplitConfigurationLogicRequest { +func NewUpdateSplitConfigurationLogicRequest(commission Commission) *UpdateSplitConfigurationLogicRequest { this := UpdateSplitConfigurationLogicRequest{} this.Commission = commission - this.PaymentFee = paymentFee return &this } @@ -54,6 +67,38 @@ func NewUpdateSplitConfigurationLogicRequestWithDefaults() *UpdateSplitConfigura return &this } +// GetAcquiringFees returns the AcquiringFees field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetAcquiringFees() string { + if o == nil || common.IsNil(o.AcquiringFees) { + var ret string + return ret + } + return *o.AcquiringFees +} + +// GetAcquiringFeesOk returns a tuple with the AcquiringFees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetAcquiringFeesOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquiringFees) { + return nil, false + } + return o.AcquiringFees, true +} + +// HasAcquiringFees returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasAcquiringFees() bool { + if o != nil && !common.IsNil(o.AcquiringFees) { + return true + } + + return false +} + +// SetAcquiringFees gets a reference to the given string and assigns it to the AcquiringFees field. +func (o *UpdateSplitConfigurationLogicRequest) SetAcquiringFees(v string) { + o.AcquiringFees = &v +} + // GetAdditionalCommission returns the AdditionalCommission field value if set, zero value otherwise. func (o *UpdateSplitConfigurationLogicRequest) GetAdditionalCommission() AdditionalCommission { if o == nil || common.IsNil(o.AdditionalCommission) { @@ -86,6 +131,102 @@ func (o *UpdateSplitConfigurationLogicRequest) SetAdditionalCommission(v Additio o.AdditionalCommission = &v } +// GetAdyenCommission returns the AdyenCommission field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenCommission() string { + if o == nil || common.IsNil(o.AdyenCommission) { + var ret string + return ret + } + return *o.AdyenCommission +} + +// GetAdyenCommissionOk returns a tuple with the AdyenCommission field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenCommissionOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenCommission) { + return nil, false + } + return o.AdyenCommission, true +} + +// HasAdyenCommission returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasAdyenCommission() bool { + if o != nil && !common.IsNil(o.AdyenCommission) { + return true + } + + return false +} + +// SetAdyenCommission gets a reference to the given string and assigns it to the AdyenCommission field. +func (o *UpdateSplitConfigurationLogicRequest) SetAdyenCommission(v string) { + o.AdyenCommission = &v +} + +// GetAdyenFees returns the AdyenFees field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenFees() string { + if o == nil || common.IsNil(o.AdyenFees) { + var ret string + return ret + } + return *o.AdyenFees +} + +// GetAdyenFeesOk returns a tuple with the AdyenFees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenFeesOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenFees) { + return nil, false + } + return o.AdyenFees, true +} + +// HasAdyenFees returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasAdyenFees() bool { + if o != nil && !common.IsNil(o.AdyenFees) { + return true + } + + return false +} + +// SetAdyenFees gets a reference to the given string and assigns it to the AdyenFees field. +func (o *UpdateSplitConfigurationLogicRequest) SetAdyenFees(v string) { + o.AdyenFees = &v +} + +// GetAdyenMarkup returns the AdyenMarkup field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenMarkup() string { + if o == nil || common.IsNil(o.AdyenMarkup) { + var ret string + return ret + } + return *o.AdyenMarkup +} + +// GetAdyenMarkupOk returns a tuple with the AdyenMarkup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetAdyenMarkupOk() (*string, bool) { + if o == nil || common.IsNil(o.AdyenMarkup) { + return nil, false + } + return o.AdyenMarkup, true +} + +// HasAdyenMarkup returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasAdyenMarkup() bool { + if o != nil && !common.IsNil(o.AdyenMarkup) { + return true + } + + return false +} + +// SetAdyenMarkup gets a reference to the given string and assigns it to the AdyenMarkup field. +func (o *UpdateSplitConfigurationLogicRequest) SetAdyenMarkup(v string) { + o.AdyenMarkup = &v +} + // GetChargeback returns the Chargeback field value if set, zero value otherwise. func (o *UpdateSplitConfigurationLogicRequest) GetChargeback() string { if o == nil || common.IsNil(o.Chargeback) { @@ -118,6 +259,38 @@ func (o *UpdateSplitConfigurationLogicRequest) SetChargeback(v string) { o.Chargeback = &v } +// GetChargebackCostAllocation returns the ChargebackCostAllocation field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetChargebackCostAllocation() string { + if o == nil || common.IsNil(o.ChargebackCostAllocation) { + var ret string + return ret + } + return *o.ChargebackCostAllocation +} + +// GetChargebackCostAllocationOk returns a tuple with the ChargebackCostAllocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetChargebackCostAllocationOk() (*string, bool) { + if o == nil || common.IsNil(o.ChargebackCostAllocation) { + return nil, false + } + return o.ChargebackCostAllocation, true +} + +// HasChargebackCostAllocation returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasChargebackCostAllocation() bool { + if o != nil && !common.IsNil(o.ChargebackCostAllocation) { + return true + } + + return false +} + +// SetChargebackCostAllocation gets a reference to the given string and assigns it to the ChargebackCostAllocation field. +func (o *UpdateSplitConfigurationLogicRequest) SetChargebackCostAllocation(v string) { + o.ChargebackCostAllocation = &v +} + // GetCommission returns the Commission field value func (o *UpdateSplitConfigurationLogicRequest) GetCommission() Commission { if o == nil { @@ -142,28 +315,68 @@ func (o *UpdateSplitConfigurationLogicRequest) SetCommission(v Commission) { o.Commission = v } -// GetPaymentFee returns the PaymentFee field value -func (o *UpdateSplitConfigurationLogicRequest) GetPaymentFee() string { - if o == nil { +// GetInterchange returns the Interchange field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetInterchange() string { + if o == nil || common.IsNil(o.Interchange) { var ret string return ret } + return *o.Interchange +} + +// GetInterchangeOk returns a tuple with the Interchange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetInterchangeOk() (*string, bool) { + if o == nil || common.IsNil(o.Interchange) { + return nil, false + } + return o.Interchange, true +} + +// HasInterchange returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasInterchange() bool { + if o != nil && !common.IsNil(o.Interchange) { + return true + } + + return false +} + +// SetInterchange gets a reference to the given string and assigns it to the Interchange field. +func (o *UpdateSplitConfigurationLogicRequest) SetInterchange(v string) { + o.Interchange = &v +} - return o.PaymentFee +// GetPaymentFee returns the PaymentFee field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetPaymentFee() string { + if o == nil || common.IsNil(o.PaymentFee) { + var ret string + return ret + } + return *o.PaymentFee } -// GetPaymentFeeOk returns a tuple with the PaymentFee field value +// GetPaymentFeeOk returns a tuple with the PaymentFee field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateSplitConfigurationLogicRequest) GetPaymentFeeOk() (*string, bool) { - if o == nil { + if o == nil || common.IsNil(o.PaymentFee) { return nil, false } - return &o.PaymentFee, true + return o.PaymentFee, true +} + +// HasPaymentFee returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasPaymentFee() bool { + if o != nil && !common.IsNil(o.PaymentFee) { + return true + } + + return false } -// SetPaymentFee sets field value +// SetPaymentFee gets a reference to the given string and assigns it to the PaymentFee field. func (o *UpdateSplitConfigurationLogicRequest) SetPaymentFee(v string) { - o.PaymentFee = v + o.PaymentFee = &v } // GetRemainder returns the Remainder field value if set, zero value otherwise. @@ -198,6 +411,38 @@ func (o *UpdateSplitConfigurationLogicRequest) SetRemainder(v string) { o.Remainder = &v } +// GetSchemeFee returns the SchemeFee field value if set, zero value otherwise. +func (o *UpdateSplitConfigurationLogicRequest) GetSchemeFee() string { + if o == nil || common.IsNil(o.SchemeFee) { + var ret string + return ret + } + return *o.SchemeFee +} + +// GetSchemeFeeOk returns a tuple with the SchemeFee field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSplitConfigurationLogicRequest) GetSchemeFeeOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeFee) { + return nil, false + } + return o.SchemeFee, true +} + +// HasSchemeFee returns a boolean if a field has been set. +func (o *UpdateSplitConfigurationLogicRequest) HasSchemeFee() bool { + if o != nil && !common.IsNil(o.SchemeFee) { + return true + } + + return false +} + +// SetSchemeFee gets a reference to the given string and assigns it to the SchemeFee field. +func (o *UpdateSplitConfigurationLogicRequest) SetSchemeFee(v string) { + o.SchemeFee = &v +} + // GetSplitLogicId returns the SplitLogicId field value if set, zero value otherwise. func (o *UpdateSplitConfigurationLogicRequest) GetSplitLogicId() string { if o == nil || common.IsNil(o.SplitLogicId) { @@ -304,17 +549,40 @@ func (o UpdateSplitConfigurationLogicRequest) MarshalJSON() ([]byte, error) { func (o UpdateSplitConfigurationLogicRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquiringFees) { + toSerialize["acquiringFees"] = o.AcquiringFees + } if !common.IsNil(o.AdditionalCommission) { toSerialize["additionalCommission"] = o.AdditionalCommission } + if !common.IsNil(o.AdyenCommission) { + toSerialize["adyenCommission"] = o.AdyenCommission + } + if !common.IsNil(o.AdyenFees) { + toSerialize["adyenFees"] = o.AdyenFees + } + if !common.IsNil(o.AdyenMarkup) { + toSerialize["adyenMarkup"] = o.AdyenMarkup + } if !common.IsNil(o.Chargeback) { toSerialize["chargeback"] = o.Chargeback } + if !common.IsNil(o.ChargebackCostAllocation) { + toSerialize["chargebackCostAllocation"] = o.ChargebackCostAllocation + } toSerialize["commission"] = o.Commission - toSerialize["paymentFee"] = o.PaymentFee + if !common.IsNil(o.Interchange) { + toSerialize["interchange"] = o.Interchange + } + if !common.IsNil(o.PaymentFee) { + toSerialize["paymentFee"] = o.PaymentFee + } if !common.IsNil(o.Remainder) { toSerialize["remainder"] = o.Remainder } + if !common.IsNil(o.SchemeFee) { + toSerialize["schemeFee"] = o.SchemeFee + } if !common.IsNil(o.SplitLogicId) { toSerialize["splitLogicId"] = o.SplitLogicId } @@ -363,6 +631,42 @@ func (v *NullableUpdateSplitConfigurationLogicRequest) UnmarshalJSON(src []byte) return json.Unmarshal(src, &v.value) } +func (o *UpdateSplitConfigurationLogicRequest) isValidAcquiringFees() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAcquiringFees() == allowed { + return true + } + } + return false +} +func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenCommission() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenCommission() == allowed { + return true + } + } + return false +} +func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenFees() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenFees() == allowed { + return true + } + } + return false +} +func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenMarkup() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetAdyenMarkup() == allowed { + return true + } + } + return false +} func (o *UpdateSplitConfigurationLogicRequest) isValidChargeback() bool { var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} for _, allowed := range allowedEnumValues { @@ -372,6 +676,24 @@ func (o *UpdateSplitConfigurationLogicRequest) isValidChargeback() bool { } return false } +func (o *UpdateSplitConfigurationLogicRequest) isValidChargebackCostAllocation() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetChargebackCostAllocation() == allowed { + return true + } + } + return false +} +func (o *UpdateSplitConfigurationLogicRequest) isValidInterchange() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetInterchange() == allowed { + return true + } + } + return false +} func (o *UpdateSplitConfigurationLogicRequest) isValidPaymentFee() bool { var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} for _, allowed := range allowedEnumValues { @@ -390,6 +712,15 @@ func (o *UpdateSplitConfigurationLogicRequest) isValidRemainder() bool { } return false } +func (o *UpdateSplitConfigurationLogicRequest) isValidSchemeFee() bool { + var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} + for _, allowed := range allowedEnumValues { + if o.GetSchemeFee() == allowed { + return true + } + } + return false +} func (o *UpdateSplitConfigurationLogicRequest) isValidSurcharge() bool { var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} for _, allowed := range allowedEnumValues { diff --git a/src/management/model_update_store_request.go b/src/management/model_update_store_request.go index 347daee3f..d27cf9c86 100644 --- a/src/management/model_update_store_request.go +++ b/src/management/model_update_store_request.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &UpdateStoreRequest{} // UpdateStoreRequest struct for UpdateStoreRequest type UpdateStoreRequest struct { Address *UpdatableAddress `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. + // 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. BusinessLineIds []string `json:"businessLineIds,omitempty"` // The description of the store. Description *string `json:"description,omitempty"` diff --git a/src/management/model_webhook.go b/src/management/model_webhook.go index f5b08b5b3..f9156bbd9 100644 --- a/src/management/model_webhook.go +++ b/src/management/model_webhook.go @@ -55,7 +55,7 @@ type Webhook struct { PopulateSoapActionHeader *bool `json:"populateSoapActionHeader,omitempty"` // SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. SslVersion *string `json:"sslVersion,omitempty"` - // The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + // The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **ach-notification-of-change-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). Type string `json:"type"` // Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. Url string `json:"url"` diff --git a/src/managementwebhook/model_mid_service_notification_data.go b/src/managementwebhook/model_mid_service_notification_data.go index dfaeda167..0908a7ac8 100644 --- a/src/managementwebhook/model_mid_service_notification_data.go +++ b/src/managementwebhook/model_mid_service_notification_data.go @@ -23,15 +23,15 @@ type MidServiceNotificationData struct { Allowed *bool `json:"allowed,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). Enabled *bool `json:"enabled,omitempty"` - // The identifier of the resource. + // The unique identifier of the resource. Id string `json:"id"` - // The identifier of the merchant account. + // The unique identifier of the merchant account. MerchantId string `json:"merchantId"` // Your reference for the payment method. Reference *string `json:"reference,omitempty"` // The result of the request to create a payment method. Result string `json:"result"` - // The identifier of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/merchants/{id}/paymentMethodSettings__reqParam_storeId), if any. + // The unique identifier of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/merchants/{id}/paymentMethodSettings__reqParam_storeId), if any. StoreId *string `json:"storeId,omitempty"` // Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). Type string `json:"type"` diff --git a/src/payments/api_modifications.go b/src/payments/api_modifications.go index f192ce93c..2a2e3cc5a 100644 --- a/src/payments/api_modifications.go +++ b/src/payments/api_modifications.go @@ -68,6 +68,10 @@ func (a *ModificationsApi) AdjustAuthorisation(ctx context.Context, r Modificati headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -119,6 +123,10 @@ func (a *ModificationsApi) Cancel(ctx context.Context, r ModificationsApiCancelI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -176,6 +184,10 @@ func (a *ModificationsApi) CancelOrRefund(ctx context.Context, r ModificationsAp headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -231,6 +243,10 @@ func (a *ModificationsApi) Capture(ctx context.Context, r ModificationsApiCaptur headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -280,6 +296,10 @@ func (a *ModificationsApi) Donate(ctx context.Context, r ModificationsApiDonateI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -334,6 +354,10 @@ func (a *ModificationsApi) Refund(ctx context.Context, r ModificationsApiRefundI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -387,6 +411,10 @@ func (a *ModificationsApi) TechnicalCancel(ctx context.Context, r ModificationsA headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -438,5 +466,9 @@ func (a *ModificationsApi) VoidPendingRefund(ctx context.Context, r Modification headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/payments/api_payments.go b/src/payments/api_payments.go new file mode 100644 index 000000000..602454c91 --- /dev/null +++ b/src/payments/api_payments.go @@ -0,0 +1,280 @@ +/* +Adyen Payment API + +API version: 68 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package payments + +import ( + "context" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// PaymentsApi service +type PaymentsApi common.Service + +// All parameters accepted by PaymentsApi.Authorise +type PaymentsApiAuthoriseInput struct { + paymentRequest *PaymentRequest +} + +func (r PaymentsApiAuthoriseInput) PaymentRequest(paymentRequest PaymentRequest) PaymentsApiAuthoriseInput { + r.paymentRequest = &paymentRequest + return r +} + +/* +Prepare a request for Authorise + +@return PaymentsApiAuthoriseInput +*/ +func (a *PaymentsApi) AuthoriseInput() PaymentsApiAuthoriseInput { + return PaymentsApiAuthoriseInput{} +} + +/* +Authorise 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthoriseInput - Request parameters, see AuthoriseInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise(ctx context.Context, r PaymentsApiAuthoriseInput) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Authorise3d +type PaymentsApiAuthorise3dInput struct { + paymentRequest3d *PaymentRequest3d +} + +func (r PaymentsApiAuthorise3dInput) PaymentRequest3d(paymentRequest3d PaymentRequest3d) PaymentsApiAuthorise3dInput { + r.paymentRequest3d = &paymentRequest3d + return r +} + +/* +Prepare a request for Authorise3d + +@return PaymentsApiAuthorise3dInput +*/ +func (a *PaymentsApi) Authorise3dInput() PaymentsApiAuthorise3dInput { + return PaymentsApiAuthorise3dInput{} +} + +/* +Authorise3d 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3dInput - Request parameters, see Authorise3dInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3d(ctx context.Context, r PaymentsApiAuthorise3dInput) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise3d" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3d, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Authorise3ds2 +type PaymentsApiAuthorise3ds2Input struct { + paymentRequest3ds2 *PaymentRequest3ds2 +} + +func (r PaymentsApiAuthorise3ds2Input) PaymentRequest3ds2(paymentRequest3ds2 PaymentRequest3ds2) PaymentsApiAuthorise3ds2Input { + r.paymentRequest3ds2 = &paymentRequest3ds2 + return r +} + +/* +Prepare a request for Authorise3ds2 + +@return PaymentsApiAuthorise3ds2Input +*/ +func (a *PaymentsApi) Authorise3ds2Input() PaymentsApiAuthorise3ds2Input { + return PaymentsApiAuthorise3ds2Input{} +} + +/* +Authorise3ds2 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3ds2Input - Request parameters, see Authorise3ds2Input +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3ds2(ctx context.Context, r PaymentsApiAuthorise3ds2Input) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise3ds2" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3ds2, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.GetAuthenticationResult +type PaymentsApiGetAuthenticationResultInput struct { + authenticationResultRequest *AuthenticationResultRequest +} + +func (r PaymentsApiGetAuthenticationResultInput) AuthenticationResultRequest(authenticationResultRequest AuthenticationResultRequest) PaymentsApiGetAuthenticationResultInput { + r.authenticationResultRequest = &authenticationResultRequest + return r +} + +/* +Prepare a request for GetAuthenticationResult + +@return PaymentsApiGetAuthenticationResultInput +*/ +func (a *PaymentsApi) GetAuthenticationResultInput() PaymentsApiGetAuthenticationResultInput { + return PaymentsApiGetAuthenticationResultInput{} +} + +/* +GetAuthenticationResult Get the 3DS authentication result + +Return the authentication result after doing a 3D Secure authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiGetAuthenticationResultInput - Request parameters, see GetAuthenticationResultInput +@return AuthenticationResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) GetAuthenticationResult(ctx context.Context, r PaymentsApiGetAuthenticationResultInput) (AuthenticationResultResponse, *http.Response, error) { + res := &AuthenticationResultResponse{} + path := "/getAuthenticationResult" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.authenticationResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Retrieve3ds2Result +type PaymentsApiRetrieve3ds2ResultInput struct { + threeDS2ResultRequest *ThreeDS2ResultRequest +} + +func (r PaymentsApiRetrieve3ds2ResultInput) ThreeDS2ResultRequest(threeDS2ResultRequest ThreeDS2ResultRequest) PaymentsApiRetrieve3ds2ResultInput { + r.threeDS2ResultRequest = &threeDS2ResultRequest + return r +} + +/* +Prepare a request for Retrieve3ds2Result + +@return PaymentsApiRetrieve3ds2ResultInput +*/ +func (a *PaymentsApi) Retrieve3ds2ResultInput() PaymentsApiRetrieve3ds2ResultInput { + return PaymentsApiRetrieve3ds2ResultInput{} +} + +/* +Retrieve3ds2Result Get the 3DS2 authentication result + +Retrieves the `threeDS2Result` after doing a 3D Secure 2 authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiRetrieve3ds2ResultInput - Request parameters, see Retrieve3ds2ResultInput +@return ThreeDS2ResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) Retrieve3ds2Result(ctx context.Context, r PaymentsApiRetrieve3ds2ResultInput) (ThreeDS2ResultResponse, *http.Response, error) { + res := &ThreeDS2ResultResponse{} + path := "/retrieve3ds2Result" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.threeDS2ResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + return *res, httpRes, err +} diff --git a/src/payments/client.go b/src/payments/client.go index 27589e220..7ef9273c6 100644 --- a/src/payments/client.go +++ b/src/payments/client.go @@ -19,9 +19,9 @@ type APIClient struct { // API Services - GeneralApi *GeneralApi - ModificationsApi *ModificationsApi + + PaymentsApi *PaymentsApi } // NewAPIClient creates a new API client. @@ -33,8 +33,8 @@ func NewAPIClient(client *common.Client) *APIClient { } // API Services - c.GeneralApi = (*GeneralApi)(&c.common) c.ModificationsApi = (*ModificationsApi)(&c.common) + c.PaymentsApi = (*PaymentsApi)(&c.common) return c } \ No newline at end of file diff --git a/src/payments/model_additional_data_airline.go b/src/payments/model_additional_data_airline.go index b8dc7786b..897dff22f 100644 --- a/src/payments/model_additional_data_airline.go +++ b/src/payments/model_additional_data_airline.go @@ -23,9 +23,9 @@ type AdditionalDataAirline struct { AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // 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 + // 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"` - // 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 + // 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"` // 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"` @@ -37,21 +37,21 @@ type AdditionalDataAirline struct { AirlineDocumentType *string `json:"airline.document_type,omitempty"` // 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"` - // 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 + // 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"` - // 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 + // 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 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + // 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"` // 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"` @@ -65,15 +65,15 @@ type AdditionalDataAirline struct { AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // 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 + // 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"` // 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 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros + // 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"` - // 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 + // 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. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + // 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"` } diff --git a/src/payments/model_additional_data_car_rental.go b/src/payments/model_additional_data_car_rental.go index 93ccfe920..143b0a608 100644 --- a/src/payments/model_additional_data_car_rental.go +++ b/src/payments/model_additional_data_car_rental.go @@ -21,19 +21,19 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} type AdditionalDataCarRental struct { // 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 * 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` // 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, 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 + // 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 where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // 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 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 where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros + // 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 didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` @@ -43,25 +43,25 @@ type AdditionalDataCarRental struct { CarRentalRate *string `json:"carRental.rate,omitempty"` // 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 for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros + // 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"` - // 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 + // 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 * 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 + // 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 * Must not start with a space or be all spaces * Must not be all zeros + // 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, 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` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // 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 + // 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 * Must not start with a space or be all spaces * Must not be all zeros + // 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 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 days the car is rented for. 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: 4 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 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/payments/model_additional_data_level23.go b/src/payments/model_additional_data_level23.go index 0adbe17a2..8b9eeb3eb 100644 --- a/src/payments/model_additional_data_level23.go +++ b/src/payments/model_additional_data_level23.go @@ -19,39 +19,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // 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 + // The customer code. * 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"` - // 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 + // 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 the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + // 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 Must not start with a space + // Destination state or province code. * Encoding: ASCII * Max length: 3 characters * Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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"` - // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // 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 + // 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"` - // 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 + // 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"` - // 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 + // 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 * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // The 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 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 + // 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 * Must not be all zeros. EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } diff --git a/src/payments/model_additional_data_lodging.go b/src/payments/model_additional_data_lodging.go index 737136c6b..43294a197 100644 --- a/src/payments/model_additional_data_lodging.go +++ b/src/payments/model_additional_data_lodging.go @@ -23,13 +23,13 @@ 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: 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` // 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, 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. * Max length: 25 characters. * Must not start with a space * Must not be all zeros + // 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"` // 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"` @@ -37,9 +37,9 @@ type AdditionalDataLodging struct { LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // 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 - + // 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 contain any special characters such as + or - *Must not be all zeros. LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` // 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"` @@ -47,7 +47,7 @@ type AdditionalDataLodging struct { LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` // 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: 4 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // 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"` diff --git a/src/payments/model_additional_data_temporary_services.go b/src/payments/model_additional_data_temporary_services.go index c1e109c21..93f7ade56 100644 --- a/src/payments/model_additional_data_temporary_services.go +++ b/src/payments/model_additional_data_temporary_services.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} type AdditionalDataTemporaryServices struct { // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` // 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"` diff --git a/src/payments/model_payment_request.go b/src/payments/model_payment_request.go index 306436988..0c9a6beab 100644 --- a/src/payments/model_payment_request.go +++ b/src/payments/model_payment_request.go @@ -49,7 +49,7 @@ type PaymentRequest struct { // 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"` - // 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. 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. diff --git a/src/payments/model_payment_request3d.go b/src/payments/model_payment_request3d.go index 7e3ffaf83..34eb04f65 100644 --- a/src/payments/model_payment_request3d.go +++ b/src/payments/model_payment_request3d.go @@ -41,7 +41,7 @@ type PaymentRequest3d struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,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"` diff --git a/src/payments/model_payment_request3ds2.go b/src/payments/model_payment_request3ds2.go index 794e119fc..e18529317 100644 --- a/src/payments/model_payment_request3ds2.go +++ b/src/payments/model_payment_request3ds2.go @@ -41,7 +41,7 @@ type PaymentRequest3ds2 struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. 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. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,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"` diff --git a/src/payments/model_payment_result.go b/src/payments/model_payment_result.go index ceb4e5bb3..9b02e03b8 100644 --- a/src/payments/model_payment_result.go +++ b/src/payments/model_payment_result.go @@ -37,7 +37,7 @@ type PaymentResult struct { 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 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. + // 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. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **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"` } @@ -493,7 +493,7 @@ func (v *NullablePaymentResult) UnmarshalJSON(src []byte) error { } func (o *PaymentResult) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/payments/model_split.go b/src/payments/model_split.go index 102f462e2..6cc884d80 100644 --- a/src/payments/model_split.go +++ b/src/payments/model_split.go @@ -254,7 +254,7 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { } func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} + var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/payments/model_three_ds2_result.go b/src/payments/model_three_ds2_result.go index 79e031a4f..360b5052f 100644 --- a/src/payments/model_three_ds2_result.go +++ b/src/payments/model_three_ds2_result.go @@ -25,8 +25,6 @@ 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` - 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. @@ -37,6 +35,8 @@ type ThreeDS2Result struct { MessageVersion *string `json:"messageVersion,omitempty"` // Risk score calculated by Cartes Bancaires Directory Server (DS). RiskScore *string `json:"riskScore,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"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` // The `timestamp` value of the 3D Secure 2 authentication. @@ -162,38 +162,6 @@ func (o *ThreeDS2Result) SetChallengeCancel(v string) { o.ChallengeCancel = &v } -// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. -func (o *ThreeDS2Result) 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. -func (o *ThreeDS2Result) 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 *ThreeDS2Result) 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. -func (o *ThreeDS2Result) SetChallengeIndicator(v string) { - o.ChallengeIndicator = &v -} - // GetDsTransID returns the DsTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetDsTransID() string { if o == nil || common.IsNil(o.DsTransID) { @@ -354,6 +322,38 @@ func (o *ThreeDS2Result) SetRiskScore(v string) { o.RiskScore = &v } +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2Result) 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 *ThreeDS2Result) 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 *ThreeDS2Result) 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 *ThreeDS2Result) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + // GetThreeDSServerTransID returns the ThreeDSServerTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetThreeDSServerTransID() string { if o == nil || common.IsNil(o.ThreeDSServerTransID) { @@ -533,9 +533,6 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ChallengeCancel) { toSerialize["challengeCancel"] = o.ChallengeCancel } - if !common.IsNil(o.ChallengeIndicator) { - toSerialize["challengeIndicator"] = o.ChallengeIndicator - } if !common.IsNil(o.DsTransID) { toSerialize["dsTransID"] = o.DsTransID } @@ -551,6 +548,9 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskScore) { toSerialize["riskScore"] = o.RiskScore } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } if !common.IsNil(o.ThreeDSServerTransID) { toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID } @@ -614,19 +614,19 @@ func (o *ThreeDS2Result) isValidChallengeCancel() bool { } return false } -func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} +func (o *ThreeDS2Result) isValidExemptionIndicator() bool { + var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { + if o.GetExemptionIndicator() == allowed { return true } } return false } -func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} +func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { + if o.GetThreeDSRequestorChallengeInd() == allowed { return true } } diff --git a/src/payout/api_initialization.go b/src/payout/api_initialization.go index c8a3bdc81..54b1cba9b 100644 --- a/src/payout/api_initialization.go +++ b/src/payout/api_initialization.go @@ -63,6 +63,10 @@ func (a *InitializationApi) StoreDetail(ctx context.Context, r InitializationApi headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -112,6 +116,10 @@ func (a *InitializationApi) StoreDetailAndSubmitThirdParty(ctx context.Context, headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -161,5 +169,9 @@ func (a *InitializationApi) SubmitThirdParty(ctx context.Context, r Initializati headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/payout/api_instant_payouts.go b/src/payout/api_instant_payouts.go index 0e115464a..5fb00b485 100644 --- a/src/payout/api_instant_payouts.go +++ b/src/payout/api_instant_payouts.go @@ -63,5 +63,9 @@ func (a *InstantPayoutsApi) Payout(ctx context.Context, r InstantPayoutsApiPayou headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/payout/api_reviewing.go b/src/payout/api_reviewing.go index 951300ed1..17e421543 100644 --- a/src/payout/api_reviewing.go +++ b/src/payout/api_reviewing.go @@ -65,6 +65,10 @@ func (a *ReviewingApi) ConfirmThirdParty(ctx context.Context, r ReviewingApiConf headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -114,5 +118,9 @@ func (a *ReviewingApi) DeclineThirdParty(ctx context.Context, r ReviewingApiDecl headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/posterminalmanagement/api_general.go b/src/posterminalmanagement/api_general.go index 2dfbc7f80..b70e9bd3b 100644 --- a/src/posterminalmanagement/api_general.go +++ b/src/posterminalmanagement/api_general.go @@ -63,6 +63,10 @@ func (a *GeneralApi) AssignTerminals(ctx context.Context, r GeneralApiAssignTerm headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -110,6 +114,10 @@ func (a *GeneralApi) FindTerminal(ctx context.Context, r GeneralApiFindTerminalI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -157,6 +165,10 @@ func (a *GeneralApi) GetStoresUnderAccount(ctx context.Context, r GeneralApiGetS headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -204,6 +216,10 @@ func (a *GeneralApi) GetTerminalDetails(ctx context.Context, r GeneralApiGetTerm headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -251,5 +267,9 @@ func (a *GeneralApi) GetTerminalsUnderAccount(ctx context.Context, r GeneralApiG headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/recurring/api_general.go b/src/recurring/api_general.go index 461480137..ad74b64de 100644 --- a/src/recurring/api_general.go +++ b/src/recurring/api_general.go @@ -63,6 +63,10 @@ func (a *GeneralApi) CreatePermit(ctx context.Context, r GeneralApiCreatePermitI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -112,6 +116,10 @@ func (a *GeneralApi) Disable(ctx context.Context, r GeneralApiDisableInput) (Dis headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -159,6 +167,10 @@ func (a *GeneralApi) DisablePermit(ctx context.Context, r GeneralApiDisablePermi headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -208,6 +220,10 @@ func (a *GeneralApi) ListRecurringDetails(ctx context.Context, r GeneralApiListR headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -255,6 +271,10 @@ func (a *GeneralApi) NotifyShopper(ctx context.Context, r GeneralApiNotifyShoppe headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -304,5 +324,9 @@ func (a *GeneralApi) ScheduleAccountUpdater(ctx context.Context, r GeneralApiSch headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/storedvalue/api_general.go b/src/storedvalue/api_general.go index be53a3762..137ffcdce 100644 --- a/src/storedvalue/api_general.go +++ b/src/storedvalue/api_general.go @@ -63,6 +63,10 @@ func (a *GeneralApi) ChangeStatus(ctx context.Context, r GeneralApiChangeStatusI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -110,6 +114,10 @@ func (a *GeneralApi) CheckBalance(ctx context.Context, r GeneralApiCheckBalanceI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -157,6 +165,10 @@ func (a *GeneralApi) Issue(ctx context.Context, r GeneralApiIssueInput) (StoredV headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -204,6 +216,10 @@ func (a *GeneralApi) Load(ctx context.Context, r GeneralApiLoadInput) (StoredVal headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -251,6 +267,10 @@ func (a *GeneralApi) MergeBalance(ctx context.Context, r GeneralApiMergeBalanceI headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } @@ -298,5 +318,9 @@ func (a *GeneralApi) VoidTransaction(ctx context.Context, r GeneralApiVoidTransa headerParams, ) + if httpRes == nil { + return *res, httpRes, err + } + return *res, httpRes, err } diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go index b675f3237..35f2905cf 100644 --- a/src/transfers/api_transactions.go +++ b/src/transfers/api_transactions.go @@ -47,25 +47,25 @@ func (r TransactionsApiGetAllTransactionsInput) CreatedUntil(createdUntil time.T return r } -// Unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). +// The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don't provide a `balanceAccountId` or `accountHolderId`. func (r TransactionsApiGetAllTransactionsInput) BalancePlatform(balancePlatform string) TransactionsApiGetAllTransactionsInput { r.balancePlatform = &balancePlatform return r } -// Unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). +// The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide. func (r TransactionsApiGetAllTransactionsInput) PaymentInstrumentId(paymentInstrumentId string) TransactionsApiGetAllTransactionsInput { r.paymentInstrumentId = &paymentInstrumentId return r } -// Unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). +// The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don't provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`. func (r TransactionsApiGetAllTransactionsInput) AccountHolderId(accountHolderId string) TransactionsApiGetAllTransactionsInput { r.accountHolderId = &accountHolderId return r } -// Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). +// The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don't provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`. func (r TransactionsApiGetAllTransactionsInput) BalanceAccountId(balanceAccountId string) TransactionsApiGetAllTransactionsInput { r.balanceAccountId = &balanceAccountId return r @@ -95,11 +95,18 @@ func (a *TransactionsApi) GetAllTransactionsInput() TransactionsApiGetAllTransac /* GetAllTransactions Get all transactions -Returns all transactions related to a balance account with a payment instrument of type **bankAccount**. +>Versions 1 and 2 of the Transfers API are deprecated. If you are just starting your implementation, use the latest version. + +Returns all the transactions related to a balance account, account holder, or balance platform. + +When making this request, you must include at least one of the following: +- `balanceAccountId` +- `accountHolderId` +- `balancePlatform`. + +This endpoint supports cursor-based pagination. The response returns the first page of results, and returns links to the next and previous pages when applicable. You can use the links to page through the results. -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. -Provide either `balanceAccountId`, `accountHolderId`, or `balancePlatform` when using this endpoint. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r TransactionsApiGetAllTransactionsInput - Request parameters, see GetAllTransactionsInput @@ -209,14 +216,16 @@ func (a *TransactionsApi) GetTransactionInput(id string) TransactionsApiGetTrans /* GetTransaction Get a transaction +>Versions 1 and 2 of the Transfers API are deprecated. If you are just starting your implementation, use the latest version. + Returns a transaction. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r TransactionsApiGetTransactionInput - Request parameters, see GetTransactionInput -@return Transaction, *http.Response, error +@return TransactionData, *http.Response, error */ -func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiGetTransactionInput) (Transaction, *http.Response, error) { - res := &Transaction{} +func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiGetTransactionInput) (TransactionData, *http.Response, error) { + res := &TransactionData{} path := "/transactions/{id}" path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go index 34845be88..9dd9dd395 100644 --- a/src/transfers/api_transfers.go +++ b/src/transfers/api_transfers.go @@ -23,7 +23,14 @@ type TransfersApi common.Service // All parameters accepted by TransfersApi.TransferFunds type TransfersApiTransferFundsInput struct { - transferInfo *TransferInfo + wWWAuthenticate *string + transferInfo *TransferInfo +} + +// Header for authenticating through SCA +func (r TransfersApiTransferFundsInput) WWWAuthenticate(wWWAuthenticate string) TransfersApiTransferFundsInput { + r.wWWAuthenticate = &wWWAuthenticate + return r } func (r TransfersApiTransferFundsInput) TransferInfo(transferInfo TransferInfo) TransfersApiTransferFundsInput { @@ -43,6 +50,8 @@ func (a *TransfersApi) TransferFundsInput() TransfersApiTransferFundsInput { /* TransferFunds Transfer funds +>Versions 1 and 2 of the Transfers API are deprecated. If you are just starting your implementation, use the latest version. + 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. @@ -56,6 +65,9 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer path := "/transfers" queryParams := url.Values{} headerParams := make(map[string]string) + if r.wWWAuthenticate != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "WWW-Authenticate", r.wWWAuthenticate, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, diff --git a/src/transfers/model_hk_local_account_identification.go b/src/transfers/model_hk_local_account_identification.go index 334a6c9ad..f49cf3ea1 100644 --- a/src/transfers/model_hk_local_account_identification.go +++ b/src/transfers/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 12-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification 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 NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transfers/model_merchant_data.go b/src/transfers/model_merchant_data.go index bf31f9f9e..19cb5122d 100644 --- a/src/transfers/model_merchant_data.go +++ b/src/transfers/model_merchant_data.go @@ -19,6 +19,8 @@ var _ common.MappedNullable = &MerchantData{} // MerchantData struct for MerchantData type MerchantData struct { + // The unique identifier of the merchant's acquirer. + AcquirerId *string `json:"acquirerId,omitempty"` // The merchant category code. Mcc *string `json:"mcc,omitempty"` // The merchant identifier. @@ -45,6 +47,38 @@ func NewMerchantDataWithDefaults() *MerchantData { return &this } +// GetAcquirerId returns the AcquirerId field value if set, zero value otherwise. +func (o *MerchantData) GetAcquirerId() string { + if o == nil || common.IsNil(o.AcquirerId) { + var ret string + return ret + } + return *o.AcquirerId +} + +// GetAcquirerIdOk returns a tuple with the AcquirerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetAcquirerIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerId) { + return nil, false + } + return o.AcquirerId, true +} + +// HasAcquirerId returns a boolean if a field has been set. +func (o *MerchantData) HasAcquirerId() bool { + if o != nil && !common.IsNil(o.AcquirerId) { + return true + } + + return false +} + +// SetAcquirerId gets a reference to the given string and assigns it to the AcquirerId field. +func (o *MerchantData) SetAcquirerId(v string) { + o.AcquirerId = &v +} + // GetMcc returns the Mcc field value if set, zero value otherwise. func (o *MerchantData) GetMcc() string { if o == nil || common.IsNil(o.Mcc) { @@ -183,6 +217,9 @@ func (o MerchantData) MarshalJSON() ([]byte, error) { func (o MerchantData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquirerId) { + toSerialize["acquirerId"] = o.AcquirerId + } if !common.IsNil(o.Mcc) { toSerialize["mcc"] = o.Mcc } diff --git a/src/transfers/model_nz_local_account_identification.go b/src/transfers/model_nz_local_account_identification.go index a31599b57..a22d3853d 100644 --- a/src/transfers/model_nz_local_account_identification.go +++ b/src/transfers/model_nz_local_account_identification.go @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. AccountNumber string `json:"accountNumber"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification 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 NewNZLocalAccountIdentification(accountNumber string, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) GetBankCode() string { - if o == nil { - var ret string - return ret - } - - return o.BankCode -} - -// GetBankCodeOk returns a tuple with the BankCode field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transfers/model_service_error.go b/src/transfers/model_service_error.go new file mode 100644 index 000000000..1046254d1 --- /dev/null +++ b/src/transfers/model_service_error.go @@ -0,0 +1,273 @@ +/* +Transfers API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the ServiceError type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ServiceError{} + +// ServiceError struct for ServiceError +type ServiceError struct { + // The error code mapped to the error message. + ErrorCode *string `json:"errorCode,omitempty"` + // The category of the error. + ErrorType *string `json:"errorType,omitempty"` + // A short explanation of the issue. + Message *string `json:"message,omitempty"` + // The PSP reference of the payment. + PspReference *string `json:"pspReference,omitempty"` + // The HTTP response status. + Status *int32 `json:"status,omitempty"` +} + +// NewServiceError instantiates a new ServiceError 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 NewServiceError() *ServiceError { + this := ServiceError{} + return &this +} + +// NewServiceErrorWithDefaults instantiates a new ServiceError 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 NewServiceErrorWithDefaults() *ServiceError { + this := ServiceError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *ServiceError) GetErrorCode() string { + if o == nil || common.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceError) GetErrorCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *ServiceError) HasErrorCode() bool { + if o != nil && !common.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *ServiceError) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetErrorType returns the ErrorType field value if set, zero value otherwise. +func (o *ServiceError) GetErrorType() string { + if o == nil || common.IsNil(o.ErrorType) { + var ret string + return ret + } + return *o.ErrorType +} + +// GetErrorTypeOk returns a tuple with the ErrorType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceError) GetErrorTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorType) { + return nil, false + } + return o.ErrorType, true +} + +// HasErrorType returns a boolean if a field has been set. +func (o *ServiceError) HasErrorType() bool { + if o != nil && !common.IsNil(o.ErrorType) { + return true + } + + return false +} + +// SetErrorType gets a reference to the given string and assigns it to the ErrorType field. +func (o *ServiceError) SetErrorType(v string) { + o.ErrorType = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ServiceError) GetMessage() string { + if o == nil || common.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceError) GetMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ServiceError) HasMessage() bool { + if o != nil && !common.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ServiceError) SetMessage(v string) { + o.Message = &v +} + +// GetPspReference returns the PspReference field value if set, zero value otherwise. +func (o *ServiceError) GetPspReference() string { + if o == nil || common.IsNil(o.PspReference) { + var ret string + return ret + } + return *o.PspReference +} + +// GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceError) GetPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PspReference) { + return nil, false + } + return o.PspReference, true +} + +// HasPspReference returns a boolean if a field has been set. +func (o *ServiceError) HasPspReference() bool { + if o != nil && !common.IsNil(o.PspReference) { + return true + } + + return false +} + +// SetPspReference gets a reference to the given string and assigns it to the PspReference field. +func (o *ServiceError) SetPspReference(v string) { + o.PspReference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ServiceError) GetStatus() int32 { + if o == nil || common.IsNil(o.Status) { + var ret int32 + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceError) GetStatusOk() (*int32, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ServiceError) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given int32 and assigns it to the Status field. +func (o *ServiceError) SetStatus(v int32) { + o.Status = &v +} + +func (o ServiceError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ErrorCode) { + toSerialize["errorCode"] = o.ErrorCode + } + if !common.IsNil(o.ErrorType) { + toSerialize["errorType"] = o.ErrorType + } + if !common.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !common.IsNil(o.PspReference) { + toSerialize["pspReference"] = o.PspReference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableServiceError struct { + value *ServiceError + isSet bool +} + +func (v NullableServiceError) Get() *ServiceError { + return v.value +} + +func (v *NullableServiceError) Set(val *ServiceError) { + v.value = val + v.isSet = true +} + +func (v NullableServiceError) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceError(val *ServiceError) *NullableServiceError { + return &NullableServiceError{value: val, isSet: true} +} + +func (v NullableServiceError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transfers/model_transaction_data.go b/src/transfers/model_transaction_data.go new file mode 100644 index 000000000..5c5854acb --- /dev/null +++ b/src/transfers/model_transaction_data.go @@ -0,0 +1,755 @@ +/* +Transfers API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + "time" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the TransactionData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionData{} + +// TransactionData struct for TransactionData +type TransactionData struct { + // Unique identifier of the account holder. + AccountHolderId string `json:"accountHolderId"` + Amount Amount `json:"amount"` + // Unique identifier of the balance account. + BalanceAccountId string `json:"balanceAccountId"` + // The unique identifier of the balance platform. + BalancePlatform string `json:"balancePlatform"` + // The date the transaction was booked into 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"` + Counterparty CounterpartyV3 `json:"counterparty"` + // The date the transaction was created. + CreatedAt time.Time `json:"createdAt"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The `description` from the `/transfers` request. + Description *string `json:"description,omitempty"` + // The PSP reference of the transaction in the journal. + EventId *string `json:"eventId,omitempty"` + // The unique identifier of the transaction. + Id string `json:"id"` + InstructedAmount *Amount `json:"instructedAmount,omitempty"` + // The unique identifier of the payment instrument that was used for the transaction. + PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` + // The [`reference`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_reference) from the `/transfers` request. If you haven't provided any, Adyen generates a unique reference. + 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. + Status string `json:"status"` + // Unique identifier of the related transfer. + TransferId *string `json:"transferId,omitempty"` + // The type of the transaction. Possible values: **payment**, **capture**, **captureReversal**, **refund** **refundReversal**, **chargeback**, **chargebackReversal**, **secondChargeback**, **atmWithdrawal**, **atmWithdrawalReversal**, **internalTransfer**, **manualCorrection**, **invoiceDeduction**, **depositCorrection**, **bankTransfer**, **miscCost**, **paymentCost**, **fee** + Type *string `json:"type,omitempty"` + // The date the transfer amount becomes available in the balance account. + ValueDate time.Time `json:"valueDate"` +} + +// NewTransactionData instantiates a new TransactionData 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 NewTransactionData(accountHolderId string, amount Amount, balanceAccountId string, balancePlatform string, bookingDate time.Time, counterparty CounterpartyV3, createdAt time.Time, id string, reference string, status string, valueDate time.Time) *TransactionData { + this := TransactionData{} + this.AccountHolderId = accountHolderId + this.Amount = amount + this.BalanceAccountId = balanceAccountId + this.BalancePlatform = balancePlatform + this.BookingDate = bookingDate + this.Counterparty = counterparty + this.CreatedAt = createdAt + this.Id = id + this.Reference = reference + this.Status = status + this.ValueDate = valueDate + return &this +} + +// NewTransactionDataWithDefaults instantiates a new TransactionData 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 NewTransactionDataWithDefaults() *TransactionData { + this := TransactionData{} + return &this +} + +// GetAccountHolderId returns the AccountHolderId field value +func (o *TransactionData) GetAccountHolderId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountHolderId +} + +// GetAccountHolderIdOk returns a tuple with the AccountHolderId field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetAccountHolderIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolderId, true +} + +// SetAccountHolderId sets field value +func (o *TransactionData) SetAccountHolderId(v string) { + o.AccountHolderId = v +} + +// GetAmount returns the Amount field value +func (o *TransactionData) GetAmount() Amount { + if o == nil { + var ret Amount + 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 *TransactionData) GetAmountOk() (*Amount, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *TransactionData) SetAmount(v Amount) { + o.Amount = v +} + +// GetBalanceAccountId returns the BalanceAccountId field value +func (o *TransactionData) GetBalanceAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetBalanceAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalanceAccountId, true +} + +// SetBalanceAccountId sets field value +func (o *TransactionData) SetBalanceAccountId(v string) { + o.BalanceAccountId = v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *TransactionData) GetBalancePlatform() string { + if o == nil { + var ret string + return ret + } + + return o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *TransactionData) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetBookingDate returns the BookingDate field value +func (o *TransactionData) GetBookingDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.BookingDate +} + +// GetBookingDateOk returns a tuple with the BookingDate field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetBookingDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.BookingDate, true +} + +// SetBookingDate sets field value +func (o *TransactionData) SetBookingDate(v time.Time) { + o.BookingDate = v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *TransactionData) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *TransactionData) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *TransactionData) SetCategory(v string) { + o.Category = &v +} + +// GetCounterparty returns the Counterparty field value +func (o *TransactionData) GetCounterparty() CounterpartyV3 { + if o == nil { + var ret CounterpartyV3 + return ret + } + + return o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetCounterpartyOk() (*CounterpartyV3, bool) { + if o == nil { + return nil, false + } + return &o.Counterparty, true +} + +// SetCounterparty sets field value +func (o *TransactionData) SetCounterparty(v CounterpartyV3) { + o.Counterparty = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *TransactionData) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *TransactionData) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *TransactionData) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *TransactionData) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *TransactionData) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TransactionData) 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 *TransactionData) 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 *TransactionData) 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 *TransactionData) SetDescription(v string) { + o.Description = &v +} + +// GetEventId returns the EventId field value if set, zero value otherwise. +func (o *TransactionData) GetEventId() string { + if o == nil || common.IsNil(o.EventId) { + var ret string + return ret + } + return *o.EventId +} + +// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetEventIdOk() (*string, bool) { + if o == nil || common.IsNil(o.EventId) { + return nil, false + } + return o.EventId, true +} + +// HasEventId returns a boolean if a field has been set. +func (o *TransactionData) HasEventId() bool { + if o != nil && !common.IsNil(o.EventId) { + return true + } + + return false +} + +// SetEventId gets a reference to the given string and assigns it to the EventId field. +func (o *TransactionData) SetEventId(v string) { + o.EventId = &v +} + +// GetId returns the Id field value +func (o *TransactionData) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TransactionData) SetId(v string) { + o.Id = v +} + +// GetInstructedAmount returns the InstructedAmount field value if set, zero value otherwise. +func (o *TransactionData) GetInstructedAmount() Amount { + if o == nil || common.IsNil(o.InstructedAmount) { + var ret Amount + return ret + } + return *o.InstructedAmount +} + +// GetInstructedAmountOk returns a tuple with the InstructedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetInstructedAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.InstructedAmount) { + return nil, false + } + return o.InstructedAmount, true +} + +// HasInstructedAmount returns a boolean if a field has been set. +func (o *TransactionData) HasInstructedAmount() bool { + if o != nil && !common.IsNil(o.InstructedAmount) { + return true + } + + return false +} + +// SetInstructedAmount gets a reference to the given Amount and assigns it to the InstructedAmount field. +func (o *TransactionData) SetInstructedAmount(v Amount) { + o.InstructedAmount = &v +} + +// GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. +func (o *TransactionData) GetPaymentInstrumentId() string { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + var ret string + return ret + } + return *o.PaymentInstrumentId +} + +// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetPaymentInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + return nil, false + } + return o.PaymentInstrumentId, true +} + +// HasPaymentInstrumentId returns a boolean if a field has been set. +func (o *TransactionData) HasPaymentInstrumentId() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentId) { + return true + } + + return false +} + +// SetPaymentInstrumentId gets a reference to the given string and assigns it to the PaymentInstrumentId field. +func (o *TransactionData) SetPaymentInstrumentId(v string) { + o.PaymentInstrumentId = &v +} + +// GetReference returns the Reference field value +func (o *TransactionData) GetReference() string { + if o == nil { + var ret string + return ret + } + + return o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetReferenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reference, true +} + +// SetReference sets field value +func (o *TransactionData) SetReference(v string) { + o.Reference = v +} + +// GetReferenceForBeneficiary returns the ReferenceForBeneficiary field value if set, zero value otherwise. +func (o *TransactionData) GetReferenceForBeneficiary() string { + if o == nil || common.IsNil(o.ReferenceForBeneficiary) { + var ret string + return ret + } + return *o.ReferenceForBeneficiary +} + +// GetReferenceForBeneficiaryOk returns a tuple with the ReferenceForBeneficiary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetReferenceForBeneficiaryOk() (*string, bool) { + if o == nil || common.IsNil(o.ReferenceForBeneficiary) { + return nil, false + } + return o.ReferenceForBeneficiary, true +} + +// HasReferenceForBeneficiary returns a boolean if a field has been set. +func (o *TransactionData) HasReferenceForBeneficiary() bool { + if o != nil && !common.IsNil(o.ReferenceForBeneficiary) { + return true + } + + return false +} + +// SetReferenceForBeneficiary gets a reference to the given string and assigns it to the ReferenceForBeneficiary field. +func (o *TransactionData) SetReferenceForBeneficiary(v string) { + o.ReferenceForBeneficiary = &v +} + +// GetStatus returns the Status field value +func (o *TransactionData) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TransactionData) SetStatus(v string) { + o.Status = v +} + +// GetTransferId returns the TransferId field value if set, zero value otherwise. +func (o *TransactionData) GetTransferId() string { + if o == nil || common.IsNil(o.TransferId) { + var ret string + return ret + } + return *o.TransferId +} + +// GetTransferIdOk returns a tuple with the TransferId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionData) GetTransferIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransferId) { + return nil, false + } + return o.TransferId, true +} + +// HasTransferId returns a boolean if a field has been set. +func (o *TransactionData) HasTransferId() bool { + if o != nil && !common.IsNil(o.TransferId) { + return true + } + + return false +} + +// SetTransferId gets a reference to the given string and assigns it to the TransferId field. +func (o *TransactionData) SetTransferId(v string) { + o.TransferId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionData) 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 *TransactionData) 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 *TransactionData) 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 *TransactionData) SetType(v string) { + o.Type = &v +} + +// GetValueDate returns the ValueDate field value +func (o *TransactionData) GetValueDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ValueDate +} + +// GetValueDateOk returns a tuple with the ValueDate field value +// and a boolean to check if the value has been set. +func (o *TransactionData) GetValueDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ValueDate, true +} + +// SetValueDate sets field value +func (o *TransactionData) SetValueDate(v time.Time) { + o.ValueDate = v +} + +func (o TransactionData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountHolderId"] = o.AccountHolderId + toSerialize["amount"] = o.Amount + toSerialize["balanceAccountId"] = o.BalanceAccountId + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["bookingDate"] = o.BookingDate + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + toSerialize["counterparty"] = o.Counterparty + toSerialize["createdAt"] = o.CreatedAt + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.EventId) { + toSerialize["eventId"] = o.EventId + } + toSerialize["id"] = o.Id + if !common.IsNil(o.InstructedAmount) { + toSerialize["instructedAmount"] = o.InstructedAmount + } + if !common.IsNil(o.PaymentInstrumentId) { + toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId + } + toSerialize["reference"] = o.Reference + if !common.IsNil(o.ReferenceForBeneficiary) { + toSerialize["referenceForBeneficiary"] = o.ReferenceForBeneficiary + } + toSerialize["status"] = o.Status + if !common.IsNil(o.TransferId) { + toSerialize["transferId"] = o.TransferId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + toSerialize["valueDate"] = o.ValueDate + return toSerialize, nil +} + +type NullableTransactionData struct { + value *TransactionData + isSet bool +} + +func (v NullableTransactionData) Get() *TransactionData { + return v.value +} + +func (v *NullableTransactionData) Set(val *TransactionData) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionData(val *TransactionData) *NullableTransactionData { + return &NullableTransactionData{value: val, isSet: true} +} + +func (v NullableTransactionData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransactionData) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "upgrade"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *TransactionData) isValidStatus() bool { + var allowedEnumValues = []string{"booked", "pending"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *TransactionData) isValidType() bool { + var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceMigration", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "cashOutFee", "cashOutFunding", "cashOutInstruction", "chargeback", "chargebackCorrection", "chargebackReversal", "chargebackReversalCorrection", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback", "secondChargebackCorrection"} + 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..eae2a4c82 100644 --- a/src/transfers/model_transaction_search_response.go +++ b/src/transfers/model_transaction_search_response.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &TransactionSearchResponse{} type TransactionSearchResponse struct { Links *Links `json:"_links,omitempty"` // Contains the transactions that match the query parameters. - Data []Transaction `json:"data,omitempty"` + Data []TransactionData `json:"data,omitempty"` } // NewTransactionSearchResponse instantiates a new TransactionSearchResponse object @@ -74,9 +74,9 @@ func (o *TransactionSearchResponse) SetLinks(v Links) { } // GetData returns the Data field value if set, zero value otherwise. -func (o *TransactionSearchResponse) GetData() []Transaction { +func (o *TransactionSearchResponse) GetData() []TransactionData { if o == nil || common.IsNil(o.Data) { - var ret []Transaction + var ret []TransactionData return ret } return o.Data @@ -84,7 +84,7 @@ func (o *TransactionSearchResponse) GetData() []Transaction { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionSearchResponse) GetDataOk() ([]Transaction, bool) { +func (o *TransactionSearchResponse) GetDataOk() ([]TransactionData, bool) { if o == nil || common.IsNil(o.Data) { return nil, false } @@ -100,8 +100,8 @@ func (o *TransactionSearchResponse) HasData() bool { return false } -// SetData gets a reference to the given []Transaction and assigns it to the Data field. -func (o *TransactionSearchResponse) SetData(v []Transaction) { +// SetData gets a reference to the given []TransactionData and assigns it to the Data field. +func (o *TransactionSearchResponse) SetData(v []TransactionData) { o.Data = v } diff --git a/src/transfers/model_transfer.go b/src/transfers/model_transfer.go index ba54ff674..7e49319b7 100644 --- a/src/transfers/model_transfer.go +++ b/src/transfers/model_transfer.go @@ -26,7 +26,7 @@ type Transfer struct { // 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. + // The category 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"` Counterparty CounterpartyV3 `json:"counterparty"` // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. @@ -41,7 +41,7 @@ type Transfer struct { // The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. // Deprecated PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` - // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). This will be removed in v4 and replaced with a new field. Priority *string `json:"priority,omitempty"` // Additional information about the status of the transfer. Reason *string `json:"reason,omitempty"` @@ -712,7 +712,7 @@ func (o *Transfer) isValidPriority() bool { return false } func (o *Transfer) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true @@ -721,7 +721,7 @@ func (o *Transfer) isValidReason() bool { 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", "capturedExternally", "chargeback", "chargebackExternally", "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", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true diff --git a/src/transfers/model_transfer_info.go b/src/transfers/model_transfer_info.go index 583e624ff..dc0c9b07a 100644 --- a/src/transfers/model_transfer_info.go +++ b/src/transfers/model_transfer_info.go @@ -27,8 +27,6 @@ type TransferInfo struct { 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"` - // The ID of the resource. - Id *string `json:"id,omitempty"` // The unique identifier of the source [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments__resParam_id). PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). @@ -196,38 +194,6 @@ func (o *TransferInfo) SetDescription(v string) { o.Description = &v } -// GetId returns the Id field value if set, zero value otherwise. -func (o *TransferInfo) GetId() string { - if o == nil || common.IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferInfo) GetIdOk() (*string, bool) { - if o == nil || common.IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *TransferInfo) HasId() bool { - if o != nil && !common.IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *TransferInfo) SetId(v string) { - o.Id = &v -} - // GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. func (o *TransferInfo) GetPaymentInstrumentId() string { if o == nil || common.IsNil(o.PaymentInstrumentId) { @@ -407,9 +373,6 @@ func (o TransferInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } - if !common.IsNil(o.Id) { - toSerialize["id"] = o.Id - } if !common.IsNil(o.PaymentInstrumentId) { toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId } diff --git a/src/transferwebhook/model_hk_local_account_identification.go b/src/transferwebhook/model_hk_local_account_identification.go index b0c4feca3..a4cb4e646 100644 --- a/src/transferwebhook/model_hk_local_account_identification.go +++ b/src/transferwebhook/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 12-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification 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 NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_merchant_data.go b/src/transferwebhook/model_merchant_data.go index 69d316a2d..6ab1f04a9 100644 --- a/src/transferwebhook/model_merchant_data.go +++ b/src/transferwebhook/model_merchant_data.go @@ -19,6 +19,8 @@ var _ common.MappedNullable = &MerchantData{} // MerchantData struct for MerchantData type MerchantData struct { + // The unique identifier of the merchant's acquirer. + AcquirerId *string `json:"acquirerId,omitempty"` // The merchant category code. Mcc *string `json:"mcc,omitempty"` // The merchant identifier. @@ -45,6 +47,38 @@ func NewMerchantDataWithDefaults() *MerchantData { return &this } +// GetAcquirerId returns the AcquirerId field value if set, zero value otherwise. +func (o *MerchantData) GetAcquirerId() string { + if o == nil || common.IsNil(o.AcquirerId) { + var ret string + return ret + } + return *o.AcquirerId +} + +// GetAcquirerIdOk returns a tuple with the AcquirerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetAcquirerIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerId) { + return nil, false + } + return o.AcquirerId, true +} + +// HasAcquirerId returns a boolean if a field has been set. +func (o *MerchantData) HasAcquirerId() bool { + if o != nil && !common.IsNil(o.AcquirerId) { + return true + } + + return false +} + +// SetAcquirerId gets a reference to the given string and assigns it to the AcquirerId field. +func (o *MerchantData) SetAcquirerId(v string) { + o.AcquirerId = &v +} + // GetMcc returns the Mcc field value if set, zero value otherwise. func (o *MerchantData) GetMcc() string { if o == nil || common.IsNil(o.Mcc) { @@ -183,6 +217,9 @@ func (o MerchantData) MarshalJSON() ([]byte, error) { func (o MerchantData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquirerId) { + toSerialize["acquirerId"] = o.AcquirerId + } if !common.IsNil(o.Mcc) { toSerialize["mcc"] = o.Mcc } diff --git a/src/transferwebhook/model_modification.go b/src/transferwebhook/model_modification.go new file mode 100644 index 000000000..cc5314be9 --- /dev/null +++ b/src/transferwebhook/model_modification.go @@ -0,0 +1,283 @@ +/* +Transfer webhooks + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v7/src/common" +) + +// checks if the Modification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Modification{} + +// Modification struct for Modification +type Modification struct { + // The direction of the money movement. + Direction *string `json:"direction,omitempty"` + // Our reference for the modification. + Id *string `json:"id,omitempty"` + // Your reference for the modification, used internally within your platform. + Reference *string `json:"reference,omitempty"` + // The status of the transfer event. + Status *string `json:"status,omitempty"` + // The type of transfer modification. + Type *string `json:"type,omitempty"` +} + +// NewModification instantiates a new Modification 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 NewModification() *Modification { + this := Modification{} + return &this +} + +// NewModificationWithDefaults instantiates a new Modification 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 NewModificationWithDefaults() *Modification { + this := Modification{} + return &this +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *Modification) GetDirection() string { + if o == nil || common.IsNil(o.Direction) { + var ret string + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetDirectionOk() (*string, bool) { + if o == nil || common.IsNil(o.Direction) { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *Modification) HasDirection() bool { + if o != nil && !common.IsNil(o.Direction) { + return true + } + + return false +} + +// SetDirection gets a reference to the given string and assigns it to the Direction field. +func (o *Modification) SetDirection(v string) { + o.Direction = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Modification) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Modification) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Modification) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *Modification) 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 *Modification) 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 *Modification) 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 *Modification) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Modification) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Modification) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Modification) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Modification) 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 *Modification) 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 *Modification) 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 *Modification) SetType(v string) { + o.Type = &v +} + +func (o Modification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Modification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Direction) { + toSerialize["direction"] = o.Direction + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableModification struct { + value *Modification + isSet bool +} + +func (v NullableModification) Get() *Modification { + return v.value +} + +func (v *NullableModification) Set(val *Modification) { + v.value = val + v.isSet = true +} + +func (v NullableModification) IsSet() bool { + return v.isSet +} + +func (v *NullableModification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModification(val *Modification) *NullableModification { + return &NullableModification{value: val, isSet: true} +} + +func (v NullableModification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *Modification) isValidStatus() bool { + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_nz_local_account_identification.go b/src/transferwebhook/model_nz_local_account_identification.go index 275cea1be..3e6a5b332 100644 --- a/src/transferwebhook/model_nz_local_account_identification.go +++ b/src/transferwebhook/model_nz_local_account_identification.go @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. AccountNumber string `json:"accountNumber"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification 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 NewNZLocalAccountIdentification(accountNumber string, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) GetBankCode() string { - if o == nil { - var ret string - return ret - } - - return o.BankCode -} - -// GetBankCodeOk returns a tuple with the BankCode field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_transfer_data.go b/src/transferwebhook/model_transfer_data.go index 1f52c3bef..7954b6c81 100644 --- a/src/transferwebhook/model_transfer_data.go +++ b/src/transferwebhook/model_transfer_data.go @@ -30,7 +30,7 @@ type TransferData struct { BalancePlatform *string `json:"balancePlatform,omitempty"` // The list of the latest balance statuses in the transfer. Balances []BalanceMutation `json:"balances,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. + // The category 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"` Counterparty *CounterpartyV3 `json:"counterparty,omitempty"` // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. @@ -59,10 +59,10 @@ type TransferData struct { // The payment's merchant reference included in the transfer. // Deprecated PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. + // Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the [Balance Platform Accounting Report](https://docs.adyen.com/marketplaces-and-platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **BalanceAccount**: for the sale amount of the transaction. * **Commission**: for your platform's commission on the transaction. * **PaymentFee**: for the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **VAT**: for the Value Added Tax. // Deprecated PlatformPaymentType *string `json:"platformPaymentType,omitempty"` - // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). This will be removed in v4 and replaced with a new field. Priority *string `json:"priority,omitempty"` // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. // Deprecated @@ -1383,7 +1383,7 @@ func (o *TransferData) isValidPanEntryMode() bool { return false } func (o *TransferData) isValidPlatformPaymentType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "PaymentFee", "VAT"} + var allowedEnumValues = []string{"AcquiringFees", "AdyenCommission", "AdyenFees", "AdyenMarkup", "BalanceAccount", "Commission", "Default", "Interchange", "PaymentFee", "Remainder", "SchemeFee", "TopUp", "VAT"} for _, allowed := range allowedEnumValues { if o.GetPlatformPaymentType() == allowed { return true @@ -1410,7 +1410,7 @@ func (o *TransferData) isValidProcessingType() bool { return false } func (o *TransferData) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true @@ -1419,7 +1419,7 @@ func (o *TransferData) isValidReason() bool { return false } func (o *TransferData) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true @@ -1428,7 +1428,7 @@ func (o *TransferData) isValidStatus() bool { return false } func (o *TransferData) isValidType() bool { - var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "chargeback", "chargebackReversal", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback"} + var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceMigration", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "cashOutFee", "cashOutFunding", "cashOutInstruction", "chargeback", "chargebackCorrection", "chargebackReversal", "chargebackReversalCorrection", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback", "secondChargebackCorrection"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/transferwebhook/model_transfer_event.go b/src/transferwebhook/model_transfer_event.go index 8a8c3f6b9..6bde7b924 100644 --- a/src/transferwebhook/model_transfer_event.go +++ b/src/transferwebhook/model_transfer_event.go @@ -28,17 +28,21 @@ type TransferEvent struct { // The estimated time the beneficiary should have access to the funds. EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` // The unique identifier of the transfer event. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + Modification *Modification `json:"modification,omitempty"` // The list of the balance mutation per event. Mutations []BalanceMutation `json:"mutations,omitempty"` OriginalAmount *Amount `json:"originalAmount,omitempty"` // The reason for the transfer status. Reason *string `json:"reason,omitempty"` + // SchemeTraceID retrieved from scheme. + SchemeTraceID *string `json:"schemeTraceID,omitempty"` + // SchemeUniqueTransactionID retrieved from scheme. + SchemeUniqueTransactionID *string `json:"schemeUniqueTransactionID,omitempty"` // The status of the transfer event. Status *string `json:"status,omitempty"` // The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. - TransactionId *string `json:"transactionId,omitempty"` - TransferOperation *TransferOperation `json:"transferOperation,omitempty"` + TransactionId *string `json:"transactionId,omitempty"` // The type of the transfer event. Possible values: **accounting**, **tracking**. Type *string `json:"type,omitempty"` // The date when the tracking status was updated. @@ -224,6 +228,38 @@ func (o *TransferEvent) SetId(v string) { o.Id = &v } +// GetModification returns the Modification field value if set, zero value otherwise. +func (o *TransferEvent) GetModification() Modification { + if o == nil || common.IsNil(o.Modification) { + var ret Modification + return ret + } + return *o.Modification +} + +// GetModificationOk returns a tuple with the Modification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetModificationOk() (*Modification, bool) { + if o == nil || common.IsNil(o.Modification) { + return nil, false + } + return o.Modification, true +} + +// HasModification returns a boolean if a field has been set. +func (o *TransferEvent) HasModification() bool { + if o != nil && !common.IsNil(o.Modification) { + return true + } + + return false +} + +// SetModification gets a reference to the given Modification and assigns it to the Modification field. +func (o *TransferEvent) SetModification(v Modification) { + o.Modification = &v +} + // GetMutations returns the Mutations field value if set, zero value otherwise. func (o *TransferEvent) GetMutations() []BalanceMutation { if o == nil || common.IsNil(o.Mutations) { @@ -320,6 +356,70 @@ func (o *TransferEvent) SetReason(v string) { o.Reason = &v } +// GetSchemeTraceID returns the SchemeTraceID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeTraceID() string { + if o == nil || common.IsNil(o.SchemeTraceID) { + var ret string + return ret + } + return *o.SchemeTraceID +} + +// GetSchemeTraceIDOk returns a tuple with the SchemeTraceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeTraceIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeTraceID) { + return nil, false + } + return o.SchemeTraceID, true +} + +// HasSchemeTraceID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeTraceID() bool { + if o != nil && !common.IsNil(o.SchemeTraceID) { + return true + } + + return false +} + +// SetSchemeTraceID gets a reference to the given string and assigns it to the SchemeTraceID field. +func (o *TransferEvent) SetSchemeTraceID(v string) { + o.SchemeTraceID = &v +} + +// GetSchemeUniqueTransactionID returns the SchemeUniqueTransactionID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeUniqueTransactionID() string { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + var ret string + return ret + } + return *o.SchemeUniqueTransactionID +} + +// GetSchemeUniqueTransactionIDOk returns a tuple with the SchemeUniqueTransactionID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeUniqueTransactionIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + return nil, false + } + return o.SchemeUniqueTransactionID, true +} + +// HasSchemeUniqueTransactionID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeUniqueTransactionID() bool { + if o != nil && !common.IsNil(o.SchemeUniqueTransactionID) { + return true + } + + return false +} + +// SetSchemeUniqueTransactionID gets a reference to the given string and assigns it to the SchemeUniqueTransactionID field. +func (o *TransferEvent) SetSchemeUniqueTransactionID(v string) { + o.SchemeUniqueTransactionID = &v +} + // GetStatus returns the Status field value if set, zero value otherwise. func (o *TransferEvent) GetStatus() string { if o == nil || common.IsNil(o.Status) { @@ -384,38 +484,6 @@ func (o *TransferEvent) SetTransactionId(v string) { o.TransactionId = &v } -// GetTransferOperation returns the TransferOperation field value if set, zero value otherwise. -func (o *TransferEvent) GetTransferOperation() TransferOperation { - if o == nil || common.IsNil(o.TransferOperation) { - var ret TransferOperation - return ret - } - return *o.TransferOperation -} - -// GetTransferOperationOk returns a tuple with the TransferOperation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferEvent) GetTransferOperationOk() (*TransferOperation, bool) { - if o == nil || common.IsNil(o.TransferOperation) { - return nil, false - } - return o.TransferOperation, true -} - -// HasTransferOperation returns a boolean if a field has been set. -func (o *TransferEvent) HasTransferOperation() bool { - if o != nil && !common.IsNil(o.TransferOperation) { - return true - } - - return false -} - -// SetTransferOperation gets a reference to the given TransferOperation and assigns it to the TransferOperation field. -func (o *TransferEvent) SetTransferOperation(v TransferOperation) { - o.TransferOperation = &v -} - // GetType returns the Type field value if set, zero value otherwise. func (o *TransferEvent) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -537,6 +605,9 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Id) { toSerialize["id"] = o.Id } + if !common.IsNil(o.Modification) { + toSerialize["modification"] = o.Modification + } if !common.IsNil(o.Mutations) { toSerialize["mutations"] = o.Mutations } @@ -546,15 +617,18 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Reason) { toSerialize["reason"] = o.Reason } + if !common.IsNil(o.SchemeTraceID) { + toSerialize["schemeTraceID"] = o.SchemeTraceID + } + if !common.IsNil(o.SchemeUniqueTransactionID) { + toSerialize["schemeUniqueTransactionID"] = o.SchemeUniqueTransactionID + } if !common.IsNil(o.Status) { toSerialize["status"] = o.Status } if !common.IsNil(o.TransactionId) { toSerialize["transactionId"] = o.TransactionId } - if !common.IsNil(o.TransferOperation) { - toSerialize["transferOperation"] = o.TransferOperation - } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } @@ -604,7 +678,7 @@ func (v *NullableTransferEvent) UnmarshalJSON(src []byte) error { } func (o *TransferEvent) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true @@ -613,7 +687,7 @@ func (o *TransferEvent) isValidReason() bool { return false } func (o *TransferEvent) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "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", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true