From f262b75b89d7f84aaafe1b984d883bdb9e19ccf4 Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Thu, 21 Dec 2023 14:05:44 +0000 Subject: [PATCH] [create-pull-request] automated change --- src/balanceplatform/client.go | 12 +- src/checkout/api_donations.go | 79 ++++ src/checkout/api_payments.go | 59 --- src/checkout/client.go | 15 +- .../model_create_checkout_session_request.go | 37 ++ .../model_create_checkout_session_response.go | 37 ++ src/legalentity/client.go | 12 +- src/management/client.go | 12 +- src/payments/client.go | 12 +- src/payout/client.go | 12 +- src/transfers/api_transactions.go | 2 +- src/transfers/api_transfers.go | 12 +- src/transfers/client.go | 12 +- src/transfers/model_issued_card.go | 111 ++++++ src/transfers/model_rest_service_error.go | 5 +- .../model_return_transfer_response.go | 2 +- src/transferwebhook/model_issued_card.go | 111 ++++++ src/transferwebhook/model_transfer_data.go | 16 +- src/transferwebhook/model_transfer_event.go | 74 ---- ...del_transfer_notification_counter_party.go | 234 ++++++++++++ ...del_transfer_notification_merchant_data.go | 347 ++++++++++++++++++ 21 files changed, 1019 insertions(+), 194 deletions(-) create mode 100644 src/checkout/api_donations.go create mode 100644 src/transferwebhook/model_transfer_notification_counter_party.go create mode 100644 src/transferwebhook/model_transfer_notification_merchant_data.go diff --git a/src/balanceplatform/client.go b/src/balanceplatform/client.go index f0d257f6c..8785e817d 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -9,7 +9,7 @@ API version: 2 package balanceplatform import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Configuration API API v2 @@ -45,10 +45,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.BalancePlatformEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.BalancePlatformEndpoint + } // API Services c.AccountHoldersApi = (*AccountHoldersApi)(&c.common) @@ -64,4 +64,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransferRoutesApi = (*TransferRoutesApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/checkout/api_donations.go b/src/checkout/api_donations.go new file mode 100644 index 000000000..368f248c8 --- /dev/null +++ b/src/checkout/api_donations.go @@ -0,0 +1,79 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "context" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// DonationsApi service +type DonationsApi common.Service + +// All parameters accepted by DonationsApi.Donations +type DonationsApiDonationsInput struct { + idempotencyKey *string + donationPaymentRequest *DonationPaymentRequest +} + +// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). +func (r DonationsApiDonationsInput) IdempotencyKey(idempotencyKey string) DonationsApiDonationsInput { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r DonationsApiDonationsInput) DonationPaymentRequest(donationPaymentRequest DonationPaymentRequest) DonationsApiDonationsInput { + r.donationPaymentRequest = &donationPaymentRequest + return r +} + +/* +Prepare a request for Donations + +@return DonationsApiDonationsInput +*/ +func (a *DonationsApi) DonationsInput() DonationsApiDonationsInput { + return DonationsApiDonationsInput{} +} + +/* +Donations Start a transaction for donations + +Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. + +For more information, see [Donations](https://docs.adyen.com/online-payments/donations). + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r DonationsApiDonationsInput - Request parameters, see DonationsInput +@return DonationPaymentResponse, *http.Response, error +*/ +func (a *DonationsApi) Donations(ctx context.Context, r DonationsApiDonationsInput) (DonationPaymentResponse, *http.Response, error) { + res := &DonationPaymentResponse{} + path := "/donations" + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.donationPaymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index 52a0ece58..27162910a 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -81,65 +81,6 @@ func (a *PaymentsApi) CardDetails(ctx context.Context, r PaymentsApiCardDetailsI return *res, httpRes, err } -// All parameters accepted by PaymentsApi.Donations -type PaymentsApiDonationsInput struct { - idempotencyKey *string - donationPaymentRequest *DonationPaymentRequest -} - -// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). -func (r PaymentsApiDonationsInput) IdempotencyKey(idempotencyKey string) PaymentsApiDonationsInput { - r.idempotencyKey = &idempotencyKey - return r -} - -func (r PaymentsApiDonationsInput) DonationPaymentRequest(donationPaymentRequest DonationPaymentRequest) PaymentsApiDonationsInput { - r.donationPaymentRequest = &donationPaymentRequest - return r -} - -/* -Prepare a request for Donations - -@return PaymentsApiDonationsInput -*/ -func (a *PaymentsApi) DonationsInput() PaymentsApiDonationsInput { - return PaymentsApiDonationsInput{} -} - -/* -Donations Start a transaction for donations - -Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. - -For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - -@param 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 DonationPaymentResponse, *http.Response, error -*/ -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) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.donationPaymentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err -} - // All parameters accepted by PaymentsApi.GetResultOfPaymentSession type PaymentsApiGetResultOfPaymentSessionInput struct { sessionId string diff --git a/src/checkout/client.go b/src/checkout/client.go index be8a39edc..9881a6440 100644 --- a/src/checkout/client.go +++ b/src/checkout/client.go @@ -9,7 +9,7 @@ API version: 71 package checkout import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Checkout API API v71 @@ -21,6 +21,8 @@ type APIClient struct { ClassicCheckoutSDKApi *ClassicCheckoutSDKApi + DonationsApi *DonationsApi + ModificationsApi *ModificationsApi OrdersApi *OrdersApi @@ -37,13 +39,14 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.CheckoutEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.CheckoutEndpoint + } // API Services c.ClassicCheckoutSDKApi = (*ClassicCheckoutSDKApi)(&c.common) + c.DonationsApi = (*DonationsApi)(&c.common) c.ModificationsApi = (*ModificationsApi)(&c.common) c.OrdersApi = (*OrdersApi)(&c.common) c.PaymentLinksApi = (*PaymentLinksApi)(&c.common) @@ -52,4 +55,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.UtilityApi = (*UtilityApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index e1319c093..0fe52ca6a 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -101,6 +101,8 @@ type CreateCheckoutSessionRequest struct { ShopperStatement *string `json:"shopperStatement,omitempty"` // Set to true to show the payment amount per installment. ShowInstallmentAmount *bool `json:"showInstallmentAmount,omitempty"` + // Set to **true** to show a button that lets the shopper remove a stored payment method. + ShowRemovePaymentMethodButton *bool `json:"showRemovePaymentMethodButton,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. @@ -1661,6 +1663,38 @@ func (o *CreateCheckoutSessionRequest) SetShowInstallmentAmount(v bool) { o.ShowInstallmentAmount = &v } +// GetShowRemovePaymentMethodButton returns the ShowRemovePaymentMethodButton field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetShowRemovePaymentMethodButton() bool { + if o == nil || common.IsNil(o.ShowRemovePaymentMethodButton) { + var ret bool + return ret + } + return *o.ShowRemovePaymentMethodButton +} + +// GetShowRemovePaymentMethodButtonOk returns a tuple with the ShowRemovePaymentMethodButton field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetShowRemovePaymentMethodButtonOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowRemovePaymentMethodButton) { + return nil, false + } + return o.ShowRemovePaymentMethodButton, true +} + +// HasShowRemovePaymentMethodButton returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasShowRemovePaymentMethodButton() bool { + if o != nil && !common.IsNil(o.ShowRemovePaymentMethodButton) { + return true + } + + return false +} + +// SetShowRemovePaymentMethodButton gets a reference to the given bool and assigns it to the ShowRemovePaymentMethodButton field. +func (o *CreateCheckoutSessionRequest) SetShowRemovePaymentMethodButton(v bool) { + o.ShowRemovePaymentMethodButton = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2130,6 +2164,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShowInstallmentAmount) { toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount } + if !common.IsNil(o.ShowRemovePaymentMethodButton) { + toSerialize["showRemovePaymentMethodButton"] = o.ShowRemovePaymentMethodButton + } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index a3c40a2f2..946e945b5 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -105,6 +105,8 @@ type CreateCheckoutSessionResponse struct { ShopperStatement *string `json:"shopperStatement,omitempty"` // Set to true to show the payment amount per installment. ShowInstallmentAmount *bool `json:"showInstallmentAmount,omitempty"` + // Set to **true** to show a button that lets the shopper remove a stored payment method. + ShowRemovePaymentMethodButton *bool `json:"showRemovePaymentMethodButton,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. @@ -1717,6 +1719,38 @@ func (o *CreateCheckoutSessionResponse) SetShowInstallmentAmount(v bool) { o.ShowInstallmentAmount = &v } +// GetShowRemovePaymentMethodButton returns the ShowRemovePaymentMethodButton field value if set, zero value otherwise. +func (o *CreateCheckoutSessionResponse) GetShowRemovePaymentMethodButton() bool { + if o == nil || common.IsNil(o.ShowRemovePaymentMethodButton) { + var ret bool + return ret + } + return *o.ShowRemovePaymentMethodButton +} + +// GetShowRemovePaymentMethodButtonOk returns a tuple with the ShowRemovePaymentMethodButton field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionResponse) GetShowRemovePaymentMethodButtonOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowRemovePaymentMethodButton) { + return nil, false + } + return o.ShowRemovePaymentMethodButton, true +} + +// HasShowRemovePaymentMethodButton returns a boolean if a field has been set. +func (o *CreateCheckoutSessionResponse) HasShowRemovePaymentMethodButton() bool { + if o != nil && !common.IsNil(o.ShowRemovePaymentMethodButton) { + return true + } + + return false +} + +// SetShowRemovePaymentMethodButton gets a reference to the given bool and assigns it to the ShowRemovePaymentMethodButton field. +func (o *CreateCheckoutSessionResponse) SetShowRemovePaymentMethodButton(v bool) { + o.ShowRemovePaymentMethodButton = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionResponse) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2220,6 +2254,9 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShowInstallmentAmount) { toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount } + if !common.IsNil(o.ShowRemovePaymentMethodButton) { + toSerialize["showRemovePaymentMethodButton"] = o.ShowRemovePaymentMethodButton + } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } diff --git a/src/legalentity/client.go b/src/legalentity/client.go index 459ddcd2d..7a6da1508 100644 --- a/src/legalentity/client.go +++ b/src/legalentity/client.go @@ -9,7 +9,7 @@ API version: 3 package legalentity import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Legal Entity Management API API v3 @@ -37,10 +37,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.LegalEntityEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.LegalEntityEndpoint + } // API Services c.BusinessLinesApi = (*BusinessLinesApi)(&c.common) @@ -52,4 +52,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransferInstrumentsApi = (*TransferInstrumentsApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/management/client.go b/src/management/client.go index f2b026505..adfd87beb 100644 --- a/src/management/client.go +++ b/src/management/client.go @@ -9,7 +9,7 @@ API version: 3 package management import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Management API API v3 @@ -81,10 +81,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.ManagementEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.ManagementEndpoint + } // API Services c.APICredentialsCompanyLevelApi = (*APICredentialsCompanyLevelApi)(&c.common) @@ -118,4 +118,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.WebhooksMerchantLevelApi = (*WebhooksMerchantLevelApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/payments/client.go b/src/payments/client.go index a50371720..4c5b549cf 100644 --- a/src/payments/client.go +++ b/src/payments/client.go @@ -9,7 +9,7 @@ API version: 68 package payments import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Payment API API v68 @@ -27,14 +27,14 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.Endpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.Endpoint + } // API Services c.ModificationsApi = (*ModificationsApi)(&c.common) c.PaymentsApi = (*PaymentsApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/payout/client.go b/src/payout/client.go index 6935c66e0..8e5c147a2 100644 --- a/src/payout/client.go +++ b/src/payout/client.go @@ -9,7 +9,7 @@ API version: 68 package payout import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Payout API API v68 @@ -29,10 +29,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.Endpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.Endpoint + } // API Services c.InitializationApi = (*InitializationApi)(&c.common) @@ -40,4 +40,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.ReviewingApi = (*ReviewingApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go index 8cc6ad2a2..4d316c3e3 100644 --- a/src/transfers/api_transactions.go +++ b/src/transfers/api_transactions.go @@ -200,7 +200,7 @@ type TransactionsApiGetTransactionInput struct { /* Prepare a request for GetTransaction -@param id Unique identifier of the transaction. +@param id The unique identifier of the transaction. @return TransactionsApiGetTransactionInput */ func (a *TransactionsApi) GetTransactionInput(id string) TransactionsApiGetTransactionInput { diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go index 5a10065c4..d939399bb 100644 --- a/src/transfers/api_transfers.go +++ b/src/transfers/api_transfers.go @@ -24,7 +24,7 @@ type TransfersApi common.Service // All parameters accepted by TransfersApi.ReturnTransfer type TransfersApiReturnTransferInput struct { - id string + transferId string returnTransferRequest *ReturnTransferRequest } @@ -35,12 +35,12 @@ func (r TransfersApiReturnTransferInput) ReturnTransferRequest(returnTransferReq /* Prepare a request for ReturnTransfer -@param id The unique identifier of the transfer to be returned. +@param transferId The unique identifier of the transfer to be returned. @return TransfersApiReturnTransferInput */ -func (a *TransfersApi) ReturnTransferInput(id string) TransfersApiReturnTransferInput { +func (a *TransfersApi) ReturnTransferInput(transferId string) TransfersApiReturnTransferInput { return TransfersApiReturnTransferInput{ - id: id, + transferId: transferId, } } @@ -55,8 +55,8 @@ Returns previously transferred funds without creating a new `transferId`. */ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnTransferInput) (ReturnTransferResponse, *http.Response, error) { res := &ReturnTransferResponse{} - path := "/transfers/{id}/returns" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + path := "/transfers/{transferId}/returns" + path = strings.Replace(path, "{"+"transferId"+"}", url.PathEscape(common.ParameterValueToString(r.transferId, "transferId")), -1) queryParams := url.Values{} headerParams := make(map[string]string) httpRes, err := common.SendAPIRequest( diff --git a/src/transfers/client.go b/src/transfers/client.go index edfeb7681..f56efa84b 100644 --- a/src/transfers/client.go +++ b/src/transfers/client.go @@ -9,7 +9,7 @@ API version: 4 package transfers import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Transfers API API v4 @@ -29,10 +29,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.TransfersEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.TransfersEndpoint + } // API Services c.CapitalApi = (*CapitalApi)(&c.common) @@ -40,4 +40,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransfersApi = (*TransfersApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/transfers/model_issued_card.go b/src/transfers/model_issued_card.go index 9037fdc3c..2ee218386 100644 --- a/src/transfers/model_issued_card.go +++ b/src/transfers/model_issued_card.go @@ -19,11 +19,17 @@ var _ common.MappedNullable = &IssuedCard{} // IssuedCard struct for IssuedCard type IssuedCard struct { + // The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + AuthorisationType *string `json:"authorisationType,omitempty"` // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. PanEntryMode *string `json:"panEntryMode,omitempty"` // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. ProcessingType *string `json:"processingType,omitempty"` RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` + // The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + SchemeTraceId *string `json:"schemeTraceId,omitempty"` + // The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + SchemeUniqueTransactionId *string `json:"schemeUniqueTransactionId,omitempty"` // **issuedCard** Type *string `json:"type,omitempty"` // The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. @@ -51,6 +57,38 @@ func NewIssuedCardWithDefaults() *IssuedCard { return &this } +// GetAuthorisationType returns the AuthorisationType field value if set, zero value otherwise. +func (o *IssuedCard) GetAuthorisationType() string { + if o == nil || common.IsNil(o.AuthorisationType) { + var ret string + return ret + } + return *o.AuthorisationType +} + +// GetAuthorisationTypeOk returns a tuple with the AuthorisationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetAuthorisationTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AuthorisationType) { + return nil, false + } + return o.AuthorisationType, true +} + +// HasAuthorisationType returns a boolean if a field has been set. +func (o *IssuedCard) HasAuthorisationType() bool { + if o != nil && !common.IsNil(o.AuthorisationType) { + return true + } + + return false +} + +// SetAuthorisationType gets a reference to the given string and assigns it to the AuthorisationType field. +func (o *IssuedCard) SetAuthorisationType(v string) { + o.AuthorisationType = &v +} + // GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. func (o *IssuedCard) GetPanEntryMode() string { if o == nil || common.IsNil(o.PanEntryMode) { @@ -147,6 +185,70 @@ func (o *IssuedCard) SetRelayedAuthorisationData(v RelayedAuthorisationData) { o.RelayedAuthorisationData = &v } +// GetSchemeTraceId returns the SchemeTraceId field value if set, zero value otherwise. +func (o *IssuedCard) GetSchemeTraceId() string { + if o == nil || common.IsNil(o.SchemeTraceId) { + var ret string + return ret + } + return *o.SchemeTraceId +} + +// GetSchemeTraceIdOk returns a tuple with the SchemeTraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetSchemeTraceIdOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeTraceId) { + return nil, false + } + return o.SchemeTraceId, true +} + +// HasSchemeTraceId returns a boolean if a field has been set. +func (o *IssuedCard) HasSchemeTraceId() bool { + if o != nil && !common.IsNil(o.SchemeTraceId) { + return true + } + + return false +} + +// SetSchemeTraceId gets a reference to the given string and assigns it to the SchemeTraceId field. +func (o *IssuedCard) SetSchemeTraceId(v string) { + o.SchemeTraceId = &v +} + +// GetSchemeUniqueTransactionId returns the SchemeUniqueTransactionId field value if set, zero value otherwise. +func (o *IssuedCard) GetSchemeUniqueTransactionId() string { + if o == nil || common.IsNil(o.SchemeUniqueTransactionId) { + var ret string + return ret + } + return *o.SchemeUniqueTransactionId +} + +// GetSchemeUniqueTransactionIdOk returns a tuple with the SchemeUniqueTransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetSchemeUniqueTransactionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeUniqueTransactionId) { + return nil, false + } + return o.SchemeUniqueTransactionId, true +} + +// HasSchemeUniqueTransactionId returns a boolean if a field has been set. +func (o *IssuedCard) HasSchemeUniqueTransactionId() bool { + if o != nil && !common.IsNil(o.SchemeUniqueTransactionId) { + return true + } + + return false +} + +// SetSchemeUniqueTransactionId gets a reference to the given string and assigns it to the SchemeUniqueTransactionId field. +func (o *IssuedCard) SetSchemeUniqueTransactionId(v string) { + o.SchemeUniqueTransactionId = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *IssuedCard) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -221,6 +323,9 @@ func (o IssuedCard) MarshalJSON() ([]byte, error) { func (o IssuedCard) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AuthorisationType) { + toSerialize["authorisationType"] = o.AuthorisationType + } if !common.IsNil(o.PanEntryMode) { toSerialize["panEntryMode"] = o.PanEntryMode } @@ -230,6 +335,12 @@ func (o IssuedCard) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RelayedAuthorisationData) { toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData } + if !common.IsNil(o.SchemeTraceId) { + toSerialize["schemeTraceId"] = o.SchemeTraceId + } + if !common.IsNil(o.SchemeUniqueTransactionId) { + toSerialize["schemeUniqueTransactionId"] = o.SchemeUniqueTransactionId + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/transfers/model_rest_service_error.go b/src/transfers/model_rest_service_error.go index 0e636d74d..07f3c7f14 100644 --- a/src/transfers/model_rest_service_error.go +++ b/src/transfers/model_rest_service_error.go @@ -28,9 +28,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidField `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - // JSON response payload. - Response map[string]interface{} `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response map[string]interface{} `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. diff --git a/src/transfers/model_return_transfer_response.go b/src/transfers/model_return_transfer_response.go index 7de4c37bf..8f923d269 100644 --- a/src/transfers/model_return_transfer_response.go +++ b/src/transfers/model_return_transfer_response.go @@ -23,7 +23,7 @@ type ReturnTransferResponse struct { Id *string `json:"id,omitempty"` // Your internal reference for the return. Reference *string `json:"reference,omitempty"` - // The resulting status of the return. For example: **authorised**, **booked**, **error**. + // The resulting status of the return. Possible values: **Authorised**, **Declined**. Status *string `json:"status,omitempty"` // The unique identifier of the original transfer. TransferId *string `json:"transferId,omitempty"` diff --git a/src/transferwebhook/model_issued_card.go b/src/transferwebhook/model_issued_card.go index 54eb8095e..c25ac46c6 100644 --- a/src/transferwebhook/model_issued_card.go +++ b/src/transferwebhook/model_issued_card.go @@ -19,11 +19,17 @@ var _ common.MappedNullable = &IssuedCard{} // IssuedCard struct for IssuedCard type IssuedCard struct { + // The authorisation type. For example, **defaultAuthorisation**, **preAuthorisation**, **finalAuthorisation** + AuthorisationType *string `json:"authorisationType,omitempty"` // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. PanEntryMode *string `json:"panEntryMode,omitempty"` // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. ProcessingType *string `json:"processingType,omitempty"` RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` + // The identifier of the original payment provided by the scheme. The Id could be alphanumeric or numeric depending on the scheme. The schemeTraceID should be referring to an original schemeUniqueTransactionID provided in an earlier payment (not necessarily processed by Adyen). Instances of available schemeTraceId is authAdjustment or recurring payments. + SchemeTraceId *string `json:"schemeTraceId,omitempty"` + // The unique identifier created by the scheme. The ID could be alphanumeric or numeric depending on the scheme. + SchemeUniqueTransactionId *string `json:"schemeUniqueTransactionId,omitempty"` // **issuedCard** Type *string `json:"type,omitempty"` // The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. @@ -51,6 +57,38 @@ func NewIssuedCardWithDefaults() *IssuedCard { return &this } +// GetAuthorisationType returns the AuthorisationType field value if set, zero value otherwise. +func (o *IssuedCard) GetAuthorisationType() string { + if o == nil || common.IsNil(o.AuthorisationType) { + var ret string + return ret + } + return *o.AuthorisationType +} + +// GetAuthorisationTypeOk returns a tuple with the AuthorisationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetAuthorisationTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AuthorisationType) { + return nil, false + } + return o.AuthorisationType, true +} + +// HasAuthorisationType returns a boolean if a field has been set. +func (o *IssuedCard) HasAuthorisationType() bool { + if o != nil && !common.IsNil(o.AuthorisationType) { + return true + } + + return false +} + +// SetAuthorisationType gets a reference to the given string and assigns it to the AuthorisationType field. +func (o *IssuedCard) SetAuthorisationType(v string) { + o.AuthorisationType = &v +} + // GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. func (o *IssuedCard) GetPanEntryMode() string { if o == nil || common.IsNil(o.PanEntryMode) { @@ -147,6 +185,70 @@ func (o *IssuedCard) SetRelayedAuthorisationData(v RelayedAuthorisationData) { o.RelayedAuthorisationData = &v } +// GetSchemeTraceId returns the SchemeTraceId field value if set, zero value otherwise. +func (o *IssuedCard) GetSchemeTraceId() string { + if o == nil || common.IsNil(o.SchemeTraceId) { + var ret string + return ret + } + return *o.SchemeTraceId +} + +// GetSchemeTraceIdOk returns a tuple with the SchemeTraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetSchemeTraceIdOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeTraceId) { + return nil, false + } + return o.SchemeTraceId, true +} + +// HasSchemeTraceId returns a boolean if a field has been set. +func (o *IssuedCard) HasSchemeTraceId() bool { + if o != nil && !common.IsNil(o.SchemeTraceId) { + return true + } + + return false +} + +// SetSchemeTraceId gets a reference to the given string and assigns it to the SchemeTraceId field. +func (o *IssuedCard) SetSchemeTraceId(v string) { + o.SchemeTraceId = &v +} + +// GetSchemeUniqueTransactionId returns the SchemeUniqueTransactionId field value if set, zero value otherwise. +func (o *IssuedCard) GetSchemeUniqueTransactionId() string { + if o == nil || common.IsNil(o.SchemeUniqueTransactionId) { + var ret string + return ret + } + return *o.SchemeUniqueTransactionId +} + +// GetSchemeUniqueTransactionIdOk returns a tuple with the SchemeUniqueTransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetSchemeUniqueTransactionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeUniqueTransactionId) { + return nil, false + } + return o.SchemeUniqueTransactionId, true +} + +// HasSchemeUniqueTransactionId returns a boolean if a field has been set. +func (o *IssuedCard) HasSchemeUniqueTransactionId() bool { + if o != nil && !common.IsNil(o.SchemeUniqueTransactionId) { + return true + } + + return false +} + +// SetSchemeUniqueTransactionId gets a reference to the given string and assigns it to the SchemeUniqueTransactionId field. +func (o *IssuedCard) SetSchemeUniqueTransactionId(v string) { + o.SchemeUniqueTransactionId = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *IssuedCard) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -221,6 +323,9 @@ func (o IssuedCard) MarshalJSON() ([]byte, error) { func (o IssuedCard) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AuthorisationType) { + toSerialize["authorisationType"] = o.AuthorisationType + } if !common.IsNil(o.PanEntryMode) { toSerialize["panEntryMode"] = o.PanEntryMode } @@ -230,6 +335,12 @@ func (o IssuedCard) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RelayedAuthorisationData) { toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData } + if !common.IsNil(o.SchemeTraceId) { + toSerialize["schemeTraceId"] = o.SchemeTraceId + } + if !common.IsNil(o.SchemeUniqueTransactionId) { + toSerialize["schemeUniqueTransactionId"] = o.SchemeUniqueTransactionId + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/transferwebhook/model_transfer_data.go b/src/transferwebhook/model_transfer_data.go index 94820aa14..3c8a5dd2f 100644 --- a/src/transferwebhook/model_transfer_data.go +++ b/src/transferwebhook/model_transfer_data.go @@ -28,9 +28,9 @@ type TransferData struct { // The list of the latest balance statuses in the transfer. Balances []BalanceMutation `json:"balances,omitempty"` // The category of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` - CategoryData *TransferDataCategoryData `json:"categoryData,omitempty"` - Counterparty *CounterpartyV3 `json:"counterparty,omitempty"` + Category string `json:"category"` + CategoryData *TransferDataCategoryData `json:"categoryData,omitempty"` + Counterparty *TransferNotificationCounterParty `json:"counterparty,omitempty"` // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. CreationDate *time.Time `json:"creationDate,omitempty"` // Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** @@ -287,9 +287,9 @@ func (o *TransferData) SetCategoryData(v TransferDataCategoryData) { } // GetCounterparty returns the Counterparty field value if set, zero value otherwise. -func (o *TransferData) GetCounterparty() CounterpartyV3 { +func (o *TransferData) GetCounterparty() TransferNotificationCounterParty { if o == nil || common.IsNil(o.Counterparty) { - var ret CounterpartyV3 + var ret TransferNotificationCounterParty return ret } return *o.Counterparty @@ -297,7 +297,7 @@ func (o *TransferData) GetCounterparty() CounterpartyV3 { // 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 *TransferData) GetCounterpartyOk() (*CounterpartyV3, bool) { +func (o *TransferData) GetCounterpartyOk() (*TransferNotificationCounterParty, bool) { if o == nil || common.IsNil(o.Counterparty) { return nil, false } @@ -313,8 +313,8 @@ func (o *TransferData) HasCounterparty() bool { return false } -// SetCounterparty gets a reference to the given CounterpartyV3 and assigns it to the Counterparty field. -func (o *TransferData) SetCounterparty(v CounterpartyV3) { +// SetCounterparty gets a reference to the given TransferNotificationCounterParty and assigns it to the Counterparty field. +func (o *TransferData) SetCounterparty(v TransferNotificationCounterParty) { o.Counterparty = &v } diff --git a/src/transferwebhook/model_transfer_event.go b/src/transferwebhook/model_transfer_event.go index 5e27a90d5..ea27af2f6 100644 --- a/src/transferwebhook/model_transfer_event.go +++ b/src/transferwebhook/model_transfer_event.go @@ -35,10 +35,6 @@ type TransferEvent struct { OriginalAmount *Amount `json:"originalAmount,omitempty"` // The reason for the transfer status. Reason *string `json:"reason,omitempty"` - // SchemeTraceID retrieved from scheme. - SchemeTraceID *string `json:"schemeTraceID,omitempty"` - // SchemeUniqueTransactionID retrieved from scheme. - SchemeUniqueTransactionID *string `json:"schemeUniqueTransactionID,omitempty"` // The status of the transfer event. Status *string `json:"status,omitempty"` // The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. @@ -356,70 +352,6 @@ func (o *TransferEvent) SetReason(v string) { o.Reason = &v } -// GetSchemeTraceID returns the SchemeTraceID field value if set, zero value otherwise. -func (o *TransferEvent) GetSchemeTraceID() string { - if o == nil || common.IsNil(o.SchemeTraceID) { - var ret string - return ret - } - return *o.SchemeTraceID -} - -// GetSchemeTraceIDOk returns a tuple with the SchemeTraceID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferEvent) GetSchemeTraceIDOk() (*string, bool) { - if o == nil || common.IsNil(o.SchemeTraceID) { - return nil, false - } - return o.SchemeTraceID, true -} - -// HasSchemeTraceID returns a boolean if a field has been set. -func (o *TransferEvent) HasSchemeTraceID() bool { - if o != nil && !common.IsNil(o.SchemeTraceID) { - return true - } - - return false -} - -// SetSchemeTraceID gets a reference to the given string and assigns it to the SchemeTraceID field. -func (o *TransferEvent) SetSchemeTraceID(v string) { - o.SchemeTraceID = &v -} - -// GetSchemeUniqueTransactionID returns the SchemeUniqueTransactionID field value if set, zero value otherwise. -func (o *TransferEvent) GetSchemeUniqueTransactionID() string { - if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { - var ret string - return ret - } - return *o.SchemeUniqueTransactionID -} - -// GetSchemeUniqueTransactionIDOk returns a tuple with the SchemeUniqueTransactionID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferEvent) GetSchemeUniqueTransactionIDOk() (*string, bool) { - if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { - return nil, false - } - return o.SchemeUniqueTransactionID, true -} - -// HasSchemeUniqueTransactionID returns a boolean if a field has been set. -func (o *TransferEvent) HasSchemeUniqueTransactionID() bool { - if o != nil && !common.IsNil(o.SchemeUniqueTransactionID) { - return true - } - - return false -} - -// SetSchemeUniqueTransactionID gets a reference to the given string and assigns it to the SchemeUniqueTransactionID field. -func (o *TransferEvent) SetSchemeUniqueTransactionID(v string) { - o.SchemeUniqueTransactionID = &v -} - // GetStatus returns the Status field value if set, zero value otherwise. func (o *TransferEvent) GetStatus() string { if o == nil || common.IsNil(o.Status) { @@ -617,12 +549,6 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Reason) { toSerialize["reason"] = o.Reason } - if !common.IsNil(o.SchemeTraceID) { - toSerialize["schemeTraceID"] = o.SchemeTraceID - } - if !common.IsNil(o.SchemeUniqueTransactionID) { - toSerialize["schemeUniqueTransactionID"] = o.SchemeUniqueTransactionID - } if !common.IsNil(o.Status) { toSerialize["status"] = o.Status } diff --git a/src/transferwebhook/model_transfer_notification_counter_party.go b/src/transferwebhook/model_transfer_notification_counter_party.go new file mode 100644 index 000000000..f7a16486d --- /dev/null +++ b/src/transferwebhook/model_transfer_notification_counter_party.go @@ -0,0 +1,234 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferNotificationCounterParty type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferNotificationCounterParty{} + +// TransferNotificationCounterParty struct for TransferNotificationCounterParty +type TransferNotificationCounterParty struct { + // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + Merchant *TransferNotificationMerchantData `json:"merchant,omitempty"` + // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` +} + +// NewTransferNotificationCounterParty instantiates a new TransferNotificationCounterParty 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 NewTransferNotificationCounterParty() *TransferNotificationCounterParty { + this := TransferNotificationCounterParty{} + return &this +} + +// NewTransferNotificationCounterPartyWithDefaults instantiates a new TransferNotificationCounterParty 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 NewTransferNotificationCounterPartyWithDefaults() *TransferNotificationCounterParty { + this := TransferNotificationCounterParty{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *TransferNotificationCounterParty) GetBankAccount() BankAccountV3 { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccountV3 + 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 *TransferNotificationCounterParty) GetBankAccountOk() (*BankAccountV3, 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 *TransferNotificationCounterParty) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccountV3 and assigns it to the BankAccount field. +func (o *TransferNotificationCounterParty) SetBankAccount(v BankAccountV3) { + o.BankAccount = &v +} + +// GetMerchant returns the Merchant field value if set, zero value otherwise. +func (o *TransferNotificationCounterParty) GetMerchant() TransferNotificationMerchantData { + if o == nil || common.IsNil(o.Merchant) { + var ret TransferNotificationMerchantData + return ret + } + return *o.Merchant +} + +// GetMerchantOk returns a tuple with the Merchant field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationCounterParty) GetMerchantOk() (*TransferNotificationMerchantData, bool) { + if o == nil || common.IsNil(o.Merchant) { + return nil, false + } + return o.Merchant, true +} + +// HasMerchant returns a boolean if a field has been set. +func (o *TransferNotificationCounterParty) HasMerchant() bool { + if o != nil && !common.IsNil(o.Merchant) { + return true + } + + return false +} + +// SetMerchant gets a reference to the given TransferNotificationMerchantData and assigns it to the Merchant field. +func (o *TransferNotificationCounterParty) SetMerchant(v TransferNotificationMerchantData) { + o.Merchant = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) 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 *TransferNotificationCounterParty) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o TransferNotificationCounterParty) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferNotificationCounterParty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.Merchant) { + toSerialize["merchant"] = o.Merchant + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableTransferNotificationCounterParty struct { + value *TransferNotificationCounterParty + isSet bool +} + +func (v NullableTransferNotificationCounterParty) Get() *TransferNotificationCounterParty { + return v.value +} + +func (v *NullableTransferNotificationCounterParty) Set(val *TransferNotificationCounterParty) { + v.value = val + v.isSet = true +} + +func (v NullableTransferNotificationCounterParty) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferNotificationCounterParty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferNotificationCounterParty(val *TransferNotificationCounterParty) *NullableTransferNotificationCounterParty { + return &NullableTransferNotificationCounterParty{value: val, isSet: true} +} + +func (v NullableTransferNotificationCounterParty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferNotificationCounterParty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transferwebhook/model_transfer_notification_merchant_data.go b/src/transferwebhook/model_transfer_notification_merchant_data.go new file mode 100644 index 000000000..89bb0be65 --- /dev/null +++ b/src/transferwebhook/model_transfer_notification_merchant_data.go @@ -0,0 +1,347 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferNotificationMerchantData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferNotificationMerchantData{} + +// TransferNotificationMerchantData struct for TransferNotificationMerchantData +type TransferNotificationMerchantData struct { + // The unique identifier of the merchant's acquirer. + AcquirerId *string `json:"acquirerId,omitempty"` + // The city where the merchant is located. + City *string `json:"city,omitempty"` + // The country where the merchant is located. + Country *string `json:"country,omitempty"` + // The merchant category code. + Mcc *string `json:"mcc,omitempty"` + // The merchant identifier. + MerchantId *string `json:"merchantId,omitempty"` + // The name of the merchant's shop or service. + Name *string `json:"name,omitempty"` + // The merchant postal code. + PostalCode *string `json:"postalCode,omitempty"` +} + +// NewTransferNotificationMerchantData instantiates a new TransferNotificationMerchantData 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 NewTransferNotificationMerchantData() *TransferNotificationMerchantData { + this := TransferNotificationMerchantData{} + return &this +} + +// NewTransferNotificationMerchantDataWithDefaults instantiates a new TransferNotificationMerchantData 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 NewTransferNotificationMerchantDataWithDefaults() *TransferNotificationMerchantData { + this := TransferNotificationMerchantData{} + return &this +} + +// GetAcquirerId returns the AcquirerId field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetAcquirerId() string { + if o == nil || common.IsNil(o.AcquirerId) { + var ret string + return ret + } + return *o.AcquirerId +} + +// GetAcquirerIdOk returns a tuple with the AcquirerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetAcquirerIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerId) { + return nil, false + } + return o.AcquirerId, true +} + +// HasAcquirerId returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasAcquirerId() bool { + if o != nil && !common.IsNil(o.AcquirerId) { + return true + } + + return false +} + +// SetAcquirerId gets a reference to the given string and assigns it to the AcquirerId field. +func (o *TransferNotificationMerchantData) SetAcquirerId(v string) { + o.AcquirerId = &v +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *TransferNotificationMerchantData) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) 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 *TransferNotificationMerchantData) 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 *TransferNotificationMerchantData) 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 *TransferNotificationMerchantData) SetCountry(v string) { + o.Country = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetMcc() string { + if o == nil || common.IsNil(o.Mcc) { + var ret string + return ret + } + return *o.Mcc +} + +// GetMccOk returns a tuple with the Mcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetMccOk() (*string, bool) { + if o == nil || common.IsNil(o.Mcc) { + return nil, false + } + return o.Mcc, true +} + +// HasMcc returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasMcc() bool { + if o != nil && !common.IsNil(o.Mcc) { + return true + } + + return false +} + +// SetMcc gets a reference to the given string and assigns it to the Mcc field. +func (o *TransferNotificationMerchantData) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantId returns the MerchantId field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetMerchantId() string { + if o == nil || common.IsNil(o.MerchantId) { + var ret string + return ret + } + return *o.MerchantId +} + +// GetMerchantIdOk returns a tuple with the MerchantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetMerchantIdOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantId) { + return nil, false + } + return o.MerchantId, true +} + +// HasMerchantId returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasMerchantId() bool { + if o != nil && !common.IsNil(o.MerchantId) { + return true + } + + return false +} + +// SetMerchantId gets a reference to the given string and assigns it to the MerchantId field. +func (o *TransferNotificationMerchantData) SetMerchantId(v string) { + o.MerchantId = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetName() string { + if o == nil || common.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetNameOk() (*string, bool) { + if o == nil || common.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasName() bool { + if o != nil && !common.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TransferNotificationMerchantData) SetName(v string) { + o.Name = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *TransferNotificationMerchantData) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationMerchantData) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *TransferNotificationMerchantData) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *TransferNotificationMerchantData) SetPostalCode(v string) { + o.PostalCode = &v +} + +func (o TransferNotificationMerchantData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferNotificationMerchantData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquirerId) { + toSerialize["acquirerId"] = o.AcquirerId + } + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantId) { + toSerialize["merchantId"] = o.MerchantId + } + if !common.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + return toSerialize, nil +} + +type NullableTransferNotificationMerchantData struct { + value *TransferNotificationMerchantData + isSet bool +} + +func (v NullableTransferNotificationMerchantData) Get() *TransferNotificationMerchantData { + return v.value +} + +func (v *NullableTransferNotificationMerchantData) Set(val *TransferNotificationMerchantData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferNotificationMerchantData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferNotificationMerchantData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferNotificationMerchantData(val *TransferNotificationMerchantData) *NullableTransferNotificationMerchantData { + return &NullableTransferNotificationMerchantData{value: val, isSet: true} +} + +func (v NullableTransferNotificationMerchantData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferNotificationMerchantData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}