diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index 9b01a4ef3..bee71f188 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -118,12 +118,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 } @@ -158,7 +158,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..01aea735d --- /dev/null +++ b/src/balanceplatform/api_transfer_routes.go @@ -0,0 +1,107 @@ +/* +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, + ) + + 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_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_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_create_sweep_configuration_v2.go b/src/balanceplatform/model_create_sweep_configuration_v2.go new file mode 100644 index 000000000..94a1349a4 --- /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", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *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_hk_local_account_identification.go b/src/balanceplatform/model_hk_local_account_identification.go index 511889b98..3c1b16da1 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 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/balanceplatform/model_payment_instrument_requirement.go b/src/balanceplatform/model_payment_instrument_requirement.go new file mode 100644 index 000000000..c1bb9153d --- /dev/null +++ b/src/balanceplatform/model_payment_instrument_requirement.go @@ -0,0 +1,248 @@ +/* +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"` + // 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 +} + +// 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.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_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_transfer_route.go b/src/balanceplatform/model_transfer_route.go new file mode 100644 index 000000000..f931b4507 --- /dev/null +++ b/src/balanceplatform/model_transfer_route.go @@ -0,0 +1,328 @@ +/* +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 unique identifier assigned to the balance platform associated with the account holder. + BalancePlatform *string `json:"balancePlatform,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. + 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 +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *TransferRoute) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *TransferRoute) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *TransferRoute) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// 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.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + 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"} + 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/checkout/api_modifications.go b/src/checkout/api_modifications.go index a5f48aa97..8b4887761 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, @@ -85,9 +85,9 @@ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r Modifi // 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 +96,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 +125,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 +139,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, @@ -152,9 +152,9 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Con // 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 +163,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 +192,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 +206,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, @@ -219,9 +219,9 @@ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r Modif // 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 +230,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 +261,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 +275,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, @@ -288,9 +288,9 @@ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r Modifica // 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 +299,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 +327,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 +341,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, @@ -354,9 +354,9 @@ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r Modifica // 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 +365,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 +394,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 +408,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, diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index 2ab5367c0..744c24c2d 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, @@ -78,8 +78,8 @@ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput // 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 +88,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 +109,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 +122,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, @@ -135,8 +135,8 @@ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBala // 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 +145,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 +166,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 +179,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, diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index b9e0f4cb4..b132ae2db 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -67,8 +67,8 @@ func (a *PaymentLinksApi) GetPaymentLink(ctx context.Context, r PaymentLinksApiG // 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 +77,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 +113,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, diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index df2cc88c3..aeb12f936 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" ) @@ -83,7 +84,7 @@ func (a *PaymentsApi) CardDetails(ctx context.Context, r PaymentsApiCardDetailsI // 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 +93,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 +116,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 +129,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, @@ -139,6 +140,61 @@ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput 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, + ) + + return *res, httpRes, err +} + // All parameters accepted by PaymentsApi.PaymentMethods type PaymentsApiPaymentMethodsInput struct { idempotencyKey *string @@ -260,8 +316,8 @@ func (a *PaymentsApi) Payments(ctx context.Context, r PaymentsApiPaymentsInput) // 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 +326,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 +362,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, diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index 2245a3e74..0e9f5f472 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,7 @@ func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r headerParams, ) - return *res, httpRes, err + return httpRes, err } // All parameters accepted by RecurringApi.GetTokensForStoredPaymentDetails diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index d27ea8962..7eccf6a5f 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, @@ -80,8 +80,8 @@ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetAppl // 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 +90,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 +114,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 +129,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, 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_card_details.go b/src/checkout/model_card_details.go index b957636a5..15b5ca1cb 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{"bcmc", "scheme", "networkToken", "giftcard", "alliancedata", "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..e79552b91 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -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"` @@ -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..88c12cbac 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -39,8 +39,8 @@ 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"` @@ -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"` @@ -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 } @@ -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_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index 036a8e4e0..5f18e3df9 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -75,7 +75,7 @@ type DonationPaymentRequest struct { 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. 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..bb1e2d22e 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", "poli", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true 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..1d10b3fff 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -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 *Address `json:"deliveryAddress,omitempty"` + // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + // 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 DonationPaymentRequestPaymentMethod `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 DonationPaymentRequestPaymentMethod, reference string, returnUrl string) *PaymentRequest { this := PaymentRequest{} this.Amount = amount this.MerchantAccount = merchantAccount @@ -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,6 +670,38 @@ 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 { if o == nil || common.IsNil(o.DeliveryAddress) { @@ -698,6 +735,7 @@ func (o *PaymentRequest) SetDeliveryAddress(v Address) { } // 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() DonationPaymentRequestPaymentMethod { if o == nil { - var ret CheckoutPaymentMethod + var ret DonationPaymentRequestPaymentMethod 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() (*DonationPaymentRequestPaymentMethod, 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 DonationPaymentRequestPaymentMethod) { 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_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_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/checkout/model_three_ds_request_data.go b/src/checkout/model_three_ds_request_data.go index f4c66e239..948b26068 100644 --- a/src/checkout/model_three_ds_request_data.go +++ b/src/checkout/model_three_ds_request_data.go @@ -263,7 +263,7 @@ func (o *ThreeDSRequestData) isValidNativeThreeDS() bool { return false } func (o *ThreeDSRequestData) isValidThreeDSVersion() bool { - var allowedEnumValues = []string{"2.1.0", "2.2.0"} + var allowedEnumValues = []string{"V_2_1_0", "V_2_2_0"} for _, allowed := range allowedEnumValues { if o.GetThreeDSVersion() == 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/legalentity/api_documents.go b/src/legalentity/api_documents.go index aeaf86ff0..63e491dfe 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -112,8 +112,15 @@ func (a *DocumentsApi) GetDocument(ctx context.Context, r DocumentsApiGetDocumen // 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 +144,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 +156,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, @@ -196,6 +208,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 diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index b19f07809..d228b8f98 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -220,8 +220,15 @@ func (a *LegalEntitiesApi) GetLegalEntity(ctx context.Context, r LegalEntitiesAp // 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 +264,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, diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index 314372646..8117140a4 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 { diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index 8b9737f89..de4574541 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 { @@ -87,7 +87,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 { @@ -132,7 +132,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 { @@ -177,7 +177,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 { diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index 794dabd38..1ebd14e4a 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -173,8 +173,15 @@ func (a *TransferInstrumentsApi) GetTransferInstrument(ctx context.Context, r Tr // 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 +215,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, 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_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_get_terms_of_service_document_request.go b/src/legalentity/model_get_terms_of_service_document_request.go index b8b8dd28c..0b9dfa308 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -20,17 +20,19 @@ 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"` + 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_hk_local_account_identification.go b/src/legalentity/model_hk_local_account_identification.go index da6196a1f..8da37c142 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 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/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index b77ccc581..e8acba550 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{"proofOfNationalIdNumber"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true 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/management/api_account_merchant_level.go b/src/management/api_account_merchant_level.go index f8c54df88..684b8fe8c 100644 --- a/src/management/api_account_merchant_level.go +++ b/src/management/api_account_merchant_level.go @@ -348,7 +348,7 @@ RequestToActivateMerchantAccount Request to activate a merchant account Sends a request to activate the merchant account identified in the path. -You get the result of the activation asychronously through a [`merchant.updated`](https://docs.adyen.com/api-explorer/ManagementNotification/latest/post/merchant.updated) webhook. Once the merchant account is activated, you can start using it to accept payments and payouts. +You get the result of the activation asynchronously through a [`merchant.updated`](https://docs.adyen.com/api-explorer/ManagementNotification/latest/post/merchant.updated) webhook. Once the merchant account is activated, you can start using it to accept payments and payouts. Use this endpoint if your integration requires it, such as Adyen for Platforms Manage. Your Adyen contact will set up your access. 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..7da4aaba4 --- /dev/null +++ b/src/management/api_android_files_company_level.go @@ -0,0 +1,391 @@ +/* +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, + ) + + 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, + ) + + 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, + ) + + 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 ebb4949a9..0be46c806 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -120,270 +120,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, - ) - - 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, - ) - - 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_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_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_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_setup_info.go b/src/management/model_payment_method_setup_info.go index 9f9d3e443..12c98edfc 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,8 +57,9 @@ 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,omitempty"` + Vipps *VippsInfo `json:"vipps,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewPaymentMethodSetupInfo instantiates a new PaymentMethodSetupInfo object @@ -292,6 +303,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 +399,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 +527,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 +591,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 +719,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) { @@ -772,6 +1103,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 +1166,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 } @@ -848,6 +1241,9 @@ func (o PaymentMethodSetupInfo) 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_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_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/payments/api_payments.go b/src/payments/api_payments.go new file mode 100644 index 000000000..42e07a097 --- /dev/null +++ b/src/payments/api_payments.go @@ -0,0 +1,260 @@ +/* +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, + ) + + 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, + ) + + 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, + ) + + 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, + ) + + 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, + ) + + 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 } }