From 3a32dfed196bf0e2701063e67454aea25393efad Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Wed, 10 Jan 2024 15:12:57 +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 +- src/checkout/model_apple_pay_donations.go | 328 +++++++ src/checkout/model_bill_desk_details.go | 2 +- src/checkout/model_card_details.go | 2 +- src/checkout/model_card_donations.go | 821 ++++++++++++++++++ .../model_create_checkout_session_request.go | 37 + .../model_create_checkout_session_response.go | 37 + src/checkout/model_donation_payment_method.go | 150 ++-- src/checkout/model_fund_origin.go | 112 ++- src/checkout/model_google_pay_details.go | 37 + src/checkout/model_google_pay_donations.go | 365 ++++++++ src/checkout/model_ideal_donations.go | 282 ++++++ .../model_pay_with_google_donations.go | 328 +++++++ src/legalentity/client.go | 12 +- .../api_android_files_company_level.go | 30 +- src/management/client.go | 12 +- src/management/model_hardware.go | 39 +- src/management/model_localization.go | 37 + src/management/model_receipt_options.go | 37 + src/management/model_tap_to_pay.go | 2 +- .../model_account_capability_data.go | 38 + 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 ++++++++ 37 files changed, 3534 insertions(+), 289 deletions(-) create mode 100644 src/checkout/api_donations.go create mode 100644 src/checkout/model_apple_pay_donations.go create mode 100644 src/checkout/model_card_donations.go create mode 100644 src/checkout/model_google_pay_donations.go create mode 100644 src/checkout/model_ideal_donations.go create mode 100644 src/checkout/model_pay_with_google_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_apple_pay_donations.go b/src/checkout/model_apple_pay_donations.go new file mode 100644 index 000000000..c2de915fc --- /dev/null +++ b/src/checkout/model_apple_pay_donations.go @@ -0,0 +1,328 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ApplePayDonations type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ApplePayDonations{} + +// ApplePayDonations struct for ApplePayDonations +type ApplePayDonations struct { + // The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + ApplePayToken string `json:"applePayToken"` + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + FundingSource *string `json:"fundingSource,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + // Deprecated + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // **applepay** + Type *string `json:"type,omitempty"` +} + +// NewApplePayDonations instantiates a new ApplePayDonations 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 NewApplePayDonations(applePayToken string) *ApplePayDonations { + this := ApplePayDonations{} + this.ApplePayToken = applePayToken + var type_ string = "applepay" + this.Type = &type_ + return &this +} + +// NewApplePayDonationsWithDefaults instantiates a new ApplePayDonations 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 NewApplePayDonationsWithDefaults() *ApplePayDonations { + this := ApplePayDonations{} + var type_ string = "applepay" + this.Type = &type_ + return &this +} + +// GetApplePayToken returns the ApplePayToken field value +func (o *ApplePayDonations) GetApplePayToken() string { + if o == nil { + var ret string + return ret + } + + return o.ApplePayToken +} + +// GetApplePayTokenOk returns a tuple with the ApplePayToken field value +// and a boolean to check if the value has been set. +func (o *ApplePayDonations) GetApplePayTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplePayToken, true +} + +// SetApplePayToken sets field value +func (o *ApplePayDonations) SetApplePayToken(v string) { + o.ApplePayToken = v +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *ApplePayDonations) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplePayDonations) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *ApplePayDonations) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *ApplePayDonations) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *ApplePayDonations) GetFundingSource() string { + if o == nil || common.IsNil(o.FundingSource) { + var ret string + return ret + } + return *o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplePayDonations) GetFundingSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *ApplePayDonations) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. +func (o *ApplePayDonations) SetFundingSource(v string) { + o.FundingSource = &v +} + +// GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. +// Deprecated +func (o *ApplePayDonations) GetRecurringDetailReference() string { + if o == nil || common.IsNil(o.RecurringDetailReference) { + var ret string + return ret + } + return *o.RecurringDetailReference +} + +// GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ApplePayDonations) GetRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringDetailReference) { + return nil, false + } + return o.RecurringDetailReference, true +} + +// HasRecurringDetailReference returns a boolean if a field has been set. +func (o *ApplePayDonations) HasRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.RecurringDetailReference) { + return true + } + + return false +} + +// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field. +// Deprecated +func (o *ApplePayDonations) SetRecurringDetailReference(v string) { + o.RecurringDetailReference = &v +} + +// GetStoredPaymentMethodId returns the StoredPaymentMethodId field value if set, zero value otherwise. +func (o *ApplePayDonations) GetStoredPaymentMethodId() string { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + var ret string + return ret + } + return *o.StoredPaymentMethodId +} + +// GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplePayDonations) GetStoredPaymentMethodIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + return nil, false + } + return o.StoredPaymentMethodId, true +} + +// HasStoredPaymentMethodId returns a boolean if a field has been set. +func (o *ApplePayDonations) HasStoredPaymentMethodId() bool { + if o != nil && !common.IsNil(o.StoredPaymentMethodId) { + return true + } + + return false +} + +// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field. +func (o *ApplePayDonations) SetStoredPaymentMethodId(v string) { + o.StoredPaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ApplePayDonations) 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 *ApplePayDonations) 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 *ApplePayDonations) 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 *ApplePayDonations) SetType(v string) { + o.Type = &v +} + +func (o ApplePayDonations) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplePayDonations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["applePayToken"] = o.ApplePayToken + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + if !common.IsNil(o.RecurringDetailReference) { + toSerialize["recurringDetailReference"] = o.RecurringDetailReference + } + if !common.IsNil(o.StoredPaymentMethodId) { + toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableApplePayDonations struct { + value *ApplePayDonations + isSet bool +} + +func (v NullableApplePayDonations) Get() *ApplePayDonations { + return v.value +} + +func (v *NullableApplePayDonations) Set(val *ApplePayDonations) { + v.value = val + v.isSet = true +} + +func (v NullableApplePayDonations) IsSet() bool { + return v.isSet +} + +func (v *NullableApplePayDonations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplePayDonations(val *ApplePayDonations) *NullableApplePayDonations { + return &NullableApplePayDonations{value: val, isSet: true} +} + +func (v NullableApplePayDonations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplePayDonations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *ApplePayDonations) isValidFundingSource() bool { + var allowedEnumValues = []string{"credit", "debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} +func (o *ApplePayDonations) isValidType() bool { + var allowedEnumValues = []string{"applepay"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/checkout/model_bill_desk_details.go b/src/checkout/model_bill_desk_details.go index 4f3ebd7ea..5cd2a50ed 100644 --- a/src/checkout/model_bill_desk_details.go +++ b/src/checkout/model_bill_desk_details.go @@ -181,7 +181,7 @@ func (v *NullableBillDeskDetails) UnmarshalJSON(src []byte) error { } func (o *BillDeskDetails) isValidType() bool { - var allowedEnumValues = []string{"billdesk_online", "billdesk_wallet", "onlinebanking_IN", "wallet_IN"} + var allowedEnumValues = []string{"billdesk_online", "billdesk_wallet"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index d5630ce21..8d248e07d 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", "card"} + var allowedEnumValues = []string{"bcmc", "scheme", "networkToken", "giftcard", "card"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_card_donations.go b/src/checkout/model_card_donations.go new file mode 100644 index 000000000..35df8a226 --- /dev/null +++ b/src/checkout/model_card_donations.go @@ -0,0 +1,821 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardDonations type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardDonations{} + +// CardDonations struct for CardDonations +type CardDonations struct { + // Secondary brand of the card. For example: **plastix**, **hmclub**. + Brand *string `json:"brand,omitempty"` + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // Deprecated + CupsecureplusSmscode *string `json:"cupsecureplus.smscode,omitempty"` + // The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + Cvc *string `json:"cvc,omitempty"` + // The encrypted card number. + EncryptedCardNumber *string `json:"encryptedCardNumber,omitempty"` + // The encrypted card expiry month. + EncryptedExpiryMonth *string `json:"encryptedExpiryMonth,omitempty"` + // The encrypted card expiry year. + EncryptedExpiryYear *string `json:"encryptedExpiryYear,omitempty"` + // The encrypted card verification code. + EncryptedSecurityCode *string `json:"encryptedSecurityCode,omitempty"` + // The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + ExpiryMonth *string `json:"expiryMonth,omitempty"` + // The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + ExpiryYear *string `json:"expiryYear,omitempty"` + // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + FundingSource *string `json:"fundingSource,omitempty"` + // The name of the card holder. + HolderName *string `json:"holderName,omitempty"` + // The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + NetworkPaymentReference *string `json:"networkPaymentReference,omitempty"` + // The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + Number *string `json:"number,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + // Deprecated + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + // The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. + ShopperNotificationReference *string `json:"shopperNotificationReference,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + ThreeDS2SdkVersion *string `json:"threeDS2SdkVersion,omitempty"` + // Default payment method details. Common for scheme payment methods, and for simple payment method details. + Type *string `json:"type,omitempty"` +} + +// NewCardDonations instantiates a new CardDonations 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 NewCardDonations() *CardDonations { + this := CardDonations{} + var type_ string = "scheme" + this.Type = &type_ + return &this +} + +// NewCardDonationsWithDefaults instantiates a new CardDonations 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 NewCardDonationsWithDefaults() *CardDonations { + this := CardDonations{} + var type_ string = "scheme" + this.Type = &type_ + return &this +} + +// GetBrand returns the Brand field value if set, zero value otherwise. +func (o *CardDonations) GetBrand() string { + if o == nil || common.IsNil(o.Brand) { + var ret string + return ret + } + return *o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetBrandOk() (*string, bool) { + if o == nil || common.IsNil(o.Brand) { + return nil, false + } + return o.Brand, true +} + +// HasBrand returns a boolean if a field has been set. +func (o *CardDonations) HasBrand() bool { + if o != nil && !common.IsNil(o.Brand) { + return true + } + + return false +} + +// SetBrand gets a reference to the given string and assigns it to the Brand field. +func (o *CardDonations) SetBrand(v string) { + o.Brand = &v +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *CardDonations) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *CardDonations) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *CardDonations) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetCupsecureplusSmscode returns the CupsecureplusSmscode field value if set, zero value otherwise. +// Deprecated +func (o *CardDonations) GetCupsecureplusSmscode() string { + if o == nil || common.IsNil(o.CupsecureplusSmscode) { + var ret string + return ret + } + return *o.CupsecureplusSmscode +} + +// GetCupsecureplusSmscodeOk returns a tuple with the CupsecureplusSmscode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CardDonations) GetCupsecureplusSmscodeOk() (*string, bool) { + if o == nil || common.IsNil(o.CupsecureplusSmscode) { + return nil, false + } + return o.CupsecureplusSmscode, true +} + +// HasCupsecureplusSmscode returns a boolean if a field has been set. +func (o *CardDonations) HasCupsecureplusSmscode() bool { + if o != nil && !common.IsNil(o.CupsecureplusSmscode) { + return true + } + + return false +} + +// SetCupsecureplusSmscode gets a reference to the given string and assigns it to the CupsecureplusSmscode field. +// Deprecated +func (o *CardDonations) SetCupsecureplusSmscode(v string) { + o.CupsecureplusSmscode = &v +} + +// GetCvc returns the Cvc field value if set, zero value otherwise. +func (o *CardDonations) GetCvc() string { + if o == nil || common.IsNil(o.Cvc) { + var ret string + return ret + } + return *o.Cvc +} + +// GetCvcOk returns a tuple with the Cvc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetCvcOk() (*string, bool) { + if o == nil || common.IsNil(o.Cvc) { + return nil, false + } + return o.Cvc, true +} + +// HasCvc returns a boolean if a field has been set. +func (o *CardDonations) HasCvc() bool { + if o != nil && !common.IsNil(o.Cvc) { + return true + } + + return false +} + +// SetCvc gets a reference to the given string and assigns it to the Cvc field. +func (o *CardDonations) SetCvc(v string) { + o.Cvc = &v +} + +// GetEncryptedCardNumber returns the EncryptedCardNumber field value if set, zero value otherwise. +func (o *CardDonations) GetEncryptedCardNumber() string { + if o == nil || common.IsNil(o.EncryptedCardNumber) { + var ret string + return ret + } + return *o.EncryptedCardNumber +} + +// GetEncryptedCardNumberOk returns a tuple with the EncryptedCardNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetEncryptedCardNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedCardNumber) { + return nil, false + } + return o.EncryptedCardNumber, true +} + +// HasEncryptedCardNumber returns a boolean if a field has been set. +func (o *CardDonations) HasEncryptedCardNumber() bool { + if o != nil && !common.IsNil(o.EncryptedCardNumber) { + return true + } + + return false +} + +// SetEncryptedCardNumber gets a reference to the given string and assigns it to the EncryptedCardNumber field. +func (o *CardDonations) SetEncryptedCardNumber(v string) { + o.EncryptedCardNumber = &v +} + +// GetEncryptedExpiryMonth returns the EncryptedExpiryMonth field value if set, zero value otherwise. +func (o *CardDonations) GetEncryptedExpiryMonth() string { + if o == nil || common.IsNil(o.EncryptedExpiryMonth) { + var ret string + return ret + } + return *o.EncryptedExpiryMonth +} + +// GetEncryptedExpiryMonthOk returns a tuple with the EncryptedExpiryMonth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetEncryptedExpiryMonthOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedExpiryMonth) { + return nil, false + } + return o.EncryptedExpiryMonth, true +} + +// HasEncryptedExpiryMonth returns a boolean if a field has been set. +func (o *CardDonations) HasEncryptedExpiryMonth() bool { + if o != nil && !common.IsNil(o.EncryptedExpiryMonth) { + return true + } + + return false +} + +// SetEncryptedExpiryMonth gets a reference to the given string and assigns it to the EncryptedExpiryMonth field. +func (o *CardDonations) SetEncryptedExpiryMonth(v string) { + o.EncryptedExpiryMonth = &v +} + +// GetEncryptedExpiryYear returns the EncryptedExpiryYear field value if set, zero value otherwise. +func (o *CardDonations) GetEncryptedExpiryYear() string { + if o == nil || common.IsNil(o.EncryptedExpiryYear) { + var ret string + return ret + } + return *o.EncryptedExpiryYear +} + +// GetEncryptedExpiryYearOk returns a tuple with the EncryptedExpiryYear field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetEncryptedExpiryYearOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedExpiryYear) { + return nil, false + } + return o.EncryptedExpiryYear, true +} + +// HasEncryptedExpiryYear returns a boolean if a field has been set. +func (o *CardDonations) HasEncryptedExpiryYear() bool { + if o != nil && !common.IsNil(o.EncryptedExpiryYear) { + return true + } + + return false +} + +// SetEncryptedExpiryYear gets a reference to the given string and assigns it to the EncryptedExpiryYear field. +func (o *CardDonations) SetEncryptedExpiryYear(v string) { + o.EncryptedExpiryYear = &v +} + +// GetEncryptedSecurityCode returns the EncryptedSecurityCode field value if set, zero value otherwise. +func (o *CardDonations) GetEncryptedSecurityCode() string { + if o == nil || common.IsNil(o.EncryptedSecurityCode) { + var ret string + return ret + } + return *o.EncryptedSecurityCode +} + +// GetEncryptedSecurityCodeOk returns a tuple with the EncryptedSecurityCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetEncryptedSecurityCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedSecurityCode) { + return nil, false + } + return o.EncryptedSecurityCode, true +} + +// HasEncryptedSecurityCode returns a boolean if a field has been set. +func (o *CardDonations) HasEncryptedSecurityCode() bool { + if o != nil && !common.IsNil(o.EncryptedSecurityCode) { + return true + } + + return false +} + +// SetEncryptedSecurityCode gets a reference to the given string and assigns it to the EncryptedSecurityCode field. +func (o *CardDonations) SetEncryptedSecurityCode(v string) { + o.EncryptedSecurityCode = &v +} + +// GetExpiryMonth returns the ExpiryMonth field value if set, zero value otherwise. +func (o *CardDonations) GetExpiryMonth() string { + if o == nil || common.IsNil(o.ExpiryMonth) { + var ret string + return ret + } + return *o.ExpiryMonth +} + +// GetExpiryMonthOk returns a tuple with the ExpiryMonth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetExpiryMonthOk() (*string, bool) { + if o == nil || common.IsNil(o.ExpiryMonth) { + return nil, false + } + return o.ExpiryMonth, true +} + +// HasExpiryMonth returns a boolean if a field has been set. +func (o *CardDonations) HasExpiryMonth() bool { + if o != nil && !common.IsNil(o.ExpiryMonth) { + return true + } + + return false +} + +// SetExpiryMonth gets a reference to the given string and assigns it to the ExpiryMonth field. +func (o *CardDonations) SetExpiryMonth(v string) { + o.ExpiryMonth = &v +} + +// GetExpiryYear returns the ExpiryYear field value if set, zero value otherwise. +func (o *CardDonations) GetExpiryYear() string { + if o == nil || common.IsNil(o.ExpiryYear) { + var ret string + return ret + } + return *o.ExpiryYear +} + +// GetExpiryYearOk returns a tuple with the ExpiryYear field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetExpiryYearOk() (*string, bool) { + if o == nil || common.IsNil(o.ExpiryYear) { + return nil, false + } + return o.ExpiryYear, true +} + +// HasExpiryYear returns a boolean if a field has been set. +func (o *CardDonations) HasExpiryYear() bool { + if o != nil && !common.IsNil(o.ExpiryYear) { + return true + } + + return false +} + +// SetExpiryYear gets a reference to the given string and assigns it to the ExpiryYear field. +func (o *CardDonations) SetExpiryYear(v string) { + o.ExpiryYear = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *CardDonations) GetFundingSource() string { + if o == nil || common.IsNil(o.FundingSource) { + var ret string + return ret + } + return *o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetFundingSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *CardDonations) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. +func (o *CardDonations) SetFundingSource(v string) { + o.FundingSource = &v +} + +// GetHolderName returns the HolderName field value if set, zero value otherwise. +func (o *CardDonations) GetHolderName() string { + if o == nil || common.IsNil(o.HolderName) { + var ret string + return ret + } + return *o.HolderName +} + +// GetHolderNameOk returns a tuple with the HolderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetHolderNameOk() (*string, bool) { + if o == nil || common.IsNil(o.HolderName) { + return nil, false + } + return o.HolderName, true +} + +// HasHolderName returns a boolean if a field has been set. +func (o *CardDonations) HasHolderName() bool { + if o != nil && !common.IsNil(o.HolderName) { + return true + } + + return false +} + +// SetHolderName gets a reference to the given string and assigns it to the HolderName field. +func (o *CardDonations) SetHolderName(v string) { + o.HolderName = &v +} + +// GetNetworkPaymentReference returns the NetworkPaymentReference field value if set, zero value otherwise. +func (o *CardDonations) GetNetworkPaymentReference() string { + if o == nil || common.IsNil(o.NetworkPaymentReference) { + var ret string + return ret + } + return *o.NetworkPaymentReference +} + +// GetNetworkPaymentReferenceOk returns a tuple with the NetworkPaymentReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetNetworkPaymentReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.NetworkPaymentReference) { + return nil, false + } + return o.NetworkPaymentReference, true +} + +// HasNetworkPaymentReference returns a boolean if a field has been set. +func (o *CardDonations) HasNetworkPaymentReference() bool { + if o != nil && !common.IsNil(o.NetworkPaymentReference) { + return true + } + + return false +} + +// SetNetworkPaymentReference gets a reference to the given string and assigns it to the NetworkPaymentReference field. +func (o *CardDonations) SetNetworkPaymentReference(v string) { + o.NetworkPaymentReference = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *CardDonations) GetNumber() string { + if o == nil || common.IsNil(o.Number) { + var ret string + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *CardDonations) HasNumber() bool { + if o != nil && !common.IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given string and assigns it to the Number field. +func (o *CardDonations) SetNumber(v string) { + o.Number = &v +} + +// GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. +// Deprecated +func (o *CardDonations) GetRecurringDetailReference() string { + if o == nil || common.IsNil(o.RecurringDetailReference) { + var ret string + return ret + } + return *o.RecurringDetailReference +} + +// GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *CardDonations) GetRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringDetailReference) { + return nil, false + } + return o.RecurringDetailReference, true +} + +// HasRecurringDetailReference returns a boolean if a field has been set. +func (o *CardDonations) HasRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.RecurringDetailReference) { + return true + } + + return false +} + +// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field. +// Deprecated +func (o *CardDonations) SetRecurringDetailReference(v string) { + o.RecurringDetailReference = &v +} + +// GetShopperNotificationReference returns the ShopperNotificationReference field value if set, zero value otherwise. +func (o *CardDonations) GetShopperNotificationReference() string { + if o == nil || common.IsNil(o.ShopperNotificationReference) { + var ret string + return ret + } + return *o.ShopperNotificationReference +} + +// GetShopperNotificationReferenceOk returns a tuple with the ShopperNotificationReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetShopperNotificationReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperNotificationReference) { + return nil, false + } + return o.ShopperNotificationReference, true +} + +// HasShopperNotificationReference returns a boolean if a field has been set. +func (o *CardDonations) HasShopperNotificationReference() bool { + if o != nil && !common.IsNil(o.ShopperNotificationReference) { + return true + } + + return false +} + +// SetShopperNotificationReference gets a reference to the given string and assigns it to the ShopperNotificationReference field. +func (o *CardDonations) SetShopperNotificationReference(v string) { + o.ShopperNotificationReference = &v +} + +// GetStoredPaymentMethodId returns the StoredPaymentMethodId field value if set, zero value otherwise. +func (o *CardDonations) GetStoredPaymentMethodId() string { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + var ret string + return ret + } + return *o.StoredPaymentMethodId +} + +// GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetStoredPaymentMethodIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + return nil, false + } + return o.StoredPaymentMethodId, true +} + +// HasStoredPaymentMethodId returns a boolean if a field has been set. +func (o *CardDonations) HasStoredPaymentMethodId() bool { + if o != nil && !common.IsNil(o.StoredPaymentMethodId) { + return true + } + + return false +} + +// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field. +func (o *CardDonations) SetStoredPaymentMethodId(v string) { + o.StoredPaymentMethodId = &v +} + +// GetThreeDS2SdkVersion returns the ThreeDS2SdkVersion field value if set, zero value otherwise. +func (o *CardDonations) GetThreeDS2SdkVersion() string { + if o == nil || common.IsNil(o.ThreeDS2SdkVersion) { + var ret string + return ret + } + return *o.ThreeDS2SdkVersion +} + +// GetThreeDS2SdkVersionOk returns a tuple with the ThreeDS2SdkVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetThreeDS2SdkVersionOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDS2SdkVersion) { + return nil, false + } + return o.ThreeDS2SdkVersion, true +} + +// HasThreeDS2SdkVersion returns a boolean if a field has been set. +func (o *CardDonations) HasThreeDS2SdkVersion() bool { + if o != nil && !common.IsNil(o.ThreeDS2SdkVersion) { + return true + } + + return false +} + +// SetThreeDS2SdkVersion gets a reference to the given string and assigns it to the ThreeDS2SdkVersion field. +func (o *CardDonations) SetThreeDS2SdkVersion(v string) { + o.ThreeDS2SdkVersion = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CardDonations) 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 *CardDonations) 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 *CardDonations) 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 *CardDonations) SetType(v string) { + o.Type = &v +} + +func (o CardDonations) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardDonations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Brand) { + toSerialize["brand"] = o.Brand + } + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.CupsecureplusSmscode) { + toSerialize["cupsecureplus.smscode"] = o.CupsecureplusSmscode + } + if !common.IsNil(o.Cvc) { + toSerialize["cvc"] = o.Cvc + } + if !common.IsNil(o.EncryptedCardNumber) { + toSerialize["encryptedCardNumber"] = o.EncryptedCardNumber + } + if !common.IsNil(o.EncryptedExpiryMonth) { + toSerialize["encryptedExpiryMonth"] = o.EncryptedExpiryMonth + } + if !common.IsNil(o.EncryptedExpiryYear) { + toSerialize["encryptedExpiryYear"] = o.EncryptedExpiryYear + } + if !common.IsNil(o.EncryptedSecurityCode) { + toSerialize["encryptedSecurityCode"] = o.EncryptedSecurityCode + } + if !common.IsNil(o.ExpiryMonth) { + toSerialize["expiryMonth"] = o.ExpiryMonth + } + if !common.IsNil(o.ExpiryYear) { + toSerialize["expiryYear"] = o.ExpiryYear + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + if !common.IsNil(o.HolderName) { + toSerialize["holderName"] = o.HolderName + } + if !common.IsNil(o.NetworkPaymentReference) { + toSerialize["networkPaymentReference"] = o.NetworkPaymentReference + } + if !common.IsNil(o.Number) { + toSerialize["number"] = o.Number + } + if !common.IsNil(o.RecurringDetailReference) { + toSerialize["recurringDetailReference"] = o.RecurringDetailReference + } + if !common.IsNil(o.ShopperNotificationReference) { + toSerialize["shopperNotificationReference"] = o.ShopperNotificationReference + } + if !common.IsNil(o.StoredPaymentMethodId) { + toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId + } + if !common.IsNil(o.ThreeDS2SdkVersion) { + toSerialize["threeDS2SdkVersion"] = o.ThreeDS2SdkVersion + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCardDonations struct { + value *CardDonations + isSet bool +} + +func (v NullableCardDonations) Get() *CardDonations { + return v.value +} + +func (v *NullableCardDonations) Set(val *CardDonations) { + v.value = val + v.isSet = true +} + +func (v NullableCardDonations) IsSet() bool { + return v.isSet +} + +func (v *NullableCardDonations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardDonations(val *CardDonations) *NullableCardDonations { + return &NullableCardDonations{value: val, isSet: true} +} + +func (v NullableCardDonations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardDonations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *CardDonations) isValidFundingSource() bool { + var allowedEnumValues = []string{"credit", "debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} +func (o *CardDonations) isValidType() bool { + var allowedEnumValues = []string{"bcmc", "scheme", "networkToken", "giftcard", "card"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} 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/checkout/model_donation_payment_method.go b/src/checkout/model_donation_payment_method.go index 7d1f97c2b..0bb3e79cc 100644 --- a/src/checkout/model_donation_payment_method.go +++ b/src/checkout/model_donation_payment_method.go @@ -15,45 +15,45 @@ import ( // DonationPaymentMethod - The type and required details of a payment method to use. type DonationPaymentMethod struct { - ApplePayDetails *ApplePayDetails - CardDetails *CardDetails - GooglePayDetails *GooglePayDetails - IdealDetails *IdealDetails - PayWithGoogleDetails *PayWithGoogleDetails + ApplePayDonations *ApplePayDonations + CardDonations *CardDonations + GooglePayDonations *GooglePayDonations + IdealDonations *IdealDonations + PayWithGoogleDonations *PayWithGoogleDonations } -// ApplePayDetailsAsDonationPaymentMethod is a convenience function that returns ApplePayDetails wrapped in DonationPaymentMethod -func ApplePayDetailsAsDonationPaymentMethod(v *ApplePayDetails) DonationPaymentMethod { +// ApplePayDonationsAsDonationPaymentMethod is a convenience function that returns ApplePayDonations wrapped in DonationPaymentMethod +func ApplePayDonationsAsDonationPaymentMethod(v *ApplePayDonations) DonationPaymentMethod { return DonationPaymentMethod{ - ApplePayDetails: v, + ApplePayDonations: v, } } -// CardDetailsAsDonationPaymentMethod is a convenience function that returns CardDetails wrapped in DonationPaymentMethod -func CardDetailsAsDonationPaymentMethod(v *CardDetails) DonationPaymentMethod { +// CardDonationsAsDonationPaymentMethod is a convenience function that returns CardDonations wrapped in DonationPaymentMethod +func CardDonationsAsDonationPaymentMethod(v *CardDonations) DonationPaymentMethod { return DonationPaymentMethod{ - CardDetails: v, + CardDonations: v, } } -// GooglePayDetailsAsDonationPaymentMethod is a convenience function that returns GooglePayDetails wrapped in DonationPaymentMethod -func GooglePayDetailsAsDonationPaymentMethod(v *GooglePayDetails) DonationPaymentMethod { +// GooglePayDonationsAsDonationPaymentMethod is a convenience function that returns GooglePayDonations wrapped in DonationPaymentMethod +func GooglePayDonationsAsDonationPaymentMethod(v *GooglePayDonations) DonationPaymentMethod { return DonationPaymentMethod{ - GooglePayDetails: v, + GooglePayDonations: v, } } -// IdealDetailsAsDonationPaymentMethod is a convenience function that returns IdealDetails wrapped in DonationPaymentMethod -func IdealDetailsAsDonationPaymentMethod(v *IdealDetails) DonationPaymentMethod { +// IdealDonationsAsDonationPaymentMethod is a convenience function that returns IdealDonations wrapped in DonationPaymentMethod +func IdealDonationsAsDonationPaymentMethod(v *IdealDonations) DonationPaymentMethod { return DonationPaymentMethod{ - IdealDetails: v, + IdealDonations: v, } } -// PayWithGoogleDetailsAsDonationPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in DonationPaymentMethod -func PayWithGoogleDetailsAsDonationPaymentMethod(v *PayWithGoogleDetails) DonationPaymentMethod { +// PayWithGoogleDonationsAsDonationPaymentMethod is a convenience function that returns PayWithGoogleDonations wrapped in DonationPaymentMethod +func PayWithGoogleDonationsAsDonationPaymentMethod(v *PayWithGoogleDonations) DonationPaymentMethod { return DonationPaymentMethod{ - PayWithGoogleDetails: v, + PayWithGoogleDonations: v, } } @@ -61,78 +61,78 @@ func PayWithGoogleDetailsAsDonationPaymentMethod(v *PayWithGoogleDetails) Donati func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { var err error match := 0 - // try to unmarshal data into ApplePayDetails - err = json.Unmarshal(data, &dst.ApplePayDetails) + // try to unmarshal data into ApplePayDonations + err = json.Unmarshal(data, &dst.ApplePayDonations) if err == nil { - jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) - if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct - dst.ApplePayDetails = nil + jsonApplePayDonations, _ := json.Marshal(dst.ApplePayDonations) + if string(jsonApplePayDonations) == "{}" || !dst.ApplePayDonations.isValidType() { // empty struct + dst.ApplePayDonations = nil } else { match++ } } else { - dst.ApplePayDetails = nil + dst.ApplePayDonations = nil } - // try to unmarshal data into CardDetails - err = json.Unmarshal(data, &dst.CardDetails) + // try to unmarshal data into CardDonations + err = json.Unmarshal(data, &dst.CardDonations) if err == nil { - jsonCardDetails, _ := json.Marshal(dst.CardDetails) - if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct - dst.CardDetails = nil + jsonCardDonations, _ := json.Marshal(dst.CardDonations) + if string(jsonCardDonations) == "{}" || !dst.CardDonations.isValidType() { // empty struct + dst.CardDonations = nil } else { match++ } } else { - dst.CardDetails = nil + dst.CardDonations = nil } - // try to unmarshal data into GooglePayDetails - err = json.Unmarshal(data, &dst.GooglePayDetails) + // try to unmarshal data into GooglePayDonations + err = json.Unmarshal(data, &dst.GooglePayDonations) if err == nil { - jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) - if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct - dst.GooglePayDetails = nil + jsonGooglePayDonations, _ := json.Marshal(dst.GooglePayDonations) + if string(jsonGooglePayDonations) == "{}" || !dst.GooglePayDonations.isValidType() { // empty struct + dst.GooglePayDonations = nil } else { match++ } } else { - dst.GooglePayDetails = nil + dst.GooglePayDonations = nil } - // try to unmarshal data into IdealDetails - err = json.Unmarshal(data, &dst.IdealDetails) + // try to unmarshal data into IdealDonations + err = json.Unmarshal(data, &dst.IdealDonations) if err == nil { - jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) - if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct - dst.IdealDetails = nil + jsonIdealDonations, _ := json.Marshal(dst.IdealDonations) + if string(jsonIdealDonations) == "{}" || !dst.IdealDonations.isValidType() { // empty struct + dst.IdealDonations = nil } else { match++ } } else { - dst.IdealDetails = nil + dst.IdealDonations = nil } - // try to unmarshal data into PayWithGoogleDetails - err = json.Unmarshal(data, &dst.PayWithGoogleDetails) + // try to unmarshal data into PayWithGoogleDonations + err = json.Unmarshal(data, &dst.PayWithGoogleDonations) if err == nil { - jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) - if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct - dst.PayWithGoogleDetails = nil + jsonPayWithGoogleDonations, _ := json.Marshal(dst.PayWithGoogleDonations) + if string(jsonPayWithGoogleDonations) == "{}" || !dst.PayWithGoogleDonations.isValidType() { // empty struct + dst.PayWithGoogleDonations = nil } else { match++ } } else { - dst.PayWithGoogleDetails = nil + dst.PayWithGoogleDonations = nil } if match > 1 { // more than 1 match // reset to nil - dst.ApplePayDetails = nil - dst.CardDetails = nil - dst.GooglePayDetails = nil - dst.IdealDetails = nil - dst.PayWithGoogleDetails = nil + dst.ApplePayDonations = nil + dst.CardDonations = nil + dst.GooglePayDonations = nil + dst.IdealDonations = nil + dst.PayWithGoogleDonations = nil return fmt.Errorf("data matches more than one schema in oneOf(DonationPaymentMethod)") } else if match == 1 { @@ -144,24 +144,24 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src DonationPaymentMethod) MarshalJSON() ([]byte, error) { - if src.ApplePayDetails != nil { - return json.Marshal(&src.ApplePayDetails) + if src.ApplePayDonations != nil { + return json.Marshal(&src.ApplePayDonations) } - if src.CardDetails != nil { - return json.Marshal(&src.CardDetails) + if src.CardDonations != nil { + return json.Marshal(&src.CardDonations) } - if src.GooglePayDetails != nil { - return json.Marshal(&src.GooglePayDetails) + if src.GooglePayDonations != nil { + return json.Marshal(&src.GooglePayDonations) } - if src.IdealDetails != nil { - return json.Marshal(&src.IdealDetails) + if src.IdealDonations != nil { + return json.Marshal(&src.IdealDonations) } - if src.PayWithGoogleDetails != nil { - return json.Marshal(&src.PayWithGoogleDetails) + if src.PayWithGoogleDonations != nil { + return json.Marshal(&src.PayWithGoogleDonations) } return nil, nil // no data in oneOf schemas @@ -172,24 +172,24 @@ func (obj *DonationPaymentMethod) GetActualInstance() interface{} { if obj == nil { return nil } - if obj.ApplePayDetails != nil { - return obj.ApplePayDetails + if obj.ApplePayDonations != nil { + return obj.ApplePayDonations } - if obj.CardDetails != nil { - return obj.CardDetails + if obj.CardDonations != nil { + return obj.CardDonations } - if obj.GooglePayDetails != nil { - return obj.GooglePayDetails + if obj.GooglePayDonations != nil { + return obj.GooglePayDonations } - if obj.IdealDetails != nil { - return obj.IdealDetails + if obj.IdealDonations != nil { + return obj.IdealDonations } - if obj.PayWithGoogleDetails != nil { - return obj.PayWithGoogleDetails + if obj.PayWithGoogleDonations != nil { + return obj.PayWithGoogleDonations } // all schemas are nil diff --git a/src/checkout/model_fund_origin.go b/src/checkout/model_fund_origin.go index bf99fba24..d90463c85 100644 --- a/src/checkout/model_fund_origin.go +++ b/src/checkout/model_fund_origin.go @@ -20,7 +20,12 @@ var _ common.MappedNullable = &FundOrigin{} // FundOrigin struct for FundOrigin type FundOrigin struct { BillingAddress *Address `json:"billingAddress,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + // Email address of the person. + ShopperEmail *string `json:"shopperEmail,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` + // Phone number of the person + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + WalletIdentifier *string `json:"walletIdentifier,omitempty"` } // NewFundOrigin instantiates a new FundOrigin object @@ -72,6 +77,38 @@ func (o *FundOrigin) SetBillingAddress(v Address) { o.BillingAddress = &v } +// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. +func (o *FundOrigin) GetShopperEmail() string { + if o == nil || common.IsNil(o.ShopperEmail) { + var ret string + return ret + } + return *o.ShopperEmail +} + +// GetShopperEmailOk returns a tuple with the ShopperEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FundOrigin) GetShopperEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.ShopperEmail) { + return nil, false + } + return o.ShopperEmail, true +} + +// HasShopperEmail returns a boolean if a field has been set. +func (o *FundOrigin) HasShopperEmail() bool { + if o != nil && !common.IsNil(o.ShopperEmail) { + return true + } + + return false +} + +// SetShopperEmail gets a reference to the given string and assigns it to the ShopperEmail field. +func (o *FundOrigin) SetShopperEmail(v string) { + o.ShopperEmail = &v +} + // GetShopperName returns the ShopperName field value if set, zero value otherwise. func (o *FundOrigin) GetShopperName() Name { if o == nil || common.IsNil(o.ShopperName) { @@ -104,6 +141,70 @@ func (o *FundOrigin) SetShopperName(v Name) { o.ShopperName = &v } +// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. +func (o *FundOrigin) GetTelephoneNumber() string { + if o == nil || common.IsNil(o.TelephoneNumber) { + var ret string + return ret + } + return *o.TelephoneNumber +} + +// GetTelephoneNumberOk returns a tuple with the TelephoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FundOrigin) GetTelephoneNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TelephoneNumber) { + return nil, false + } + return o.TelephoneNumber, true +} + +// HasTelephoneNumber returns a boolean if a field has been set. +func (o *FundOrigin) HasTelephoneNumber() bool { + if o != nil && !common.IsNil(o.TelephoneNumber) { + return true + } + + return false +} + +// SetTelephoneNumber gets a reference to the given string and assigns it to the TelephoneNumber field. +func (o *FundOrigin) SetTelephoneNumber(v string) { + o.TelephoneNumber = &v +} + +// GetWalletIdentifier returns the WalletIdentifier field value if set, zero value otherwise. +func (o *FundOrigin) GetWalletIdentifier() string { + if o == nil || common.IsNil(o.WalletIdentifier) { + var ret string + return ret + } + return *o.WalletIdentifier +} + +// GetWalletIdentifierOk returns a tuple with the WalletIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FundOrigin) GetWalletIdentifierOk() (*string, bool) { + if o == nil || common.IsNil(o.WalletIdentifier) { + return nil, false + } + return o.WalletIdentifier, true +} + +// HasWalletIdentifier returns a boolean if a field has been set. +func (o *FundOrigin) HasWalletIdentifier() bool { + if o != nil && !common.IsNil(o.WalletIdentifier) { + return true + } + + return false +} + +// SetWalletIdentifier gets a reference to the given string and assigns it to the WalletIdentifier field. +func (o *FundOrigin) SetWalletIdentifier(v string) { + o.WalletIdentifier = &v +} + func (o FundOrigin) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -117,9 +218,18 @@ func (o FundOrigin) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BillingAddress) { toSerialize["billingAddress"] = o.BillingAddress } + if !common.IsNil(o.ShopperEmail) { + toSerialize["shopperEmail"] = o.ShopperEmail + } if !common.IsNil(o.ShopperName) { toSerialize["shopperName"] = o.ShopperName } + if !common.IsNil(o.TelephoneNumber) { + toSerialize["telephoneNumber"] = o.TelephoneNumber + } + if !common.IsNil(o.WalletIdentifier) { + toSerialize["walletIdentifier"] = o.WalletIdentifier + } return toSerialize, nil } diff --git a/src/checkout/model_google_pay_details.go b/src/checkout/model_google_pay_details.go index 3ad9dbb4b..6b23b815c 100644 --- a/src/checkout/model_google_pay_details.go +++ b/src/checkout/model_google_pay_details.go @@ -23,6 +23,8 @@ type GooglePayDetails struct { CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. FundingSource *string `json:"fundingSource,omitempty"` + // The selected payment card network. + GooglePayCardNetwork *string `json:"googlePayCardNetwork,omitempty"` // The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. GooglePayToken string `json:"googlePayToken"` // This is the `recurringDetailReference` returned in the response when you created the token. @@ -120,6 +122,38 @@ func (o *GooglePayDetails) SetFundingSource(v string) { o.FundingSource = &v } +// GetGooglePayCardNetwork returns the GooglePayCardNetwork field value if set, zero value otherwise. +func (o *GooglePayDetails) GetGooglePayCardNetwork() string { + if o == nil || common.IsNil(o.GooglePayCardNetwork) { + var ret string + return ret + } + return *o.GooglePayCardNetwork +} + +// GetGooglePayCardNetworkOk returns a tuple with the GooglePayCardNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GooglePayDetails) GetGooglePayCardNetworkOk() (*string, bool) { + if o == nil || common.IsNil(o.GooglePayCardNetwork) { + return nil, false + } + return o.GooglePayCardNetwork, true +} + +// HasGooglePayCardNetwork returns a boolean if a field has been set. +func (o *GooglePayDetails) HasGooglePayCardNetwork() bool { + if o != nil && !common.IsNil(o.GooglePayCardNetwork) { + return true + } + + return false +} + +// SetGooglePayCardNetwork gets a reference to the given string and assigns it to the GooglePayCardNetwork field. +func (o *GooglePayDetails) SetGooglePayCardNetwork(v string) { + o.GooglePayCardNetwork = &v +} + // GetGooglePayToken returns the GooglePayToken field value func (o *GooglePayDetails) GetGooglePayToken() string { if o == nil { @@ -259,6 +293,9 @@ func (o GooglePayDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FundingSource) { toSerialize["fundingSource"] = o.FundingSource } + if !common.IsNil(o.GooglePayCardNetwork) { + toSerialize["googlePayCardNetwork"] = o.GooglePayCardNetwork + } toSerialize["googlePayToken"] = o.GooglePayToken if !common.IsNil(o.RecurringDetailReference) { toSerialize["recurringDetailReference"] = o.RecurringDetailReference diff --git a/src/checkout/model_google_pay_donations.go b/src/checkout/model_google_pay_donations.go new file mode 100644 index 000000000..ea4840387 --- /dev/null +++ b/src/checkout/model_google_pay_donations.go @@ -0,0 +1,365 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the GooglePayDonations type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &GooglePayDonations{} + +// GooglePayDonations struct for GooglePayDonations +type GooglePayDonations struct { + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + FundingSource *string `json:"fundingSource,omitempty"` + // The selected payment card network. + GooglePayCardNetwork *string `json:"googlePayCardNetwork,omitempty"` + // The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + GooglePayToken string `json:"googlePayToken"` + // This is the `recurringDetailReference` returned in the response when you created the token. + // Deprecated + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // **googlepay**, **paywithgoogle** + Type *string `json:"type,omitempty"` +} + +// NewGooglePayDonations instantiates a new GooglePayDonations 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 NewGooglePayDonations(googlePayToken string) *GooglePayDonations { + this := GooglePayDonations{} + this.GooglePayToken = googlePayToken + var type_ string = "googlepay" + this.Type = &type_ + return &this +} + +// NewGooglePayDonationsWithDefaults instantiates a new GooglePayDonations 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 NewGooglePayDonationsWithDefaults() *GooglePayDonations { + this := GooglePayDonations{} + var type_ string = "googlepay" + this.Type = &type_ + return &this +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *GooglePayDonations) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GooglePayDonations) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *GooglePayDonations) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *GooglePayDonations) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *GooglePayDonations) GetFundingSource() string { + if o == nil || common.IsNil(o.FundingSource) { + var ret string + return ret + } + return *o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GooglePayDonations) GetFundingSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *GooglePayDonations) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. +func (o *GooglePayDonations) SetFundingSource(v string) { + o.FundingSource = &v +} + +// GetGooglePayCardNetwork returns the GooglePayCardNetwork field value if set, zero value otherwise. +func (o *GooglePayDonations) GetGooglePayCardNetwork() string { + if o == nil || common.IsNil(o.GooglePayCardNetwork) { + var ret string + return ret + } + return *o.GooglePayCardNetwork +} + +// GetGooglePayCardNetworkOk returns a tuple with the GooglePayCardNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GooglePayDonations) GetGooglePayCardNetworkOk() (*string, bool) { + if o == nil || common.IsNil(o.GooglePayCardNetwork) { + return nil, false + } + return o.GooglePayCardNetwork, true +} + +// HasGooglePayCardNetwork returns a boolean if a field has been set. +func (o *GooglePayDonations) HasGooglePayCardNetwork() bool { + if o != nil && !common.IsNil(o.GooglePayCardNetwork) { + return true + } + + return false +} + +// SetGooglePayCardNetwork gets a reference to the given string and assigns it to the GooglePayCardNetwork field. +func (o *GooglePayDonations) SetGooglePayCardNetwork(v string) { + o.GooglePayCardNetwork = &v +} + +// GetGooglePayToken returns the GooglePayToken field value +func (o *GooglePayDonations) GetGooglePayToken() string { + if o == nil { + var ret string + return ret + } + + return o.GooglePayToken +} + +// GetGooglePayTokenOk returns a tuple with the GooglePayToken field value +// and a boolean to check if the value has been set. +func (o *GooglePayDonations) GetGooglePayTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GooglePayToken, true +} + +// SetGooglePayToken sets field value +func (o *GooglePayDonations) SetGooglePayToken(v string) { + o.GooglePayToken = v +} + +// GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. +// Deprecated +func (o *GooglePayDonations) GetRecurringDetailReference() string { + if o == nil || common.IsNil(o.RecurringDetailReference) { + var ret string + return ret + } + return *o.RecurringDetailReference +} + +// GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *GooglePayDonations) GetRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringDetailReference) { + return nil, false + } + return o.RecurringDetailReference, true +} + +// HasRecurringDetailReference returns a boolean if a field has been set. +func (o *GooglePayDonations) HasRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.RecurringDetailReference) { + return true + } + + return false +} + +// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field. +// Deprecated +func (o *GooglePayDonations) SetRecurringDetailReference(v string) { + o.RecurringDetailReference = &v +} + +// GetStoredPaymentMethodId returns the StoredPaymentMethodId field value if set, zero value otherwise. +func (o *GooglePayDonations) GetStoredPaymentMethodId() string { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + var ret string + return ret + } + return *o.StoredPaymentMethodId +} + +// GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GooglePayDonations) GetStoredPaymentMethodIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + return nil, false + } + return o.StoredPaymentMethodId, true +} + +// HasStoredPaymentMethodId returns a boolean if a field has been set. +func (o *GooglePayDonations) HasStoredPaymentMethodId() bool { + if o != nil && !common.IsNil(o.StoredPaymentMethodId) { + return true + } + + return false +} + +// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field. +func (o *GooglePayDonations) SetStoredPaymentMethodId(v string) { + o.StoredPaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GooglePayDonations) 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 *GooglePayDonations) 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 *GooglePayDonations) 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 *GooglePayDonations) SetType(v string) { + o.Type = &v +} + +func (o GooglePayDonations) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GooglePayDonations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + if !common.IsNil(o.GooglePayCardNetwork) { + toSerialize["googlePayCardNetwork"] = o.GooglePayCardNetwork + } + toSerialize["googlePayToken"] = o.GooglePayToken + if !common.IsNil(o.RecurringDetailReference) { + toSerialize["recurringDetailReference"] = o.RecurringDetailReference + } + if !common.IsNil(o.StoredPaymentMethodId) { + toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableGooglePayDonations struct { + value *GooglePayDonations + isSet bool +} + +func (v NullableGooglePayDonations) Get() *GooglePayDonations { + return v.value +} + +func (v *NullableGooglePayDonations) Set(val *GooglePayDonations) { + v.value = val + v.isSet = true +} + +func (v NullableGooglePayDonations) IsSet() bool { + return v.isSet +} + +func (v *NullableGooglePayDonations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGooglePayDonations(val *GooglePayDonations) *NullableGooglePayDonations { + return &NullableGooglePayDonations{value: val, isSet: true} +} + +func (v NullableGooglePayDonations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGooglePayDonations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *GooglePayDonations) isValidFundingSource() bool { + var allowedEnumValues = []string{"credit", "debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} +func (o *GooglePayDonations) isValidType() bool { + var allowedEnumValues = []string{"googlepay"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/checkout/model_ideal_donations.go b/src/checkout/model_ideal_donations.go new file mode 100644 index 000000000..8b821f8bc --- /dev/null +++ b/src/checkout/model_ideal_donations.go @@ -0,0 +1,282 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the IdealDonations type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &IdealDonations{} + +// IdealDonations struct for IdealDonations +type IdealDonations struct { + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. + Issuer string `json:"issuer"` + // This is the `recurringDetailReference` returned in the response when you created the token. + // Deprecated + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // **ideal** + Type *string `json:"type,omitempty"` +} + +// NewIdealDonations instantiates a new IdealDonations 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 NewIdealDonations(issuer string) *IdealDonations { + this := IdealDonations{} + this.Issuer = issuer + var type_ string = "ideal" + this.Type = &type_ + return &this +} + +// NewIdealDonationsWithDefaults instantiates a new IdealDonations 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 NewIdealDonationsWithDefaults() *IdealDonations { + this := IdealDonations{} + var type_ string = "ideal" + this.Type = &type_ + return &this +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *IdealDonations) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdealDonations) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *IdealDonations) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *IdealDonations) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetIssuer returns the Issuer field value +func (o *IdealDonations) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *IdealDonations) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *IdealDonations) SetIssuer(v string) { + o.Issuer = v +} + +// GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. +// Deprecated +func (o *IdealDonations) GetRecurringDetailReference() string { + if o == nil || common.IsNil(o.RecurringDetailReference) { + var ret string + return ret + } + return *o.RecurringDetailReference +} + +// GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *IdealDonations) GetRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringDetailReference) { + return nil, false + } + return o.RecurringDetailReference, true +} + +// HasRecurringDetailReference returns a boolean if a field has been set. +func (o *IdealDonations) HasRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.RecurringDetailReference) { + return true + } + + return false +} + +// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field. +// Deprecated +func (o *IdealDonations) SetRecurringDetailReference(v string) { + o.RecurringDetailReference = &v +} + +// GetStoredPaymentMethodId returns the StoredPaymentMethodId field value if set, zero value otherwise. +func (o *IdealDonations) GetStoredPaymentMethodId() string { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + var ret string + return ret + } + return *o.StoredPaymentMethodId +} + +// GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdealDonations) GetStoredPaymentMethodIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + return nil, false + } + return o.StoredPaymentMethodId, true +} + +// HasStoredPaymentMethodId returns a boolean if a field has been set. +func (o *IdealDonations) HasStoredPaymentMethodId() bool { + if o != nil && !common.IsNil(o.StoredPaymentMethodId) { + return true + } + + return false +} + +// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field. +func (o *IdealDonations) SetStoredPaymentMethodId(v string) { + o.StoredPaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *IdealDonations) 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 *IdealDonations) 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 *IdealDonations) 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 *IdealDonations) SetType(v string) { + o.Type = &v +} + +func (o IdealDonations) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdealDonations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + toSerialize["issuer"] = o.Issuer + if !common.IsNil(o.RecurringDetailReference) { + toSerialize["recurringDetailReference"] = o.RecurringDetailReference + } + if !common.IsNil(o.StoredPaymentMethodId) { + toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableIdealDonations struct { + value *IdealDonations + isSet bool +} + +func (v NullableIdealDonations) Get() *IdealDonations { + return v.value +} + +func (v *NullableIdealDonations) Set(val *IdealDonations) { + v.value = val + v.isSet = true +} + +func (v NullableIdealDonations) IsSet() bool { + return v.isSet +} + +func (v *NullableIdealDonations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdealDonations(val *IdealDonations) *NullableIdealDonations { + return &NullableIdealDonations{value: val, isSet: true} +} + +func (v NullableIdealDonations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdealDonations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *IdealDonations) isValidType() bool { + var allowedEnumValues = []string{"ideal"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/checkout/model_pay_with_google_donations.go b/src/checkout/model_pay_with_google_donations.go new file mode 100644 index 000000000..de6037c48 --- /dev/null +++ b/src/checkout/model_pay_with_google_donations.go @@ -0,0 +1,328 @@ +/* +Adyen Checkout API + +API version: 71 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PayWithGoogleDonations type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PayWithGoogleDonations{} + +// PayWithGoogleDonations struct for PayWithGoogleDonations +type PayWithGoogleDonations struct { + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + FundingSource *string `json:"fundingSource,omitempty"` + // The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + GooglePayToken string `json:"googlePayToken"` + // This is the `recurringDetailReference` returned in the response when you created the token. + // Deprecated + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + // This is the `recurringDetailReference` returned in the response when you created the token. + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // **paywithgoogle** + Type *string `json:"type,omitempty"` +} + +// NewPayWithGoogleDonations instantiates a new PayWithGoogleDonations 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 NewPayWithGoogleDonations(googlePayToken string) *PayWithGoogleDonations { + this := PayWithGoogleDonations{} + this.GooglePayToken = googlePayToken + var type_ string = "paywithgoogle" + this.Type = &type_ + return &this +} + +// NewPayWithGoogleDonationsWithDefaults instantiates a new PayWithGoogleDonations 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 NewPayWithGoogleDonationsWithDefaults() *PayWithGoogleDonations { + this := PayWithGoogleDonations{} + var type_ string = "paywithgoogle" + this.Type = &type_ + return &this +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *PayWithGoogleDonations) GetCheckoutAttemptId() string { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + var ret string + return ret + } + return *o.CheckoutAttemptId +} + +// GetCheckoutAttemptIdOk returns a tuple with the CheckoutAttemptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayWithGoogleDonations) GetCheckoutAttemptIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutAttemptId) { + return nil, false + } + return o.CheckoutAttemptId, true +} + +// HasCheckoutAttemptId returns a boolean if a field has been set. +func (o *PayWithGoogleDonations) HasCheckoutAttemptId() bool { + if o != nil && !common.IsNil(o.CheckoutAttemptId) { + return true + } + + return false +} + +// SetCheckoutAttemptId gets a reference to the given string and assigns it to the CheckoutAttemptId field. +func (o *PayWithGoogleDonations) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *PayWithGoogleDonations) GetFundingSource() string { + if o == nil || common.IsNil(o.FundingSource) { + var ret string + return ret + } + return *o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayWithGoogleDonations) GetFundingSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *PayWithGoogleDonations) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. +func (o *PayWithGoogleDonations) SetFundingSource(v string) { + o.FundingSource = &v +} + +// GetGooglePayToken returns the GooglePayToken field value +func (o *PayWithGoogleDonations) GetGooglePayToken() string { + if o == nil { + var ret string + return ret + } + + return o.GooglePayToken +} + +// GetGooglePayTokenOk returns a tuple with the GooglePayToken field value +// and a boolean to check if the value has been set. +func (o *PayWithGoogleDonations) GetGooglePayTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GooglePayToken, true +} + +// SetGooglePayToken sets field value +func (o *PayWithGoogleDonations) SetGooglePayToken(v string) { + o.GooglePayToken = v +} + +// GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. +// Deprecated +func (o *PayWithGoogleDonations) GetRecurringDetailReference() string { + if o == nil || common.IsNil(o.RecurringDetailReference) { + var ret string + return ret + } + return *o.RecurringDetailReference +} + +// GetRecurringDetailReferenceOk returns a tuple with the RecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *PayWithGoogleDonations) GetRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringDetailReference) { + return nil, false + } + return o.RecurringDetailReference, true +} + +// HasRecurringDetailReference returns a boolean if a field has been set. +func (o *PayWithGoogleDonations) HasRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.RecurringDetailReference) { + return true + } + + return false +} + +// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field. +// Deprecated +func (o *PayWithGoogleDonations) SetRecurringDetailReference(v string) { + o.RecurringDetailReference = &v +} + +// GetStoredPaymentMethodId returns the StoredPaymentMethodId field value if set, zero value otherwise. +func (o *PayWithGoogleDonations) GetStoredPaymentMethodId() string { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + var ret string + return ret + } + return *o.StoredPaymentMethodId +} + +// GetStoredPaymentMethodIdOk returns a tuple with the StoredPaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayWithGoogleDonations) GetStoredPaymentMethodIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoredPaymentMethodId) { + return nil, false + } + return o.StoredPaymentMethodId, true +} + +// HasStoredPaymentMethodId returns a boolean if a field has been set. +func (o *PayWithGoogleDonations) HasStoredPaymentMethodId() bool { + if o != nil && !common.IsNil(o.StoredPaymentMethodId) { + return true + } + + return false +} + +// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field. +func (o *PayWithGoogleDonations) SetStoredPaymentMethodId(v string) { + o.StoredPaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PayWithGoogleDonations) 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 *PayWithGoogleDonations) 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 *PayWithGoogleDonations) 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 *PayWithGoogleDonations) SetType(v string) { + o.Type = &v +} + +func (o PayWithGoogleDonations) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayWithGoogleDonations) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + toSerialize["googlePayToken"] = o.GooglePayToken + if !common.IsNil(o.RecurringDetailReference) { + toSerialize["recurringDetailReference"] = o.RecurringDetailReference + } + if !common.IsNil(o.StoredPaymentMethodId) { + toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullablePayWithGoogleDonations struct { + value *PayWithGoogleDonations + isSet bool +} + +func (v NullablePayWithGoogleDonations) Get() *PayWithGoogleDonations { + return v.value +} + +func (v *NullablePayWithGoogleDonations) Set(val *PayWithGoogleDonations) { + v.value = val + v.isSet = true +} + +func (v NullablePayWithGoogleDonations) IsSet() bool { + return v.isSet +} + +func (v *NullablePayWithGoogleDonations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayWithGoogleDonations(val *PayWithGoogleDonations) *NullablePayWithGoogleDonations { + return &NullablePayWithGoogleDonations{value: val, isSet: true} +} + +func (v NullablePayWithGoogleDonations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayWithGoogleDonations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PayWithGoogleDonations) isValidFundingSource() bool { + var allowedEnumValues = []string{"credit", "debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} +func (o *PayWithGoogleDonations) isValidType() bool { + var allowedEnumValues = []string{"paywithgoogle"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} 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/api_android_files_company_level.go b/src/management/api_android_files_company_level.go index e59f6ab47..33ea66f00 100644 --- a/src/management/api_android_files_company_level.go +++ b/src/management/api_android_files_company_level.go @@ -415,10 +415,10 @@ To make this request, your API credential must have the following [role](https:/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r AndroidFilesCompanyLevelApiUploadAndroidAppInput - Request parameters, see UploadAndroidAppInput -@return *http.Response, error +@return UploadAndroidAppResponse, *http.Response, error */ -func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r AndroidFilesCompanyLevelApiUploadAndroidAppInput) (*http.Response, error) { - var res interface{} +func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r AndroidFilesCompanyLevelApiUploadAndroidAppInput) (UploadAndroidAppResponse, *http.Response, error) { + res := &UploadAndroidAppResponse{} path := "/companies/{companyId}/androidApps" path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) queryParams := url.Values{} @@ -435,7 +435,7 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An ) if httpRes == nil { - return httpRes, err + return *res, httpRes, err } var serviceError common.RestServiceError @@ -443,42 +443,42 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) if decodeError != nil { - return httpRes, decodeError + return *res, httpRes, decodeError } - return httpRes, serviceError + return *res, httpRes, serviceError } if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) if decodeError != nil { - return httpRes, decodeError + return *res, httpRes, decodeError } - return httpRes, serviceError + return *res, httpRes, serviceError } if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) if decodeError != nil { - return httpRes, decodeError + return *res, httpRes, decodeError } - return httpRes, serviceError + return *res, httpRes, serviceError } if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) if decodeError != nil { - return httpRes, decodeError + return *res, httpRes, decodeError } - return httpRes, serviceError + return *res, httpRes, serviceError } if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) if decodeError != nil { - return httpRes, decodeError + return *res, httpRes, decodeError } - return httpRes, serviceError + return *res, httpRes, serviceError } - return httpRes, err + return *res, httpRes, err } 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/management/model_hardware.go b/src/management/model_hardware.go index 8fa24ffd3..560af349d 100644 --- a/src/management/model_hardware.go +++ b/src/management/model_hardware.go @@ -21,7 +21,9 @@ var _ common.MappedNullable = &Hardware{} type Hardware struct { // The brightness of the display when the terminal is being used, expressed as a percentage. DisplayMaximumBackLight *int32 `json:"displayMaximumBackLight,omitempty"` - // The hour of the day when the terminal is set to reboot to apply the configuration and software updates. By default, the restart hour is at 6:00 AM in the timezone of the terminal Minimum vaoue: 0, maximum value: 23. + // The hour of the day when the terminal is set to reset the Totals report. By default, the reset hour is at 6:00 AM in the timezone of the terminal. Minimum value: 0, maximum value: 23. + ResetTotalsHour *int32 `json:"resetTotalsHour,omitempty"` + // The hour of the day when the terminal is set to reboot to apply the configuration and software updates. By default, the restart hour is at 6:00 AM in the timezone of the terminal. Minimum value: 0, maximum value: 23. RestartHour *int32 `json:"restartHour,omitempty"` } @@ -74,6 +76,38 @@ func (o *Hardware) SetDisplayMaximumBackLight(v int32) { o.DisplayMaximumBackLight = &v } +// GetResetTotalsHour returns the ResetTotalsHour field value if set, zero value otherwise. +func (o *Hardware) GetResetTotalsHour() int32 { + if o == nil || common.IsNil(o.ResetTotalsHour) { + var ret int32 + return ret + } + return *o.ResetTotalsHour +} + +// GetResetTotalsHourOk returns a tuple with the ResetTotalsHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetResetTotalsHourOk() (*int32, bool) { + if o == nil || common.IsNil(o.ResetTotalsHour) { + return nil, false + } + return o.ResetTotalsHour, true +} + +// HasResetTotalsHour returns a boolean if a field has been set. +func (o *Hardware) HasResetTotalsHour() bool { + if o != nil && !common.IsNil(o.ResetTotalsHour) { + return true + } + + return false +} + +// SetResetTotalsHour gets a reference to the given int32 and assigns it to the ResetTotalsHour field. +func (o *Hardware) SetResetTotalsHour(v int32) { + o.ResetTotalsHour = &v +} + // GetRestartHour returns the RestartHour field value if set, zero value otherwise. func (o *Hardware) GetRestartHour() int32 { if o == nil || common.IsNil(o.RestartHour) { @@ -119,6 +153,9 @@ func (o Hardware) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DisplayMaximumBackLight) { toSerialize["displayMaximumBackLight"] = o.DisplayMaximumBackLight } + if !common.IsNil(o.ResetTotalsHour) { + toSerialize["resetTotalsHour"] = o.ResetTotalsHour + } if !common.IsNil(o.RestartHour) { toSerialize["restartHour"] = o.RestartHour } diff --git a/src/management/model_localization.go b/src/management/model_localization.go index 7b55d9e6a..39aef3d05 100644 --- a/src/management/model_localization.go +++ b/src/management/model_localization.go @@ -21,6 +21,8 @@ var _ common.MappedNullable = &Localization{} type Localization struct { // Language of the terminal. Language *string `json:"language,omitempty"` + // Secondary language of the terminal. + SecondaryLanguage *string `json:"secondaryLanguage,omitempty"` } // NewLocalization instantiates a new Localization object @@ -72,6 +74,38 @@ func (o *Localization) SetLanguage(v string) { o.Language = &v } +// GetSecondaryLanguage returns the SecondaryLanguage field value if set, zero value otherwise. +func (o *Localization) GetSecondaryLanguage() string { + if o == nil || common.IsNil(o.SecondaryLanguage) { + var ret string + return ret + } + return *o.SecondaryLanguage +} + +// GetSecondaryLanguageOk returns a tuple with the SecondaryLanguage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Localization) GetSecondaryLanguageOk() (*string, bool) { + if o == nil || common.IsNil(o.SecondaryLanguage) { + return nil, false + } + return o.SecondaryLanguage, true +} + +// HasSecondaryLanguage returns a boolean if a field has been set. +func (o *Localization) HasSecondaryLanguage() bool { + if o != nil && !common.IsNil(o.SecondaryLanguage) { + return true + } + + return false +} + +// SetSecondaryLanguage gets a reference to the given string and assigns it to the SecondaryLanguage field. +func (o *Localization) SetSecondaryLanguage(v string) { + o.SecondaryLanguage = &v +} + func (o Localization) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -85,6 +119,9 @@ func (o Localization) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Language) { toSerialize["language"] = o.Language } + if !common.IsNil(o.SecondaryLanguage) { + toSerialize["secondaryLanguage"] = o.SecondaryLanguage + } return toSerialize, nil } diff --git a/src/management/model_receipt_options.go b/src/management/model_receipt_options.go index 089e6ef52..fb5f8c403 100644 --- a/src/management/model_receipt_options.go +++ b/src/management/model_receipt_options.go @@ -21,6 +21,8 @@ var _ common.MappedNullable = &ReceiptOptions{} type ReceiptOptions struct { // The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px. Logo *string `json:"logo,omitempty"` + // Indicates whether a screen appears asking if you want to print the shopper receipt. + PromptBeforePrinting *bool `json:"promptBeforePrinting,omitempty"` // Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**. QrCodeData *string `json:"qrCodeData,omitempty"` } @@ -74,6 +76,38 @@ func (o *ReceiptOptions) SetLogo(v string) { o.Logo = &v } +// GetPromptBeforePrinting returns the PromptBeforePrinting field value if set, zero value otherwise. +func (o *ReceiptOptions) GetPromptBeforePrinting() bool { + if o == nil || common.IsNil(o.PromptBeforePrinting) { + var ret bool + return ret + } + return *o.PromptBeforePrinting +} + +// GetPromptBeforePrintingOk returns a tuple with the PromptBeforePrinting field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptOptions) GetPromptBeforePrintingOk() (*bool, bool) { + if o == nil || common.IsNil(o.PromptBeforePrinting) { + return nil, false + } + return o.PromptBeforePrinting, true +} + +// HasPromptBeforePrinting returns a boolean if a field has been set. +func (o *ReceiptOptions) HasPromptBeforePrinting() bool { + if o != nil && !common.IsNil(o.PromptBeforePrinting) { + return true + } + + return false +} + +// SetPromptBeforePrinting gets a reference to the given bool and assigns it to the PromptBeforePrinting field. +func (o *ReceiptOptions) SetPromptBeforePrinting(v bool) { + o.PromptBeforePrinting = &v +} + // GetQrCodeData returns the QrCodeData field value if set, zero value otherwise. func (o *ReceiptOptions) GetQrCodeData() string { if o == nil || common.IsNil(o.QrCodeData) { @@ -119,6 +153,9 @@ func (o ReceiptOptions) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Logo) { toSerialize["logo"] = o.Logo } + if !common.IsNil(o.PromptBeforePrinting) { + toSerialize["promptBeforePrinting"] = o.PromptBeforePrinting + } if !common.IsNil(o.QrCodeData) { toSerialize["qrCodeData"] = o.QrCodeData } diff --git a/src/management/model_tap_to_pay.go b/src/management/model_tap_to_pay.go index 813d0fa0d..1fdb161bf 100644 --- a/src/management/model_tap_to_pay.go +++ b/src/management/model_tap_to_pay.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &TapToPay{} // TapToPay struct for TapToPay type TapToPay struct { - // Platform merchants can customize the text that appears on the TapToPay screen during a transaction + // The text shown on the screen during the Tap to Pay transaction. MerchantDisplayName *string `json:"merchantDisplayName,omitempty"` } diff --git a/src/managementwebhook/model_account_capability_data.go b/src/managementwebhook/model_account_capability_data.go index a40059711..eed20a08f 100644 --- a/src/managementwebhook/model_account_capability_data.go +++ b/src/managementwebhook/model_account_capability_data.go @@ -10,6 +10,7 @@ package managementwebhook import ( "encoding/json" + "time" "github.com/adyen/adyen-go-api-library/v8/src/common" ) @@ -31,6 +32,8 @@ type AccountCapabilityData struct { Requested bool `json:"requested"` // The level that you requested for the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may require additional checks and increased monitoring.Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel string `json:"requestedLevel"` + // The verification deadline for the capability that will be disallowed if verification errors are not resolved. + VerificationDeadline *time.Time `json:"verificationDeadline,omitempty"` // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification was successful. * **rejected**: Adyen checked the information and found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -230,6 +233,38 @@ func (o *AccountCapabilityData) SetRequestedLevel(v string) { o.RequestedLevel = v } +// GetVerificationDeadline returns the VerificationDeadline field value if set, zero value otherwise. +func (o *AccountCapabilityData) GetVerificationDeadline() time.Time { + if o == nil || common.IsNil(o.VerificationDeadline) { + var ret time.Time + return ret + } + return *o.VerificationDeadline +} + +// GetVerificationDeadlineOk returns a tuple with the VerificationDeadline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountCapabilityData) GetVerificationDeadlineOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.VerificationDeadline) { + return nil, false + } + return o.VerificationDeadline, true +} + +// HasVerificationDeadline returns a boolean if a field has been set. +func (o *AccountCapabilityData) HasVerificationDeadline() bool { + if o != nil && !common.IsNil(o.VerificationDeadline) { + return true + } + + return false +} + +// SetVerificationDeadline gets a reference to the given time.Time and assigns it to the VerificationDeadline field. +func (o *AccountCapabilityData) SetVerificationDeadline(v time.Time) { + o.VerificationDeadline = &v +} + // GetVerificationStatus returns the VerificationStatus field value if set, zero value otherwise. func (o *AccountCapabilityData) GetVerificationStatus() string { if o == nil || common.IsNil(o.VerificationStatus) { @@ -286,6 +321,9 @@ func (o AccountCapabilityData) ToMap() (map[string]interface{}, error) { } toSerialize["requested"] = o.Requested toSerialize["requestedLevel"] = o.RequestedLevel + if !common.IsNil(o.VerificationDeadline) { + toSerialize["verificationDeadline"] = o.VerificationDeadline + } if !common.IsNil(o.VerificationStatus) { toSerialize["verificationStatus"] = o.VerificationStatus } 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) +}