diff --git a/src/checkout/model_checkout_payment_method.go b/src/checkout/model_checkout_payment_method.go index 451c63fcc..561a477d4 100644 --- a/src/checkout/model_checkout_payment_method.go +++ b/src/checkout/model_checkout_payment_method.go @@ -41,6 +41,7 @@ type CheckoutPaymentMethod struct { MobilePayDetails *MobilePayDetails MolPayDetails *MolPayDetails OpenInvoiceDetails *OpenInvoiceDetails + PayByBankDetails *PayByBankDetails PayPalDetails *PayPalDetails PayUUpiDetails *PayUUpiDetails PayWithGoogleDetails *PayWithGoogleDetails @@ -240,6 +241,13 @@ func OpenInvoiceDetailsAsCheckoutPaymentMethod(v *OpenInvoiceDetails) CheckoutPa } } +// PayByBankDetailsAsCheckoutPaymentMethod is a convenience function that returns PayByBankDetails wrapped in CheckoutPaymentMethod +func PayByBankDetailsAsCheckoutPaymentMethod(v *PayByBankDetails) CheckoutPaymentMethod { + return CheckoutPaymentMethod{ + PayByBankDetails: v, + } +} + // PayPalDetailsAsCheckoutPaymentMethod is a convenience function that returns PayPalDetails wrapped in CheckoutPaymentMethod func PayPalDetailsAsCheckoutPaymentMethod(v *PayPalDetails) CheckoutPaymentMethod { return CheckoutPaymentMethod{ @@ -687,6 +695,19 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { dst.OpenInvoiceDetails = nil } + // try to unmarshal data into PayByBankDetails + err = json.Unmarshal(data, &dst.PayByBankDetails) + if err == nil { + jsonPayByBankDetails, _ := json.Marshal(dst.PayByBankDetails) + if string(jsonPayByBankDetails) == "{}" || !dst.PayByBankDetails.isValidType() { // empty struct + dst.PayByBankDetails = nil + } else { + match++ + } + } else { + dst.PayByBankDetails = nil + } + // try to unmarshal data into PayPalDetails err = json.Unmarshal(data, &dst.PayPalDetails) if err == nil { @@ -910,6 +931,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { dst.MobilePayDetails = nil dst.MolPayDetails = nil dst.OpenInvoiceDetails = nil + dst.PayByBankDetails = nil dst.PayPalDetails = nil dst.PayUUpiDetails = nil dst.PayWithGoogleDetails = nil @@ -1040,6 +1062,10 @@ func (src CheckoutPaymentMethod) MarshalJSON() ([]byte, error) { return json.Marshal(&src.OpenInvoiceDetails) } + if src.PayByBankDetails != nil { + return json.Marshal(&src.PayByBankDetails) + } + if src.PayPalDetails != nil { return json.Marshal(&src.PayPalDetails) } @@ -1212,6 +1238,10 @@ func (obj *CheckoutPaymentMethod) GetActualInstance() interface{} { return obj.OpenInvoiceDetails } + if obj.PayByBankDetails != nil { + return obj.PayByBankDetails + } + if obj.PayPalDetails != nil { return obj.PayPalDetails } diff --git a/src/checkout/model_pay_by_bank_details.go b/src/checkout/model_pay_by_bank_details.go new file mode 100644 index 000000000..e799f9811 --- /dev/null +++ b/src/checkout/model_pay_by_bank_details.go @@ -0,0 +1,202 @@ +/* +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/v10/src/common" +) + +// checks if the PayByBankDetails type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PayByBankDetails{} + +// PayByBankDetails struct for PayByBankDetails +type PayByBankDetails struct { + // The checkout attempt identifier. + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The PayByBank issuer value of the shopper's selected bank. + Issuer *string `json:"issuer,omitempty"` + // **paybybank** + Type string `json:"type"` +} + +// NewPayByBankDetails instantiates a new PayByBankDetails 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 NewPayByBankDetails(type_ string) *PayByBankDetails { + this := PayByBankDetails{} + this.Type = type_ + return &this +} + +// NewPayByBankDetailsWithDefaults instantiates a new PayByBankDetails 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 NewPayByBankDetailsWithDefaults() *PayByBankDetails { + this := PayByBankDetails{} + var type_ string = "paybybank" + this.Type = type_ + return &this +} + +// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. +func (o *PayByBankDetails) 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 *PayByBankDetails) 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 *PayByBankDetails) 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 *PayByBankDetails) SetCheckoutAttemptId(v string) { + o.CheckoutAttemptId = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *PayByBankDetails) GetIssuer() string { + if o == nil || common.IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayByBankDetails) GetIssuerOk() (*string, bool) { + if o == nil || common.IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *PayByBankDetails) HasIssuer() bool { + if o != nil && !common.IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *PayByBankDetails) SetIssuer(v string) { + o.Issuer = &v +} + +// GetType returns the Type field value +func (o *PayByBankDetails) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PayByBankDetails) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PayByBankDetails) SetType(v string) { + o.Type = v +} + +func (o PayByBankDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayByBankDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CheckoutAttemptId) { + toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId + } + if !common.IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePayByBankDetails struct { + value *PayByBankDetails + isSet bool +} + +func (v NullablePayByBankDetails) Get() *PayByBankDetails { + return v.value +} + +func (v *NullablePayByBankDetails) Set(val *PayByBankDetails) { + v.value = val + v.isSet = true +} + +func (v NullablePayByBankDetails) IsSet() bool { + return v.isSet +} + +func (v *NullablePayByBankDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayByBankDetails(val *PayByBankDetails) *NullablePayByBankDetails { + return &NullablePayByBankDetails{value: val, isSet: true} +} + +func (v NullablePayByBankDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayByBankDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PayByBankDetails) isValidType() bool { + var allowedEnumValues = []string{"paybybank"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 3946f7951..8bb65576b 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -162,7 +162,7 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { } func (o *PaymentDetails) isValidType() bool { - var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "paypo", "scalapay", "scalapay_3x", "scalapay_4x", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} + var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "paypo", "scalapay", "scalapay_3x", "scalapay_4x", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/management/api_webhooks_merchant_level.go b/src/management/api_webhooks_merchant_level.go index 42e970bd8..d4d019b29 100644 --- a/src/management/api_webhooks_merchant_level.go +++ b/src/management/api_webhooks_merchant_level.go @@ -252,6 +252,8 @@ ListAllWebhooks List all webhooks Lists all webhook configurations for the merchant account. +> This call does not return webhook configurations for the company account to which the specified merchant account belongs. You can see these in your Customer Area under **Developers** > **Webhooks**. + To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Webhooks read * Management API—Webhooks read and write