From af6943e96bb269a304b823a040e2f994ea48ae44 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Wed, 25 Oct 2023 15:04:34 +0200 Subject: [PATCH 1/9] ITT-604: Update Checkout models (#223) * ITT-604: Update Checkout models * Updated models * Make nil check conditional * Update api.mustache --- Makefile | 3 +- src/checkout/api_modifications.go | 106 +- src/checkout/api_orders.go | 48 +- src/checkout/api_payment_links.go | 10 +- src/checkout/api_payments.go | 80 +- src/checkout/api_recurring.go | 24 +- src/checkout/api_utility.go | 26 +- src/checkout/model_ach_details.go | 46 + src/checkout/model_additional_data_airline.go | 26 +- .../model_additional_data_car_rental.go | 24 +- src/checkout/model_additional_data_level23.go | 34 +- src/checkout/model_additional_data_lodging.go | 10 +- ...odel_additional_data_temporary_services.go | 4 +- src/checkout/model_afterpay_details.go | 2 +- src/checkout/model_amazon_pay_details.go | 39 +- src/checkout/model_balance_check_request.go | 2 +- src/checkout/model_billing_address.go | 265 ++ src/checkout/model_card_details.go | 2 +- .../model_checkout_balance_check_request.go | 1713 ----------- .../model_checkout_balance_check_response.go | 336 --- .../model_checkout_cancel_order_request.go | 143 - .../model_checkout_cancel_order_response.go | 154 - .../model_checkout_create_order_request.go | 208 -- .../model_checkout_create_order_response.go | 420 --- .../model_checkout_utility_request.go | 116 - .../model_checkout_utility_response.go | 125 - src/checkout/model_checkout_voucher_action.go | 37 + .../model_create_apple_pay_session_request.go | 172 -- .../model_create_checkout_session_request.go | 70 +- .../model_create_checkout_session_response.go | 84 +- ...el_create_payment_amount_update_request.go | 264 -- .../model_create_payment_cancel_request.go | 153 - .../model_create_payment_capture_request.go | 254 -- .../model_create_payment_link_request.go | 1489 ---------- .../model_create_payment_refund_request.go | 301 -- .../model_create_payment_reversal_request.go | 153 - ...reate_standalone_payment_cancel_request.go | 181 -- src/checkout/model_delivery_address.go | 337 +++ src/checkout/model_details_request.go | 229 -- src/checkout/model_doku_details.go | 2 +- src/checkout/model_donation_payment_method.go | 233 ++ .../model_donation_payment_request.go | 215 +- ...donation_payment_request_payment_method.go | 1253 -------- src/checkout/model_donation_response.go | 355 --- src/checkout/model_klarna_details.go | 37 + src/checkout/model_line_item.go | 2 +- src/checkout/model_pay_pal_details.go | 74 + .../model_payment_amount_update_resource.go | 348 --- src/checkout/model_payment_cancel_resource.go | 247 -- src/checkout/model_payment_capture_request.go | 12 +- .../model_payment_capture_resource.go | 348 --- .../model_payment_capture_response.go | 12 +- .../model_payment_completion_details.go | 38 +- src/checkout/model_payment_details.go | 2 +- .../model_payment_details_response.go | 4 +- .../model_payment_donation_request.go | 2552 ----------------- src/checkout/model_payment_link_response.go | 8 +- src/checkout/model_payment_methods_request.go | 2 +- src/checkout/model_payment_refund_resource.go | 394 --- src/checkout/model_payment_request.go | 175 +- src/checkout/model_payment_response.go | 4 +- src/checkout/model_payment_response_action.go | 44 +- .../model_payment_reversal_resource.go | 247 -- src/checkout/model_payment_setup_request.go | 4 +- .../model_payment_verification_response.go | 4 +- .../model_platform_chargeback_logic.go | 7 +- src/checkout/model_split.go | 2 +- ...odel_standalone_payment_cancel_resource.go | 247 -- .../model_stored_payment_method_details.go | 2 +- src/checkout/model_sub_merchant_2.go | 268 -- src/checkout/model_sub_merchant_info.go | 20 +- src/checkout/model_three_ds2_request_data.go | 4 - src/checkout/model_three_ds2_result.go | 86 +- templates/custom/api.mustache | 10 +- tests/api_modifications_test.go | 10 +- tests/checkout_test.go | 18 +- 76 files changed, 1919 insertions(+), 13061 deletions(-) create mode 100644 src/checkout/model_billing_address.go delete mode 100644 src/checkout/model_checkout_balance_check_request.go delete mode 100644 src/checkout/model_checkout_balance_check_response.go delete mode 100644 src/checkout/model_checkout_cancel_order_request.go delete mode 100644 src/checkout/model_checkout_cancel_order_response.go delete mode 100644 src/checkout/model_checkout_create_order_request.go delete mode 100644 src/checkout/model_checkout_create_order_response.go delete mode 100644 src/checkout/model_checkout_utility_request.go delete mode 100644 src/checkout/model_checkout_utility_response.go delete mode 100644 src/checkout/model_create_apple_pay_session_request.go delete mode 100644 src/checkout/model_create_payment_amount_update_request.go delete mode 100644 src/checkout/model_create_payment_cancel_request.go delete mode 100644 src/checkout/model_create_payment_capture_request.go delete mode 100644 src/checkout/model_create_payment_link_request.go delete mode 100644 src/checkout/model_create_payment_refund_request.go delete mode 100644 src/checkout/model_create_payment_reversal_request.go delete mode 100644 src/checkout/model_create_standalone_payment_cancel_request.go create mode 100644 src/checkout/model_delivery_address.go delete mode 100644 src/checkout/model_details_request.go create mode 100644 src/checkout/model_donation_payment_method.go delete mode 100644 src/checkout/model_donation_payment_request_payment_method.go delete mode 100644 src/checkout/model_donation_response.go delete mode 100644 src/checkout/model_payment_amount_update_resource.go delete mode 100644 src/checkout/model_payment_cancel_resource.go delete mode 100644 src/checkout/model_payment_capture_resource.go delete mode 100644 src/checkout/model_payment_donation_request.go delete mode 100644 src/checkout/model_payment_refund_resource.go delete mode 100644 src/checkout/model_payment_reversal_resource.go delete mode 100644 src/checkout/model_standalone_payment_cancel_resource.go delete mode 100644 src/checkout/model_sub_merchant_2.go diff --git a/Makefile b/Makefile index a7b66d2dd..b29149b96 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ $(services): schema $(openapi-generator-jar) $(goimports) --global-property modelDocs=false \ --skip-validate-spec \ --enable-post-process-file \ - --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings PaymentRequest_paymentMethod=CheckoutPaymentMethod \ + --inline-schema-name-mappings DonationPaymentRequest_paymentMethod=DonationPaymentMethod \ --additional-properties=serviceName=$(serviceName) \ --additional-properties=$(if $(hasRestServiceError),hasRestServiceError=true) rm -rf $(output)/$(@)/go.{mod,sum} diff --git a/src/checkout/api_modifications.go b/src/checkout/api_modifications.go index b418a40e1..6782d7ba0 100644 --- a/src/checkout/api_modifications.go +++ b/src/checkout/api_modifications.go @@ -22,8 +22,8 @@ type ModificationsApi common.Service // All parameters accepted by ModificationsApi.CancelAuthorisedPayment type ModificationsApiCancelAuthorisedPaymentInput struct { - idempotencyKey *string - createStandalonePaymentCancelRequest *CreateStandalonePaymentCancelRequest + idempotencyKey *string + standalonePaymentCancelRequest *StandalonePaymentCancelRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -32,8 +32,8 @@ func (r ModificationsApiCancelAuthorisedPaymentInput) IdempotencyKey(idempotency return r } -func (r ModificationsApiCancelAuthorisedPaymentInput) CreateStandalonePaymentCancelRequest(createStandalonePaymentCancelRequest CreateStandalonePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentInput { - r.createStandalonePaymentCancelRequest = &createStandalonePaymentCancelRequest +func (r ModificationsApiCancelAuthorisedPaymentInput) StandalonePaymentCancelRequest(standalonePaymentCancelRequest StandalonePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentInput { + r.standalonePaymentCancelRequest = &standalonePaymentCancelRequest return r } @@ -59,10 +59,10 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCancelAuthorisedPaymentInput - Request parameters, see CancelAuthorisedPaymentInput -@return StandalonePaymentCancelResource, *http.Response, error +@return StandalonePaymentCancelResponse, *http.Response, error */ -func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentInput) (StandalonePaymentCancelResource, *http.Response, error) { - res := &StandalonePaymentCancelResource{} +func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentInput) (StandalonePaymentCancelResponse, *http.Response, error) { + res := &StandalonePaymentCancelResponse{} path := "/cancels" queryParams := url.Values{} headerParams := make(map[string]string) @@ -72,7 +72,7 @@ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r Modifi httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createStandalonePaymentCancelRequest, + r.standalonePaymentCancelRequest, res, http.MethodPost, a.BasePath()+path, @@ -85,9 +85,9 @@ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r Modifi // All parameters accepted by ModificationsApi.CancelAuthorisedPaymentByPspReference type ModificationsApiCancelAuthorisedPaymentByPspReferenceInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentCancelRequest *CreatePaymentCancelRequest + paymentPspReference string + idempotencyKey *string + paymentCancelRequest *PaymentCancelRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -96,8 +96,8 @@ func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) IdempotencyK return r } -func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) CreatePaymentCancelRequest(createPaymentCancelRequest CreatePaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentByPspReferenceInput { - r.createPaymentCancelRequest = &createPaymentCancelRequest +func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) PaymentCancelRequest(paymentCancelRequest PaymentCancelRequest) ModificationsApiCancelAuthorisedPaymentByPspReferenceInput { + r.paymentCancelRequest = &paymentCancelRequest return r } @@ -125,10 +125,10 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput - Request parameters, see CancelAuthorisedPaymentByPspReferenceInput -@return PaymentCancelResource, *http.Response, error +@return PaymentCancelResponse, *http.Response, error */ -func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) (PaymentCancelResource, *http.Response, error) { - res := &PaymentCancelResource{} +func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) (PaymentCancelResponse, *http.Response, error) { + res := &PaymentCancelResponse{} path := "/payments/{paymentPspReference}/cancels" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -139,7 +139,7 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Con httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentCancelRequest, + r.paymentCancelRequest, res, http.MethodPost, a.BasePath()+path, @@ -152,9 +152,9 @@ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Con // All parameters accepted by ModificationsApi.CaptureAuthorisedPayment type ModificationsApiCaptureAuthorisedPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentCaptureRequest *CreatePaymentCaptureRequest + paymentPspReference string + idempotencyKey *string + paymentCaptureRequest *PaymentCaptureRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -163,8 +163,8 @@ func (r ModificationsApiCaptureAuthorisedPaymentInput) IdempotencyKey(idempotenc return r } -func (r ModificationsApiCaptureAuthorisedPaymentInput) CreatePaymentCaptureRequest(createPaymentCaptureRequest CreatePaymentCaptureRequest) ModificationsApiCaptureAuthorisedPaymentInput { - r.createPaymentCaptureRequest = &createPaymentCaptureRequest +func (r ModificationsApiCaptureAuthorisedPaymentInput) PaymentCaptureRequest(paymentCaptureRequest PaymentCaptureRequest) ModificationsApiCaptureAuthorisedPaymentInput { + r.paymentCaptureRequest = &paymentCaptureRequest return r } @@ -192,10 +192,10 @@ For more information, refer to [Capture](https://docs.adyen.com/online-payments/ @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiCaptureAuthorisedPaymentInput - Request parameters, see CaptureAuthorisedPaymentInput -@return PaymentCaptureResource, *http.Response, error +@return PaymentCaptureResponse, *http.Response, error */ -func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r ModificationsApiCaptureAuthorisedPaymentInput) (PaymentCaptureResource, *http.Response, error) { - res := &PaymentCaptureResource{} +func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r ModificationsApiCaptureAuthorisedPaymentInput) (PaymentCaptureResponse, *http.Response, error) { + res := &PaymentCaptureResponse{} path := "/payments/{paymentPspReference}/captures" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -206,7 +206,7 @@ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r Modif httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentCaptureRequest, + r.paymentCaptureRequest, res, http.MethodPost, a.BasePath()+path, @@ -219,9 +219,9 @@ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r Modif // All parameters accepted by ModificationsApi.RefundCapturedPayment type ModificationsApiRefundCapturedPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentRefundRequest *CreatePaymentRefundRequest + paymentPspReference string + idempotencyKey *string + paymentRefundRequest *PaymentRefundRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -230,8 +230,8 @@ func (r ModificationsApiRefundCapturedPaymentInput) IdempotencyKey(idempotencyKe return r } -func (r ModificationsApiRefundCapturedPaymentInput) CreatePaymentRefundRequest(createPaymentRefundRequest CreatePaymentRefundRequest) ModificationsApiRefundCapturedPaymentInput { - r.createPaymentRefundRequest = &createPaymentRefundRequest +func (r ModificationsApiRefundCapturedPaymentInput) PaymentRefundRequest(paymentRefundRequest PaymentRefundRequest) ModificationsApiRefundCapturedPaymentInput { + r.paymentRefundRequest = &paymentRefundRequest return r } @@ -261,10 +261,10 @@ For more information, refer to [Refund](https://docs.adyen.com/online-payments/r @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiRefundCapturedPaymentInput - Request parameters, see RefundCapturedPaymentInput -@return PaymentRefundResource, *http.Response, error +@return PaymentRefundResponse, *http.Response, error */ -func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r ModificationsApiRefundCapturedPaymentInput) (PaymentRefundResource, *http.Response, error) { - res := &PaymentRefundResource{} +func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r ModificationsApiRefundCapturedPaymentInput) (PaymentRefundResponse, *http.Response, error) { + res := &PaymentRefundResponse{} path := "/payments/{paymentPspReference}/refunds" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -275,7 +275,7 @@ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r Modifica httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentRefundRequest, + r.paymentRefundRequest, res, http.MethodPost, a.BasePath()+path, @@ -288,9 +288,9 @@ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r Modifica // All parameters accepted by ModificationsApi.RefundOrCancelPayment type ModificationsApiRefundOrCancelPaymentInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentReversalRequest *CreatePaymentReversalRequest + paymentPspReference string + idempotencyKey *string + paymentReversalRequest *PaymentReversalRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -299,8 +299,8 @@ func (r ModificationsApiRefundOrCancelPaymentInput) IdempotencyKey(idempotencyKe return r } -func (r ModificationsApiRefundOrCancelPaymentInput) CreatePaymentReversalRequest(createPaymentReversalRequest CreatePaymentReversalRequest) ModificationsApiRefundOrCancelPaymentInput { - r.createPaymentReversalRequest = &createPaymentReversalRequest +func (r ModificationsApiRefundOrCancelPaymentInput) PaymentReversalRequest(paymentReversalRequest PaymentReversalRequest) ModificationsApiRefundOrCancelPaymentInput { + r.paymentReversalRequest = &paymentReversalRequest return r } @@ -327,10 +327,10 @@ For more information, refer to [Reversal](https://docs.adyen.com/online-payments @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiRefundOrCancelPaymentInput - Request parameters, see RefundOrCancelPaymentInput -@return PaymentReversalResource, *http.Response, error +@return PaymentReversalResponse, *http.Response, error */ -func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r ModificationsApiRefundOrCancelPaymentInput) (PaymentReversalResource, *http.Response, error) { - res := &PaymentReversalResource{} +func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r ModificationsApiRefundOrCancelPaymentInput) (PaymentReversalResponse, *http.Response, error) { + res := &PaymentReversalResponse{} path := "/payments/{paymentPspReference}/reversals" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -341,7 +341,7 @@ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r Modifica httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentReversalRequest, + r.paymentReversalRequest, res, http.MethodPost, a.BasePath()+path, @@ -354,9 +354,9 @@ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r Modifica // All parameters accepted by ModificationsApi.UpdateAuthorisedAmount type ModificationsApiUpdateAuthorisedAmountInput struct { - paymentPspReference string - idempotencyKey *string - createPaymentAmountUpdateRequest *CreatePaymentAmountUpdateRequest + paymentPspReference string + idempotencyKey *string + paymentAmountUpdateRequest *PaymentAmountUpdateRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -365,8 +365,8 @@ func (r ModificationsApiUpdateAuthorisedAmountInput) IdempotencyKey(idempotencyK return r } -func (r ModificationsApiUpdateAuthorisedAmountInput) CreatePaymentAmountUpdateRequest(createPaymentAmountUpdateRequest CreatePaymentAmountUpdateRequest) ModificationsApiUpdateAuthorisedAmountInput { - r.createPaymentAmountUpdateRequest = &createPaymentAmountUpdateRequest +func (r ModificationsApiUpdateAuthorisedAmountInput) PaymentAmountUpdateRequest(paymentAmountUpdateRequest PaymentAmountUpdateRequest) ModificationsApiUpdateAuthorisedAmountInput { + r.paymentAmountUpdateRequest = &paymentAmountUpdateRequest return r } @@ -394,10 +394,10 @@ For more information, refer to [Authorisation adjustment](https://docs.adyen.com @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r ModificationsApiUpdateAuthorisedAmountInput - Request parameters, see UpdateAuthorisedAmountInput -@return PaymentAmountUpdateResource, *http.Response, error +@return PaymentAmountUpdateResponse, *http.Response, error */ -func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r ModificationsApiUpdateAuthorisedAmountInput) (PaymentAmountUpdateResource, *http.Response, error) { - res := &PaymentAmountUpdateResource{} +func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r ModificationsApiUpdateAuthorisedAmountInput) (PaymentAmountUpdateResponse, *http.Response, error) { + res := &PaymentAmountUpdateResponse{} path := "/payments/{paymentPspReference}/amountUpdates" path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) queryParams := url.Values{} @@ -408,7 +408,7 @@ func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r Modific httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentAmountUpdateRequest, + r.paymentAmountUpdateRequest, res, http.MethodPost, a.BasePath()+path, diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index 19a2216b2..adb16656c 100644 --- a/src/checkout/api_orders.go +++ b/src/checkout/api_orders.go @@ -21,8 +21,8 @@ type OrdersApi common.Service // All parameters accepted by OrdersApi.CancelOrder type OrdersApiCancelOrderInput struct { - idempotencyKey *string - checkoutCancelOrderRequest *CheckoutCancelOrderRequest + idempotencyKey *string + cancelOrderRequest *CancelOrderRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -31,8 +31,8 @@ func (r OrdersApiCancelOrderInput) IdempotencyKey(idempotencyKey string) OrdersA return r } -func (r OrdersApiCancelOrderInput) CheckoutCancelOrderRequest(checkoutCancelOrderRequest CheckoutCancelOrderRequest) OrdersApiCancelOrderInput { - r.checkoutCancelOrderRequest = &checkoutCancelOrderRequest +func (r OrdersApiCancelOrderInput) CancelOrderRequest(cancelOrderRequest CancelOrderRequest) OrdersApiCancelOrderInput { + r.cancelOrderRequest = &cancelOrderRequest return r } @@ -52,10 +52,10 @@ Cancels an order. Cancellation of an order results in an automatic rollback of a @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiCancelOrderInput - Request parameters, see CancelOrderInput -@return CheckoutCancelOrderResponse, *http.Response, error +@return CancelOrderResponse, *http.Response, error */ -func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput) (CheckoutCancelOrderResponse, *http.Response, error) { - res := &CheckoutCancelOrderResponse{} +func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput) (CancelOrderResponse, *http.Response, error) { + res := &CancelOrderResponse{} path := "/orders/cancel" queryParams := url.Values{} headerParams := make(map[string]string) @@ -65,7 +65,7 @@ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutCancelOrderRequest, + r.cancelOrderRequest, res, http.MethodPost, a.BasePath()+path, @@ -78,8 +78,8 @@ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput // All parameters accepted by OrdersApi.GetBalanceOfGiftCard type OrdersApiGetBalanceOfGiftCardInput struct { - idempotencyKey *string - checkoutBalanceCheckRequest *CheckoutBalanceCheckRequest + idempotencyKey *string + balanceCheckRequest *BalanceCheckRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -88,8 +88,8 @@ func (r OrdersApiGetBalanceOfGiftCardInput) IdempotencyKey(idempotencyKey string return r } -func (r OrdersApiGetBalanceOfGiftCardInput) CheckoutBalanceCheckRequest(checkoutBalanceCheckRequest CheckoutBalanceCheckRequest) OrdersApiGetBalanceOfGiftCardInput { - r.checkoutBalanceCheckRequest = &checkoutBalanceCheckRequest +func (r OrdersApiGetBalanceOfGiftCardInput) BalanceCheckRequest(balanceCheckRequest BalanceCheckRequest) OrdersApiGetBalanceOfGiftCardInput { + r.balanceCheckRequest = &balanceCheckRequest return r } @@ -109,10 +109,10 @@ Retrieves the balance remaining on a shopper's gift card. To check a gift card's @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiGetBalanceOfGiftCardInput - Request parameters, see GetBalanceOfGiftCardInput -@return CheckoutBalanceCheckResponse, *http.Response, error +@return BalanceCheckResponse, *http.Response, error */ -func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBalanceOfGiftCardInput) (CheckoutBalanceCheckResponse, *http.Response, error) { - res := &CheckoutBalanceCheckResponse{} +func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBalanceOfGiftCardInput) (BalanceCheckResponse, *http.Response, error) { + res := &BalanceCheckResponse{} path := "/paymentMethods/balance" queryParams := url.Values{} headerParams := make(map[string]string) @@ -122,7 +122,7 @@ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBala httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutBalanceCheckRequest, + r.balanceCheckRequest, res, http.MethodPost, a.BasePath()+path, @@ -135,8 +135,8 @@ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBala // All parameters accepted by OrdersApi.Orders type OrdersApiOrdersInput struct { - idempotencyKey *string - checkoutCreateOrderRequest *CheckoutCreateOrderRequest + idempotencyKey *string + createOrderRequest *CreateOrderRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -145,8 +145,8 @@ func (r OrdersApiOrdersInput) IdempotencyKey(idempotencyKey string) OrdersApiOrd return r } -func (r OrdersApiOrdersInput) CheckoutCreateOrderRequest(checkoutCreateOrderRequest CheckoutCreateOrderRequest) OrdersApiOrdersInput { - r.checkoutCreateOrderRequest = &checkoutCreateOrderRequest +func (r OrdersApiOrdersInput) CreateOrderRequest(createOrderRequest CreateOrderRequest) OrdersApiOrdersInput { + r.createOrderRequest = &createOrderRequest return r } @@ -166,10 +166,10 @@ Creates an order to be used for partial payments. Make a POST `/orders` call bef @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r OrdersApiOrdersInput - Request parameters, see OrdersInput -@return CheckoutCreateOrderResponse, *http.Response, error +@return CreateOrderResponse, *http.Response, error */ -func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (CheckoutCreateOrderResponse, *http.Response, error) { - res := &CheckoutCreateOrderResponse{} +func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (CreateOrderResponse, *http.Response, error) { + res := &CreateOrderResponse{} path := "/orders" queryParams := url.Values{} headerParams := make(map[string]string) @@ -179,7 +179,7 @@ func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (Checkou httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutCreateOrderRequest, + r.createOrderRequest, res, http.MethodPost, a.BasePath()+path, diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index 25d68596b..3c74f91fb 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -67,8 +67,8 @@ func (a *PaymentLinksApi) GetPaymentLink(ctx context.Context, r PaymentLinksApiG // All parameters accepted by PaymentLinksApi.PaymentLinks type PaymentLinksApiPaymentLinksInput struct { - idempotencyKey *string - createPaymentLinkRequest *CreatePaymentLinkRequest + idempotencyKey *string + paymentLinkRequest *PaymentLinkRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -77,8 +77,8 @@ func (r PaymentLinksApiPaymentLinksInput) IdempotencyKey(idempotencyKey string) return r } -func (r PaymentLinksApiPaymentLinksInput) CreatePaymentLinkRequest(createPaymentLinkRequest CreatePaymentLinkRequest) PaymentLinksApiPaymentLinksInput { - r.createPaymentLinkRequest = &createPaymentLinkRequest +func (r PaymentLinksApiPaymentLinksInput) PaymentLinkRequest(paymentLinkRequest PaymentLinkRequest) PaymentLinksApiPaymentLinksInput { + r.paymentLinkRequest = &paymentLinkRequest return r } @@ -113,7 +113,7 @@ func (a *PaymentLinksApi) PaymentLinks(ctx context.Context, r PaymentLinksApiPay httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createPaymentLinkRequest, + r.paymentLinkRequest, res, http.MethodPost, a.BasePath()+path, diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index 6c90b5134..180745258 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -12,6 +12,7 @@ import ( "context" "net/http" "net/url" + "strings" "github.com/adyen/adyen-go-api-library/v8/src/common" ) @@ -83,7 +84,7 @@ func (a *PaymentsApi) CardDetails(ctx context.Context, r PaymentsApiCardDetailsI // All parameters accepted by PaymentsApi.Donations type PaymentsApiDonationsInput struct { idempotencyKey *string - paymentDonationRequest *PaymentDonationRequest + donationPaymentRequest *DonationPaymentRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -92,8 +93,8 @@ func (r PaymentsApiDonationsInput) IdempotencyKey(idempotencyKey string) Payment return r } -func (r PaymentsApiDonationsInput) PaymentDonationRequest(paymentDonationRequest PaymentDonationRequest) PaymentsApiDonationsInput { - r.paymentDonationRequest = &paymentDonationRequest +func (r PaymentsApiDonationsInput) DonationPaymentRequest(donationPaymentRequest DonationPaymentRequest) PaymentsApiDonationsInput { + r.donationPaymentRequest = &donationPaymentRequest return r } @@ -115,10 +116,10 @@ For more information, see [Donations](https://docs.adyen.com/online-payments/don @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PaymentsApiDonationsInput - Request parameters, see DonationsInput -@return DonationResponse, *http.Response, error +@return DonationPaymentResponse, *http.Response, error */ -func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput) (DonationResponse, *http.Response, error) { - res := &DonationResponse{} +func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput) (DonationPaymentResponse, *http.Response, error) { + res := &DonationPaymentResponse{} path := "/donations" queryParams := url.Values{} headerParams := make(map[string]string) @@ -128,7 +129,7 @@ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.paymentDonationRequest, + r.donationPaymentRequest, res, http.MethodPost, a.BasePath()+path, @@ -139,6 +140,61 @@ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput return *res, httpRes, err } +// All parameters accepted by PaymentsApi.GetResultOfPaymentSession +type PaymentsApiGetResultOfPaymentSessionInput struct { + sessionId string + sessionResult *string +} + +// The `sessionResult` value from the Drop-in or Component. +func (r PaymentsApiGetResultOfPaymentSessionInput) SessionResult(sessionResult string) PaymentsApiGetResultOfPaymentSessionInput { + r.sessionResult = &sessionResult + return r +} + +/* +Prepare a request for GetResultOfPaymentSession +@param sessionId A unique identifier of the session. +@return PaymentsApiGetResultOfPaymentSessionInput +*/ +func (a *PaymentsApi) GetResultOfPaymentSessionInput(sessionId string) PaymentsApiGetResultOfPaymentSessionInput { + return PaymentsApiGetResultOfPaymentSessionInput{ + sessionId: sessionId, + } +} + +/* +GetResultOfPaymentSession Get the result of a payment session + +Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiGetResultOfPaymentSessionInput - Request parameters, see GetResultOfPaymentSessionInput +@return SessionResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) GetResultOfPaymentSession(ctx context.Context, r PaymentsApiGetResultOfPaymentSessionInput) (SessionResultResponse, *http.Response, error) { + res := &SessionResultResponse{} + path := "/sessions/{sessionId}" + path = strings.Replace(path, "{"+"sessionId"+"}", url.PathEscape(common.ParameterValueToString(r.sessionId, "sessionId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.sessionResult != nil { + common.ParameterAddToQuery(queryParams, "sessionResult", r.sessionResult, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} + // All parameters accepted by PaymentsApi.PaymentMethods type PaymentsApiPaymentMethodsInput struct { idempotencyKey *string @@ -260,8 +316,8 @@ func (a *PaymentsApi) Payments(ctx context.Context, r PaymentsApiPaymentsInput) // All parameters accepted by PaymentsApi.PaymentsDetails type PaymentsApiPaymentsDetailsInput struct { - idempotencyKey *string - detailsRequest *DetailsRequest + idempotencyKey *string + paymentDetailsRequest *PaymentDetailsRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -270,8 +326,8 @@ func (r PaymentsApiPaymentsDetailsInput) IdempotencyKey(idempotencyKey string) P return r } -func (r PaymentsApiPaymentsDetailsInput) DetailsRequest(detailsRequest DetailsRequest) PaymentsApiPaymentsDetailsInput { - r.detailsRequest = &detailsRequest +func (r PaymentsApiPaymentsDetailsInput) PaymentDetailsRequest(paymentDetailsRequest PaymentDetailsRequest) PaymentsApiPaymentsDetailsInput { + r.paymentDetailsRequest = &paymentDetailsRequest return r } @@ -306,7 +362,7 @@ func (a *PaymentsApi) PaymentsDetails(ctx context.Context, r PaymentsApiPayments httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.detailsRequest, + r.paymentDetailsRequest, res, http.MethodPost, a.BasePath()+path, diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index c4017a48d..3344a221e 100644 --- a/src/checkout/api_recurring.go +++ b/src/checkout/api_recurring.go @@ -22,9 +22,9 @@ type RecurringApi common.Service // All parameters accepted by RecurringApi.DeleteTokenForStoredPaymentDetails type RecurringApiDeleteTokenForStoredPaymentDetailsInput struct { - recurringId string - shopperReference *string - merchantAccount *string + storedPaymentMethodId string + shopperReference *string + merchantAccount *string } // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -41,12 +41,12 @@ func (r RecurringApiDeleteTokenForStoredPaymentDetailsInput) MerchantAccount(mer /* Prepare a request for DeleteTokenForStoredPaymentDetails -@param recurringId The unique identifier of the token. +@param storedPaymentMethodId The unique identifier of the token. @return RecurringApiDeleteTokenForStoredPaymentDetailsInput */ -func (a *RecurringApi) DeleteTokenForStoredPaymentDetailsInput(recurringId string) RecurringApiDeleteTokenForStoredPaymentDetailsInput { +func (a *RecurringApi) DeleteTokenForStoredPaymentDetailsInput(storedPaymentMethodId string) RecurringApiDeleteTokenForStoredPaymentDetailsInput { return RecurringApiDeleteTokenForStoredPaymentDetailsInput{ - recurringId: recurringId, + storedPaymentMethodId: storedPaymentMethodId, } } @@ -57,12 +57,12 @@ Deletes the token identified in the path. The token can no longer be used with p @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r RecurringApiDeleteTokenForStoredPaymentDetailsInput - Request parameters, see DeleteTokenForStoredPaymentDetailsInput -@return StoredPaymentMethodResource, *http.Response, error +@return *http.Response, error */ -func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r RecurringApiDeleteTokenForStoredPaymentDetailsInput) (StoredPaymentMethodResource, *http.Response, error) { - res := &StoredPaymentMethodResource{} - path := "/storedPaymentMethods/{recurringId}" - path = strings.Replace(path, "{"+"recurringId"+"}", url.PathEscape(common.ParameterValueToString(r.recurringId, "recurringId")), -1) +func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r RecurringApiDeleteTokenForStoredPaymentDetailsInput) (*http.Response, error) { + var res interface{} + path := "/storedPaymentMethods/{storedPaymentMethodId}" + path = strings.Replace(path, "{"+"storedPaymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.storedPaymentMethodId, "storedPaymentMethodId")), -1) queryParams := url.Values{} headerParams := make(map[string]string) if r.shopperReference != nil { @@ -82,7 +82,7 @@ func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r headerParams, ) - return *res, httpRes, err + return httpRes, err } // All parameters accepted by RecurringApi.GetTokensForStoredPaymentDetails diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index d38e43925..ca8f91d74 100644 --- a/src/checkout/api_utility.go +++ b/src/checkout/api_utility.go @@ -21,8 +21,8 @@ type UtilityApi common.Service // All parameters accepted by UtilityApi.GetApplePaySession type UtilityApiGetApplePaySessionInput struct { - idempotencyKey *string - createApplePaySessionRequest *CreateApplePaySessionRequest + idempotencyKey *string + applePaySessionRequest *ApplePaySessionRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -31,8 +31,8 @@ func (r UtilityApiGetApplePaySessionInput) IdempotencyKey(idempotencyKey string) return r } -func (r UtilityApiGetApplePaySessionInput) CreateApplePaySessionRequest(createApplePaySessionRequest CreateApplePaySessionRequest) UtilityApiGetApplePaySessionInput { - r.createApplePaySessionRequest = &createApplePaySessionRequest +func (r UtilityApiGetApplePaySessionInput) ApplePaySessionRequest(applePaySessionRequest ApplePaySessionRequest) UtilityApiGetApplePaySessionInput { + r.applePaySessionRequest = &applePaySessionRequest return r } @@ -67,7 +67,7 @@ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetAppl httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.createApplePaySessionRequest, + r.applePaySessionRequest, res, http.MethodPost, a.BasePath()+path, @@ -80,8 +80,8 @@ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetAppl // All parameters accepted by UtilityApi.OriginKeys type UtilityApiOriginKeysInput struct { - idempotencyKey *string - checkoutUtilityRequest *CheckoutUtilityRequest + idempotencyKey *string + utilityRequest *UtilityRequest } // A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). @@ -90,8 +90,8 @@ func (r UtilityApiOriginKeysInput) IdempotencyKey(idempotencyKey string) Utility return r } -func (r UtilityApiOriginKeysInput) CheckoutUtilityRequest(checkoutUtilityRequest CheckoutUtilityRequest) UtilityApiOriginKeysInput { - r.checkoutUtilityRequest = &checkoutUtilityRequest +func (r UtilityApiOriginKeysInput) UtilityRequest(utilityRequest UtilityRequest) UtilityApiOriginKeysInput { + r.utilityRequest = &utilityRequest return r } @@ -114,12 +114,12 @@ This operation takes the origin domains and returns a JSON object containing the @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r UtilityApiOriginKeysInput - Request parameters, see OriginKeysInput -@return CheckoutUtilityResponse, *http.Response, error +@return UtilityResponse, *http.Response, error Deprecated */ -func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput) (CheckoutUtilityResponse, *http.Response, error) { - res := &CheckoutUtilityResponse{} +func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput) (UtilityResponse, *http.Response, error) { + res := &UtilityResponse{} path := "/originKeys" queryParams := url.Values{} headerParams := make(map[string]string) @@ -129,7 +129,7 @@ func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.checkoutUtilityRequest, + r.utilityRequest, res, http.MethodPost, a.BasePath()+path, diff --git a/src/checkout/model_ach_details.go b/src/checkout/model_ach_details.go index 6a5347874..322f8cf2a 100644 --- a/src/checkout/model_ach_details.go +++ b/src/checkout/model_ach_details.go @@ -21,6 +21,8 @@ var _ common.MappedNullable = &AchDetails{} type AchDetails struct { // The bank account number (without separators). BankAccountNumber string `json:"bankAccountNumber"` + // The bank account type (checking, savings...). + BankAccountType *string `json:"bankAccountType,omitempty"` // The bank routing number of the account. The field value is `nil` in most cases. BankLocationId *string `json:"bankLocationId,omitempty"` // The checkout attempt identifier. @@ -86,6 +88,38 @@ func (o *AchDetails) SetBankAccountNumber(v string) { o.BankAccountNumber = v } +// GetBankAccountType returns the BankAccountType field value if set, zero value otherwise. +func (o *AchDetails) GetBankAccountType() string { + if o == nil || common.IsNil(o.BankAccountType) { + var ret string + return ret + } + return *o.BankAccountType +} + +// GetBankAccountTypeOk returns a tuple with the BankAccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AchDetails) GetBankAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.BankAccountType) { + return nil, false + } + return o.BankAccountType, true +} + +// HasBankAccountType returns a boolean if a field has been set. +func (o *AchDetails) HasBankAccountType() bool { + if o != nil && !common.IsNil(o.BankAccountType) { + return true + } + + return false +} + +// SetBankAccountType gets a reference to the given string and assigns it to the BankAccountType field. +func (o *AchDetails) SetBankAccountType(v string) { + o.BankAccountType = &v +} + // GetBankLocationId returns the BankLocationId field value if set, zero value otherwise. func (o *AchDetails) GetBankLocationId() string { if o == nil || common.IsNil(o.BankLocationId) { @@ -356,6 +390,9 @@ func (o AchDetails) MarshalJSON() ([]byte, error) { func (o AchDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["bankAccountNumber"] = o.BankAccountNumber + if !common.IsNil(o.BankAccountType) { + toSerialize["bankAccountType"] = o.BankAccountType + } if !common.IsNil(o.BankLocationId) { toSerialize["bankLocationId"] = o.BankLocationId } @@ -419,6 +456,15 @@ func (v *NullableAchDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } +func (o *AchDetails) isValidBankAccountType() bool { + var allowedEnumValues = []string{"balance", "checking", "deposit", "general", "other", "payment", "savings"} + for _, allowed := range allowedEnumValues { + if o.GetBankAccountType() == allowed { + return true + } + } + return false +} func (o *AchDetails) isValidType() bool { var allowedEnumValues = []string{"ach", "ach_plaid"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_additional_data_airline.go b/src/checkout/model_additional_data_airline.go index eed9f34c4..8d6fde8d8 100644 --- a/src/checkout/model_additional_data_airline.go +++ b/src/checkout/model_additional_data_airline.go @@ -23,9 +23,9 @@ type AdditionalDataAirline struct { AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineCode *string `json:"airline.airline_code,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineDesignatorCode *string `json:"airline.airline_designator_code,omitempty"` // The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters AirlineBoardingFee *string `json:"airline.boarding_fee,omitempty"` @@ -37,21 +37,21 @@ type AdditionalDataAirline struct { AirlineDocumentType *string `json:"airline.document_type,omitempty"` // The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters AirlineFlightDate *string `json:"airline.flight_date,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineLegCarrierCode *string `json:"airline.leg.carrier_code,omitempty"` - // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros + // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros. AirlineLegClassOfTravel *string `json:"airline.leg.class_of_travel,omitempty"` // Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters AirlineLegDateOfTravel *string `json:"airline.leg.date_of_travel,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDepartAirport *string `json:"airline.leg.depart_airport,omitempty"` - // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros + // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 *Must not be all zeros. AirlineLegDepartTax *string `json:"airline.leg.depart_tax,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDestinationCode *string `json:"airline.leg.destination_code,omitempty"` - // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros + // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces *Must not be all zeros. AirlineLegFareBaseCode *string `json:"airline.leg.fare_base_code,omitempty"` - // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces *Must not be all zeros. AirlineLegFlightNumber *string `json:"airline.leg.flight_number,omitempty"` // A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character AirlineLegStopOverCode *string `json:"airline.leg.stop_over_code,omitempty"` @@ -65,15 +65,15 @@ type AdditionalDataAirline struct { AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros + // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces *Must not be all zeros. AirlinePassengerName string `json:"airline.passenger_name"` // The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters AirlineTicketIssueAddress *string `json:"airline.ticket_issue_address,omitempty"` - // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros + // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros. AirlineTicketNumber *string `json:"airline.ticket_number,omitempty"` - // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros + // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyCode *string `json:"airline.travel_agency_code,omitempty"` - // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyName *string `json:"airline.travel_agency_name,omitempty"` } diff --git a/src/checkout/model_additional_data_car_rental.go b/src/checkout/model_additional_data_car_rental.go index 734b5f0f2..6437ed896 100644 --- a/src/checkout/model_additional_data_car_rental.go +++ b/src/checkout/model_additional_data_car_rental.go @@ -21,19 +21,19 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} type AdditionalDataCarRental struct { // The pick-up date. * Date format: `yyyyMMdd` CarRentalCheckOutDate *string `json:"carRental.checkOutDate,omitempty"` - // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` // Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 CarRentalFuelCharges *string `json:"carRental.fuelCharges,omitempty"` - // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros + // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. CarRentalInsuranceCharges *string `json:"carRental.insuranceCharges,omitempty"` - // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationCity *string `json:"carRental.locationCity,omitempty"` // The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalLocationCountry *string `json:"carRental.locationCountry,omitempty"` - // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationStateProvince *string `json:"carRental.locationStateProvince,omitempty"` // Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` @@ -43,25 +43,25 @@ type AdditionalDataCarRental struct { CarRentalRate *string `json:"carRental.rate,omitempty"` // Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate CarRentalRateIndicator *string `json:"carRental.rateIndicator,omitempty"` - // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros + // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalAgreementNumber *string `json:"carRental.rentalAgreementNumber,omitempty"` - // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros + // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalClassId *string `json:"carRental.rentalClassId,omitempty"` - // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros + // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRenterName *string `json:"carRental.renterName,omitempty"` - // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnCity *string `json:"carRental.returnCity,omitempty"` // The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalReturnCountry *string `json:"carRental.returnCountry,omitempty"` // The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros + // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnLocationId *string `json:"carRental.returnLocationId,omitempty"` - // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnStateProvince *string `json:"carRental.returnStateProvince,omitempty"` // Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected CarRentalTaxExemptIndicator *string `json:"carRental.taxExemptIndicator,omitempty"` - // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 + // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/checkout/model_additional_data_level23.go b/src/checkout/model_additional_data_level23.go index 3c1b0b8cb..b6ebf9f9a 100644 --- a/src/checkout/model_additional_data_level23.go +++ b/src/checkout/model_additional_data_level23.go @@ -19,39 +19,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros + // The customer code. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters + // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters EnhancedSchemeDataDestinationCountryCode *string `json:"enhancedSchemeData.destinationCountryCode,omitempty"` - // The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + // The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space EnhancedSchemeDataDestinationPostalCode *string `json:"enhancedSchemeData.destinationPostalCode,omitempty"` - // Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space + // Destination state or province code. * Encoding: ASCII * Max length: 3 characters * Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters EnhancedSchemeDataDutyAmount *string `json:"enhancedSchemeData.dutyAmount,omitempty"` - // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric *Max length: 12 characters EnhancedSchemeDataFreightAmount *string `json:"enhancedSchemeData.freightAmount,omitempty"` - // The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The [UNSPC commodity code](https://www.unspsc.org/) of the item. * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrCommodityCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].commodityCode,omitempty"` - // A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros + // A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrDescription *string `json:"enhancedSchemeData.itemDetailLine[itemNr].description,omitempty"` - // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` - // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces + // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` - // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` - // The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros + // The unit of measurement for an item. * Encoding: ASCII Max length: 3 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure,omitempty"` - // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters + // The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters EnhancedSchemeDataOrderDate *string `json:"enhancedSchemeData.orderDate,omitempty"` - // The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros + // The postal code of the address the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataShipFromPostalCode *string `json:"enhancedSchemeData.shipFromPostalCode,omitempty"` - // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. *Encoding: Numeric *Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } diff --git a/src/checkout/model_additional_data_lodging.go b/src/checkout/model_additional_data_lodging.go index 40cf96403..3fa00957f 100644 --- a/src/checkout/model_additional_data_lodging.go +++ b/src/checkout/model_additional_data_lodging.go @@ -23,13 +23,13 @@ type AdditionalDataLodging struct { LodgingCheckInDate *string `json:"lodging.checkInDate,omitempty"` // The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. LodgingCheckOutDate *string `json:"lodging.checkOutDate,omitempty"` - // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` // Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character LodgingFireSafetyActIndicator *string `json:"lodging.fireSafetyActIndicator,omitempty"` // The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFolioCashAdvances *string `json:"lodging.folioCashAdvances,omitempty"` - // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros + // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space *Must not be all zeros. LodgingFolioNumber *string `json:"lodging.folioNumber,omitempty"` // Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFoodBeverageCharges *string `json:"lodging.foodBeverageCharges,omitempty"` @@ -37,9 +37,9 @@ type AdditionalDataLodging struct { LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` // The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingRoom1Rate *string `json:"lodging.room1.rate,omitempty"` @@ -47,7 +47,7 @@ type AdditionalDataLodging struct { LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingTotalTax *string `json:"lodging.totalTax,omitempty"` - // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters + // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/checkout/model_additional_data_temporary_services.go b/src/checkout/model_additional_data_temporary_services.go index 6c5ba2fa1..8760d41c2 100644 --- a/src/checkout/model_additional_data_temporary_services.go +++ b/src/checkout/model_additional_data_temporary_services.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} type AdditionalDataTemporaryServices struct { // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` // The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros EnhancedSchemeDataRegularHoursRate *string `json:"enhancedSchemeData.regularHoursRate,omitempty"` diff --git a/src/checkout/model_afterpay_details.go b/src/checkout/model_afterpay_details.go index 0e591bbae..c8ad19ce5 100644 --- a/src/checkout/model_afterpay_details.go +++ b/src/checkout/model_afterpay_details.go @@ -344,7 +344,7 @@ func (v *NullableAfterpayDetails) UnmarshalJSON(src []byte) error { } func (o *AfterpayDetails) isValidType() bool { - var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b"} + var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b", "clearpay"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_amazon_pay_details.go b/src/checkout/model_amazon_pay_details.go index 24e1da433..27381828e 100644 --- a/src/checkout/model_amazon_pay_details.go +++ b/src/checkout/model_amazon_pay_details.go @@ -19,10 +19,12 @@ var _ common.MappedNullable = &AmazonPayDetails{} // AmazonPayDetails struct for AmazonPayDetails type AmazonPayDetails struct { - // This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. + // This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. AmazonPayToken *string `json:"amazonPayToken,omitempty"` // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + // The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. + CheckoutSessionId *string `json:"checkoutSessionId,omitempty"` // **amazonpay** Type *string `json:"type,omitempty"` } @@ -112,6 +114,38 @@ func (o *AmazonPayDetails) SetCheckoutAttemptId(v string) { o.CheckoutAttemptId = &v } +// GetCheckoutSessionId returns the CheckoutSessionId field value if set, zero value otherwise. +func (o *AmazonPayDetails) GetCheckoutSessionId() string { + if o == nil || common.IsNil(o.CheckoutSessionId) { + var ret string + return ret + } + return *o.CheckoutSessionId +} + +// GetCheckoutSessionIdOk returns a tuple with the CheckoutSessionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmazonPayDetails) GetCheckoutSessionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CheckoutSessionId) { + return nil, false + } + return o.CheckoutSessionId, true +} + +// HasCheckoutSessionId returns a boolean if a field has been set. +func (o *AmazonPayDetails) HasCheckoutSessionId() bool { + if o != nil && !common.IsNil(o.CheckoutSessionId) { + return true + } + + return false +} + +// SetCheckoutSessionId gets a reference to the given string and assigns it to the CheckoutSessionId field. +func (o *AmazonPayDetails) SetCheckoutSessionId(v string) { + o.CheckoutSessionId = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *AmazonPayDetails) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -160,6 +194,9 @@ func (o AmazonPayDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CheckoutAttemptId) { toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId } + if !common.IsNil(o.CheckoutSessionId) { + toSerialize["checkoutSessionId"] = o.CheckoutSessionId + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/checkout/model_balance_check_request.go b/src/checkout/model_balance_check_request.go index dd93efb00..34308994d 100644 --- a/src/checkout/model_balance_check_request.go +++ b/src/checkout/model_balance_check_request.go @@ -41,7 +41,7 @@ type BalanceCheckRequest struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` diff --git a/src/checkout/model_billing_address.go b/src/checkout/model_billing_address.go new file mode 100644 index 000000000..31bcd8e98 --- /dev/null +++ b/src/checkout/model_billing_address.go @@ -0,0 +1,265 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BillingAddress type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BillingAddress{} + +// BillingAddress struct for BillingAddress +type BillingAddress struct { + // The name of the city. Maximum length: 3000 characters. + City string `json:"city"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + Country string `json:"country"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName string `json:"houseNumberOrName"` + // A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + PostalCode string `json:"postalCode"` + // The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + Street string `json:"street"` +} + +// NewBillingAddress instantiates a new BillingAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBillingAddress(city string, country string, houseNumberOrName string, postalCode string, street string) *BillingAddress { + this := BillingAddress{} + this.City = city + this.Country = country + this.HouseNumberOrName = houseNumberOrName + this.PostalCode = postalCode + this.Street = street + return &this +} + +// NewBillingAddressWithDefaults instantiates a new BillingAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBillingAddressWithDefaults() *BillingAddress { + this := BillingAddress{} + return &this +} + +// GetCity returns the City field value +func (o *BillingAddress) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +func (o *BillingAddress) SetCity(v string) { + o.City = v +} + +// GetCountry returns the Country field value +func (o *BillingAddress) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *BillingAddress) SetCountry(v string) { + o.Country = v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value +func (o *BillingAddress) GetHouseNumberOrName() string { + if o == nil { + var ret string + return ret + } + + return o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HouseNumberOrName, true +} + +// SetHouseNumberOrName sets field value +func (o *BillingAddress) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = v +} + +// GetPostalCode returns the PostalCode field value +func (o *BillingAddress) GetPostalCode() string { + if o == nil { + var ret string + return ret + } + + return o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PostalCode, true +} + +// SetPostalCode sets field value +func (o *BillingAddress) SetPostalCode(v string) { + o.PostalCode = v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *BillingAddress) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *BillingAddress) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *BillingAddress) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value +func (o *BillingAddress) GetStreet() string { + if o == nil { + var ret string + return ret + } + + return o.Street +} + +// GetStreetOk returns a tuple with the Street field value +// and a boolean to check if the value has been set. +func (o *BillingAddress) GetStreetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Street, true +} + +// SetStreet sets field value +func (o *BillingAddress) SetStreet(v string) { + o.Street = v +} + +func (o BillingAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BillingAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["city"] = o.City + toSerialize["country"] = o.Country + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + toSerialize["postalCode"] = o.PostalCode + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + toSerialize["street"] = o.Street + return toSerialize, nil +} + +type NullableBillingAddress struct { + value *BillingAddress + isSet bool +} + +func (v NullableBillingAddress) Get() *BillingAddress { + return v.value +} + +func (v *NullableBillingAddress) Set(val *BillingAddress) { + v.value = val + v.isSet = true +} + +func (v NullableBillingAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableBillingAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBillingAddress(val *BillingAddress) *NullableBillingAddress { + return &NullableBillingAddress{value: val, isSet: true} +} + +func (v NullableBillingAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBillingAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index 13aba3ec7..7e1e8b667 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -811,7 +811,7 @@ func (o *CardDetails) isValidFundingSource() bool { return false } func (o *CardDetails) isValidType() bool { - var allowedEnumValues = []string{"scheme", "networkToken", "giftcard", "alliancedata", "card"} + var allowedEnumValues = []string{"scheme", "networkToken", "card"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_checkout_balance_check_request.go b/src/checkout/model_checkout_balance_check_request.go deleted file mode 100644 index 56399a2a2..000000000 --- a/src/checkout/model_checkout_balance_check_request.go +++ /dev/null @@ -1,1713 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutBalanceCheckRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutBalanceCheckRequest{} - -// CheckoutBalanceCheckRequest struct for CheckoutBalanceCheckRequest -type CheckoutBalanceCheckRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` - // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` - // The delay between the authorisation and scheduled auto-capture, specified in hours. - CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` - // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` - // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliveryDate *time.Time `json:"deliveryDate,omitempty"` - // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` - // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. - LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - Mcc *string `json:"mcc,omitempty"` - // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` - // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` - // The collection that contains the type of the payment method and its specific information. - PaymentMethod map[string]string `json:"paymentMethod"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` - // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` - // Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - SelectedBrand *string `json:"selectedBrand,omitempty"` - // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` - // A session ID used to identify a payment session. - SessionId *string `json:"sessionId,omitempty"` - // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - ShopperEmail *string `json:"shopperEmail,omitempty"` - // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - ShopperIP *string `json:"shopperIP,omitempty"` - // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - // The combination of a language code and a country code to specify the language to be used in the payment. - ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` - // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - ShopperReference *string `json:"shopperReference,omitempty"` - // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - ShopperStatement *string `json:"shopperStatement,omitempty"` - // The shopper's social security number. - SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. - Store *string `json:"store,omitempty"` - // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` - // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - // Deprecated - ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` - // The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - TotalsGroup *string `json:"totalsGroup,omitempty"` - // Set to true if the payment should be routed to a trusted MID. - TrustedShopper *bool `json:"trustedShopper,omitempty"` -} - -// NewCheckoutBalanceCheckRequest instantiates a new CheckoutBalanceCheckRequest 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 NewCheckoutBalanceCheckRequest(merchantAccount string, paymentMethod map[string]string) *CheckoutBalanceCheckRequest { - this := CheckoutBalanceCheckRequest{} - this.MerchantAccount = merchantAccount - this.PaymentMethod = paymentMethod - var threeDSAuthenticationOnly bool = false - this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly - return &this -} - -// NewCheckoutBalanceCheckRequestWithDefaults instantiates a new CheckoutBalanceCheckRequest 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 NewCheckoutBalanceCheckRequestWithDefaults() *CheckoutBalanceCheckRequest { - this := CheckoutBalanceCheckRequest{} - var threeDSAuthenticationOnly bool = false - this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly - return &this -} - -// GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetAccountInfo() AccountInfo { - if o == nil || common.IsNil(o.AccountInfo) { - var ret AccountInfo - return ret - } - return *o.AccountInfo -} - -// GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetAccountInfoOk() (*AccountInfo, bool) { - if o == nil || common.IsNil(o.AccountInfo) { - return nil, false - } - return o.AccountInfo, true -} - -// HasAccountInfo returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasAccountInfo() bool { - if o != nil && !common.IsNil(o.AccountInfo) { - return true - } - - return false -} - -// SetAccountInfo gets a reference to the given AccountInfo and assigns it to the AccountInfo field. -func (o *CheckoutBalanceCheckRequest) SetAccountInfo(v AccountInfo) { - o.AccountInfo = &v -} - -// GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetAdditionalAmount() Amount { - if o == nil || common.IsNil(o.AdditionalAmount) { - var ret Amount - return ret - } - return *o.AdditionalAmount -} - -// GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetAdditionalAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.AdditionalAmount) { - return nil, false - } - return o.AdditionalAmount, true -} - -// HasAdditionalAmount returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasAdditionalAmount() bool { - if o != nil && !common.IsNil(o.AdditionalAmount) { - return true - } - - return false -} - -// SetAdditionalAmount gets a reference to the given Amount and assigns it to the AdditionalAmount field. -func (o *CheckoutBalanceCheckRequest) SetAdditionalAmount(v Amount) { - o.AdditionalAmount = &v -} - -// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetAdditionalData() map[string]string { - if o == nil || common.IsNil(o.AdditionalData) { - var ret map[string]string - return ret - } - return *o.AdditionalData -} - -// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetAdditionalDataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.AdditionalData) { - return nil, false - } - return o.AdditionalData, true -} - -// HasAdditionalData returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasAdditionalData() bool { - if o != nil && !common.IsNil(o.AdditionalData) { - return true - } - - return false -} - -// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. -func (o *CheckoutBalanceCheckRequest) SetAdditionalData(v map[string]string) { - o.AdditionalData = &v -} - -// GetAmount returns the Amount field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetAmount() Amount { - if o == nil || common.IsNil(o.Amount) { - var ret Amount - return ret - } - return *o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.Amount) { - return nil, false - } - return o.Amount, true -} - -// HasAmount returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasAmount() bool { - if o != nil && !common.IsNil(o.Amount) { - return true - } - - return false -} - -// SetAmount gets a reference to the given Amount and assigns it to the Amount field. -func (o *CheckoutBalanceCheckRequest) SetAmount(v Amount) { - o.Amount = &v -} - -// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetApplicationInfo() ApplicationInfo { - if o == nil || common.IsNil(o.ApplicationInfo) { - var ret ApplicationInfo - return ret - } - return *o.ApplicationInfo -} - -// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { - if o == nil || common.IsNil(o.ApplicationInfo) { - return nil, false - } - return o.ApplicationInfo, true -} - -// HasApplicationInfo returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasApplicationInfo() bool { - if o != nil && !common.IsNil(o.ApplicationInfo) { - return true - } - - return false -} - -// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. -func (o *CheckoutBalanceCheckRequest) SetApplicationInfo(v ApplicationInfo) { - o.ApplicationInfo = &v -} - -// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetBillingAddress() Address { - if o == nil || common.IsNil(o.BillingAddress) { - var ret Address - return ret - } - return *o.BillingAddress -} - -// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetBillingAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.BillingAddress) { - return nil, false - } - return o.BillingAddress, true -} - -// HasBillingAddress returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasBillingAddress() bool { - if o != nil && !common.IsNil(o.BillingAddress) { - return true - } - - return false -} - -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CheckoutBalanceCheckRequest) SetBillingAddress(v Address) { - o.BillingAddress = &v -} - -// GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetBrowserInfo() BrowserInfo { - if o == nil || common.IsNil(o.BrowserInfo) { - var ret BrowserInfo - return ret - } - return *o.BrowserInfo -} - -// GetBrowserInfoOk returns a tuple with the BrowserInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetBrowserInfoOk() (*BrowserInfo, bool) { - if o == nil || common.IsNil(o.BrowserInfo) { - return nil, false - } - return o.BrowserInfo, true -} - -// HasBrowserInfo returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasBrowserInfo() bool { - if o != nil && !common.IsNil(o.BrowserInfo) { - return true - } - - return false -} - -// SetBrowserInfo gets a reference to the given BrowserInfo and assigns it to the BrowserInfo field. -func (o *CheckoutBalanceCheckRequest) SetBrowserInfo(v BrowserInfo) { - o.BrowserInfo = &v -} - -// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetCaptureDelayHours() int32 { - if o == nil || common.IsNil(o.CaptureDelayHours) { - var ret int32 - return ret - } - return *o.CaptureDelayHours -} - -// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetCaptureDelayHoursOk() (*int32, bool) { - if o == nil || common.IsNil(o.CaptureDelayHours) { - return nil, false - } - return o.CaptureDelayHours, true -} - -// HasCaptureDelayHours returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasCaptureDelayHours() bool { - if o != nil && !common.IsNil(o.CaptureDelayHours) { - return true - } - - return false -} - -// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. -func (o *CheckoutBalanceCheckRequest) SetCaptureDelayHours(v int32) { - o.CaptureDelayHours = &v -} - -// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetDateOfBirth() string { - if o == nil || common.IsNil(o.DateOfBirth) { - var ret string - return ret - } - return *o.DateOfBirth -} - -// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetDateOfBirthOk() (*string, bool) { - if o == nil || common.IsNil(o.DateOfBirth) { - return nil, false - } - return o.DateOfBirth, true -} - -// HasDateOfBirth returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasDateOfBirth() bool { - if o != nil && !common.IsNil(o.DateOfBirth) { - return true - } - - return false -} - -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *CheckoutBalanceCheckRequest) SetDateOfBirth(v string) { - o.DateOfBirth = &v -} - -// GetDccQuote returns the DccQuote field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetDccQuote() ForexQuote { - if o == nil || common.IsNil(o.DccQuote) { - var ret ForexQuote - return ret - } - return *o.DccQuote -} - -// GetDccQuoteOk returns a tuple with the DccQuote field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetDccQuoteOk() (*ForexQuote, bool) { - if o == nil || common.IsNil(o.DccQuote) { - return nil, false - } - return o.DccQuote, true -} - -// HasDccQuote returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasDccQuote() bool { - if o != nil && !common.IsNil(o.DccQuote) { - return true - } - - return false -} - -// SetDccQuote gets a reference to the given ForexQuote and assigns it to the DccQuote field. -func (o *CheckoutBalanceCheckRequest) SetDccQuote(v ForexQuote) { - o.DccQuote = &v -} - -// GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetDeliveryAddress() Address { - if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address - return ret - } - return *o.DeliveryAddress -} - -// GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetDeliveryAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.DeliveryAddress) { - return nil, false - } - return o.DeliveryAddress, true -} - -// HasDeliveryAddress returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasDeliveryAddress() bool { - if o != nil && !common.IsNil(o.DeliveryAddress) { - return true - } - - return false -} - -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CheckoutBalanceCheckRequest) SetDeliveryAddress(v Address) { - o.DeliveryAddress = &v -} - -// GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetDeliveryDate() time.Time { - if o == nil || common.IsNil(o.DeliveryDate) { - var ret time.Time - return ret - } - return *o.DeliveryDate -} - -// GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetDeliveryDateOk() (*time.Time, bool) { - if o == nil || common.IsNil(o.DeliveryDate) { - return nil, false - } - return o.DeliveryDate, true -} - -// HasDeliveryDate returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasDeliveryDate() bool { - if o != nil && !common.IsNil(o.DeliveryDate) { - return true - } - - return false -} - -// SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. -func (o *CheckoutBalanceCheckRequest) SetDeliveryDate(v time.Time) { - o.DeliveryDate = &v -} - -// GetDeviceFingerprint returns the DeviceFingerprint field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetDeviceFingerprint() string { - if o == nil || common.IsNil(o.DeviceFingerprint) { - var ret string - return ret - } - return *o.DeviceFingerprint -} - -// GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetDeviceFingerprintOk() (*string, bool) { - if o == nil || common.IsNil(o.DeviceFingerprint) { - return nil, false - } - return o.DeviceFingerprint, true -} - -// HasDeviceFingerprint returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasDeviceFingerprint() bool { - if o != nil && !common.IsNil(o.DeviceFingerprint) { - return true - } - - return false -} - -// SetDeviceFingerprint gets a reference to the given string and assigns it to the DeviceFingerprint field. -func (o *CheckoutBalanceCheckRequest) SetDeviceFingerprint(v string) { - o.DeviceFingerprint = &v -} - -// GetFraudOffset returns the FraudOffset field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetFraudOffset() int32 { - if o == nil || common.IsNil(o.FraudOffset) { - var ret int32 - return ret - } - return *o.FraudOffset -} - -// GetFraudOffsetOk returns a tuple with the FraudOffset field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetFraudOffsetOk() (*int32, bool) { - if o == nil || common.IsNil(o.FraudOffset) { - return nil, false - } - return o.FraudOffset, true -} - -// HasFraudOffset returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasFraudOffset() bool { - if o != nil && !common.IsNil(o.FraudOffset) { - return true - } - - return false -} - -// SetFraudOffset gets a reference to the given int32 and assigns it to the FraudOffset field. -func (o *CheckoutBalanceCheckRequest) SetFraudOffset(v int32) { - o.FraudOffset = &v -} - -// GetInstallments returns the Installments field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetInstallments() Installments { - if o == nil || common.IsNil(o.Installments) { - var ret Installments - return ret - } - return *o.Installments -} - -// GetInstallmentsOk returns a tuple with the Installments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetInstallmentsOk() (*Installments, bool) { - if o == nil || common.IsNil(o.Installments) { - return nil, false - } - return o.Installments, true -} - -// HasInstallments returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasInstallments() bool { - if o != nil && !common.IsNil(o.Installments) { - return true - } - - return false -} - -// SetInstallments gets a reference to the given Installments and assigns it to the Installments field. -func (o *CheckoutBalanceCheckRequest) SetInstallments(v Installments) { - o.Installments = &v -} - -// GetLocalizedShopperStatement returns the LocalizedShopperStatement field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetLocalizedShopperStatement() map[string]string { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - var ret map[string]string - return ret - } - return *o.LocalizedShopperStatement -} - -// GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - return nil, false - } - return o.LocalizedShopperStatement, true -} - -// HasLocalizedShopperStatement returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasLocalizedShopperStatement() bool { - if o != nil && !common.IsNil(o.LocalizedShopperStatement) { - return true - } - - return false -} - -// SetLocalizedShopperStatement gets a reference to the given map[string]string and assigns it to the LocalizedShopperStatement field. -func (o *CheckoutBalanceCheckRequest) SetLocalizedShopperStatement(v map[string]string) { - o.LocalizedShopperStatement = &v -} - -// GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) SetMcc(v string) { - o.Mcc = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CheckoutBalanceCheckRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CheckoutBalanceCheckRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetMerchantOrderReference() string { - if o == nil || common.IsNil(o.MerchantOrderReference) { - var ret string - return ret - } - return *o.MerchantOrderReference -} - -// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetMerchantOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantOrderReference) { - return nil, false - } - return o.MerchantOrderReference, true -} - -// HasMerchantOrderReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasMerchantOrderReference() bool { - if o != nil && !common.IsNil(o.MerchantOrderReference) { - return true - } - - return false -} - -// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. -func (o *CheckoutBalanceCheckRequest) SetMerchantOrderReference(v string) { - o.MerchantOrderReference = &v -} - -// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetMerchantRiskIndicator() MerchantRiskIndicator { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - var ret MerchantRiskIndicator - return ret - } - return *o.MerchantRiskIndicator -} - -// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator, bool) { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - return nil, false - } - return o.MerchantRiskIndicator, true -} - -// HasMerchantRiskIndicator returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasMerchantRiskIndicator() bool { - if o != nil && !common.IsNil(o.MerchantRiskIndicator) { - return true - } - - return false -} - -// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator and assigns it to the MerchantRiskIndicator field. -func (o *CheckoutBalanceCheckRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator) { - o.MerchantRiskIndicator = &v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetMetadata() map[string]string { - if o == nil || common.IsNil(o.Metadata) { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetMetadataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.Metadata) { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasMetadata() bool { - if o != nil && !common.IsNil(o.Metadata) { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *CheckoutBalanceCheckRequest) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetOrderReference returns the OrderReference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetOrderReference() string { - if o == nil || common.IsNil(o.OrderReference) { - var ret string - return ret - } - return *o.OrderReference -} - -// GetOrderReferenceOk returns a tuple with the OrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.OrderReference) { - return nil, false - } - return o.OrderReference, true -} - -// HasOrderReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasOrderReference() bool { - if o != nil && !common.IsNil(o.OrderReference) { - return true - } - - return false -} - -// SetOrderReference gets a reference to the given string and assigns it to the OrderReference field. -func (o *CheckoutBalanceCheckRequest) SetOrderReference(v string) { - o.OrderReference = &v -} - -// GetPaymentMethod returns the PaymentMethod field value -func (o *CheckoutBalanceCheckRequest) GetPaymentMethod() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.PaymentMethod -} - -// GetPaymentMethodOk returns a tuple with the PaymentMethod field value -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetPaymentMethodOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentMethod, true -} - -// SetPaymentMethod sets field value -func (o *CheckoutBalanceCheckRequest) SetPaymentMethod(v map[string]string) { - o.PaymentMethod = v -} - -// GetRecurring returns the Recurring field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetRecurring() Recurring { - if o == nil || common.IsNil(o.Recurring) { - var ret Recurring - return ret - } - return *o.Recurring -} - -// GetRecurringOk returns a tuple with the Recurring field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetRecurringOk() (*Recurring, bool) { - if o == nil || common.IsNil(o.Recurring) { - return nil, false - } - return o.Recurring, true -} - -// HasRecurring returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasRecurring() bool { - if o != nil && !common.IsNil(o.Recurring) { - return true - } - - return false -} - -// SetRecurring gets a reference to the given Recurring and assigns it to the Recurring field. -func (o *CheckoutBalanceCheckRequest) SetRecurring(v Recurring) { - o.Recurring = &v -} - -// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetRecurringProcessingModel() string { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - var ret string - return ret - } - return *o.RecurringProcessingModel -} - -// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetRecurringProcessingModelOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - return nil, false - } - return o.RecurringProcessingModel, true -} - -// HasRecurringProcessingModel returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasRecurringProcessingModel() bool { - if o != nil && !common.IsNil(o.RecurringProcessingModel) { - return true - } - - return false -} - -// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. -func (o *CheckoutBalanceCheckRequest) SetRecurringProcessingModel(v string) { - o.RecurringProcessingModel = &v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CheckoutBalanceCheckRequest) SetReference(v string) { - o.Reference = &v -} - -// GetSelectedBrand returns the SelectedBrand field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetSelectedBrand() string { - if o == nil || common.IsNil(o.SelectedBrand) { - var ret string - return ret - } - return *o.SelectedBrand -} - -// GetSelectedBrandOk returns a tuple with the SelectedBrand field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetSelectedBrandOk() (*string, bool) { - if o == nil || common.IsNil(o.SelectedBrand) { - return nil, false - } - return o.SelectedBrand, true -} - -// HasSelectedBrand returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasSelectedBrand() bool { - if o != nil && !common.IsNil(o.SelectedBrand) { - return true - } - - return false -} - -// SetSelectedBrand gets a reference to the given string and assigns it to the SelectedBrand field. -func (o *CheckoutBalanceCheckRequest) SetSelectedBrand(v string) { - o.SelectedBrand = &v -} - -// GetSelectedRecurringDetailReference returns the SelectedRecurringDetailReference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetSelectedRecurringDetailReference() string { - if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { - var ret string - return ret - } - return *o.SelectedRecurringDetailReference -} - -// GetSelectedRecurringDetailReferenceOk returns a tuple with the SelectedRecurringDetailReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetSelectedRecurringDetailReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { - return nil, false - } - return o.SelectedRecurringDetailReference, true -} - -// HasSelectedRecurringDetailReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasSelectedRecurringDetailReference() bool { - if o != nil && !common.IsNil(o.SelectedRecurringDetailReference) { - return true - } - - return false -} - -// SetSelectedRecurringDetailReference gets a reference to the given string and assigns it to the SelectedRecurringDetailReference field. -func (o *CheckoutBalanceCheckRequest) SetSelectedRecurringDetailReference(v string) { - o.SelectedRecurringDetailReference = &v -} - -// GetSessionId returns the SessionId field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetSessionId() string { - if o == nil || common.IsNil(o.SessionId) { - var ret string - return ret - } - return *o.SessionId -} - -// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetSessionIdOk() (*string, bool) { - if o == nil || common.IsNil(o.SessionId) { - return nil, false - } - return o.SessionId, true -} - -// HasSessionId returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasSessionId() bool { - if o != nil && !common.IsNil(o.SessionId) { - return true - } - - return false -} - -// SetSessionId gets a reference to the given string and assigns it to the SessionId field. -func (o *CheckoutBalanceCheckRequest) SetSessionId(v string) { - o.SessionId = &v -} - -// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) SetShopperEmail(v string) { - o.ShopperEmail = &v -} - -// GetShopperIP returns the ShopperIP field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperIP() string { - if o == nil || common.IsNil(o.ShopperIP) { - var ret string - return ret - } - return *o.ShopperIP -} - -// GetShopperIPOk returns a tuple with the ShopperIP field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperIPOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperIP) { - return nil, false - } - return o.ShopperIP, true -} - -// HasShopperIP returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperIP() bool { - if o != nil && !common.IsNil(o.ShopperIP) { - return true - } - - return false -} - -// SetShopperIP gets a reference to the given string and assigns it to the ShopperIP field. -func (o *CheckoutBalanceCheckRequest) SetShopperIP(v string) { - o.ShopperIP = &v -} - -// GetShopperInteraction returns the ShopperInteraction field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperInteraction() string { - if o == nil || common.IsNil(o.ShopperInteraction) { - var ret string - return ret - } - return *o.ShopperInteraction -} - -// GetShopperInteractionOk returns a tuple with the ShopperInteraction field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperInteractionOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperInteraction) { - return nil, false - } - return o.ShopperInteraction, true -} - -// HasShopperInteraction returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperInteraction() bool { - if o != nil && !common.IsNil(o.ShopperInteraction) { - return true - } - - return false -} - -// SetShopperInteraction gets a reference to the given string and assigns it to the ShopperInteraction field. -func (o *CheckoutBalanceCheckRequest) SetShopperInteraction(v string) { - o.ShopperInteraction = &v -} - -// GetShopperLocale returns the ShopperLocale field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperLocale() string { - if o == nil || common.IsNil(o.ShopperLocale) { - var ret string - return ret - } - return *o.ShopperLocale -} - -// GetShopperLocaleOk returns a tuple with the ShopperLocale field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperLocaleOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperLocale) { - return nil, false - } - return o.ShopperLocale, true -} - -// HasShopperLocale returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperLocale() bool { - if o != nil && !common.IsNil(o.ShopperLocale) { - return true - } - - return false -} - -// SetShopperLocale gets a reference to the given string and assigns it to the ShopperLocale field. -func (o *CheckoutBalanceCheckRequest) SetShopperLocale(v string) { - o.ShopperLocale = &v -} - -// GetShopperName returns the ShopperName field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperName() Name { - if o == nil || common.IsNil(o.ShopperName) { - var ret Name - return ret - } - return *o.ShopperName -} - -// GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperNameOk() (*Name, bool) { - if o == nil || common.IsNil(o.ShopperName) { - return nil, false - } - return o.ShopperName, true -} - -// HasShopperName returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperName() bool { - if o != nil && !common.IsNil(o.ShopperName) { - return true - } - - return false -} - -// SetShopperName gets a reference to the given Name and assigns it to the ShopperName field. -func (o *CheckoutBalanceCheckRequest) SetShopperName(v Name) { - o.ShopperName = &v -} - -// GetShopperReference returns the ShopperReference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperReference() string { - if o == nil || common.IsNil(o.ShopperReference) { - var ret string - return ret - } - return *o.ShopperReference -} - -// GetShopperReferenceOk returns a tuple with the ShopperReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperReference) { - return nil, false - } - return o.ShopperReference, true -} - -// HasShopperReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperReference() bool { - if o != nil && !common.IsNil(o.ShopperReference) { - return true - } - - return false -} - -// SetShopperReference gets a reference to the given string and assigns it to the ShopperReference field. -func (o *CheckoutBalanceCheckRequest) SetShopperReference(v string) { - o.ShopperReference = &v -} - -// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetShopperStatement() string { - if o == nil || common.IsNil(o.ShopperStatement) { - var ret string - return ret - } - return *o.ShopperStatement -} - -// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetShopperStatementOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperStatement) { - return nil, false - } - return o.ShopperStatement, true -} - -// HasShopperStatement returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasShopperStatement() bool { - if o != nil && !common.IsNil(o.ShopperStatement) { - return true - } - - return false -} - -// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. -func (o *CheckoutBalanceCheckRequest) SetShopperStatement(v string) { - o.ShopperStatement = &v -} - -// GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetSocialSecurityNumber() string { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - var ret string - return ret - } - return *o.SocialSecurityNumber -} - -// GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetSocialSecurityNumberOk() (*string, bool) { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - return nil, false - } - return o.SocialSecurityNumber, true -} - -// HasSocialSecurityNumber returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasSocialSecurityNumber() bool { - if o != nil && !common.IsNil(o.SocialSecurityNumber) { - return true - } - - return false -} - -// SetSocialSecurityNumber gets a reference to the given string and assigns it to the SocialSecurityNumber field. -func (o *CheckoutBalanceCheckRequest) SetSocialSecurityNumber(v string) { - o.SocialSecurityNumber = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CheckoutBalanceCheckRequest) SetSplits(v []Split) { - o.Splits = v -} - -// GetStore returns the Store field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetStore() string { - if o == nil || common.IsNil(o.Store) { - var ret string - return ret - } - return *o.Store -} - -// GetStoreOk returns a tuple with the Store field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetStoreOk() (*string, bool) { - if o == nil || common.IsNil(o.Store) { - return nil, false - } - return o.Store, true -} - -// HasStore returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasStore() bool { - if o != nil && !common.IsNil(o.Store) { - return true - } - - return false -} - -// SetStore gets a reference to the given string and assigns it to the Store field. -func (o *CheckoutBalanceCheckRequest) SetStore(v string) { - o.Store = &v -} - -// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) 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 *CheckoutBalanceCheckRequest) SetTelephoneNumber(v string) { - o.TelephoneNumber = &v -} - -// GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetThreeDS2RequestData() ThreeDS2RequestData { - if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData - return ret - } - return *o.ThreeDS2RequestData -} - -// GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData, bool) { - if o == nil || common.IsNil(o.ThreeDS2RequestData) { - return nil, false - } - return o.ThreeDS2RequestData, true -} - -// HasThreeDS2RequestData returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasThreeDS2RequestData() bool { - if o != nil && !common.IsNil(o.ThreeDS2RequestData) { - return true - } - - return false -} - -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData and assigns it to the ThreeDS2RequestData field. -func (o *CheckoutBalanceCheckRequest) SetThreeDS2RequestData(v ThreeDS2RequestData) { - o.ThreeDS2RequestData = &v -} - -// GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field value if set, zero value otherwise. -// Deprecated -func (o *CheckoutBalanceCheckRequest) GetThreeDSAuthenticationOnly() bool { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - var ret bool - return ret - } - return *o.ThreeDSAuthenticationOnly -} - -// GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *CheckoutBalanceCheckRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool) { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - return nil, false - } - return o.ThreeDSAuthenticationOnly, true -} - -// HasThreeDSAuthenticationOnly returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasThreeDSAuthenticationOnly() bool { - if o != nil && !common.IsNil(o.ThreeDSAuthenticationOnly) { - return true - } - - return false -} - -// SetThreeDSAuthenticationOnly gets a reference to the given bool and assigns it to the ThreeDSAuthenticationOnly field. -// Deprecated -func (o *CheckoutBalanceCheckRequest) SetThreeDSAuthenticationOnly(v bool) { - o.ThreeDSAuthenticationOnly = &v -} - -// GetTotalsGroup returns the TotalsGroup field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetTotalsGroup() string { - if o == nil || common.IsNil(o.TotalsGroup) { - var ret string - return ret - } - return *o.TotalsGroup -} - -// GetTotalsGroupOk returns a tuple with the TotalsGroup field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetTotalsGroupOk() (*string, bool) { - if o == nil || common.IsNil(o.TotalsGroup) { - return nil, false - } - return o.TotalsGroup, true -} - -// HasTotalsGroup returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasTotalsGroup() bool { - if o != nil && !common.IsNil(o.TotalsGroup) { - return true - } - - return false -} - -// SetTotalsGroup gets a reference to the given string and assigns it to the TotalsGroup field. -func (o *CheckoutBalanceCheckRequest) SetTotalsGroup(v string) { - o.TotalsGroup = &v -} - -// GetTrustedShopper returns the TrustedShopper field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckRequest) GetTrustedShopper() bool { - if o == nil || common.IsNil(o.TrustedShopper) { - var ret bool - return ret - } - return *o.TrustedShopper -} - -// GetTrustedShopperOk returns a tuple with the TrustedShopper field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckRequest) GetTrustedShopperOk() (*bool, bool) { - if o == nil || common.IsNil(o.TrustedShopper) { - return nil, false - } - return o.TrustedShopper, true -} - -// HasTrustedShopper returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckRequest) HasTrustedShopper() bool { - if o != nil && !common.IsNil(o.TrustedShopper) { - return true - } - - return false -} - -// SetTrustedShopper gets a reference to the given bool and assigns it to the TrustedShopper field. -func (o *CheckoutBalanceCheckRequest) SetTrustedShopper(v bool) { - o.TrustedShopper = &v -} - -func (o CheckoutBalanceCheckRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutBalanceCheckRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AccountInfo) { - toSerialize["accountInfo"] = o.AccountInfo - } - if !common.IsNil(o.AdditionalAmount) { - toSerialize["additionalAmount"] = o.AdditionalAmount - } - if !common.IsNil(o.AdditionalData) { - toSerialize["additionalData"] = o.AdditionalData - } - if !common.IsNil(o.Amount) { - toSerialize["amount"] = o.Amount - } - if !common.IsNil(o.ApplicationInfo) { - toSerialize["applicationInfo"] = o.ApplicationInfo - } - if !common.IsNil(o.BillingAddress) { - toSerialize["billingAddress"] = o.BillingAddress - } - if !common.IsNil(o.BrowserInfo) { - toSerialize["browserInfo"] = o.BrowserInfo - } - if !common.IsNil(o.CaptureDelayHours) { - toSerialize["captureDelayHours"] = o.CaptureDelayHours - } - if !common.IsNil(o.DateOfBirth) { - toSerialize["dateOfBirth"] = o.DateOfBirth - } - if !common.IsNil(o.DccQuote) { - toSerialize["dccQuote"] = o.DccQuote - } - if !common.IsNil(o.DeliveryAddress) { - toSerialize["deliveryAddress"] = o.DeliveryAddress - } - if !common.IsNil(o.DeliveryDate) { - toSerialize["deliveryDate"] = o.DeliveryDate - } - if !common.IsNil(o.DeviceFingerprint) { - toSerialize["deviceFingerprint"] = o.DeviceFingerprint - } - if !common.IsNil(o.FraudOffset) { - toSerialize["fraudOffset"] = o.FraudOffset - } - if !common.IsNil(o.Installments) { - toSerialize["installments"] = o.Installments - } - if !common.IsNil(o.LocalizedShopperStatement) { - toSerialize["localizedShopperStatement"] = o.LocalizedShopperStatement - } - if !common.IsNil(o.Mcc) { - toSerialize["mcc"] = o.Mcc - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantOrderReference) { - toSerialize["merchantOrderReference"] = o.MerchantOrderReference - } - if !common.IsNil(o.MerchantRiskIndicator) { - toSerialize["merchantRiskIndicator"] = o.MerchantRiskIndicator - } - if !common.IsNil(o.Metadata) { - toSerialize["metadata"] = o.Metadata - } - if !common.IsNil(o.OrderReference) { - toSerialize["orderReference"] = o.OrderReference - } - toSerialize["paymentMethod"] = o.PaymentMethod - if !common.IsNil(o.Recurring) { - toSerialize["recurring"] = o.Recurring - } - if !common.IsNil(o.RecurringProcessingModel) { - toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel - } - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.SelectedBrand) { - toSerialize["selectedBrand"] = o.SelectedBrand - } - if !common.IsNil(o.SelectedRecurringDetailReference) { - toSerialize["selectedRecurringDetailReference"] = o.SelectedRecurringDetailReference - } - if !common.IsNil(o.SessionId) { - toSerialize["sessionId"] = o.SessionId - } - if !common.IsNil(o.ShopperEmail) { - toSerialize["shopperEmail"] = o.ShopperEmail - } - if !common.IsNil(o.ShopperIP) { - toSerialize["shopperIP"] = o.ShopperIP - } - if !common.IsNil(o.ShopperInteraction) { - toSerialize["shopperInteraction"] = o.ShopperInteraction - } - if !common.IsNil(o.ShopperLocale) { - toSerialize["shopperLocale"] = o.ShopperLocale - } - if !common.IsNil(o.ShopperName) { - toSerialize["shopperName"] = o.ShopperName - } - if !common.IsNil(o.ShopperReference) { - toSerialize["shopperReference"] = o.ShopperReference - } - if !common.IsNil(o.ShopperStatement) { - toSerialize["shopperStatement"] = o.ShopperStatement - } - if !common.IsNil(o.SocialSecurityNumber) { - toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - if !common.IsNil(o.Store) { - toSerialize["store"] = o.Store - } - if !common.IsNil(o.TelephoneNumber) { - toSerialize["telephoneNumber"] = o.TelephoneNumber - } - if !common.IsNil(o.ThreeDS2RequestData) { - toSerialize["threeDS2RequestData"] = o.ThreeDS2RequestData - } - if !common.IsNil(o.ThreeDSAuthenticationOnly) { - toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly - } - if !common.IsNil(o.TotalsGroup) { - toSerialize["totalsGroup"] = o.TotalsGroup - } - if !common.IsNil(o.TrustedShopper) { - toSerialize["trustedShopper"] = o.TrustedShopper - } - return toSerialize, nil -} - -type NullableCheckoutBalanceCheckRequest struct { - value *CheckoutBalanceCheckRequest - isSet bool -} - -func (v NullableCheckoutBalanceCheckRequest) Get() *CheckoutBalanceCheckRequest { - return v.value -} - -func (v *NullableCheckoutBalanceCheckRequest) Set(val *CheckoutBalanceCheckRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutBalanceCheckRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutBalanceCheckRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutBalanceCheckRequest(val *CheckoutBalanceCheckRequest) *NullableCheckoutBalanceCheckRequest { - return &NullableCheckoutBalanceCheckRequest{value: val, isSet: true} -} - -func (v NullableCheckoutBalanceCheckRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutBalanceCheckRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CheckoutBalanceCheckRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false -} -func (o *CheckoutBalanceCheckRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_checkout_balance_check_response.go b/src/checkout/model_checkout_balance_check_response.go deleted file mode 100644 index b145cac7f..000000000 --- a/src/checkout/model_checkout_balance_check_response.go +++ /dev/null @@ -1,336 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutBalanceCheckResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutBalanceCheckResponse{} - -// CheckoutBalanceCheckResponse struct for CheckoutBalanceCheckResponse -type CheckoutBalanceCheckResponse struct { - // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Balance Amount `json:"balance"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` - // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - PspReference *string `json:"pspReference,omitempty"` - // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - ResultCode string `json:"resultCode"` - TransactionLimit *Amount `json:"transactionLimit,omitempty"` -} - -// NewCheckoutBalanceCheckResponse instantiates a new CheckoutBalanceCheckResponse 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 NewCheckoutBalanceCheckResponse(balance Amount, resultCode string) *CheckoutBalanceCheckResponse { - this := CheckoutBalanceCheckResponse{} - this.Balance = balance - this.ResultCode = resultCode - return &this -} - -// NewCheckoutBalanceCheckResponseWithDefaults instantiates a new CheckoutBalanceCheckResponse 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 NewCheckoutBalanceCheckResponseWithDefaults() *CheckoutBalanceCheckResponse { - this := CheckoutBalanceCheckResponse{} - return &this -} - -// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckResponse) GetAdditionalData() map[string]string { - if o == nil || common.IsNil(o.AdditionalData) { - var ret map[string]string - return ret - } - return *o.AdditionalData -} - -// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetAdditionalDataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.AdditionalData) { - return nil, false - } - return o.AdditionalData, true -} - -// HasAdditionalData returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckResponse) HasAdditionalData() bool { - if o != nil && !common.IsNil(o.AdditionalData) { - return true - } - - return false -} - -// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. -func (o *CheckoutBalanceCheckResponse) SetAdditionalData(v map[string]string) { - o.AdditionalData = &v -} - -// GetBalance returns the Balance field value -func (o *CheckoutBalanceCheckResponse) GetBalance() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Balance -} - -// GetBalanceOk returns a tuple with the Balance field value -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetBalanceOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Balance, true -} - -// SetBalance sets field value -func (o *CheckoutBalanceCheckResponse) SetBalance(v Amount) { - o.Balance = v -} - -// GetFraudResult returns the FraudResult field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckResponse) GetFraudResult() FraudResult { - if o == nil || common.IsNil(o.FraudResult) { - var ret FraudResult - return ret - } - return *o.FraudResult -} - -// GetFraudResultOk returns a tuple with the FraudResult field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetFraudResultOk() (*FraudResult, bool) { - if o == nil || common.IsNil(o.FraudResult) { - return nil, false - } - return o.FraudResult, true -} - -// HasFraudResult returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckResponse) HasFraudResult() bool { - if o != nil && !common.IsNil(o.FraudResult) { - return true - } - - return false -} - -// SetFraudResult gets a reference to the given FraudResult and assigns it to the FraudResult field. -func (o *CheckoutBalanceCheckResponse) SetFraudResult(v FraudResult) { - o.FraudResult = &v -} - -// GetPspReference returns the PspReference field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckResponse) GetPspReference() string { - if o == nil || common.IsNil(o.PspReference) { - var ret string - return ret - } - return *o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetPspReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.PspReference) { - return nil, false - } - return o.PspReference, true -} - -// HasPspReference returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckResponse) HasPspReference() bool { - if o != nil && !common.IsNil(o.PspReference) { - return true - } - - return false -} - -// SetPspReference gets a reference to the given string and assigns it to the PspReference field. -func (o *CheckoutBalanceCheckResponse) SetPspReference(v string) { - o.PspReference = &v -} - -// GetRefusalReason returns the RefusalReason field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckResponse) GetRefusalReason() string { - if o == nil || common.IsNil(o.RefusalReason) { - var ret string - return ret - } - return *o.RefusalReason -} - -// GetRefusalReasonOk returns a tuple with the RefusalReason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetRefusalReasonOk() (*string, bool) { - if o == nil || common.IsNil(o.RefusalReason) { - return nil, false - } - return o.RefusalReason, true -} - -// HasRefusalReason returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckResponse) HasRefusalReason() bool { - if o != nil && !common.IsNil(o.RefusalReason) { - return true - } - - return false -} - -// SetRefusalReason gets a reference to the given string and assigns it to the RefusalReason field. -func (o *CheckoutBalanceCheckResponse) SetRefusalReason(v string) { - o.RefusalReason = &v -} - -// GetResultCode returns the ResultCode field value -func (o *CheckoutBalanceCheckResponse) GetResultCode() string { - if o == nil { - var ret string - return ret - } - - return o.ResultCode -} - -// GetResultCodeOk returns a tuple with the ResultCode field value -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetResultCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ResultCode, true -} - -// SetResultCode sets field value -func (o *CheckoutBalanceCheckResponse) SetResultCode(v string) { - o.ResultCode = v -} - -// GetTransactionLimit returns the TransactionLimit field value if set, zero value otherwise. -func (o *CheckoutBalanceCheckResponse) GetTransactionLimit() Amount { - if o == nil || common.IsNil(o.TransactionLimit) { - var ret Amount - return ret - } - return *o.TransactionLimit -} - -// GetTransactionLimitOk returns a tuple with the TransactionLimit field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutBalanceCheckResponse) GetTransactionLimitOk() (*Amount, bool) { - if o == nil || common.IsNil(o.TransactionLimit) { - return nil, false - } - return o.TransactionLimit, true -} - -// HasTransactionLimit returns a boolean if a field has been set. -func (o *CheckoutBalanceCheckResponse) HasTransactionLimit() bool { - if o != nil && !common.IsNil(o.TransactionLimit) { - return true - } - - return false -} - -// SetTransactionLimit gets a reference to the given Amount and assigns it to the TransactionLimit field. -func (o *CheckoutBalanceCheckResponse) SetTransactionLimit(v Amount) { - o.TransactionLimit = &v -} - -func (o CheckoutBalanceCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutBalanceCheckResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AdditionalData) { - toSerialize["additionalData"] = o.AdditionalData - } - toSerialize["balance"] = o.Balance - if !common.IsNil(o.FraudResult) { - toSerialize["fraudResult"] = o.FraudResult - } - if !common.IsNil(o.PspReference) { - toSerialize["pspReference"] = o.PspReference - } - if !common.IsNil(o.RefusalReason) { - toSerialize["refusalReason"] = o.RefusalReason - } - toSerialize["resultCode"] = o.ResultCode - if !common.IsNil(o.TransactionLimit) { - toSerialize["transactionLimit"] = o.TransactionLimit - } - return toSerialize, nil -} - -type NullableCheckoutBalanceCheckResponse struct { - value *CheckoutBalanceCheckResponse - isSet bool -} - -func (v NullableCheckoutBalanceCheckResponse) Get() *CheckoutBalanceCheckResponse { - return v.value -} - -func (v *NullableCheckoutBalanceCheckResponse) Set(val *CheckoutBalanceCheckResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutBalanceCheckResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutBalanceCheckResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutBalanceCheckResponse(val *CheckoutBalanceCheckResponse) *NullableCheckoutBalanceCheckResponse { - return &NullableCheckoutBalanceCheckResponse{value: val, isSet: true} -} - -func (v NullableCheckoutBalanceCheckResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutBalanceCheckResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CheckoutBalanceCheckResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "NotEnoughBalance", "Failed"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_checkout_cancel_order_request.go b/src/checkout/model_checkout_cancel_order_request.go deleted file mode 100644 index ea7fb0ecc..000000000 --- a/src/checkout/model_checkout_cancel_order_request.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutCancelOrderRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutCancelOrderRequest{} - -// CheckoutCancelOrderRequest struct for CheckoutCancelOrderRequest -type CheckoutCancelOrderRequest struct { - // The merchant account identifier that orderData belongs to. - MerchantAccount string `json:"merchantAccount"` - Order EncryptedOrderData `json:"order"` -} - -// NewCheckoutCancelOrderRequest instantiates a new CheckoutCancelOrderRequest 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 NewCheckoutCancelOrderRequest(merchantAccount string, order EncryptedOrderData) *CheckoutCancelOrderRequest { - this := CheckoutCancelOrderRequest{} - this.MerchantAccount = merchantAccount - this.Order = order - return &this -} - -// NewCheckoutCancelOrderRequestWithDefaults instantiates a new CheckoutCancelOrderRequest 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 NewCheckoutCancelOrderRequestWithDefaults() *CheckoutCancelOrderRequest { - this := CheckoutCancelOrderRequest{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CheckoutCancelOrderRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CheckoutCancelOrderRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CheckoutCancelOrderRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetOrder returns the Order field value -func (o *CheckoutCancelOrderRequest) GetOrder() EncryptedOrderData { - if o == nil { - var ret EncryptedOrderData - return ret - } - - return o.Order -} - -// GetOrderOk returns a tuple with the Order field value -// and a boolean to check if the value has been set. -func (o *CheckoutCancelOrderRequest) GetOrderOk() (*EncryptedOrderData, bool) { - if o == nil { - return nil, false - } - return &o.Order, true -} - -// SetOrder sets field value -func (o *CheckoutCancelOrderRequest) SetOrder(v EncryptedOrderData) { - o.Order = v -} - -func (o CheckoutCancelOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutCancelOrderRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["order"] = o.Order - return toSerialize, nil -} - -type NullableCheckoutCancelOrderRequest struct { - value *CheckoutCancelOrderRequest - isSet bool -} - -func (v NullableCheckoutCancelOrderRequest) Get() *CheckoutCancelOrderRequest { - return v.value -} - -func (v *NullableCheckoutCancelOrderRequest) Set(val *CheckoutCancelOrderRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutCancelOrderRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutCancelOrderRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutCancelOrderRequest(val *CheckoutCancelOrderRequest) *NullableCheckoutCancelOrderRequest { - return &NullableCheckoutCancelOrderRequest{value: val, isSet: true} -} - -func (v NullableCheckoutCancelOrderRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutCancelOrderRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_checkout_cancel_order_response.go b/src/checkout/model_checkout_cancel_order_response.go deleted file mode 100644 index 20cd303d0..000000000 --- a/src/checkout/model_checkout_cancel_order_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutCancelOrderResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutCancelOrderResponse{} - -// CheckoutCancelOrderResponse struct for CheckoutCancelOrderResponse -type CheckoutCancelOrderResponse struct { - // A unique reference of the cancellation request. - PspReference string `json:"pspReference"` - // The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - ResultCode string `json:"resultCode"` -} - -// NewCheckoutCancelOrderResponse instantiates a new CheckoutCancelOrderResponse 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 NewCheckoutCancelOrderResponse(pspReference string, resultCode string) *CheckoutCancelOrderResponse { - this := CheckoutCancelOrderResponse{} - this.PspReference = pspReference - this.ResultCode = resultCode - return &this -} - -// NewCheckoutCancelOrderResponseWithDefaults instantiates a new CheckoutCancelOrderResponse 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 NewCheckoutCancelOrderResponseWithDefaults() *CheckoutCancelOrderResponse { - this := CheckoutCancelOrderResponse{} - return &this -} - -// GetPspReference returns the PspReference field value -func (o *CheckoutCancelOrderResponse) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *CheckoutCancelOrderResponse) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *CheckoutCancelOrderResponse) SetPspReference(v string) { - o.PspReference = v -} - -// GetResultCode returns the ResultCode field value -func (o *CheckoutCancelOrderResponse) GetResultCode() string { - if o == nil { - var ret string - return ret - } - - return o.ResultCode -} - -// GetResultCodeOk returns a tuple with the ResultCode field value -// and a boolean to check if the value has been set. -func (o *CheckoutCancelOrderResponse) GetResultCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ResultCode, true -} - -// SetResultCode sets field value -func (o *CheckoutCancelOrderResponse) SetResultCode(v string) { - o.ResultCode = v -} - -func (o CheckoutCancelOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutCancelOrderResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["pspReference"] = o.PspReference - toSerialize["resultCode"] = o.ResultCode - return toSerialize, nil -} - -type NullableCheckoutCancelOrderResponse struct { - value *CheckoutCancelOrderResponse - isSet bool -} - -func (v NullableCheckoutCancelOrderResponse) Get() *CheckoutCancelOrderResponse { - return v.value -} - -func (v *NullableCheckoutCancelOrderResponse) Set(val *CheckoutCancelOrderResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutCancelOrderResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutCancelOrderResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutCancelOrderResponse(val *CheckoutCancelOrderResponse) *NullableCheckoutCancelOrderResponse { - return &NullableCheckoutCancelOrderResponse{value: val, isSet: true} -} - -func (v NullableCheckoutCancelOrderResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutCancelOrderResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CheckoutCancelOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Received"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_checkout_create_order_request.go b/src/checkout/model_checkout_create_order_request.go deleted file mode 100644 index db48cf5b6..000000000 --- a/src/checkout/model_checkout_create_order_request.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutCreateOrderRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutCreateOrderRequest{} - -// CheckoutCreateOrderRequest struct for CheckoutCreateOrderRequest -type CheckoutCreateOrderRequest struct { - Amount Amount `json:"amount"` - // The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. - ExpiresAt *string `json:"expiresAt,omitempty"` - // The merchant account identifier, with which you want to process the order. - MerchantAccount string `json:"merchantAccount"` - // A custom reference identifying the order. - Reference string `json:"reference"` -} - -// NewCheckoutCreateOrderRequest instantiates a new CheckoutCreateOrderRequest 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 NewCheckoutCreateOrderRequest(amount Amount, merchantAccount string, reference string) *CheckoutCreateOrderRequest { - this := CheckoutCreateOrderRequest{} - this.Amount = amount - this.MerchantAccount = merchantAccount - this.Reference = reference - return &this -} - -// NewCheckoutCreateOrderRequestWithDefaults instantiates a new CheckoutCreateOrderRequest 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 NewCheckoutCreateOrderRequestWithDefaults() *CheckoutCreateOrderRequest { - this := CheckoutCreateOrderRequest{} - return &this -} - -// GetAmount returns the Amount field value -func (o *CheckoutCreateOrderRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CheckoutCreateOrderRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *CheckoutCreateOrderRequest) GetExpiresAt() string { - if o == nil || common.IsNil(o.ExpiresAt) { - var ret string - return ret - } - return *o.ExpiresAt -} - -// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderRequest) GetExpiresAtOk() (*string, bool) { - if o == nil || common.IsNil(o.ExpiresAt) { - return nil, false - } - return o.ExpiresAt, true -} - -// HasExpiresAt returns a boolean if a field has been set. -func (o *CheckoutCreateOrderRequest) HasExpiresAt() bool { - if o != nil && !common.IsNil(o.ExpiresAt) { - return true - } - - return false -} - -// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. -func (o *CheckoutCreateOrderRequest) SetExpiresAt(v string) { - o.ExpiresAt = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CheckoutCreateOrderRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CheckoutCreateOrderRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetReference returns the Reference field value -func (o *CheckoutCreateOrderRequest) GetReference() string { - if o == nil { - var ret string - return ret - } - - return o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderRequest) GetReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Reference, true -} - -// SetReference sets field value -func (o *CheckoutCreateOrderRequest) SetReference(v string) { - o.Reference = v -} - -func (o CheckoutCreateOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutCreateOrderRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.ExpiresAt) { - toSerialize["expiresAt"] = o.ExpiresAt - } - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["reference"] = o.Reference - return toSerialize, nil -} - -type NullableCheckoutCreateOrderRequest struct { - value *CheckoutCreateOrderRequest - isSet bool -} - -func (v NullableCheckoutCreateOrderRequest) Get() *CheckoutCreateOrderRequest { - return v.value -} - -func (v *NullableCheckoutCreateOrderRequest) Set(val *CheckoutCreateOrderRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutCreateOrderRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutCreateOrderRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutCreateOrderRequest(val *CheckoutCreateOrderRequest) *NullableCheckoutCreateOrderRequest { - return &NullableCheckoutCreateOrderRequest{value: val, isSet: true} -} - -func (v NullableCheckoutCreateOrderRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutCreateOrderRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_checkout_create_order_response.go b/src/checkout/model_checkout_create_order_response.go deleted file mode 100644 index ee6e72959..000000000 --- a/src/checkout/model_checkout_create_order_response.go +++ /dev/null @@ -1,420 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutCreateOrderResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutCreateOrderResponse{} - -// CheckoutCreateOrderResponse struct for CheckoutCreateOrderResponse -type CheckoutCreateOrderResponse struct { - // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - // The date that the order will expire. - ExpiresAt string `json:"expiresAt"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` - // The encrypted data that will be used by merchant for adding payments to the order. - OrderData string `json:"orderData"` - // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - PspReference *string `json:"pspReference,omitempty"` - // The reference provided by merchant for creating the order. - Reference *string `json:"reference,omitempty"` - // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - RefusalReason *string `json:"refusalReason,omitempty"` - RemainingAmount Amount `json:"remainingAmount"` - // The result of the order creation request. The value is always **Success**. - ResultCode string `json:"resultCode"` -} - -// NewCheckoutCreateOrderResponse instantiates a new CheckoutCreateOrderResponse 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 NewCheckoutCreateOrderResponse(amount Amount, expiresAt string, orderData string, remainingAmount Amount, resultCode string) *CheckoutCreateOrderResponse { - this := CheckoutCreateOrderResponse{} - this.Amount = amount - this.ExpiresAt = expiresAt - this.OrderData = orderData - this.RemainingAmount = remainingAmount - this.ResultCode = resultCode - return &this -} - -// NewCheckoutCreateOrderResponseWithDefaults instantiates a new CheckoutCreateOrderResponse 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 NewCheckoutCreateOrderResponseWithDefaults() *CheckoutCreateOrderResponse { - this := CheckoutCreateOrderResponse{} - return &this -} - -// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. -func (o *CheckoutCreateOrderResponse) GetAdditionalData() map[string]string { - if o == nil || common.IsNil(o.AdditionalData) { - var ret map[string]string - return ret - } - return *o.AdditionalData -} - -// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetAdditionalDataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.AdditionalData) { - return nil, false - } - return o.AdditionalData, true -} - -// HasAdditionalData returns a boolean if a field has been set. -func (o *CheckoutCreateOrderResponse) HasAdditionalData() bool { - if o != nil && !common.IsNil(o.AdditionalData) { - return true - } - - return false -} - -// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. -func (o *CheckoutCreateOrderResponse) SetAdditionalData(v map[string]string) { - o.AdditionalData = &v -} - -// GetAmount returns the Amount field value -func (o *CheckoutCreateOrderResponse) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CheckoutCreateOrderResponse) SetAmount(v Amount) { - o.Amount = v -} - -// GetExpiresAt returns the ExpiresAt field value -func (o *CheckoutCreateOrderResponse) GetExpiresAt() string { - if o == nil { - var ret string - return ret - } - - return o.ExpiresAt -} - -// GetExpiresAtOk returns a tuple with the ExpiresAt field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetExpiresAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ExpiresAt, true -} - -// SetExpiresAt sets field value -func (o *CheckoutCreateOrderResponse) SetExpiresAt(v string) { - o.ExpiresAt = v -} - -// GetFraudResult returns the FraudResult field value if set, zero value otherwise. -func (o *CheckoutCreateOrderResponse) GetFraudResult() FraudResult { - if o == nil || common.IsNil(o.FraudResult) { - var ret FraudResult - return ret - } - return *o.FraudResult -} - -// GetFraudResultOk returns a tuple with the FraudResult field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetFraudResultOk() (*FraudResult, bool) { - if o == nil || common.IsNil(o.FraudResult) { - return nil, false - } - return o.FraudResult, true -} - -// HasFraudResult returns a boolean if a field has been set. -func (o *CheckoutCreateOrderResponse) HasFraudResult() bool { - if o != nil && !common.IsNil(o.FraudResult) { - return true - } - - return false -} - -// SetFraudResult gets a reference to the given FraudResult and assigns it to the FraudResult field. -func (o *CheckoutCreateOrderResponse) SetFraudResult(v FraudResult) { - o.FraudResult = &v -} - -// GetOrderData returns the OrderData field value -func (o *CheckoutCreateOrderResponse) GetOrderData() string { - if o == nil { - var ret string - return ret - } - - return o.OrderData -} - -// GetOrderDataOk returns a tuple with the OrderData field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetOrderDataOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.OrderData, true -} - -// SetOrderData sets field value -func (o *CheckoutCreateOrderResponse) SetOrderData(v string) { - o.OrderData = v -} - -// GetPspReference returns the PspReference field value if set, zero value otherwise. -func (o *CheckoutCreateOrderResponse) GetPspReference() string { - if o == nil || common.IsNil(o.PspReference) { - var ret string - return ret - } - return *o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetPspReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.PspReference) { - return nil, false - } - return o.PspReference, true -} - -// HasPspReference returns a boolean if a field has been set. -func (o *CheckoutCreateOrderResponse) HasPspReference() bool { - if o != nil && !common.IsNil(o.PspReference) { - return true - } - - return false -} - -// SetPspReference gets a reference to the given string and assigns it to the PspReference field. -func (o *CheckoutCreateOrderResponse) SetPspReference(v string) { - o.PspReference = &v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CheckoutCreateOrderResponse) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CheckoutCreateOrderResponse) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CheckoutCreateOrderResponse) SetReference(v string) { - o.Reference = &v -} - -// GetRefusalReason returns the RefusalReason field value if set, zero value otherwise. -func (o *CheckoutCreateOrderResponse) GetRefusalReason() string { - if o == nil || common.IsNil(o.RefusalReason) { - var ret string - return ret - } - return *o.RefusalReason -} - -// GetRefusalReasonOk returns a tuple with the RefusalReason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetRefusalReasonOk() (*string, bool) { - if o == nil || common.IsNil(o.RefusalReason) { - return nil, false - } - return o.RefusalReason, true -} - -// HasRefusalReason returns a boolean if a field has been set. -func (o *CheckoutCreateOrderResponse) HasRefusalReason() bool { - if o != nil && !common.IsNil(o.RefusalReason) { - return true - } - - return false -} - -// SetRefusalReason gets a reference to the given string and assigns it to the RefusalReason field. -func (o *CheckoutCreateOrderResponse) SetRefusalReason(v string) { - o.RefusalReason = &v -} - -// GetRemainingAmount returns the RemainingAmount field value -func (o *CheckoutCreateOrderResponse) GetRemainingAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.RemainingAmount -} - -// GetRemainingAmountOk returns a tuple with the RemainingAmount field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetRemainingAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.RemainingAmount, true -} - -// SetRemainingAmount sets field value -func (o *CheckoutCreateOrderResponse) SetRemainingAmount(v Amount) { - o.RemainingAmount = v -} - -// GetResultCode returns the ResultCode field value -func (o *CheckoutCreateOrderResponse) GetResultCode() string { - if o == nil { - var ret string - return ret - } - - return o.ResultCode -} - -// GetResultCodeOk returns a tuple with the ResultCode field value -// and a boolean to check if the value has been set. -func (o *CheckoutCreateOrderResponse) GetResultCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ResultCode, true -} - -// SetResultCode sets field value -func (o *CheckoutCreateOrderResponse) SetResultCode(v string) { - o.ResultCode = v -} - -func (o CheckoutCreateOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutCreateOrderResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AdditionalData) { - toSerialize["additionalData"] = o.AdditionalData - } - toSerialize["amount"] = o.Amount - toSerialize["expiresAt"] = o.ExpiresAt - if !common.IsNil(o.FraudResult) { - toSerialize["fraudResult"] = o.FraudResult - } - toSerialize["orderData"] = o.OrderData - if !common.IsNil(o.PspReference) { - toSerialize["pspReference"] = o.PspReference - } - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.RefusalReason) { - toSerialize["refusalReason"] = o.RefusalReason - } - toSerialize["remainingAmount"] = o.RemainingAmount - toSerialize["resultCode"] = o.ResultCode - return toSerialize, nil -} - -type NullableCheckoutCreateOrderResponse struct { - value *CheckoutCreateOrderResponse - isSet bool -} - -func (v NullableCheckoutCreateOrderResponse) Get() *CheckoutCreateOrderResponse { - return v.value -} - -func (v *NullableCheckoutCreateOrderResponse) Set(val *CheckoutCreateOrderResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutCreateOrderResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutCreateOrderResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutCreateOrderResponse(val *CheckoutCreateOrderResponse) *NullableCheckoutCreateOrderResponse { - return &NullableCheckoutCreateOrderResponse{value: val, isSet: true} -} - -func (v NullableCheckoutCreateOrderResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutCreateOrderResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CheckoutCreateOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_checkout_utility_request.go b/src/checkout/model_checkout_utility_request.go deleted file mode 100644 index 4dbe5865d..000000000 --- a/src/checkout/model_checkout_utility_request.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutUtilityRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutUtilityRequest{} - -// CheckoutUtilityRequest struct for CheckoutUtilityRequest -type CheckoutUtilityRequest struct { - // The list of origin domains, for which origin keys are requested. - OriginDomains []string `json:"originDomains"` -} - -// NewCheckoutUtilityRequest instantiates a new CheckoutUtilityRequest 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 NewCheckoutUtilityRequest(originDomains []string) *CheckoutUtilityRequest { - this := CheckoutUtilityRequest{} - this.OriginDomains = originDomains - return &this -} - -// NewCheckoutUtilityRequestWithDefaults instantiates a new CheckoutUtilityRequest 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 NewCheckoutUtilityRequestWithDefaults() *CheckoutUtilityRequest { - this := CheckoutUtilityRequest{} - return &this -} - -// GetOriginDomains returns the OriginDomains field value -func (o *CheckoutUtilityRequest) GetOriginDomains() []string { - if o == nil { - var ret []string - return ret - } - - return o.OriginDomains -} - -// GetOriginDomainsOk returns a tuple with the OriginDomains field value -// and a boolean to check if the value has been set. -func (o *CheckoutUtilityRequest) GetOriginDomainsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.OriginDomains, true -} - -// SetOriginDomains sets field value -func (o *CheckoutUtilityRequest) SetOriginDomains(v []string) { - o.OriginDomains = v -} - -func (o CheckoutUtilityRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutUtilityRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["originDomains"] = o.OriginDomains - return toSerialize, nil -} - -type NullableCheckoutUtilityRequest struct { - value *CheckoutUtilityRequest - isSet bool -} - -func (v NullableCheckoutUtilityRequest) Get() *CheckoutUtilityRequest { - return v.value -} - -func (v *NullableCheckoutUtilityRequest) Set(val *CheckoutUtilityRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutUtilityRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutUtilityRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutUtilityRequest(val *CheckoutUtilityRequest) *NullableCheckoutUtilityRequest { - return &NullableCheckoutUtilityRequest{value: val, isSet: true} -} - -func (v NullableCheckoutUtilityRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutUtilityRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_checkout_utility_response.go b/src/checkout/model_checkout_utility_response.go deleted file mode 100644 index c65d5db8e..000000000 --- a/src/checkout/model_checkout_utility_response.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CheckoutUtilityResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CheckoutUtilityResponse{} - -// CheckoutUtilityResponse struct for CheckoutUtilityResponse -type CheckoutUtilityResponse struct { - // The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. - OriginKeys *map[string]string `json:"originKeys,omitempty"` -} - -// NewCheckoutUtilityResponse instantiates a new CheckoutUtilityResponse 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 NewCheckoutUtilityResponse() *CheckoutUtilityResponse { - this := CheckoutUtilityResponse{} - return &this -} - -// NewCheckoutUtilityResponseWithDefaults instantiates a new CheckoutUtilityResponse 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 NewCheckoutUtilityResponseWithDefaults() *CheckoutUtilityResponse { - this := CheckoutUtilityResponse{} - return &this -} - -// GetOriginKeys returns the OriginKeys field value if set, zero value otherwise. -func (o *CheckoutUtilityResponse) GetOriginKeys() map[string]string { - if o == nil || common.IsNil(o.OriginKeys) { - var ret map[string]string - return ret - } - return *o.OriginKeys -} - -// GetOriginKeysOk returns a tuple with the OriginKeys field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CheckoutUtilityResponse) GetOriginKeysOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.OriginKeys) { - return nil, false - } - return o.OriginKeys, true -} - -// HasOriginKeys returns a boolean if a field has been set. -func (o *CheckoutUtilityResponse) HasOriginKeys() bool { - if o != nil && !common.IsNil(o.OriginKeys) { - return true - } - - return false -} - -// SetOriginKeys gets a reference to the given map[string]string and assigns it to the OriginKeys field. -func (o *CheckoutUtilityResponse) SetOriginKeys(v map[string]string) { - o.OriginKeys = &v -} - -func (o CheckoutUtilityResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CheckoutUtilityResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.OriginKeys) { - toSerialize["originKeys"] = o.OriginKeys - } - return toSerialize, nil -} - -type NullableCheckoutUtilityResponse struct { - value *CheckoutUtilityResponse - isSet bool -} - -func (v NullableCheckoutUtilityResponse) Get() *CheckoutUtilityResponse { - return v.value -} - -func (v *NullableCheckoutUtilityResponse) Set(val *CheckoutUtilityResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCheckoutUtilityResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCheckoutUtilityResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCheckoutUtilityResponse(val *CheckoutUtilityResponse) *NullableCheckoutUtilityResponse { - return &NullableCheckoutUtilityResponse{value: val, isSet: true} -} - -func (v NullableCheckoutUtilityResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCheckoutUtilityResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_checkout_voucher_action.go b/src/checkout/model_checkout_voucher_action.go index 8c27d140c..2820d6837 100644 --- a/src/checkout/model_checkout_voucher_action.go +++ b/src/checkout/model_checkout_voucher_action.go @@ -40,6 +40,8 @@ type CheckoutVoucherAction struct { MerchantName *string `json:"merchantName,omitempty"` // The merchant reference. MerchantReference *string `json:"merchantReference,omitempty"` + // A base64 encoded signature of all properties + PassCreationToken *string `json:"passCreationToken,omitempty"` // A value that must be submitted to the `/payments/details` endpoint to verify this payment. PaymentData *string `json:"paymentData,omitempty"` // Specifies the payment method. @@ -428,6 +430,38 @@ func (o *CheckoutVoucherAction) SetMerchantReference(v string) { o.MerchantReference = &v } +// GetPassCreationToken returns the PassCreationToken field value if set, zero value otherwise. +func (o *CheckoutVoucherAction) GetPassCreationToken() string { + if o == nil || common.IsNil(o.PassCreationToken) { + var ret string + return ret + } + return *o.PassCreationToken +} + +// GetPassCreationTokenOk returns a tuple with the PassCreationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckoutVoucherAction) GetPassCreationTokenOk() (*string, bool) { + if o == nil || common.IsNil(o.PassCreationToken) { + return nil, false + } + return o.PassCreationToken, true +} + +// HasPassCreationToken returns a boolean if a field has been set. +func (o *CheckoutVoucherAction) HasPassCreationToken() bool { + if o != nil && !common.IsNil(o.PassCreationToken) { + return true + } + + return false +} + +// SetPassCreationToken gets a reference to the given string and assigns it to the PassCreationToken field. +func (o *CheckoutVoucherAction) SetPassCreationToken(v string) { + o.PassCreationToken = &v +} + // GetPaymentData returns the PaymentData field value if set, zero value otherwise. func (o *CheckoutVoucherAction) GetPaymentData() string { if o == nil || common.IsNil(o.PaymentData) { @@ -751,6 +785,9 @@ func (o CheckoutVoucherAction) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MerchantReference) { toSerialize["merchantReference"] = o.MerchantReference } + if !common.IsNil(o.PassCreationToken) { + toSerialize["passCreationToken"] = o.PassCreationToken + } if !common.IsNil(o.PaymentData) { toSerialize["paymentData"] = o.PaymentData } diff --git a/src/checkout/model_create_apple_pay_session_request.go b/src/checkout/model_create_apple_pay_session_request.go deleted file mode 100644 index af2b85dc9..000000000 --- a/src/checkout/model_create_apple_pay_session_request.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreateApplePaySessionRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreateApplePaySessionRequest{} - -// CreateApplePaySessionRequest struct for CreateApplePaySessionRequest -type CreateApplePaySessionRequest struct { - // This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - DisplayName string `json:"displayName"` - // The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. - DomainName string `json:"domainName"` - // Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - MerchantIdentifier string `json:"merchantIdentifier"` -} - -// NewCreateApplePaySessionRequest instantiates a new CreateApplePaySessionRequest 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 NewCreateApplePaySessionRequest(displayName string, domainName string, merchantIdentifier string) *CreateApplePaySessionRequest { - this := CreateApplePaySessionRequest{} - this.DisplayName = displayName - this.DomainName = domainName - this.MerchantIdentifier = merchantIdentifier - return &this -} - -// NewCreateApplePaySessionRequestWithDefaults instantiates a new CreateApplePaySessionRequest 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 NewCreateApplePaySessionRequestWithDefaults() *CreateApplePaySessionRequest { - this := CreateApplePaySessionRequest{} - return &this -} - -// GetDisplayName returns the DisplayName field value -func (o *CreateApplePaySessionRequest) GetDisplayName() string { - if o == nil { - var ret string - return ret - } - - return o.DisplayName -} - -// GetDisplayNameOk returns a tuple with the DisplayName field value -// and a boolean to check if the value has been set. -func (o *CreateApplePaySessionRequest) GetDisplayNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DisplayName, true -} - -// SetDisplayName sets field value -func (o *CreateApplePaySessionRequest) SetDisplayName(v string) { - o.DisplayName = v -} - -// GetDomainName returns the DomainName field value -func (o *CreateApplePaySessionRequest) GetDomainName() string { - if o == nil { - var ret string - return ret - } - - return o.DomainName -} - -// GetDomainNameOk returns a tuple with the DomainName field value -// and a boolean to check if the value has been set. -func (o *CreateApplePaySessionRequest) GetDomainNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DomainName, true -} - -// SetDomainName sets field value -func (o *CreateApplePaySessionRequest) SetDomainName(v string) { - o.DomainName = v -} - -// GetMerchantIdentifier returns the MerchantIdentifier field value -func (o *CreateApplePaySessionRequest) GetMerchantIdentifier() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantIdentifier -} - -// GetMerchantIdentifierOk returns a tuple with the MerchantIdentifier field value -// and a boolean to check if the value has been set. -func (o *CreateApplePaySessionRequest) GetMerchantIdentifierOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantIdentifier, true -} - -// SetMerchantIdentifier sets field value -func (o *CreateApplePaySessionRequest) SetMerchantIdentifier(v string) { - o.MerchantIdentifier = v -} - -func (o CreateApplePaySessionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateApplePaySessionRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["displayName"] = o.DisplayName - toSerialize["domainName"] = o.DomainName - toSerialize["merchantIdentifier"] = o.MerchantIdentifier - return toSerialize, nil -} - -type NullableCreateApplePaySessionRequest struct { - value *CreateApplePaySessionRequest - isSet bool -} - -func (v NullableCreateApplePaySessionRequest) Get() *CreateApplePaySessionRequest { - return v.value -} - -func (v *NullableCreateApplePaySessionRequest) Set(val *CreateApplePaySessionRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateApplePaySessionRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateApplePaySessionRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateApplePaySessionRequest(val *CreateApplePaySessionRequest) *NullableCreateApplePaySessionRequest { - return &NullableCreateApplePaySessionRequest{value: val, isSet: true} -} - -func (v NullableCreateApplePaySessionRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateApplePaySessionRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index a76f1fbad..2b12d4406 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -29,7 +29,7 @@ type CreateCheckoutSessionRequest struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -42,8 +42,8 @@ type CreateCheckoutSessionRequest struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. @@ -66,8 +66,9 @@ type CreateCheckoutSessionRequest struct { // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. @@ -100,9 +101,9 @@ type CreateCheckoutSessionRequest struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` @@ -363,9 +364,9 @@ func (o *CreateCheckoutSessionRequest) SetAuthenticationData(v AuthenticationDat } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address { +func (o *CreateCheckoutSessionRequest) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -373,7 +374,7 @@ func (o *CreateCheckoutSessionRequest) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionRequest) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -389,8 +390,8 @@ func (o *CreateCheckoutSessionRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CreateCheckoutSessionRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -619,9 +620,9 @@ func (o *CreateCheckoutSessionRequest) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address { +func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -629,7 +630,7 @@ func (o *CreateCheckoutSessionRequest) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionRequest) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -645,8 +646,8 @@ func (o *CreateCheckoutSessionRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } @@ -1090,6 +1091,38 @@ func (o *CreateCheckoutSessionRequest) SetMpiData(v ThreeDSecureData) { o.MpiData = &v } +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + var ret PlatformChargebackLogic + return ret + } + return *o.PlatformChargebackLogic +} + +// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + return nil, false + } + return o.PlatformChargebackLogic, true +} + +// HasPlatformChargebackLogic returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasPlatformChargebackLogic() bool { + if o != nil && !common.IsNil(o.PlatformChargebackLogic) { + return true + } + + return false +} + +// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. +func (o *CreateCheckoutSessionRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + // GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetRecurringExpiry() string { if o == nil || common.IsNil(o.RecurringExpiry) { @@ -1941,6 +1974,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } if !common.IsNil(o.RecurringExpiry) { toSerialize["recurringExpiry"] = o.RecurringExpiry } diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index 304aaa8fb..01e488960 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -29,7 +29,7 @@ type CreateCheckoutSessionResponse struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -39,11 +39,11 @@ type CreateCheckoutSessionResponse struct { Company *Company `json:"company,omitempty"` // The shopper's two-letter country code. CountryCode *string `json:"countryCode,omitempty"` - // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` + // The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. @@ -70,8 +70,9 @@ type CreateCheckoutSessionResponse struct { // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - Mode *string `json:"mode,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Mode *string `json:"mode,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. @@ -106,9 +107,9 @@ type CreateCheckoutSessionResponse struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` @@ -375,9 +376,9 @@ func (o *CreateCheckoutSessionResponse) SetAuthenticationData(v AuthenticationDa } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address { +func (o *CreateCheckoutSessionResponse) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -385,7 +386,7 @@ func (o *CreateCheckoutSessionResponse) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionResponse) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -401,8 +402,8 @@ func (o *CreateCheckoutSessionResponse) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CreateCheckoutSessionResponse) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *CreateCheckoutSessionResponse) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -567,9 +568,9 @@ func (o *CreateCheckoutSessionResponse) SetCountryCode(v string) { } // GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetDateOfBirth() string { +func (o *CreateCheckoutSessionResponse) GetDateOfBirth() time.Time { if o == nil || common.IsNil(o.DateOfBirth) { - var ret string + var ret time.Time return ret } return *o.DateOfBirth @@ -577,7 +578,7 @@ func (o *CreateCheckoutSessionResponse) GetDateOfBirth() string { // GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetDateOfBirthOk() (*string, bool) { +func (o *CreateCheckoutSessionResponse) GetDateOfBirthOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DateOfBirth) { return nil, false } @@ -593,8 +594,8 @@ func (o *CreateCheckoutSessionResponse) HasDateOfBirth() bool { return false } -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *CreateCheckoutSessionResponse) SetDateOfBirth(v string) { +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *CreateCheckoutSessionResponse) SetDateOfBirth(v time.Time) { o.DateOfBirth = &v } @@ -631,9 +632,9 @@ func (o *CreateCheckoutSessionResponse) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address { +func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -641,7 +642,7 @@ func (o *CreateCheckoutSessionResponse) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*Address, bool) { +func (o *CreateCheckoutSessionResponse) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -657,8 +658,8 @@ func (o *CreateCheckoutSessionResponse) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *CreateCheckoutSessionResponse) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } @@ -1150,6 +1151,38 @@ func (o *CreateCheckoutSessionResponse) SetMpiData(v ThreeDSecureData) { o.MpiData = &v } +// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. +func (o *CreateCheckoutSessionResponse) GetPlatformChargebackLogic() PlatformChargebackLogic { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + var ret PlatformChargebackLogic + return ret + } + return *o.PlatformChargebackLogic +} + +// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionResponse) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { + if o == nil || common.IsNil(o.PlatformChargebackLogic) { + return nil, false + } + return o.PlatformChargebackLogic, true +} + +// HasPlatformChargebackLogic returns a boolean if a field has been set. +func (o *CreateCheckoutSessionResponse) HasPlatformChargebackLogic() bool { + if o != nil && !common.IsNil(o.PlatformChargebackLogic) { + return true + } + + return false +} + +// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. +func (o *CreateCheckoutSessionResponse) SetPlatformChargebackLogic(v PlatformChargebackLogic) { + o.PlatformChargebackLogic = &v +} + // GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. func (o *CreateCheckoutSessionResponse) GetRecurringExpiry() string { if o == nil || common.IsNil(o.RecurringExpiry) { @@ -2035,6 +2068,9 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } + if !common.IsNil(o.PlatformChargebackLogic) { + toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic + } if !common.IsNil(o.RecurringExpiry) { toSerialize["recurringExpiry"] = o.RecurringExpiry } diff --git a/src/checkout/model_create_payment_amount_update_request.go b/src/checkout/model_create_payment_amount_update_request.go deleted file mode 100644 index 31c3eea05..000000000 --- a/src/checkout/model_create_payment_amount_update_request.go +++ /dev/null @@ -1,264 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentAmountUpdateRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentAmountUpdateRequest{} - -// CreatePaymentAmountUpdateRequest struct for CreatePaymentAmountUpdateRequest -type CreatePaymentAmountUpdateRequest struct { - Amount Amount `json:"amount"` - // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - IndustryUsage *string `json:"industryUsage,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reference for the amount update request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` -} - -// NewCreatePaymentAmountUpdateRequest instantiates a new CreatePaymentAmountUpdateRequest 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 NewCreatePaymentAmountUpdateRequest(amount Amount, merchantAccount string) *CreatePaymentAmountUpdateRequest { - this := CreatePaymentAmountUpdateRequest{} - this.Amount = amount - this.MerchantAccount = merchantAccount - return &this -} - -// NewCreatePaymentAmountUpdateRequestWithDefaults instantiates a new CreatePaymentAmountUpdateRequest 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 NewCreatePaymentAmountUpdateRequestWithDefaults() *CreatePaymentAmountUpdateRequest { - this := CreatePaymentAmountUpdateRequest{} - return &this -} - -// GetAmount returns the Amount field value -func (o *CreatePaymentAmountUpdateRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentAmountUpdateRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CreatePaymentAmountUpdateRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. -func (o *CreatePaymentAmountUpdateRequest) GetIndustryUsage() string { - if o == nil || common.IsNil(o.IndustryUsage) { - var ret string - return ret - } - return *o.IndustryUsage -} - -// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentAmountUpdateRequest) GetIndustryUsageOk() (*string, bool) { - if o == nil || common.IsNil(o.IndustryUsage) { - return nil, false - } - return o.IndustryUsage, true -} - -// HasIndustryUsage returns a boolean if a field has been set. -func (o *CreatePaymentAmountUpdateRequest) HasIndustryUsage() bool { - if o != nil && !common.IsNil(o.IndustryUsage) { - return true - } - - return false -} - -// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. -func (o *CreatePaymentAmountUpdateRequest) SetIndustryUsage(v string) { - o.IndustryUsage = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentAmountUpdateRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentAmountUpdateRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentAmountUpdateRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreatePaymentAmountUpdateRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentAmountUpdateRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreatePaymentAmountUpdateRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreatePaymentAmountUpdateRequest) SetReference(v string) { - o.Reference = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreatePaymentAmountUpdateRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentAmountUpdateRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *CreatePaymentAmountUpdateRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreatePaymentAmountUpdateRequest) SetSplits(v []Split) { - o.Splits = v -} - -func (o CreatePaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentAmountUpdateRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.IndustryUsage) { - toSerialize["industryUsage"] = o.IndustryUsage - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - return toSerialize, nil -} - -type NullableCreatePaymentAmountUpdateRequest struct { - value *CreatePaymentAmountUpdateRequest - isSet bool -} - -func (v NullableCreatePaymentAmountUpdateRequest) Get() *CreatePaymentAmountUpdateRequest { - return v.value -} - -func (v *NullableCreatePaymentAmountUpdateRequest) Set(val *CreatePaymentAmountUpdateRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentAmountUpdateRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentAmountUpdateRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentAmountUpdateRequest(val *CreatePaymentAmountUpdateRequest) *NullableCreatePaymentAmountUpdateRequest { - return &NullableCreatePaymentAmountUpdateRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentAmountUpdateRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CreatePaymentAmountUpdateRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_create_payment_cancel_request.go b/src/checkout/model_create_payment_cancel_request.go deleted file mode 100644 index 62d0d2e29..000000000 --- a/src/checkout/model_create_payment_cancel_request.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentCancelRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentCancelRequest{} - -// CreatePaymentCancelRequest struct for CreatePaymentCancelRequest -type CreatePaymentCancelRequest struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reference for the cancel request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` -} - -// NewCreatePaymentCancelRequest instantiates a new CreatePaymentCancelRequest 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 NewCreatePaymentCancelRequest(merchantAccount string) *CreatePaymentCancelRequest { - this := CreatePaymentCancelRequest{} - this.MerchantAccount = merchantAccount - return &this -} - -// NewCreatePaymentCancelRequestWithDefaults instantiates a new CreatePaymentCancelRequest 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 NewCreatePaymentCancelRequestWithDefaults() *CreatePaymentCancelRequest { - this := CreatePaymentCancelRequest{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentCancelRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentCancelRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentCancelRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreatePaymentCancelRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentCancelRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreatePaymentCancelRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreatePaymentCancelRequest) SetReference(v string) { - o.Reference = &v -} - -func (o CreatePaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentCancelRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - return toSerialize, nil -} - -type NullableCreatePaymentCancelRequest struct { - value *CreatePaymentCancelRequest - isSet bool -} - -func (v NullableCreatePaymentCancelRequest) Get() *CreatePaymentCancelRequest { - return v.value -} - -func (v *NullableCreatePaymentCancelRequest) Set(val *CreatePaymentCancelRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentCancelRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentCancelRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentCancelRequest(val *CreatePaymentCancelRequest) *NullableCreatePaymentCancelRequest { - return &NullableCreatePaymentCancelRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentCancelRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentCancelRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_create_payment_capture_request.go b/src/checkout/model_create_payment_capture_request.go deleted file mode 100644 index be76c5768..000000000 --- a/src/checkout/model_create_payment_capture_request.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentCaptureRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentCaptureRequest{} - -// CreatePaymentCaptureRequest struct for CreatePaymentCaptureRequest -type CreatePaymentCaptureRequest struct { - Amount Amount `json:"amount"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reference for the capture request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` -} - -// NewCreatePaymentCaptureRequest instantiates a new CreatePaymentCaptureRequest 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 NewCreatePaymentCaptureRequest(amount Amount, merchantAccount string) *CreatePaymentCaptureRequest { - this := CreatePaymentCaptureRequest{} - this.Amount = amount - this.MerchantAccount = merchantAccount - return &this -} - -// NewCreatePaymentCaptureRequestWithDefaults instantiates a new CreatePaymentCaptureRequest 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 NewCreatePaymentCaptureRequestWithDefaults() *CreatePaymentCaptureRequest { - this := CreatePaymentCaptureRequest{} - return &this -} - -// GetAmount returns the Amount field value -func (o *CreatePaymentCaptureRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentCaptureRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CreatePaymentCaptureRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *CreatePaymentCaptureRequest) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentCaptureRequest) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *CreatePaymentCaptureRequest) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *CreatePaymentCaptureRequest) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentCaptureRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentCaptureRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentCaptureRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreatePaymentCaptureRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentCaptureRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreatePaymentCaptureRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreatePaymentCaptureRequest) SetReference(v string) { - o.Reference = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreatePaymentCaptureRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentCaptureRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *CreatePaymentCaptureRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreatePaymentCaptureRequest) SetSplits(v []Split) { - o.Splits = v -} - -func (o CreatePaymentCaptureRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentCaptureRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - return toSerialize, nil -} - -type NullableCreatePaymentCaptureRequest struct { - value *CreatePaymentCaptureRequest - isSet bool -} - -func (v NullableCreatePaymentCaptureRequest) Get() *CreatePaymentCaptureRequest { - return v.value -} - -func (v *NullableCreatePaymentCaptureRequest) Set(val *CreatePaymentCaptureRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentCaptureRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentCaptureRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentCaptureRequest(val *CreatePaymentCaptureRequest) *NullableCreatePaymentCaptureRequest { - return &NullableCreatePaymentCaptureRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentCaptureRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentCaptureRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_create_payment_link_request.go b/src/checkout/model_create_payment_link_request.go deleted file mode 100644 index cb090b7b1..000000000 --- a/src/checkout/model_create_payment_link_request.go +++ /dev/null @@ -1,1489 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentLinkRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentLinkRequest{} - -// CreatePaymentLinkRequest struct for CreatePaymentLinkRequest -type CreatePaymentLinkRequest struct { - // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` - BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` - // The delay between the authorisation and scheduled auto-capture, specified in hours. - CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` - // The shopper's two-letter country code. - CountryCode *string `json:"countryCode,omitempty"` - // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` - // A short description visible on the payment page. Maximum length: 280 characters. - Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - ExpiresAt *string `json:"expiresAt,omitempty"` - // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - InstallmentOptions *map[string]InstallmentOption `json:"installmentOptions,omitempty"` - // Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - ManualCapture *bool `json:"manualCapture,omitempty"` - // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - Mcc *string `json:"mcc,omitempty"` - // The merchant account identifier for which the payment link is created. - MerchantAccount string `json:"merchantAccount"` - // This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` - // A reference that is used to uniquely identify the payment in future communications about the payment status. - Reference string `json:"reference"` - // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - RequiredShopperFields []string `json:"requiredShopperFields,omitempty"` - // Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - ReturnUrl *string `json:"returnUrl,omitempty"` - // Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - Reusable *bool `json:"reusable,omitempty"` - RiskData *RiskData `json:"riskData,omitempty"` - // The shopper's email address. - ShopperEmail *string `json:"shopperEmail,omitempty"` - // The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` - // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - ShopperReference *string `json:"shopperReference,omitempty"` - // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - ShopperStatement *string `json:"shopperStatement,omitempty"` - // Set to **false** to hide the 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. - SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` - // The physical store, for which this payment is processed. - Store *string `json:"store,omitempty"` - // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - StorePaymentMethodMode *string `json:"storePaymentMethodMode,omitempty"` - // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - // A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - ThemeId *string `json:"themeId,omitempty"` -} - -// NewCreatePaymentLinkRequest instantiates a new CreatePaymentLinkRequest 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 NewCreatePaymentLinkRequest(amount Amount, merchantAccount string, reference string) *CreatePaymentLinkRequest { - this := CreatePaymentLinkRequest{} - this.Amount = amount - this.MerchantAccount = merchantAccount - this.Reference = reference - var showRemovePaymentMethodButton bool = true - this.ShowRemovePaymentMethodButton = &showRemovePaymentMethodButton - var splitCardFundingSources bool = false - this.SplitCardFundingSources = &splitCardFundingSources - return &this -} - -// NewCreatePaymentLinkRequestWithDefaults instantiates a new CreatePaymentLinkRequest 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 NewCreatePaymentLinkRequestWithDefaults() *CreatePaymentLinkRequest { - this := CreatePaymentLinkRequest{} - var showRemovePaymentMethodButton bool = true - this.ShowRemovePaymentMethodButton = &showRemovePaymentMethodButton - var splitCardFundingSources bool = false - this.SplitCardFundingSources = &splitCardFundingSources - return &this -} - -// GetAllowedPaymentMethods returns the AllowedPaymentMethods field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetAllowedPaymentMethods() []string { - if o == nil || common.IsNil(o.AllowedPaymentMethods) { - var ret []string - return ret - } - return o.AllowedPaymentMethods -} - -// GetAllowedPaymentMethodsOk returns a tuple with the AllowedPaymentMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetAllowedPaymentMethodsOk() ([]string, bool) { - if o == nil || common.IsNil(o.AllowedPaymentMethods) { - return nil, false - } - return o.AllowedPaymentMethods, true -} - -// HasAllowedPaymentMethods returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasAllowedPaymentMethods() bool { - if o != nil && !common.IsNil(o.AllowedPaymentMethods) { - return true - } - - return false -} - -// SetAllowedPaymentMethods gets a reference to the given []string and assigns it to the AllowedPaymentMethods field. -func (o *CreatePaymentLinkRequest) SetAllowedPaymentMethods(v []string) { - o.AllowedPaymentMethods = v -} - -// GetAmount returns the Amount field value -func (o *CreatePaymentLinkRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CreatePaymentLinkRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetApplicationInfo() ApplicationInfo { - if o == nil || common.IsNil(o.ApplicationInfo) { - var ret ApplicationInfo - return ret - } - return *o.ApplicationInfo -} - -// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { - if o == nil || common.IsNil(o.ApplicationInfo) { - return nil, false - } - return o.ApplicationInfo, true -} - -// HasApplicationInfo returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasApplicationInfo() bool { - if o != nil && !common.IsNil(o.ApplicationInfo) { - return true - } - - return false -} - -// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. -func (o *CreatePaymentLinkRequest) SetApplicationInfo(v ApplicationInfo) { - o.ApplicationInfo = &v -} - -// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetBillingAddress() Address { - if o == nil || common.IsNil(o.BillingAddress) { - var ret Address - return ret - } - return *o.BillingAddress -} - -// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetBillingAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.BillingAddress) { - return nil, false - } - return o.BillingAddress, true -} - -// HasBillingAddress returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasBillingAddress() bool { - if o != nil && !common.IsNil(o.BillingAddress) { - return true - } - - return false -} - -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *CreatePaymentLinkRequest) SetBillingAddress(v Address) { - o.BillingAddress = &v -} - -// GetBlockedPaymentMethods returns the BlockedPaymentMethods field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetBlockedPaymentMethods() []string { - if o == nil || common.IsNil(o.BlockedPaymentMethods) { - var ret []string - return ret - } - return o.BlockedPaymentMethods -} - -// GetBlockedPaymentMethodsOk returns a tuple with the BlockedPaymentMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetBlockedPaymentMethodsOk() ([]string, bool) { - if o == nil || common.IsNil(o.BlockedPaymentMethods) { - return nil, false - } - return o.BlockedPaymentMethods, true -} - -// HasBlockedPaymentMethods returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasBlockedPaymentMethods() bool { - if o != nil && !common.IsNil(o.BlockedPaymentMethods) { - return true - } - - return false -} - -// SetBlockedPaymentMethods gets a reference to the given []string and assigns it to the BlockedPaymentMethods field. -func (o *CreatePaymentLinkRequest) SetBlockedPaymentMethods(v []string) { - o.BlockedPaymentMethods = v -} - -// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetCaptureDelayHours() int32 { - if o == nil || common.IsNil(o.CaptureDelayHours) { - var ret int32 - return ret - } - return *o.CaptureDelayHours -} - -// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetCaptureDelayHoursOk() (*int32, bool) { - if o == nil || common.IsNil(o.CaptureDelayHours) { - return nil, false - } - return o.CaptureDelayHours, true -} - -// HasCaptureDelayHours returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasCaptureDelayHours() bool { - if o != nil && !common.IsNil(o.CaptureDelayHours) { - return true - } - - return false -} - -// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. -func (o *CreatePaymentLinkRequest) SetCaptureDelayHours(v int32) { - o.CaptureDelayHours = &v -} - -// GetCountryCode returns the CountryCode field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetCountryCode() string { - if o == nil || common.IsNil(o.CountryCode) { - var ret string - return ret - } - return *o.CountryCode -} - -// GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetCountryCodeOk() (*string, bool) { - if o == nil || common.IsNil(o.CountryCode) { - return nil, false - } - return o.CountryCode, true -} - -// HasCountryCode returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasCountryCode() bool { - if o != nil && !common.IsNil(o.CountryCode) { - return true - } - - return false -} - -// SetCountryCode gets a reference to the given string and assigns it to the CountryCode field. -func (o *CreatePaymentLinkRequest) SetCountryCode(v string) { - o.CountryCode = &v -} - -// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetDateOfBirth() string { - if o == nil || common.IsNil(o.DateOfBirth) { - var ret string - return ret - } - return *o.DateOfBirth -} - -// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetDateOfBirthOk() (*string, bool) { - if o == nil || common.IsNil(o.DateOfBirth) { - return nil, false - } - return o.DateOfBirth, true -} - -// HasDateOfBirth returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasDateOfBirth() bool { - if o != nil && !common.IsNil(o.DateOfBirth) { - return true - } - - return false -} - -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *CreatePaymentLinkRequest) SetDateOfBirth(v string) { - o.DateOfBirth = &v -} - -// GetDeliverAt returns the DeliverAt field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetDeliverAt() time.Time { - if o == nil || common.IsNil(o.DeliverAt) { - var ret time.Time - return ret - } - return *o.DeliverAt -} - -// GetDeliverAtOk returns a tuple with the DeliverAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetDeliverAtOk() (*time.Time, bool) { - if o == nil || common.IsNil(o.DeliverAt) { - return nil, false - } - return o.DeliverAt, true -} - -// HasDeliverAt returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasDeliverAt() bool { - if o != nil && !common.IsNil(o.DeliverAt) { - return true - } - - return false -} - -// SetDeliverAt gets a reference to the given time.Time and assigns it to the DeliverAt field. -func (o *CreatePaymentLinkRequest) SetDeliverAt(v time.Time) { - o.DeliverAt = &v -} - -// GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetDeliveryAddress() Address { - if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address - return ret - } - return *o.DeliveryAddress -} - -// GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetDeliveryAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.DeliveryAddress) { - return nil, false - } - return o.DeliveryAddress, true -} - -// HasDeliveryAddress returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasDeliveryAddress() bool { - if o != nil && !common.IsNil(o.DeliveryAddress) { - return true - } - - return false -} - -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *CreatePaymentLinkRequest) SetDeliveryAddress(v Address) { - o.DeliveryAddress = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetDescription() string { - if o == nil || common.IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetDescriptionOk() (*string, bool) { - if o == nil || common.IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasDescription() bool { - if o != nil && !common.IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreatePaymentLinkRequest) SetDescription(v string) { - o.Description = &v -} - -// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetExpiresAt() string { - if o == nil || common.IsNil(o.ExpiresAt) { - var ret string - return ret - } - return *o.ExpiresAt -} - -// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetExpiresAtOk() (*string, bool) { - if o == nil || common.IsNil(o.ExpiresAt) { - return nil, false - } - return o.ExpiresAt, true -} - -// HasExpiresAt returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasExpiresAt() bool { - if o != nil && !common.IsNil(o.ExpiresAt) { - return true - } - - return false -} - -// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. -func (o *CreatePaymentLinkRequest) SetExpiresAt(v string) { - o.ExpiresAt = &v -} - -// GetInstallmentOptions returns the InstallmentOptions field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetInstallmentOptions() map[string]InstallmentOption { - if o == nil || common.IsNil(o.InstallmentOptions) { - var ret map[string]InstallmentOption - return ret - } - return *o.InstallmentOptions -} - -// GetInstallmentOptionsOk returns a tuple with the InstallmentOptions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetInstallmentOptionsOk() (*map[string]InstallmentOption, bool) { - if o == nil || common.IsNil(o.InstallmentOptions) { - return nil, false - } - return o.InstallmentOptions, true -} - -// HasInstallmentOptions returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasInstallmentOptions() bool { - if o != nil && !common.IsNil(o.InstallmentOptions) { - return true - } - - return false -} - -// SetInstallmentOptions gets a reference to the given map[string]InstallmentOption and assigns it to the InstallmentOptions field. -func (o *CreatePaymentLinkRequest) SetInstallmentOptions(v map[string]InstallmentOption) { - o.InstallmentOptions = &v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *CreatePaymentLinkRequest) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetManualCapture returns the ManualCapture field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetManualCapture() bool { - if o == nil || common.IsNil(o.ManualCapture) { - var ret bool - return ret - } - return *o.ManualCapture -} - -// GetManualCaptureOk returns a tuple with the ManualCapture field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetManualCaptureOk() (*bool, bool) { - if o == nil || common.IsNil(o.ManualCapture) { - return nil, false - } - return o.ManualCapture, true -} - -// HasManualCapture returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasManualCapture() bool { - if o != nil && !common.IsNil(o.ManualCapture) { - return true - } - - return false -} - -// SetManualCapture gets a reference to the given bool and assigns it to the ManualCapture field. -func (o *CreatePaymentLinkRequest) SetManualCapture(v bool) { - o.ManualCapture = &v -} - -// GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) SetMcc(v string) { - o.Mcc = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentLinkRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentLinkRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetMerchantOrderReference() string { - if o == nil || common.IsNil(o.MerchantOrderReference) { - var ret string - return ret - } - return *o.MerchantOrderReference -} - -// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetMerchantOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantOrderReference) { - return nil, false - } - return o.MerchantOrderReference, true -} - -// HasMerchantOrderReference returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasMerchantOrderReference() bool { - if o != nil && !common.IsNil(o.MerchantOrderReference) { - return true - } - - return false -} - -// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. -func (o *CreatePaymentLinkRequest) SetMerchantOrderReference(v string) { - o.MerchantOrderReference = &v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetMetadata() map[string]string { - if o == nil || common.IsNil(o.Metadata) { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetMetadataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.Metadata) { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasMetadata() bool { - if o != nil && !common.IsNil(o.Metadata) { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *CreatePaymentLinkRequest) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetRecurringProcessingModel() string { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - var ret string - return ret - } - return *o.RecurringProcessingModel -} - -// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetRecurringProcessingModelOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - return nil, false - } - return o.RecurringProcessingModel, true -} - -// HasRecurringProcessingModel returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasRecurringProcessingModel() bool { - if o != nil && !common.IsNil(o.RecurringProcessingModel) { - return true - } - - return false -} - -// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. -func (o *CreatePaymentLinkRequest) SetRecurringProcessingModel(v string) { - o.RecurringProcessingModel = &v -} - -// GetReference returns the Reference field value -func (o *CreatePaymentLinkRequest) GetReference() string { - if o == nil { - var ret string - return ret - } - - return o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Reference, true -} - -// SetReference sets field value -func (o *CreatePaymentLinkRequest) SetReference(v string) { - o.Reference = v -} - -// GetRequiredShopperFields returns the RequiredShopperFields field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetRequiredShopperFields() []string { - if o == nil || common.IsNil(o.RequiredShopperFields) { - var ret []string - return ret - } - return o.RequiredShopperFields -} - -// GetRequiredShopperFieldsOk returns a tuple with the RequiredShopperFields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetRequiredShopperFieldsOk() ([]string, bool) { - if o == nil || common.IsNil(o.RequiredShopperFields) { - return nil, false - } - return o.RequiredShopperFields, true -} - -// HasRequiredShopperFields returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasRequiredShopperFields() bool { - if o != nil && !common.IsNil(o.RequiredShopperFields) { - return true - } - - return false -} - -// SetRequiredShopperFields gets a reference to the given []string and assigns it to the RequiredShopperFields field. -func (o *CreatePaymentLinkRequest) SetRequiredShopperFields(v []string) { - o.RequiredShopperFields = v -} - -// GetReturnUrl returns the ReturnUrl field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetReturnUrl() string { - if o == nil || common.IsNil(o.ReturnUrl) { - var ret string - return ret - } - return *o.ReturnUrl -} - -// GetReturnUrlOk returns a tuple with the ReturnUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetReturnUrlOk() (*string, bool) { - if o == nil || common.IsNil(o.ReturnUrl) { - return nil, false - } - return o.ReturnUrl, true -} - -// HasReturnUrl returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasReturnUrl() bool { - if o != nil && !common.IsNil(o.ReturnUrl) { - return true - } - - return false -} - -// SetReturnUrl gets a reference to the given string and assigns it to the ReturnUrl field. -func (o *CreatePaymentLinkRequest) SetReturnUrl(v string) { - o.ReturnUrl = &v -} - -// GetReusable returns the Reusable field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetReusable() bool { - if o == nil || common.IsNil(o.Reusable) { - var ret bool - return ret - } - return *o.Reusable -} - -// GetReusableOk returns a tuple with the Reusable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetReusableOk() (*bool, bool) { - if o == nil || common.IsNil(o.Reusable) { - return nil, false - } - return o.Reusable, true -} - -// HasReusable returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasReusable() bool { - if o != nil && !common.IsNil(o.Reusable) { - return true - } - - return false -} - -// SetReusable gets a reference to the given bool and assigns it to the Reusable field. -func (o *CreatePaymentLinkRequest) SetReusable(v bool) { - o.Reusable = &v -} - -// GetRiskData returns the RiskData field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetRiskData() RiskData { - if o == nil || common.IsNil(o.RiskData) { - var ret RiskData - return ret - } - return *o.RiskData -} - -// GetRiskDataOk returns a tuple with the RiskData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetRiskDataOk() (*RiskData, bool) { - if o == nil || common.IsNil(o.RiskData) { - return nil, false - } - return o.RiskData, true -} - -// HasRiskData returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasRiskData() bool { - if o != nil && !common.IsNil(o.RiskData) { - return true - } - - return false -} - -// SetRiskData gets a reference to the given RiskData and assigns it to the RiskData field. -func (o *CreatePaymentLinkRequest) SetRiskData(v RiskData) { - o.RiskData = &v -} - -// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) SetShopperEmail(v string) { - o.ShopperEmail = &v -} - -// GetShopperLocale returns the ShopperLocale field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetShopperLocale() string { - if o == nil || common.IsNil(o.ShopperLocale) { - var ret string - return ret - } - return *o.ShopperLocale -} - -// GetShopperLocaleOk returns a tuple with the ShopperLocale field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetShopperLocaleOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperLocale) { - return nil, false - } - return o.ShopperLocale, true -} - -// HasShopperLocale returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasShopperLocale() bool { - if o != nil && !common.IsNil(o.ShopperLocale) { - return true - } - - return false -} - -// SetShopperLocale gets a reference to the given string and assigns it to the ShopperLocale field. -func (o *CreatePaymentLinkRequest) SetShopperLocale(v string) { - o.ShopperLocale = &v -} - -// GetShopperName returns the ShopperName field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetShopperName() Name { - if o == nil || common.IsNil(o.ShopperName) { - var ret Name - return ret - } - return *o.ShopperName -} - -// GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetShopperNameOk() (*Name, bool) { - if o == nil || common.IsNil(o.ShopperName) { - return nil, false - } - return o.ShopperName, true -} - -// HasShopperName returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasShopperName() bool { - if o != nil && !common.IsNil(o.ShopperName) { - return true - } - - return false -} - -// SetShopperName gets a reference to the given Name and assigns it to the ShopperName field. -func (o *CreatePaymentLinkRequest) SetShopperName(v Name) { - o.ShopperName = &v -} - -// GetShopperReference returns the ShopperReference field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetShopperReference() string { - if o == nil || common.IsNil(o.ShopperReference) { - var ret string - return ret - } - return *o.ShopperReference -} - -// GetShopperReferenceOk returns a tuple with the ShopperReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetShopperReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperReference) { - return nil, false - } - return o.ShopperReference, true -} - -// HasShopperReference returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasShopperReference() bool { - if o != nil && !common.IsNil(o.ShopperReference) { - return true - } - - return false -} - -// SetShopperReference gets a reference to the given string and assigns it to the ShopperReference field. -func (o *CreatePaymentLinkRequest) SetShopperReference(v string) { - o.ShopperReference = &v -} - -// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetShopperStatement() string { - if o == nil || common.IsNil(o.ShopperStatement) { - var ret string - return ret - } - return *o.ShopperStatement -} - -// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetShopperStatementOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperStatement) { - return nil, false - } - return o.ShopperStatement, true -} - -// HasShopperStatement returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasShopperStatement() bool { - if o != nil && !common.IsNil(o.ShopperStatement) { - return true - } - - return false -} - -// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. -func (o *CreatePaymentLinkRequest) SetShopperStatement(v string) { - o.ShopperStatement = &v -} - -// GetShowRemovePaymentMethodButton returns the ShowRemovePaymentMethodButton field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) SetShowRemovePaymentMethodButton(v bool) { - o.ShowRemovePaymentMethodButton = &v -} - -// GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetSocialSecurityNumber() string { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - var ret string - return ret - } - return *o.SocialSecurityNumber -} - -// GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetSocialSecurityNumberOk() (*string, bool) { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - return nil, false - } - return o.SocialSecurityNumber, true -} - -// HasSocialSecurityNumber returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasSocialSecurityNumber() bool { - if o != nil && !common.IsNil(o.SocialSecurityNumber) { - return true - } - - return false -} - -// SetSocialSecurityNumber gets a reference to the given string and assigns it to the SocialSecurityNumber field. -func (o *CreatePaymentLinkRequest) SetSocialSecurityNumber(v string) { - o.SocialSecurityNumber = &v -} - -// GetSplitCardFundingSources returns the SplitCardFundingSources field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetSplitCardFundingSources() bool { - if o == nil || common.IsNil(o.SplitCardFundingSources) { - var ret bool - return ret - } - return *o.SplitCardFundingSources -} - -// GetSplitCardFundingSourcesOk returns a tuple with the SplitCardFundingSources field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetSplitCardFundingSourcesOk() (*bool, bool) { - if o == nil || common.IsNil(o.SplitCardFundingSources) { - return nil, false - } - return o.SplitCardFundingSources, true -} - -// HasSplitCardFundingSources returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasSplitCardFundingSources() bool { - if o != nil && !common.IsNil(o.SplitCardFundingSources) { - return true - } - - return false -} - -// SetSplitCardFundingSources gets a reference to the given bool and assigns it to the SplitCardFundingSources field. -func (o *CreatePaymentLinkRequest) SetSplitCardFundingSources(v bool) { - o.SplitCardFundingSources = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreatePaymentLinkRequest) SetSplits(v []Split) { - o.Splits = v -} - -// GetStore returns the Store field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetStore() string { - if o == nil || common.IsNil(o.Store) { - var ret string - return ret - } - return *o.Store -} - -// GetStoreOk returns a tuple with the Store field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetStoreOk() (*string, bool) { - if o == nil || common.IsNil(o.Store) { - return nil, false - } - return o.Store, true -} - -// HasStore returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasStore() bool { - if o != nil && !common.IsNil(o.Store) { - return true - } - - return false -} - -// SetStore gets a reference to the given string and assigns it to the Store field. -func (o *CreatePaymentLinkRequest) SetStore(v string) { - o.Store = &v -} - -// GetStorePaymentMethodMode returns the StorePaymentMethodMode field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetStorePaymentMethodMode() string { - if o == nil || common.IsNil(o.StorePaymentMethodMode) { - var ret string - return ret - } - return *o.StorePaymentMethodMode -} - -// GetStorePaymentMethodModeOk returns a tuple with the StorePaymentMethodMode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetStorePaymentMethodModeOk() (*string, bool) { - if o == nil || common.IsNil(o.StorePaymentMethodMode) { - return nil, false - } - return o.StorePaymentMethodMode, true -} - -// HasStorePaymentMethodMode returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasStorePaymentMethodMode() bool { - if o != nil && !common.IsNil(o.StorePaymentMethodMode) { - return true - } - - return false -} - -// SetStorePaymentMethodMode gets a reference to the given string and assigns it to the StorePaymentMethodMode field. -func (o *CreatePaymentLinkRequest) SetStorePaymentMethodMode(v string) { - o.StorePaymentMethodMode = &v -} - -// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) 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 *CreatePaymentLinkRequest) SetTelephoneNumber(v string) { - o.TelephoneNumber = &v -} - -// GetThemeId returns the ThemeId field value if set, zero value otherwise. -func (o *CreatePaymentLinkRequest) GetThemeId() string { - if o == nil || common.IsNil(o.ThemeId) { - var ret string - return ret - } - return *o.ThemeId -} - -// GetThemeIdOk returns a tuple with the ThemeId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentLinkRequest) GetThemeIdOk() (*string, bool) { - if o == nil || common.IsNil(o.ThemeId) { - return nil, false - } - return o.ThemeId, true -} - -// HasThemeId returns a boolean if a field has been set. -func (o *CreatePaymentLinkRequest) HasThemeId() bool { - if o != nil && !common.IsNil(o.ThemeId) { - return true - } - - return false -} - -// SetThemeId gets a reference to the given string and assigns it to the ThemeId field. -func (o *CreatePaymentLinkRequest) SetThemeId(v string) { - o.ThemeId = &v -} - -func (o CreatePaymentLinkRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentLinkRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AllowedPaymentMethods) { - toSerialize["allowedPaymentMethods"] = o.AllowedPaymentMethods - } - toSerialize["amount"] = o.Amount - if !common.IsNil(o.ApplicationInfo) { - toSerialize["applicationInfo"] = o.ApplicationInfo - } - if !common.IsNil(o.BillingAddress) { - toSerialize["billingAddress"] = o.BillingAddress - } - if !common.IsNil(o.BlockedPaymentMethods) { - toSerialize["blockedPaymentMethods"] = o.BlockedPaymentMethods - } - if !common.IsNil(o.CaptureDelayHours) { - toSerialize["captureDelayHours"] = o.CaptureDelayHours - } - if !common.IsNil(o.CountryCode) { - toSerialize["countryCode"] = o.CountryCode - } - if !common.IsNil(o.DateOfBirth) { - toSerialize["dateOfBirth"] = o.DateOfBirth - } - if !common.IsNil(o.DeliverAt) { - toSerialize["deliverAt"] = o.DeliverAt - } - if !common.IsNil(o.DeliveryAddress) { - toSerialize["deliveryAddress"] = o.DeliveryAddress - } - if !common.IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !common.IsNil(o.ExpiresAt) { - toSerialize["expiresAt"] = o.ExpiresAt - } - if !common.IsNil(o.InstallmentOptions) { - toSerialize["installmentOptions"] = o.InstallmentOptions - } - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - if !common.IsNil(o.ManualCapture) { - toSerialize["manualCapture"] = o.ManualCapture - } - if !common.IsNil(o.Mcc) { - toSerialize["mcc"] = o.Mcc - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantOrderReference) { - toSerialize["merchantOrderReference"] = o.MerchantOrderReference - } - if !common.IsNil(o.Metadata) { - toSerialize["metadata"] = o.Metadata - } - if !common.IsNil(o.RecurringProcessingModel) { - toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel - } - toSerialize["reference"] = o.Reference - if !common.IsNil(o.RequiredShopperFields) { - toSerialize["requiredShopperFields"] = o.RequiredShopperFields - } - if !common.IsNil(o.ReturnUrl) { - toSerialize["returnUrl"] = o.ReturnUrl - } - if !common.IsNil(o.Reusable) { - toSerialize["reusable"] = o.Reusable - } - if !common.IsNil(o.RiskData) { - toSerialize["riskData"] = o.RiskData - } - if !common.IsNil(o.ShopperEmail) { - toSerialize["shopperEmail"] = o.ShopperEmail - } - if !common.IsNil(o.ShopperLocale) { - toSerialize["shopperLocale"] = o.ShopperLocale - } - if !common.IsNil(o.ShopperName) { - toSerialize["shopperName"] = o.ShopperName - } - if !common.IsNil(o.ShopperReference) { - toSerialize["shopperReference"] = o.ShopperReference - } - if !common.IsNil(o.ShopperStatement) { - toSerialize["shopperStatement"] = o.ShopperStatement - } - if !common.IsNil(o.ShowRemovePaymentMethodButton) { - toSerialize["showRemovePaymentMethodButton"] = o.ShowRemovePaymentMethodButton - } - if !common.IsNil(o.SocialSecurityNumber) { - toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber - } - if !common.IsNil(o.SplitCardFundingSources) { - toSerialize["splitCardFundingSources"] = o.SplitCardFundingSources - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - if !common.IsNil(o.Store) { - toSerialize["store"] = o.Store - } - if !common.IsNil(o.StorePaymentMethodMode) { - toSerialize["storePaymentMethodMode"] = o.StorePaymentMethodMode - } - if !common.IsNil(o.TelephoneNumber) { - toSerialize["telephoneNumber"] = o.TelephoneNumber - } - if !common.IsNil(o.ThemeId) { - toSerialize["themeId"] = o.ThemeId - } - return toSerialize, nil -} - -type NullableCreatePaymentLinkRequest struct { - value *CreatePaymentLinkRequest - isSet bool -} - -func (v NullableCreatePaymentLinkRequest) Get() *CreatePaymentLinkRequest { - return v.value -} - -func (v *NullableCreatePaymentLinkRequest) Set(val *CreatePaymentLinkRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentLinkRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentLinkRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentLinkRequest(val *CreatePaymentLinkRequest) *NullableCreatePaymentLinkRequest { - return &NullableCreatePaymentLinkRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentLinkRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentLinkRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CreatePaymentLinkRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false -} -func (o *CreatePaymentLinkRequest) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_create_payment_refund_request.go b/src/checkout/model_create_payment_refund_request.go deleted file mode 100644 index 62b064d8d..000000000 --- a/src/checkout/model_create_payment_refund_request.go +++ /dev/null @@ -1,301 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentRefundRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentRefundRequest{} - -// CreatePaymentRefundRequest struct for CreatePaymentRefundRequest -type CreatePaymentRefundRequest struct { - Amount Amount `json:"amount"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reason for the refund request - MerchantRefundReason *string `json:"merchantRefundReason,omitempty"` - // Your reference for the refund request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` -} - -// NewCreatePaymentRefundRequest instantiates a new CreatePaymentRefundRequest 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 NewCreatePaymentRefundRequest(amount Amount, merchantAccount string) *CreatePaymentRefundRequest { - this := CreatePaymentRefundRequest{} - this.Amount = amount - this.MerchantAccount = merchantAccount - return &this -} - -// NewCreatePaymentRefundRequestWithDefaults instantiates a new CreatePaymentRefundRequest 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 NewCreatePaymentRefundRequestWithDefaults() *CreatePaymentRefundRequest { - this := CreatePaymentRefundRequest{} - return &this -} - -// GetAmount returns the Amount field value -func (o *CreatePaymentRefundRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *CreatePaymentRefundRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *CreatePaymentRefundRequest) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *CreatePaymentRefundRequest) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *CreatePaymentRefundRequest) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentRefundRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentRefundRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantRefundReason returns the MerchantRefundReason field value if set, zero value otherwise. -func (o *CreatePaymentRefundRequest) GetMerchantRefundReason() string { - if o == nil || common.IsNil(o.MerchantRefundReason) { - var ret string - return ret - } - return *o.MerchantRefundReason -} - -// GetMerchantRefundReasonOk returns a tuple with the MerchantRefundReason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetMerchantRefundReasonOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantRefundReason) { - return nil, false - } - return o.MerchantRefundReason, true -} - -// HasMerchantRefundReason returns a boolean if a field has been set. -func (o *CreatePaymentRefundRequest) HasMerchantRefundReason() bool { - if o != nil && !common.IsNil(o.MerchantRefundReason) { - return true - } - - return false -} - -// SetMerchantRefundReason gets a reference to the given string and assigns it to the MerchantRefundReason field. -func (o *CreatePaymentRefundRequest) SetMerchantRefundReason(v string) { - o.MerchantRefundReason = &v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreatePaymentRefundRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreatePaymentRefundRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreatePaymentRefundRequest) SetReference(v string) { - o.Reference = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *CreatePaymentRefundRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentRefundRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *CreatePaymentRefundRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *CreatePaymentRefundRequest) SetSplits(v []Split) { - o.Splits = v -} - -func (o CreatePaymentRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentRefundRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantRefundReason) { - toSerialize["merchantRefundReason"] = o.MerchantRefundReason - } - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - return toSerialize, nil -} - -type NullableCreatePaymentRefundRequest struct { - value *CreatePaymentRefundRequest - isSet bool -} - -func (v NullableCreatePaymentRefundRequest) Get() *CreatePaymentRefundRequest { - return v.value -} - -func (v *NullableCreatePaymentRefundRequest) Set(val *CreatePaymentRefundRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentRefundRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentRefundRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentRefundRequest(val *CreatePaymentRefundRequest) *NullableCreatePaymentRefundRequest { - return &NullableCreatePaymentRefundRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentRefundRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentRefundRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *CreatePaymentRefundRequest) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_create_payment_reversal_request.go b/src/checkout/model_create_payment_reversal_request.go deleted file mode 100644 index 23979b927..000000000 --- a/src/checkout/model_create_payment_reversal_request.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreatePaymentReversalRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreatePaymentReversalRequest{} - -// CreatePaymentReversalRequest struct for CreatePaymentReversalRequest -type CreatePaymentReversalRequest struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reference for the reversal request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` -} - -// NewCreatePaymentReversalRequest instantiates a new CreatePaymentReversalRequest 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 NewCreatePaymentReversalRequest(merchantAccount string) *CreatePaymentReversalRequest { - this := CreatePaymentReversalRequest{} - this.MerchantAccount = merchantAccount - return &this -} - -// NewCreatePaymentReversalRequestWithDefaults instantiates a new CreatePaymentReversalRequest 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 NewCreatePaymentReversalRequestWithDefaults() *CreatePaymentReversalRequest { - this := CreatePaymentReversalRequest{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreatePaymentReversalRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreatePaymentReversalRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreatePaymentReversalRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreatePaymentReversalRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreatePaymentReversalRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreatePaymentReversalRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreatePaymentReversalRequest) SetReference(v string) { - o.Reference = &v -} - -func (o CreatePaymentReversalRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreatePaymentReversalRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - return toSerialize, nil -} - -type NullableCreatePaymentReversalRequest struct { - value *CreatePaymentReversalRequest - isSet bool -} - -func (v NullableCreatePaymentReversalRequest) Get() *CreatePaymentReversalRequest { - return v.value -} - -func (v *NullableCreatePaymentReversalRequest) Set(val *CreatePaymentReversalRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreatePaymentReversalRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreatePaymentReversalRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreatePaymentReversalRequest(val *CreatePaymentReversalRequest) *NullableCreatePaymentReversalRequest { - return &NullableCreatePaymentReversalRequest{value: val, isSet: true} -} - -func (v NullableCreatePaymentReversalRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreatePaymentReversalRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_create_standalone_payment_cancel_request.go b/src/checkout/model_create_standalone_payment_cancel_request.go deleted file mode 100644 index ab83b78cc..000000000 --- a/src/checkout/model_create_standalone_payment_cancel_request.go +++ /dev/null @@ -1,181 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the CreateStandalonePaymentCancelRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &CreateStandalonePaymentCancelRequest{} - -// CreateStandalonePaymentCancelRequest struct for CreateStandalonePaymentCancelRequest -type CreateStandalonePaymentCancelRequest struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. - PaymentReference string `json:"paymentReference"` - // Your reference for the cancel request. Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` -} - -// NewCreateStandalonePaymentCancelRequest instantiates a new CreateStandalonePaymentCancelRequest 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 NewCreateStandalonePaymentCancelRequest(merchantAccount string, paymentReference string) *CreateStandalonePaymentCancelRequest { - this := CreateStandalonePaymentCancelRequest{} - this.MerchantAccount = merchantAccount - this.PaymentReference = paymentReference - return &this -} - -// NewCreateStandalonePaymentCancelRequestWithDefaults instantiates a new CreateStandalonePaymentCancelRequest 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 NewCreateStandalonePaymentCancelRequestWithDefaults() *CreateStandalonePaymentCancelRequest { - this := CreateStandalonePaymentCancelRequest{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *CreateStandalonePaymentCancelRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *CreateStandalonePaymentCancelRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *CreateStandalonePaymentCancelRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentReference returns the PaymentReference field value -func (o *CreateStandalonePaymentCancelRequest) GetPaymentReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentReference -} - -// GetPaymentReferenceOk returns a tuple with the PaymentReference field value -// and a boolean to check if the value has been set. -func (o *CreateStandalonePaymentCancelRequest) GetPaymentReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentReference, true -} - -// SetPaymentReference sets field value -func (o *CreateStandalonePaymentCancelRequest) SetPaymentReference(v string) { - o.PaymentReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *CreateStandalonePaymentCancelRequest) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateStandalonePaymentCancelRequest) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *CreateStandalonePaymentCancelRequest) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *CreateStandalonePaymentCancelRequest) SetReference(v string) { - o.Reference = &v -} - -func (o CreateStandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateStandalonePaymentCancelRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentReference"] = o.PaymentReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - return toSerialize, nil -} - -type NullableCreateStandalonePaymentCancelRequest struct { - value *CreateStandalonePaymentCancelRequest - isSet bool -} - -func (v NullableCreateStandalonePaymentCancelRequest) Get() *CreateStandalonePaymentCancelRequest { - return v.value -} - -func (v *NullableCreateStandalonePaymentCancelRequest) Set(val *CreateStandalonePaymentCancelRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateStandalonePaymentCancelRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateStandalonePaymentCancelRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateStandalonePaymentCancelRequest(val *CreateStandalonePaymentCancelRequest) *NullableCreateStandalonePaymentCancelRequest { - return &NullableCreateStandalonePaymentCancelRequest{value: val, isSet: true} -} - -func (v NullableCreateStandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateStandalonePaymentCancelRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_delivery_address.go b/src/checkout/model_delivery_address.go new file mode 100644 index 000000000..d62f616dd --- /dev/null +++ b/src/checkout/model_delivery_address.go @@ -0,0 +1,337 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the DeliveryAddress type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &DeliveryAddress{} + +// DeliveryAddress struct for DeliveryAddress +type DeliveryAddress struct { + // The name of the city. Maximum length: 3000 characters. + City string `json:"city"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + Country string `json:"country"` + FirstName *string `json:"firstName,omitempty"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName string `json:"houseNumberOrName"` + LastName *string `json:"lastName,omitempty"` + // A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + PostalCode string `json:"postalCode"` + // The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + Street string `json:"street"` +} + +// NewDeliveryAddress instantiates a new DeliveryAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeliveryAddress(city string, country string, houseNumberOrName string, postalCode string, street string) *DeliveryAddress { + this := DeliveryAddress{} + this.City = city + this.Country = country + this.HouseNumberOrName = houseNumberOrName + this.PostalCode = postalCode + this.Street = street + return &this +} + +// NewDeliveryAddressWithDefaults instantiates a new DeliveryAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeliveryAddressWithDefaults() *DeliveryAddress { + this := DeliveryAddress{} + return &this +} + +// GetCity returns the City field value +func (o *DeliveryAddress) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +func (o *DeliveryAddress) SetCity(v string) { + o.City = v +} + +// GetCountry returns the Country field value +func (o *DeliveryAddress) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *DeliveryAddress) SetCountry(v string) { + o.Country = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *DeliveryAddress) GetFirstName() string { + if o == nil || common.IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetFirstNameOk() (*string, bool) { + if o == nil || common.IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *DeliveryAddress) HasFirstName() bool { + if o != nil && !common.IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *DeliveryAddress) SetFirstName(v string) { + o.FirstName = &v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value +func (o *DeliveryAddress) GetHouseNumberOrName() string { + if o == nil { + var ret string + return ret + } + + return o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HouseNumberOrName, true +} + +// SetHouseNumberOrName sets field value +func (o *DeliveryAddress) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *DeliveryAddress) GetLastName() string { + if o == nil || common.IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetLastNameOk() (*string, bool) { + if o == nil || common.IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *DeliveryAddress) HasLastName() bool { + if o != nil && !common.IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *DeliveryAddress) SetLastName(v string) { + o.LastName = &v +} + +// GetPostalCode returns the PostalCode field value +func (o *DeliveryAddress) GetPostalCode() string { + if o == nil { + var ret string + return ret + } + + return o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PostalCode, true +} + +// SetPostalCode sets field value +func (o *DeliveryAddress) SetPostalCode(v string) { + o.PostalCode = v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *DeliveryAddress) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *DeliveryAddress) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *DeliveryAddress) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value +func (o *DeliveryAddress) GetStreet() string { + if o == nil { + var ret string + return ret + } + + return o.Street +} + +// GetStreetOk returns a tuple with the Street field value +// and a boolean to check if the value has been set. +func (o *DeliveryAddress) GetStreetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Street, true +} + +// SetStreet sets field value +func (o *DeliveryAddress) SetStreet(v string) { + o.Street = v +} + +func (o DeliveryAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeliveryAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["city"] = o.City + toSerialize["country"] = o.Country + if !common.IsNil(o.FirstName) { + toSerialize["firstName"] = o.FirstName + } + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + if !common.IsNil(o.LastName) { + toSerialize["lastName"] = o.LastName + } + toSerialize["postalCode"] = o.PostalCode + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + toSerialize["street"] = o.Street + return toSerialize, nil +} + +type NullableDeliveryAddress struct { + value *DeliveryAddress + isSet bool +} + +func (v NullableDeliveryAddress) Get() *DeliveryAddress { + return v.value +} + +func (v *NullableDeliveryAddress) Set(val *DeliveryAddress) { + v.value = val + v.isSet = true +} + +func (v NullableDeliveryAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableDeliveryAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeliveryAddress(val *DeliveryAddress) *NullableDeliveryAddress { + return &NullableDeliveryAddress{value: val, isSet: true} +} + +func (v NullableDeliveryAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeliveryAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/checkout/model_details_request.go b/src/checkout/model_details_request.go deleted file mode 100644 index 01bb477bd..000000000 --- a/src/checkout/model_details_request.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the DetailsRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &DetailsRequest{} - -// DetailsRequest struct for DetailsRequest -type DetailsRequest struct { - AuthenticationData *DetailsRequestAuthenticationData `json:"authenticationData,omitempty"` - Details PaymentCompletionDetails `json:"details"` - // The `paymentData` value from the `/payments` response. Required if the `/payments` response returns this value. - PaymentData *string `json:"paymentData,omitempty"` - // Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. - // Deprecated - ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` -} - -// NewDetailsRequest instantiates a new DetailsRequest 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 NewDetailsRequest(details PaymentCompletionDetails) *DetailsRequest { - this := DetailsRequest{} - this.Details = details - return &this -} - -// NewDetailsRequestWithDefaults instantiates a new DetailsRequest 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 NewDetailsRequestWithDefaults() *DetailsRequest { - this := DetailsRequest{} - return &this -} - -// GetAuthenticationData returns the AuthenticationData field value if set, zero value otherwise. -func (o *DetailsRequest) GetAuthenticationData() DetailsRequestAuthenticationData { - if o == nil || common.IsNil(o.AuthenticationData) { - var ret DetailsRequestAuthenticationData - return ret - } - return *o.AuthenticationData -} - -// GetAuthenticationDataOk returns a tuple with the AuthenticationData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DetailsRequest) GetAuthenticationDataOk() (*DetailsRequestAuthenticationData, bool) { - if o == nil || common.IsNil(o.AuthenticationData) { - return nil, false - } - return o.AuthenticationData, true -} - -// HasAuthenticationData returns a boolean if a field has been set. -func (o *DetailsRequest) HasAuthenticationData() bool { - if o != nil && !common.IsNil(o.AuthenticationData) { - return true - } - - return false -} - -// SetAuthenticationData gets a reference to the given DetailsRequestAuthenticationData and assigns it to the AuthenticationData field. -func (o *DetailsRequest) SetAuthenticationData(v DetailsRequestAuthenticationData) { - o.AuthenticationData = &v -} - -// GetDetails returns the Details field value -func (o *DetailsRequest) GetDetails() PaymentCompletionDetails { - if o == nil { - var ret PaymentCompletionDetails - return ret - } - - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value -// and a boolean to check if the value has been set. -func (o *DetailsRequest) GetDetailsOk() (*PaymentCompletionDetails, bool) { - if o == nil { - return nil, false - } - return &o.Details, true -} - -// SetDetails sets field value -func (o *DetailsRequest) SetDetails(v PaymentCompletionDetails) { - o.Details = v -} - -// GetPaymentData returns the PaymentData field value if set, zero value otherwise. -func (o *DetailsRequest) GetPaymentData() string { - if o == nil || common.IsNil(o.PaymentData) { - var ret string - return ret - } - return *o.PaymentData -} - -// GetPaymentDataOk returns a tuple with the PaymentData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DetailsRequest) GetPaymentDataOk() (*string, bool) { - if o == nil || common.IsNil(o.PaymentData) { - return nil, false - } - return o.PaymentData, true -} - -// HasPaymentData returns a boolean if a field has been set. -func (o *DetailsRequest) HasPaymentData() bool { - if o != nil && !common.IsNil(o.PaymentData) { - return true - } - - return false -} - -// SetPaymentData gets a reference to the given string and assigns it to the PaymentData field. -func (o *DetailsRequest) SetPaymentData(v string) { - o.PaymentData = &v -} - -// GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field value if set, zero value otherwise. -// Deprecated -func (o *DetailsRequest) GetThreeDSAuthenticationOnly() bool { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - var ret bool - return ret - } - return *o.ThreeDSAuthenticationOnly -} - -// GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *DetailsRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool) { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - return nil, false - } - return o.ThreeDSAuthenticationOnly, true -} - -// HasThreeDSAuthenticationOnly returns a boolean if a field has been set. -func (o *DetailsRequest) HasThreeDSAuthenticationOnly() bool { - if o != nil && !common.IsNil(o.ThreeDSAuthenticationOnly) { - return true - } - - return false -} - -// SetThreeDSAuthenticationOnly gets a reference to the given bool and assigns it to the ThreeDSAuthenticationOnly field. -// Deprecated -func (o *DetailsRequest) SetThreeDSAuthenticationOnly(v bool) { - o.ThreeDSAuthenticationOnly = &v -} - -func (o DetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DetailsRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AuthenticationData) { - toSerialize["authenticationData"] = o.AuthenticationData - } - toSerialize["details"] = o.Details - if !common.IsNil(o.PaymentData) { - toSerialize["paymentData"] = o.PaymentData - } - if !common.IsNil(o.ThreeDSAuthenticationOnly) { - toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly - } - return toSerialize, nil -} - -type NullableDetailsRequest struct { - value *DetailsRequest - isSet bool -} - -func (v NullableDetailsRequest) Get() *DetailsRequest { - return v.value -} - -func (v *NullableDetailsRequest) Set(val *DetailsRequest) { - v.value = val - v.isSet = true -} - -func (v NullableDetailsRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableDetailsRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDetailsRequest(val *DetailsRequest) *NullableDetailsRequest { - return &NullableDetailsRequest{value: val, isSet: true} -} - -func (v NullableDetailsRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDetailsRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_doku_details.go b/src/checkout/model_doku_details.go index 022b590c4..3e13a484e 100644 --- a/src/checkout/model_doku_details.go +++ b/src/checkout/model_doku_details.go @@ -237,7 +237,7 @@ func (v *NullableDokuDetails) UnmarshalJSON(src []byte) error { } func (o *DokuDetails) isValidType() bool { - var allowedEnumValues = []string{"doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret"} + var allowedEnumValues = []string{"doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret", "doku_wallet", "doku_ovo"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_donation_payment_method.go b/src/checkout/model_donation_payment_method.go new file mode 100644 index 000000000..1924132aa --- /dev/null +++ b/src/checkout/model_donation_payment_method.go @@ -0,0 +1,233 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + "fmt" +) + +// 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 +} + +// ApplePayDetailsAsDonationPaymentMethod is a convenience function that returns ApplePayDetails wrapped in DonationPaymentMethod +func ApplePayDetailsAsDonationPaymentMethod(v *ApplePayDetails) DonationPaymentMethod { + return DonationPaymentMethod{ + ApplePayDetails: v, + } +} + +// CardDetailsAsDonationPaymentMethod is a convenience function that returns CardDetails wrapped in DonationPaymentMethod +func CardDetailsAsDonationPaymentMethod(v *CardDetails) DonationPaymentMethod { + return DonationPaymentMethod{ + CardDetails: v, + } +} + +// GooglePayDetailsAsDonationPaymentMethod is a convenience function that returns GooglePayDetails wrapped in DonationPaymentMethod +func GooglePayDetailsAsDonationPaymentMethod(v *GooglePayDetails) DonationPaymentMethod { + return DonationPaymentMethod{ + GooglePayDetails: v, + } +} + +// IdealDetailsAsDonationPaymentMethod is a convenience function that returns IdealDetails wrapped in DonationPaymentMethod +func IdealDetailsAsDonationPaymentMethod(v *IdealDetails) DonationPaymentMethod { + return DonationPaymentMethod{ + IdealDetails: v, + } +} + +// PayWithGoogleDetailsAsDonationPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in DonationPaymentMethod +func PayWithGoogleDetailsAsDonationPaymentMethod(v *PayWithGoogleDetails) DonationPaymentMethod { + return DonationPaymentMethod{ + PayWithGoogleDetails: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ApplePayDetails + err = json.Unmarshal(data, &dst.ApplePayDetails) + if err == nil { + jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) + if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct + dst.ApplePayDetails = nil + } else { + match++ + } + } else { + dst.ApplePayDetails = nil + } + + // try to unmarshal data into CardDetails + err = json.Unmarshal(data, &dst.CardDetails) + if err == nil { + jsonCardDetails, _ := json.Marshal(dst.CardDetails) + if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct + dst.CardDetails = nil + } else { + match++ + } + } else { + dst.CardDetails = nil + } + + // try to unmarshal data into GooglePayDetails + err = json.Unmarshal(data, &dst.GooglePayDetails) + if err == nil { + jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) + if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct + dst.GooglePayDetails = nil + } else { + match++ + } + } else { + dst.GooglePayDetails = nil + } + + // try to unmarshal data into IdealDetails + err = json.Unmarshal(data, &dst.IdealDetails) + if err == nil { + jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) + if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct + dst.IdealDetails = nil + } else { + match++ + } + } else { + dst.IdealDetails = nil + } + + // try to unmarshal data into PayWithGoogleDetails + err = json.Unmarshal(data, &dst.PayWithGoogleDetails) + if err == nil { + jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) + if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct + dst.PayWithGoogleDetails = nil + } else { + match++ + } + } else { + dst.PayWithGoogleDetails = nil + } + + 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 + + return fmt.Errorf("data matches more than one schema in oneOf(DonationPaymentMethod)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(DonationPaymentMethod)") + } +} + +// 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.CardDetails != nil { + return json.Marshal(&src.CardDetails) + } + + if src.GooglePayDetails != nil { + return json.Marshal(&src.GooglePayDetails) + } + + if src.IdealDetails != nil { + return json.Marshal(&src.IdealDetails) + } + + if src.PayWithGoogleDetails != nil { + return json.Marshal(&src.PayWithGoogleDetails) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *DonationPaymentMethod) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.ApplePayDetails != nil { + return obj.ApplePayDetails + } + + if obj.CardDetails != nil { + return obj.CardDetails + } + + if obj.GooglePayDetails != nil { + return obj.GooglePayDetails + } + + if obj.IdealDetails != nil { + return obj.IdealDetails + } + + if obj.PayWithGoogleDetails != nil { + return obj.PayWithGoogleDetails + } + + // all schemas are nil + return nil +} + +type NullableDonationPaymentMethod struct { + value *DonationPaymentMethod + isSet bool +} + +func (v NullableDonationPaymentMethod) Get() *DonationPaymentMethod { + return v.value +} + +func (v *NullableDonationPaymentMethod) Set(val *DonationPaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullableDonationPaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableDonationPaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDonationPaymentMethod(val *DonationPaymentMethod) *NullableDonationPaymentMethod { + return &NullableDonationPaymentMethod{value: val, isSet: true} +} + +func (v NullableDonationPaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDonationPaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/checkout/model_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index 9899abb1f..d6e27b80c 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -23,12 +23,16 @@ type DonationPaymentRequest struct { AccountInfo *AccountInfo `json:"accountInfo,omitempty"` AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web @@ -45,10 +49,9 @@ type DonationPaymentRequest struct { DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` DccQuote *ForexQuote `json:"dccQuote,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - // Deprecated DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` @@ -70,12 +73,14 @@ type DonationPaymentRequest struct { FraudOffset *int32 `json:"fraudOffset,omitempty"` FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` + // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + FundingSource *string `json:"fundingSource,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` Installments *Installments `json:"installments,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. @@ -92,9 +97,9 @@ type DonationPaymentRequest struct { // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - Origin *string `json:"origin,omitempty"` - PaymentMethod DonationPaymentRequestPaymentMethod `json:"paymentMethod"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + Origin *string `json:"origin,omitempty"` + PaymentMethod DonationPaymentMethod `json:"paymentMethod"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. @@ -110,6 +115,8 @@ type DonationPaymentRequest struct { // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` ReturnUrl string `json:"returnUrl"` RiskData *RiskData `json:"riskData,omitempty"` + // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 SessionValidity *string `json:"sessionValidity,omitempty"` // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. @@ -147,7 +154,7 @@ type DonationPaymentRequest struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDonationPaymentRequest(amount Amount, donationAccount string, merchantAccount string, paymentMethod DonationPaymentRequestPaymentMethod, reference string, returnUrl string) *DonationPaymentRequest { +func NewDonationPaymentRequest(amount Amount, donationAccount string, merchantAccount string, paymentMethod DonationPaymentMethod, reference string, returnUrl string) *DonationPaymentRequest { this := DonationPaymentRequest{} this.Amount = amount this.DonationAccount = donationAccount @@ -266,6 +273,38 @@ func (o *DonationPaymentRequest) SetAdditionalData(v map[string]string) { o.AdditionalData = &v } +// GetAllowedPaymentMethods returns the AllowedPaymentMethods field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetAllowedPaymentMethods() []string { + if o == nil || common.IsNil(o.AllowedPaymentMethods) { + var ret []string + return ret + } + return o.AllowedPaymentMethods +} + +// GetAllowedPaymentMethodsOk returns a tuple with the AllowedPaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetAllowedPaymentMethodsOk() ([]string, bool) { + if o == nil || common.IsNil(o.AllowedPaymentMethods) { + return nil, false + } + return o.AllowedPaymentMethods, true +} + +// HasAllowedPaymentMethods returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasAllowedPaymentMethods() bool { + if o != nil && !common.IsNil(o.AllowedPaymentMethods) { + return true + } + + return false +} + +// SetAllowedPaymentMethods gets a reference to the given []string and assigns it to the AllowedPaymentMethods field. +func (o *DonationPaymentRequest) SetAllowedPaymentMethods(v []string) { + o.AllowedPaymentMethods = v +} + // GetAmount returns the Amount field value func (o *DonationPaymentRequest) GetAmount() Amount { if o == nil { @@ -355,9 +394,9 @@ func (o *DonationPaymentRequest) SetAuthenticationData(v AuthenticationData) { } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetBillingAddress() Address { +func (o *DonationPaymentRequest) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -365,7 +404,7 @@ func (o *DonationPaymentRequest) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetBillingAddressOk() (*Address, bool) { +func (o *DonationPaymentRequest) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -381,11 +420,43 @@ func (o *DonationPaymentRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *DonationPaymentRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *DonationPaymentRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } +// GetBlockedPaymentMethods returns the BlockedPaymentMethods field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetBlockedPaymentMethods() []string { + if o == nil || common.IsNil(o.BlockedPaymentMethods) { + var ret []string + return ret + } + return o.BlockedPaymentMethods +} + +// GetBlockedPaymentMethodsOk returns a tuple with the BlockedPaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetBlockedPaymentMethodsOk() ([]string, bool) { + if o == nil || common.IsNil(o.BlockedPaymentMethods) { + return nil, false + } + return o.BlockedPaymentMethods, true +} + +// HasBlockedPaymentMethods returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasBlockedPaymentMethods() bool { + if o != nil && !common.IsNil(o.BlockedPaymentMethods) { + return true + } + + return false +} + +// SetBlockedPaymentMethods gets a reference to the given []string and assigns it to the BlockedPaymentMethods field. +func (o *DonationPaymentRequest) SetBlockedPaymentMethods(v []string) { + o.BlockedPaymentMethods = v +} + // GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetBrowserInfo() BrowserInfo { if o == nil || common.IsNil(o.BrowserInfo) { @@ -710,9 +781,9 @@ func (o *DonationPaymentRequest) SetDeliverAt(v time.Time) { } // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetDeliveryAddress() Address { +func (o *DonationPaymentRequest) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -720,7 +791,7 @@ func (o *DonationPaymentRequest) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *DonationPaymentRequest) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -736,13 +807,12 @@ func (o *DonationPaymentRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *DonationPaymentRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *DonationPaymentRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } // GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. -// Deprecated func (o *DonationPaymentRequest) GetDeliveryDate() time.Time { if o == nil || common.IsNil(o.DeliveryDate) { var ret time.Time @@ -753,7 +823,6 @@ func (o *DonationPaymentRequest) GetDeliveryDate() time.Time { // GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// Deprecated func (o *DonationPaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DeliveryDate) { return nil, false @@ -771,7 +840,6 @@ func (o *DonationPaymentRequest) HasDeliveryDate() bool { } // SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. -// Deprecated func (o *DonationPaymentRequest) SetDeliveryDate(v time.Time) { o.DeliveryDate = &v } @@ -1120,6 +1188,38 @@ func (o *DonationPaymentRequest) SetFundRecipient(v FundRecipient) { o.FundRecipient = &v } +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetFundingSource() string { + if o == nil || common.IsNil(o.FundingSource) { + var ret string + return ret + } + return *o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetFundingSourceOk() (*string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. +func (o *DonationPaymentRequest) SetFundingSource(v string) { + o.FundingSource = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -1561,9 +1661,9 @@ func (o *DonationPaymentRequest) SetOrigin(v string) { } // GetPaymentMethod returns the PaymentMethod field value -func (o *DonationPaymentRequest) GetPaymentMethod() DonationPaymentRequestPaymentMethod { +func (o *DonationPaymentRequest) GetPaymentMethod() DonationPaymentMethod { if o == nil { - var ret DonationPaymentRequestPaymentMethod + var ret DonationPaymentMethod return ret } @@ -1572,7 +1672,7 @@ func (o *DonationPaymentRequest) GetPaymentMethod() DonationPaymentRequestPaymen // GetPaymentMethodOk returns a tuple with the PaymentMethod field value // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetPaymentMethodOk() (*DonationPaymentRequestPaymentMethod, bool) { +func (o *DonationPaymentRequest) GetPaymentMethodOk() (*DonationPaymentMethod, bool) { if o == nil { return nil, false } @@ -1580,7 +1680,7 @@ func (o *DonationPaymentRequest) GetPaymentMethodOk() (*DonationPaymentRequestPa } // SetPaymentMethod sets field value -func (o *DonationPaymentRequest) SetPaymentMethod(v DonationPaymentRequestPaymentMethod) { +func (o *DonationPaymentRequest) SetPaymentMethod(v DonationPaymentMethod) { o.PaymentMethod = v } @@ -1856,6 +1956,38 @@ func (o *DonationPaymentRequest) SetRiskData(v RiskData) { o.RiskData = &v } +// GetSelectedRecurringDetailReference returns the SelectedRecurringDetailReference field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetSelectedRecurringDetailReference() string { + if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { + var ret string + return ret + } + return *o.SelectedRecurringDetailReference +} + +// GetSelectedRecurringDetailReferenceOk returns a tuple with the SelectedRecurringDetailReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DonationPaymentRequest) GetSelectedRecurringDetailReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { + return nil, false + } + return o.SelectedRecurringDetailReference, true +} + +// HasSelectedRecurringDetailReference returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasSelectedRecurringDetailReference() bool { + if o != nil && !common.IsNil(o.SelectedRecurringDetailReference) { + return true + } + + return false +} + +// SetSelectedRecurringDetailReference gets a reference to the given string and assigns it to the SelectedRecurringDetailReference field. +func (o *DonationPaymentRequest) SetSelectedRecurringDetailReference(v string) { + o.SelectedRecurringDetailReference = &v +} + // GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetSessionValidity() string { if o == nil || common.IsNil(o.SessionValidity) { @@ -2390,6 +2522,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AdditionalData) { toSerialize["additionalData"] = o.AdditionalData } + if !common.IsNil(o.AllowedPaymentMethods) { + toSerialize["allowedPaymentMethods"] = o.AllowedPaymentMethods + } toSerialize["amount"] = o.Amount if !common.IsNil(o.ApplicationInfo) { toSerialize["applicationInfo"] = o.ApplicationInfo @@ -2400,6 +2535,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BillingAddress) { toSerialize["billingAddress"] = o.BillingAddress } + if !common.IsNil(o.BlockedPaymentMethods) { + toSerialize["blockedPaymentMethods"] = o.BlockedPaymentMethods + } if !common.IsNil(o.BrowserInfo) { toSerialize["browserInfo"] = o.BrowserInfo } @@ -2467,6 +2605,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FundRecipient) { toSerialize["fundRecipient"] = o.FundRecipient } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } @@ -2531,6 +2672,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskData) { toSerialize["riskData"] = o.RiskData } + if !common.IsNil(o.SelectedRecurringDetailReference) { + toSerialize["selectedRecurringDetailReference"] = o.SelectedRecurringDetailReference + } if !common.IsNil(o.SessionValidity) { toSerialize["sessionValidity"] = o.SessionValidity } @@ -2636,6 +2780,15 @@ func (o *DonationPaymentRequest) isValidEntityType() bool { } return false } +func (o *DonationPaymentRequest) isValidFundingSource() bool { + var allowedEnumValues = []string{"debit"} + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false +} func (o *DonationPaymentRequest) isValidIndustryUsage() bool { var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_donation_payment_request_payment_method.go b/src/checkout/model_donation_payment_request_payment_method.go deleted file mode 100644 index 40545737d..000000000 --- a/src/checkout/model_donation_payment_request_payment_method.go +++ /dev/null @@ -1,1253 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - "fmt" -) - -// DonationPaymentRequestPaymentMethod - The type and required details of a payment method to use. -type DonationPaymentRequestPaymentMethod struct { - AchDetails *AchDetails - AfterpayDetails *AfterpayDetails - AmazonPayDetails *AmazonPayDetails - AndroidPayDetails *AndroidPayDetails - ApplePayDetails *ApplePayDetails - BacsDirectDebitDetails *BacsDirectDebitDetails - BillDeskDetails *BillDeskDetails - BlikDetails *BlikDetails - CardDetails *CardDetails - CellulantDetails *CellulantDetails - DokuDetails *DokuDetails - DotpayDetails *DotpayDetails - DragonpayDetails *DragonpayDetails - EcontextVoucherDetails *EcontextVoucherDetails - GenericIssuerPaymentMethodDetails *GenericIssuerPaymentMethodDetails - GiropayDetails *GiropayDetails - GooglePayDetails *GooglePayDetails - IdealDetails *IdealDetails - KlarnaDetails *KlarnaDetails - MasterpassDetails *MasterpassDetails - MbwayDetails *MbwayDetails - MobilePayDetails *MobilePayDetails - MolPayDetails *MolPayDetails - OpenInvoiceDetails *OpenInvoiceDetails - PayPalDetails *PayPalDetails - PayUUpiDetails *PayUUpiDetails - PayWithGoogleDetails *PayWithGoogleDetails - PaymentDetails *PaymentDetails - RatepayDetails *RatepayDetails - SamsungPayDetails *SamsungPayDetails - SepaDirectDebitDetails *SepaDirectDebitDetails - StoredPaymentMethodDetails *StoredPaymentMethodDetails - UpiCollectDetails *UpiCollectDetails - UpiIntentDetails *UpiIntentDetails - VippsDetails *VippsDetails - VisaCheckoutDetails *VisaCheckoutDetails - WeChatPayDetails *WeChatPayDetails - WeChatPayMiniProgramDetails *WeChatPayMiniProgramDetails - ZipDetails *ZipDetails -} - -// AchDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AchDetails wrapped in DonationPaymentRequestPaymentMethod -func AchDetailsAsDonationPaymentRequestPaymentMethod(v *AchDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AchDetails: v, - } -} - -// AfterpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AfterpayDetails wrapped in DonationPaymentRequestPaymentMethod -func AfterpayDetailsAsDonationPaymentRequestPaymentMethod(v *AfterpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AfterpayDetails: v, - } -} - -// AmazonPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AmazonPayDetails wrapped in DonationPaymentRequestPaymentMethod -func AmazonPayDetailsAsDonationPaymentRequestPaymentMethod(v *AmazonPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AmazonPayDetails: v, - } -} - -// AndroidPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns AndroidPayDetails wrapped in DonationPaymentRequestPaymentMethod -func AndroidPayDetailsAsDonationPaymentRequestPaymentMethod(v *AndroidPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - AndroidPayDetails: v, - } -} - -// ApplePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns ApplePayDetails wrapped in DonationPaymentRequestPaymentMethod -func ApplePayDetailsAsDonationPaymentRequestPaymentMethod(v *ApplePayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - ApplePayDetails: v, - } -} - -// BacsDirectDebitDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BacsDirectDebitDetails wrapped in DonationPaymentRequestPaymentMethod -func BacsDirectDebitDetailsAsDonationPaymentRequestPaymentMethod(v *BacsDirectDebitDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BacsDirectDebitDetails: v, - } -} - -// BillDeskDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BillDeskDetails wrapped in DonationPaymentRequestPaymentMethod -func BillDeskDetailsAsDonationPaymentRequestPaymentMethod(v *BillDeskDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BillDeskDetails: v, - } -} - -// BlikDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns BlikDetails wrapped in DonationPaymentRequestPaymentMethod -func BlikDetailsAsDonationPaymentRequestPaymentMethod(v *BlikDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - BlikDetails: v, - } -} - -// CardDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns CardDetails wrapped in DonationPaymentRequestPaymentMethod -func CardDetailsAsDonationPaymentRequestPaymentMethod(v *CardDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - CardDetails: v, - } -} - -// CellulantDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns CellulantDetails wrapped in DonationPaymentRequestPaymentMethod -func CellulantDetailsAsDonationPaymentRequestPaymentMethod(v *CellulantDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - CellulantDetails: v, - } -} - -// DokuDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DokuDetails wrapped in DonationPaymentRequestPaymentMethod -func DokuDetailsAsDonationPaymentRequestPaymentMethod(v *DokuDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DokuDetails: v, - } -} - -// DotpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DotpayDetails wrapped in DonationPaymentRequestPaymentMethod -func DotpayDetailsAsDonationPaymentRequestPaymentMethod(v *DotpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DotpayDetails: v, - } -} - -// DragonpayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns DragonpayDetails wrapped in DonationPaymentRequestPaymentMethod -func DragonpayDetailsAsDonationPaymentRequestPaymentMethod(v *DragonpayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - DragonpayDetails: v, - } -} - -// EcontextVoucherDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns EcontextVoucherDetails wrapped in DonationPaymentRequestPaymentMethod -func EcontextVoucherDetailsAsDonationPaymentRequestPaymentMethod(v *EcontextVoucherDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - EcontextVoucherDetails: v, - } -} - -// GenericIssuerPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GenericIssuerPaymentMethodDetails wrapped in DonationPaymentRequestPaymentMethod -func GenericIssuerPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod(v *GenericIssuerPaymentMethodDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - GenericIssuerPaymentMethodDetails: v, - } -} - -// GiropayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GiropayDetails wrapped in DonationPaymentRequestPaymentMethod -func GiropayDetailsAsDonationPaymentRequestPaymentMethod(v *GiropayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - GiropayDetails: v, - } -} - -// GooglePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns GooglePayDetails wrapped in DonationPaymentRequestPaymentMethod -func GooglePayDetailsAsDonationPaymentRequestPaymentMethod(v *GooglePayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - GooglePayDetails: v, - } -} - -// IdealDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns IdealDetails wrapped in DonationPaymentRequestPaymentMethod -func IdealDetailsAsDonationPaymentRequestPaymentMethod(v *IdealDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - IdealDetails: v, - } -} - -// KlarnaDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns KlarnaDetails wrapped in DonationPaymentRequestPaymentMethod -func KlarnaDetailsAsDonationPaymentRequestPaymentMethod(v *KlarnaDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - KlarnaDetails: v, - } -} - -// MasterpassDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MasterpassDetails wrapped in DonationPaymentRequestPaymentMethod -func MasterpassDetailsAsDonationPaymentRequestPaymentMethod(v *MasterpassDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MasterpassDetails: v, - } -} - -// MbwayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MbwayDetails wrapped in DonationPaymentRequestPaymentMethod -func MbwayDetailsAsDonationPaymentRequestPaymentMethod(v *MbwayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MbwayDetails: v, - } -} - -// MobilePayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MobilePayDetails wrapped in DonationPaymentRequestPaymentMethod -func MobilePayDetailsAsDonationPaymentRequestPaymentMethod(v *MobilePayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MobilePayDetails: v, - } -} - -// MolPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns MolPayDetails wrapped in DonationPaymentRequestPaymentMethod -func MolPayDetailsAsDonationPaymentRequestPaymentMethod(v *MolPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - MolPayDetails: v, - } -} - -// OpenInvoiceDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns OpenInvoiceDetails wrapped in DonationPaymentRequestPaymentMethod -func OpenInvoiceDetailsAsDonationPaymentRequestPaymentMethod(v *OpenInvoiceDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - OpenInvoiceDetails: v, - } -} - -// PayPalDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayPalDetails wrapped in DonationPaymentRequestPaymentMethod -func PayPalDetailsAsDonationPaymentRequestPaymentMethod(v *PayPalDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PayPalDetails: v, - } -} - -// PayUUpiDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayUUpiDetails wrapped in DonationPaymentRequestPaymentMethod -func PayUUpiDetailsAsDonationPaymentRequestPaymentMethod(v *PayUUpiDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PayUUpiDetails: v, - } -} - -// PayWithGoogleDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PayWithGoogleDetails wrapped in DonationPaymentRequestPaymentMethod -func PayWithGoogleDetailsAsDonationPaymentRequestPaymentMethod(v *PayWithGoogleDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PayWithGoogleDetails: v, - } -} - -// PaymentDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns PaymentDetails wrapped in DonationPaymentRequestPaymentMethod -func PaymentDetailsAsDonationPaymentRequestPaymentMethod(v *PaymentDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - PaymentDetails: v, - } -} - -// RatepayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns RatepayDetails wrapped in DonationPaymentRequestPaymentMethod -func RatepayDetailsAsDonationPaymentRequestPaymentMethod(v *RatepayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - RatepayDetails: v, - } -} - -// SamsungPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns SamsungPayDetails wrapped in DonationPaymentRequestPaymentMethod -func SamsungPayDetailsAsDonationPaymentRequestPaymentMethod(v *SamsungPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - SamsungPayDetails: v, - } -} - -// SepaDirectDebitDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns SepaDirectDebitDetails wrapped in DonationPaymentRequestPaymentMethod -func SepaDirectDebitDetailsAsDonationPaymentRequestPaymentMethod(v *SepaDirectDebitDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - SepaDirectDebitDetails: v, - } -} - -// StoredPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns StoredPaymentMethodDetails wrapped in DonationPaymentRequestPaymentMethod -func StoredPaymentMethodDetailsAsDonationPaymentRequestPaymentMethod(v *StoredPaymentMethodDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - StoredPaymentMethodDetails: v, - } -} - -// UpiCollectDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns UpiCollectDetails wrapped in DonationPaymentRequestPaymentMethod -func UpiCollectDetailsAsDonationPaymentRequestPaymentMethod(v *UpiCollectDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - UpiCollectDetails: v, - } -} - -// UpiIntentDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns UpiIntentDetails wrapped in DonationPaymentRequestPaymentMethod -func UpiIntentDetailsAsDonationPaymentRequestPaymentMethod(v *UpiIntentDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - UpiIntentDetails: v, - } -} - -// VippsDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns VippsDetails wrapped in DonationPaymentRequestPaymentMethod -func VippsDetailsAsDonationPaymentRequestPaymentMethod(v *VippsDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - VippsDetails: v, - } -} - -// VisaCheckoutDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns VisaCheckoutDetails wrapped in DonationPaymentRequestPaymentMethod -func VisaCheckoutDetailsAsDonationPaymentRequestPaymentMethod(v *VisaCheckoutDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - VisaCheckoutDetails: v, - } -} - -// WeChatPayDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayDetails wrapped in DonationPaymentRequestPaymentMethod -func WeChatPayDetailsAsDonationPaymentRequestPaymentMethod(v *WeChatPayDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - WeChatPayDetails: v, - } -} - -// WeChatPayMiniProgramDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns WeChatPayMiniProgramDetails wrapped in DonationPaymentRequestPaymentMethod -func WeChatPayMiniProgramDetailsAsDonationPaymentRequestPaymentMethod(v *WeChatPayMiniProgramDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - WeChatPayMiniProgramDetails: v, - } -} - -// ZipDetailsAsDonationPaymentRequestPaymentMethod is a convenience function that returns ZipDetails wrapped in DonationPaymentRequestPaymentMethod -func ZipDetailsAsDonationPaymentRequestPaymentMethod(v *ZipDetails) DonationPaymentRequestPaymentMethod { - return DonationPaymentRequestPaymentMethod{ - ZipDetails: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *DonationPaymentRequestPaymentMethod) UnmarshalJSON(data []byte) error { - var err error - match := 0 - // try to unmarshal data into AchDetails - err = json.Unmarshal(data, &dst.AchDetails) - if err == nil { - jsonAchDetails, _ := json.Marshal(dst.AchDetails) - if string(jsonAchDetails) == "{}" || !dst.AchDetails.isValidType() { // empty struct - dst.AchDetails = nil - } else { - match++ - } - } else { - dst.AchDetails = nil - } - - // try to unmarshal data into AfterpayDetails - err = json.Unmarshal(data, &dst.AfterpayDetails) - if err == nil { - jsonAfterpayDetails, _ := json.Marshal(dst.AfterpayDetails) - if string(jsonAfterpayDetails) == "{}" || !dst.AfterpayDetails.isValidType() { // empty struct - dst.AfterpayDetails = nil - } else { - match++ - } - } else { - dst.AfterpayDetails = nil - } - - // try to unmarshal data into AmazonPayDetails - err = json.Unmarshal(data, &dst.AmazonPayDetails) - if err == nil { - jsonAmazonPayDetails, _ := json.Marshal(dst.AmazonPayDetails) - if string(jsonAmazonPayDetails) == "{}" || !dst.AmazonPayDetails.isValidType() { // empty struct - dst.AmazonPayDetails = nil - } else { - match++ - } - } else { - dst.AmazonPayDetails = nil - } - - // try to unmarshal data into AndroidPayDetails - err = json.Unmarshal(data, &dst.AndroidPayDetails) - if err == nil { - jsonAndroidPayDetails, _ := json.Marshal(dst.AndroidPayDetails) - if string(jsonAndroidPayDetails) == "{}" || !dst.AndroidPayDetails.isValidType() { // empty struct - dst.AndroidPayDetails = nil - } else { - match++ - } - } else { - dst.AndroidPayDetails = nil - } - - // try to unmarshal data into ApplePayDetails - err = json.Unmarshal(data, &dst.ApplePayDetails) - if err == nil { - jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) - if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct - dst.ApplePayDetails = nil - } else { - match++ - } - } else { - dst.ApplePayDetails = nil - } - - // try to unmarshal data into BacsDirectDebitDetails - err = json.Unmarshal(data, &dst.BacsDirectDebitDetails) - if err == nil { - jsonBacsDirectDebitDetails, _ := json.Marshal(dst.BacsDirectDebitDetails) - if string(jsonBacsDirectDebitDetails) == "{}" || !dst.BacsDirectDebitDetails.isValidType() { // empty struct - dst.BacsDirectDebitDetails = nil - } else { - match++ - } - } else { - dst.BacsDirectDebitDetails = nil - } - - // try to unmarshal data into BillDeskDetails - err = json.Unmarshal(data, &dst.BillDeskDetails) - if err == nil { - jsonBillDeskDetails, _ := json.Marshal(dst.BillDeskDetails) - if string(jsonBillDeskDetails) == "{}" || !dst.BillDeskDetails.isValidType() { // empty struct - dst.BillDeskDetails = nil - } else { - match++ - } - } else { - dst.BillDeskDetails = nil - } - - // try to unmarshal data into BlikDetails - err = json.Unmarshal(data, &dst.BlikDetails) - if err == nil { - jsonBlikDetails, _ := json.Marshal(dst.BlikDetails) - if string(jsonBlikDetails) == "{}" || !dst.BlikDetails.isValidType() { // empty struct - dst.BlikDetails = nil - } else { - match++ - } - } else { - dst.BlikDetails = nil - } - - // try to unmarshal data into CardDetails - err = json.Unmarshal(data, &dst.CardDetails) - if err == nil { - jsonCardDetails, _ := json.Marshal(dst.CardDetails) - if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct - dst.CardDetails = nil - } else { - match++ - } - } else { - dst.CardDetails = nil - } - - // try to unmarshal data into CellulantDetails - err = json.Unmarshal(data, &dst.CellulantDetails) - if err == nil { - jsonCellulantDetails, _ := json.Marshal(dst.CellulantDetails) - if string(jsonCellulantDetails) == "{}" || !dst.CellulantDetails.isValidType() { // empty struct - dst.CellulantDetails = nil - } else { - match++ - } - } else { - dst.CellulantDetails = nil - } - - // try to unmarshal data into DokuDetails - err = json.Unmarshal(data, &dst.DokuDetails) - if err == nil { - jsonDokuDetails, _ := json.Marshal(dst.DokuDetails) - if string(jsonDokuDetails) == "{}" || !dst.DokuDetails.isValidType() { // empty struct - dst.DokuDetails = nil - } else { - match++ - } - } else { - dst.DokuDetails = nil - } - - // try to unmarshal data into DotpayDetails - err = json.Unmarshal(data, &dst.DotpayDetails) - if err == nil { - jsonDotpayDetails, _ := json.Marshal(dst.DotpayDetails) - if string(jsonDotpayDetails) == "{}" || !dst.DotpayDetails.isValidType() { // empty struct - dst.DotpayDetails = nil - } else { - match++ - } - } else { - dst.DotpayDetails = nil - } - - // try to unmarshal data into DragonpayDetails - err = json.Unmarshal(data, &dst.DragonpayDetails) - if err == nil { - jsonDragonpayDetails, _ := json.Marshal(dst.DragonpayDetails) - if string(jsonDragonpayDetails) == "{}" || !dst.DragonpayDetails.isValidType() { // empty struct - dst.DragonpayDetails = nil - } else { - match++ - } - } else { - dst.DragonpayDetails = nil - } - - // try to unmarshal data into EcontextVoucherDetails - err = json.Unmarshal(data, &dst.EcontextVoucherDetails) - if err == nil { - jsonEcontextVoucherDetails, _ := json.Marshal(dst.EcontextVoucherDetails) - if string(jsonEcontextVoucherDetails) == "{}" || !dst.EcontextVoucherDetails.isValidType() { // empty struct - dst.EcontextVoucherDetails = nil - } else { - match++ - } - } else { - dst.EcontextVoucherDetails = nil - } - - // try to unmarshal data into GenericIssuerPaymentMethodDetails - err = json.Unmarshal(data, &dst.GenericIssuerPaymentMethodDetails) - if err == nil { - jsonGenericIssuerPaymentMethodDetails, _ := json.Marshal(dst.GenericIssuerPaymentMethodDetails) - if string(jsonGenericIssuerPaymentMethodDetails) == "{}" || !dst.GenericIssuerPaymentMethodDetails.isValidType() { // empty struct - dst.GenericIssuerPaymentMethodDetails = nil - } else { - match++ - } - } else { - dst.GenericIssuerPaymentMethodDetails = nil - } - - // try to unmarshal data into GiropayDetails - err = json.Unmarshal(data, &dst.GiropayDetails) - if err == nil { - jsonGiropayDetails, _ := json.Marshal(dst.GiropayDetails) - if string(jsonGiropayDetails) == "{}" || !dst.GiropayDetails.isValidType() { // empty struct - dst.GiropayDetails = nil - } else { - match++ - } - } else { - dst.GiropayDetails = nil - } - - // try to unmarshal data into GooglePayDetails - err = json.Unmarshal(data, &dst.GooglePayDetails) - if err == nil { - jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) - if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct - dst.GooglePayDetails = nil - } else { - match++ - } - } else { - dst.GooglePayDetails = nil - } - - // try to unmarshal data into IdealDetails - err = json.Unmarshal(data, &dst.IdealDetails) - if err == nil { - jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) - if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct - dst.IdealDetails = nil - } else { - match++ - } - } else { - dst.IdealDetails = nil - } - - // try to unmarshal data into KlarnaDetails - err = json.Unmarshal(data, &dst.KlarnaDetails) - if err == nil { - jsonKlarnaDetails, _ := json.Marshal(dst.KlarnaDetails) - if string(jsonKlarnaDetails) == "{}" || !dst.KlarnaDetails.isValidType() { // empty struct - dst.KlarnaDetails = nil - } else { - match++ - } - } else { - dst.KlarnaDetails = nil - } - - // try to unmarshal data into MasterpassDetails - err = json.Unmarshal(data, &dst.MasterpassDetails) - if err == nil { - jsonMasterpassDetails, _ := json.Marshal(dst.MasterpassDetails) - if string(jsonMasterpassDetails) == "{}" || !dst.MasterpassDetails.isValidType() { // empty struct - dst.MasterpassDetails = nil - } else { - match++ - } - } else { - dst.MasterpassDetails = nil - } - - // try to unmarshal data into MbwayDetails - err = json.Unmarshal(data, &dst.MbwayDetails) - if err == nil { - jsonMbwayDetails, _ := json.Marshal(dst.MbwayDetails) - if string(jsonMbwayDetails) == "{}" || !dst.MbwayDetails.isValidType() { // empty struct - dst.MbwayDetails = nil - } else { - match++ - } - } else { - dst.MbwayDetails = nil - } - - // try to unmarshal data into MobilePayDetails - err = json.Unmarshal(data, &dst.MobilePayDetails) - if err == nil { - jsonMobilePayDetails, _ := json.Marshal(dst.MobilePayDetails) - if string(jsonMobilePayDetails) == "{}" || !dst.MobilePayDetails.isValidType() { // empty struct - dst.MobilePayDetails = nil - } else { - match++ - } - } else { - dst.MobilePayDetails = nil - } - - // try to unmarshal data into MolPayDetails - err = json.Unmarshal(data, &dst.MolPayDetails) - if err == nil { - jsonMolPayDetails, _ := json.Marshal(dst.MolPayDetails) - if string(jsonMolPayDetails) == "{}" || !dst.MolPayDetails.isValidType() { // empty struct - dst.MolPayDetails = nil - } else { - match++ - } - } else { - dst.MolPayDetails = nil - } - - // try to unmarshal data into OpenInvoiceDetails - err = json.Unmarshal(data, &dst.OpenInvoiceDetails) - if err == nil { - jsonOpenInvoiceDetails, _ := json.Marshal(dst.OpenInvoiceDetails) - if string(jsonOpenInvoiceDetails) == "{}" || !dst.OpenInvoiceDetails.isValidType() { // empty struct - dst.OpenInvoiceDetails = nil - } else { - match++ - } - } else { - dst.OpenInvoiceDetails = nil - } - - // try to unmarshal data into PayPalDetails - err = json.Unmarshal(data, &dst.PayPalDetails) - if err == nil { - jsonPayPalDetails, _ := json.Marshal(dst.PayPalDetails) - if string(jsonPayPalDetails) == "{}" || !dst.PayPalDetails.isValidType() { // empty struct - dst.PayPalDetails = nil - } else { - match++ - } - } else { - dst.PayPalDetails = nil - } - - // try to unmarshal data into PayUUpiDetails - err = json.Unmarshal(data, &dst.PayUUpiDetails) - if err == nil { - jsonPayUUpiDetails, _ := json.Marshal(dst.PayUUpiDetails) - if string(jsonPayUUpiDetails) == "{}" || !dst.PayUUpiDetails.isValidType() { // empty struct - dst.PayUUpiDetails = nil - } else { - match++ - } - } else { - dst.PayUUpiDetails = nil - } - - // try to unmarshal data into PayWithGoogleDetails - err = json.Unmarshal(data, &dst.PayWithGoogleDetails) - if err == nil { - jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) - if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct - dst.PayWithGoogleDetails = nil - } else { - match++ - } - } else { - dst.PayWithGoogleDetails = nil - } - - // try to unmarshal data into PaymentDetails - err = json.Unmarshal(data, &dst.PaymentDetails) - if err == nil { - jsonPaymentDetails, _ := json.Marshal(dst.PaymentDetails) - if string(jsonPaymentDetails) == "{}" || !dst.PaymentDetails.isValidType() { // empty struct - dst.PaymentDetails = nil - } else { - match++ - } - } else { - dst.PaymentDetails = nil - } - - // try to unmarshal data into RatepayDetails - err = json.Unmarshal(data, &dst.RatepayDetails) - if err == nil { - jsonRatepayDetails, _ := json.Marshal(dst.RatepayDetails) - if string(jsonRatepayDetails) == "{}" || !dst.RatepayDetails.isValidType() { // empty struct - dst.RatepayDetails = nil - } else { - match++ - } - } else { - dst.RatepayDetails = nil - } - - // try to unmarshal data into SamsungPayDetails - err = json.Unmarshal(data, &dst.SamsungPayDetails) - if err == nil { - jsonSamsungPayDetails, _ := json.Marshal(dst.SamsungPayDetails) - if string(jsonSamsungPayDetails) == "{}" || !dst.SamsungPayDetails.isValidType() { // empty struct - dst.SamsungPayDetails = nil - } else { - match++ - } - } else { - dst.SamsungPayDetails = nil - } - - // try to unmarshal data into SepaDirectDebitDetails - err = json.Unmarshal(data, &dst.SepaDirectDebitDetails) - if err == nil { - jsonSepaDirectDebitDetails, _ := json.Marshal(dst.SepaDirectDebitDetails) - if string(jsonSepaDirectDebitDetails) == "{}" || !dst.SepaDirectDebitDetails.isValidType() { // empty struct - dst.SepaDirectDebitDetails = nil - } else { - match++ - } - } else { - dst.SepaDirectDebitDetails = nil - } - - // try to unmarshal data into StoredPaymentMethodDetails - err = json.Unmarshal(data, &dst.StoredPaymentMethodDetails) - if err == nil { - jsonStoredPaymentMethodDetails, _ := json.Marshal(dst.StoredPaymentMethodDetails) - if string(jsonStoredPaymentMethodDetails) == "{}" || !dst.StoredPaymentMethodDetails.isValidType() { // empty struct - dst.StoredPaymentMethodDetails = nil - } else { - match++ - } - } else { - dst.StoredPaymentMethodDetails = nil - } - - // try to unmarshal data into UpiCollectDetails - err = json.Unmarshal(data, &dst.UpiCollectDetails) - if err == nil { - jsonUpiCollectDetails, _ := json.Marshal(dst.UpiCollectDetails) - if string(jsonUpiCollectDetails) == "{}" || !dst.UpiCollectDetails.isValidType() { // empty struct - dst.UpiCollectDetails = nil - } else { - match++ - } - } else { - dst.UpiCollectDetails = nil - } - - // try to unmarshal data into UpiIntentDetails - err = json.Unmarshal(data, &dst.UpiIntentDetails) - if err == nil { - jsonUpiIntentDetails, _ := json.Marshal(dst.UpiIntentDetails) - if string(jsonUpiIntentDetails) == "{}" || !dst.UpiIntentDetails.isValidType() { // empty struct - dst.UpiIntentDetails = nil - } else { - match++ - } - } else { - dst.UpiIntentDetails = nil - } - - // try to unmarshal data into VippsDetails - err = json.Unmarshal(data, &dst.VippsDetails) - if err == nil { - jsonVippsDetails, _ := json.Marshal(dst.VippsDetails) - if string(jsonVippsDetails) == "{}" || !dst.VippsDetails.isValidType() { // empty struct - dst.VippsDetails = nil - } else { - match++ - } - } else { - dst.VippsDetails = nil - } - - // try to unmarshal data into VisaCheckoutDetails - err = json.Unmarshal(data, &dst.VisaCheckoutDetails) - if err == nil { - jsonVisaCheckoutDetails, _ := json.Marshal(dst.VisaCheckoutDetails) - if string(jsonVisaCheckoutDetails) == "{}" || !dst.VisaCheckoutDetails.isValidType() { // empty struct - dst.VisaCheckoutDetails = nil - } else { - match++ - } - } else { - dst.VisaCheckoutDetails = nil - } - - // try to unmarshal data into WeChatPayDetails - err = json.Unmarshal(data, &dst.WeChatPayDetails) - if err == nil { - jsonWeChatPayDetails, _ := json.Marshal(dst.WeChatPayDetails) - if string(jsonWeChatPayDetails) == "{}" || !dst.WeChatPayDetails.isValidType() { // empty struct - dst.WeChatPayDetails = nil - } else { - match++ - } - } else { - dst.WeChatPayDetails = nil - } - - // try to unmarshal data into WeChatPayMiniProgramDetails - err = json.Unmarshal(data, &dst.WeChatPayMiniProgramDetails) - if err == nil { - jsonWeChatPayMiniProgramDetails, _ := json.Marshal(dst.WeChatPayMiniProgramDetails) - if string(jsonWeChatPayMiniProgramDetails) == "{}" || !dst.WeChatPayMiniProgramDetails.isValidType() { // empty struct - dst.WeChatPayMiniProgramDetails = nil - } else { - match++ - } - } else { - dst.WeChatPayMiniProgramDetails = nil - } - - // try to unmarshal data into ZipDetails - err = json.Unmarshal(data, &dst.ZipDetails) - if err == nil { - jsonZipDetails, _ := json.Marshal(dst.ZipDetails) - if string(jsonZipDetails) == "{}" || !dst.ZipDetails.isValidType() { // empty struct - dst.ZipDetails = nil - } else { - match++ - } - } else { - dst.ZipDetails = nil - } - - if match > 1 { // more than 1 match - // reset to nil - dst.AchDetails = nil - dst.AfterpayDetails = nil - dst.AmazonPayDetails = nil - dst.AndroidPayDetails = nil - dst.ApplePayDetails = nil - dst.BacsDirectDebitDetails = nil - dst.BillDeskDetails = nil - dst.BlikDetails = nil - dst.CardDetails = nil - dst.CellulantDetails = nil - dst.DokuDetails = nil - dst.DotpayDetails = nil - dst.DragonpayDetails = nil - dst.EcontextVoucherDetails = nil - dst.GenericIssuerPaymentMethodDetails = nil - dst.GiropayDetails = nil - dst.GooglePayDetails = nil - dst.IdealDetails = nil - dst.KlarnaDetails = nil - dst.MasterpassDetails = nil - dst.MbwayDetails = nil - dst.MobilePayDetails = nil - dst.MolPayDetails = nil - dst.OpenInvoiceDetails = nil - dst.PayPalDetails = nil - dst.PayUUpiDetails = nil - dst.PayWithGoogleDetails = nil - dst.PaymentDetails = nil - dst.RatepayDetails = nil - dst.SamsungPayDetails = nil - dst.SepaDirectDebitDetails = nil - dst.StoredPaymentMethodDetails = nil - dst.UpiCollectDetails = nil - dst.UpiIntentDetails = nil - dst.VippsDetails = nil - dst.VisaCheckoutDetails = nil - dst.WeChatPayDetails = nil - dst.WeChatPayMiniProgramDetails = nil - dst.ZipDetails = nil - - return fmt.Errorf("data matches more than one schema in oneOf(DonationPaymentRequestPaymentMethod)") - } else if match == 1 { - return nil // exactly one match - } else { // no match - return fmt.Errorf("data failed to match schemas in oneOf(DonationPaymentRequestPaymentMethod)") - } -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src DonationPaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { - if src.AchDetails != nil { - return json.Marshal(&src.AchDetails) - } - - if src.AfterpayDetails != nil { - return json.Marshal(&src.AfterpayDetails) - } - - if src.AmazonPayDetails != nil { - return json.Marshal(&src.AmazonPayDetails) - } - - if src.AndroidPayDetails != nil { - return json.Marshal(&src.AndroidPayDetails) - } - - if src.ApplePayDetails != nil { - return json.Marshal(&src.ApplePayDetails) - } - - if src.BacsDirectDebitDetails != nil { - return json.Marshal(&src.BacsDirectDebitDetails) - } - - if src.BillDeskDetails != nil { - return json.Marshal(&src.BillDeskDetails) - } - - if src.BlikDetails != nil { - return json.Marshal(&src.BlikDetails) - } - - if src.CardDetails != nil { - return json.Marshal(&src.CardDetails) - } - - if src.CellulantDetails != nil { - return json.Marshal(&src.CellulantDetails) - } - - if src.DokuDetails != nil { - return json.Marshal(&src.DokuDetails) - } - - if src.DotpayDetails != nil { - return json.Marshal(&src.DotpayDetails) - } - - if src.DragonpayDetails != nil { - return json.Marshal(&src.DragonpayDetails) - } - - if src.EcontextVoucherDetails != nil { - return json.Marshal(&src.EcontextVoucherDetails) - } - - if src.GenericIssuerPaymentMethodDetails != nil { - return json.Marshal(&src.GenericIssuerPaymentMethodDetails) - } - - if src.GiropayDetails != nil { - return json.Marshal(&src.GiropayDetails) - } - - if src.GooglePayDetails != nil { - return json.Marshal(&src.GooglePayDetails) - } - - if src.IdealDetails != nil { - return json.Marshal(&src.IdealDetails) - } - - if src.KlarnaDetails != nil { - return json.Marshal(&src.KlarnaDetails) - } - - if src.MasterpassDetails != nil { - return json.Marshal(&src.MasterpassDetails) - } - - if src.MbwayDetails != nil { - return json.Marshal(&src.MbwayDetails) - } - - if src.MobilePayDetails != nil { - return json.Marshal(&src.MobilePayDetails) - } - - if src.MolPayDetails != nil { - return json.Marshal(&src.MolPayDetails) - } - - if src.OpenInvoiceDetails != nil { - return json.Marshal(&src.OpenInvoiceDetails) - } - - if src.PayPalDetails != nil { - return json.Marshal(&src.PayPalDetails) - } - - if src.PayUUpiDetails != nil { - return json.Marshal(&src.PayUUpiDetails) - } - - if src.PayWithGoogleDetails != nil { - return json.Marshal(&src.PayWithGoogleDetails) - } - - if src.PaymentDetails != nil { - return json.Marshal(&src.PaymentDetails) - } - - if src.RatepayDetails != nil { - return json.Marshal(&src.RatepayDetails) - } - - if src.SamsungPayDetails != nil { - return json.Marshal(&src.SamsungPayDetails) - } - - if src.SepaDirectDebitDetails != nil { - return json.Marshal(&src.SepaDirectDebitDetails) - } - - if src.StoredPaymentMethodDetails != nil { - return json.Marshal(&src.StoredPaymentMethodDetails) - } - - if src.UpiCollectDetails != nil { - return json.Marshal(&src.UpiCollectDetails) - } - - if src.UpiIntentDetails != nil { - return json.Marshal(&src.UpiIntentDetails) - } - - if src.VippsDetails != nil { - return json.Marshal(&src.VippsDetails) - } - - if src.VisaCheckoutDetails != nil { - return json.Marshal(&src.VisaCheckoutDetails) - } - - if src.WeChatPayDetails != nil { - return json.Marshal(&src.WeChatPayDetails) - } - - if src.WeChatPayMiniProgramDetails != nil { - return json.Marshal(&src.WeChatPayMiniProgramDetails) - } - - if src.ZipDetails != nil { - return json.Marshal(&src.ZipDetails) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *DonationPaymentRequestPaymentMethod) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.AchDetails != nil { - return obj.AchDetails - } - - if obj.AfterpayDetails != nil { - return obj.AfterpayDetails - } - - if obj.AmazonPayDetails != nil { - return obj.AmazonPayDetails - } - - if obj.AndroidPayDetails != nil { - return obj.AndroidPayDetails - } - - if obj.ApplePayDetails != nil { - return obj.ApplePayDetails - } - - if obj.BacsDirectDebitDetails != nil { - return obj.BacsDirectDebitDetails - } - - if obj.BillDeskDetails != nil { - return obj.BillDeskDetails - } - - if obj.BlikDetails != nil { - return obj.BlikDetails - } - - if obj.CardDetails != nil { - return obj.CardDetails - } - - if obj.CellulantDetails != nil { - return obj.CellulantDetails - } - - if obj.DokuDetails != nil { - return obj.DokuDetails - } - - if obj.DotpayDetails != nil { - return obj.DotpayDetails - } - - if obj.DragonpayDetails != nil { - return obj.DragonpayDetails - } - - if obj.EcontextVoucherDetails != nil { - return obj.EcontextVoucherDetails - } - - if obj.GenericIssuerPaymentMethodDetails != nil { - return obj.GenericIssuerPaymentMethodDetails - } - - if obj.GiropayDetails != nil { - return obj.GiropayDetails - } - - if obj.GooglePayDetails != nil { - return obj.GooglePayDetails - } - - if obj.IdealDetails != nil { - return obj.IdealDetails - } - - if obj.KlarnaDetails != nil { - return obj.KlarnaDetails - } - - if obj.MasterpassDetails != nil { - return obj.MasterpassDetails - } - - if obj.MbwayDetails != nil { - return obj.MbwayDetails - } - - if obj.MobilePayDetails != nil { - return obj.MobilePayDetails - } - - if obj.MolPayDetails != nil { - return obj.MolPayDetails - } - - if obj.OpenInvoiceDetails != nil { - return obj.OpenInvoiceDetails - } - - if obj.PayPalDetails != nil { - return obj.PayPalDetails - } - - if obj.PayUUpiDetails != nil { - return obj.PayUUpiDetails - } - - if obj.PayWithGoogleDetails != nil { - return obj.PayWithGoogleDetails - } - - if obj.PaymentDetails != nil { - return obj.PaymentDetails - } - - if obj.RatepayDetails != nil { - return obj.RatepayDetails - } - - if obj.SamsungPayDetails != nil { - return obj.SamsungPayDetails - } - - if obj.SepaDirectDebitDetails != nil { - return obj.SepaDirectDebitDetails - } - - if obj.StoredPaymentMethodDetails != nil { - return obj.StoredPaymentMethodDetails - } - - if obj.UpiCollectDetails != nil { - return obj.UpiCollectDetails - } - - if obj.UpiIntentDetails != nil { - return obj.UpiIntentDetails - } - - if obj.VippsDetails != nil { - return obj.VippsDetails - } - - if obj.VisaCheckoutDetails != nil { - return obj.VisaCheckoutDetails - } - - if obj.WeChatPayDetails != nil { - return obj.WeChatPayDetails - } - - if obj.WeChatPayMiniProgramDetails != nil { - return obj.WeChatPayMiniProgramDetails - } - - if obj.ZipDetails != nil { - return obj.ZipDetails - } - - // all schemas are nil - return nil -} - -type NullableDonationPaymentRequestPaymentMethod struct { - value *DonationPaymentRequestPaymentMethod - isSet bool -} - -func (v NullableDonationPaymentRequestPaymentMethod) Get() *DonationPaymentRequestPaymentMethod { - return v.value -} - -func (v *NullableDonationPaymentRequestPaymentMethod) Set(val *DonationPaymentRequestPaymentMethod) { - v.value = val - v.isSet = true -} - -func (v NullableDonationPaymentRequestPaymentMethod) IsSet() bool { - return v.isSet -} - -func (v *NullableDonationPaymentRequestPaymentMethod) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDonationPaymentRequestPaymentMethod(val *DonationPaymentRequestPaymentMethod) *NullableDonationPaymentRequestPaymentMethod { - return &NullableDonationPaymentRequestPaymentMethod{value: val, isSet: true} -} - -func (v NullableDonationPaymentRequestPaymentMethod) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDonationPaymentRequestPaymentMethod) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_donation_response.go b/src/checkout/model_donation_response.go deleted file mode 100644 index 9fa8f6a4e..000000000 --- a/src/checkout/model_donation_response.go +++ /dev/null @@ -1,355 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the DonationResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &DonationResponse{} - -// DonationResponse struct for DonationResponse -type DonationResponse struct { - Amount *Amount `json:"amount,omitempty"` - // The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). - DonationAccount *string `json:"donationAccount,omitempty"` - // Your unique resource identifier. - Id *string `json:"id,omitempty"` - // The merchant account identifier, with which you want to process the transaction. - MerchantAccount *string `json:"merchantAccount,omitempty"` - Payment *PaymentResponse `json:"payment,omitempty"` - // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - Reference *string `json:"reference,omitempty"` - // The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** - Status *string `json:"status,omitempty"` -} - -// NewDonationResponse instantiates a new DonationResponse 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 NewDonationResponse() *DonationResponse { - this := DonationResponse{} - return &this -} - -// NewDonationResponseWithDefaults instantiates a new DonationResponse 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 NewDonationResponseWithDefaults() *DonationResponse { - this := DonationResponse{} - return &this -} - -// GetAmount returns the Amount field value if set, zero value otherwise. -func (o *DonationResponse) GetAmount() Amount { - if o == nil || common.IsNil(o.Amount) { - var ret Amount - return ret - } - return *o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.Amount) { - return nil, false - } - return o.Amount, true -} - -// HasAmount returns a boolean if a field has been set. -func (o *DonationResponse) HasAmount() bool { - if o != nil && !common.IsNil(o.Amount) { - return true - } - - return false -} - -// SetAmount gets a reference to the given Amount and assigns it to the Amount field. -func (o *DonationResponse) SetAmount(v Amount) { - o.Amount = &v -} - -// GetDonationAccount returns the DonationAccount field value if set, zero value otherwise. -func (o *DonationResponse) GetDonationAccount() string { - if o == nil || common.IsNil(o.DonationAccount) { - var ret string - return ret - } - return *o.DonationAccount -} - -// GetDonationAccountOk returns a tuple with the DonationAccount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetDonationAccountOk() (*string, bool) { - if o == nil || common.IsNil(o.DonationAccount) { - return nil, false - } - return o.DonationAccount, true -} - -// HasDonationAccount returns a boolean if a field has been set. -func (o *DonationResponse) HasDonationAccount() bool { - if o != nil && !common.IsNil(o.DonationAccount) { - return true - } - - return false -} - -// SetDonationAccount gets a reference to the given string and assigns it to the DonationAccount field. -func (o *DonationResponse) SetDonationAccount(v string) { - o.DonationAccount = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *DonationResponse) GetId() string { - if o == nil || common.IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetIdOk() (*string, bool) { - if o == nil || common.IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *DonationResponse) HasId() bool { - if o != nil && !common.IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DonationResponse) SetId(v string) { - o.Id = &v -} - -// GetMerchantAccount returns the MerchantAccount field value if set, zero value otherwise. -func (o *DonationResponse) GetMerchantAccount() string { - if o == nil || common.IsNil(o.MerchantAccount) { - var ret string - return ret - } - return *o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetMerchantAccountOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantAccount) { - return nil, false - } - return o.MerchantAccount, true -} - -// HasMerchantAccount returns a boolean if a field has been set. -func (o *DonationResponse) HasMerchantAccount() bool { - if o != nil && !common.IsNil(o.MerchantAccount) { - return true - } - - return false -} - -// SetMerchantAccount gets a reference to the given string and assigns it to the MerchantAccount field. -func (o *DonationResponse) SetMerchantAccount(v string) { - o.MerchantAccount = &v -} - -// GetPayment returns the Payment field value if set, zero value otherwise. -func (o *DonationResponse) GetPayment() PaymentResponse { - if o == nil || common.IsNil(o.Payment) { - var ret PaymentResponse - return ret - } - return *o.Payment -} - -// GetPaymentOk returns a tuple with the Payment field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetPaymentOk() (*PaymentResponse, bool) { - if o == nil || common.IsNil(o.Payment) { - return nil, false - } - return o.Payment, true -} - -// HasPayment returns a boolean if a field has been set. -func (o *DonationResponse) HasPayment() bool { - if o != nil && !common.IsNil(o.Payment) { - return true - } - - return false -} - -// SetPayment gets a reference to the given PaymentResponse and assigns it to the Payment field. -func (o *DonationResponse) SetPayment(v PaymentResponse) { - o.Payment = &v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *DonationResponse) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *DonationResponse) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *DonationResponse) SetReference(v string) { - o.Reference = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *DonationResponse) GetStatus() string { - if o == nil || common.IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationResponse) GetStatusOk() (*string, bool) { - if o == nil || common.IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *DonationResponse) HasStatus() bool { - if o != nil && !common.IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *DonationResponse) SetStatus(v string) { - o.Status = &v -} - -func (o DonationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DonationResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.Amount) { - toSerialize["amount"] = o.Amount - } - if !common.IsNil(o.DonationAccount) { - toSerialize["donationAccount"] = o.DonationAccount - } - if !common.IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !common.IsNil(o.MerchantAccount) { - toSerialize["merchantAccount"] = o.MerchantAccount - } - if !common.IsNil(o.Payment) { - toSerialize["payment"] = o.Payment - } - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Status) { - toSerialize["status"] = o.Status - } - return toSerialize, nil -} - -type NullableDonationResponse struct { - value *DonationResponse - isSet bool -} - -func (v NullableDonationResponse) Get() *DonationResponse { - return v.value -} - -func (v *NullableDonationResponse) Set(val *DonationResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDonationResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDonationResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDonationResponse(val *DonationResponse) *NullableDonationResponse { - return &NullableDonationResponse{value: val, isSet: true} -} - -func (v NullableDonationResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDonationResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *DonationResponse) isValidStatus() bool { - var allowedEnumValues = []string{"completed", "pending", "refused"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_klarna_details.go b/src/checkout/model_klarna_details.go index 812a846b2..9195e2ae1 100644 --- a/src/checkout/model_klarna_details.go +++ b/src/checkout/model_klarna_details.go @@ -32,6 +32,8 @@ type KlarnaDetails struct { RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + // The type of flow to initiate. + Subtype *string `json:"subtype,omitempty"` // **klarna** Type string `json:"type"` } @@ -251,6 +253,38 @@ func (o *KlarnaDetails) SetStoredPaymentMethodId(v string) { o.StoredPaymentMethodId = &v } +// GetSubtype returns the Subtype field value if set, zero value otherwise. +func (o *KlarnaDetails) GetSubtype() string { + if o == nil || common.IsNil(o.Subtype) { + var ret string + return ret + } + return *o.Subtype +} + +// GetSubtypeOk returns a tuple with the Subtype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KlarnaDetails) GetSubtypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Subtype) { + return nil, false + } + return o.Subtype, true +} + +// HasSubtype returns a boolean if a field has been set. +func (o *KlarnaDetails) HasSubtype() bool { + if o != nil && !common.IsNil(o.Subtype) { + return true + } + + return false +} + +// SetSubtype gets a reference to the given string and assigns it to the Subtype field. +func (o *KlarnaDetails) SetSubtype(v string) { + o.Subtype = &v +} + // GetType returns the Type field value func (o *KlarnaDetails) GetType() string { if o == nil { @@ -303,6 +337,9 @@ func (o KlarnaDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.StoredPaymentMethodId) { toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId } + if !common.IsNil(o.Subtype) { + toSerialize["subtype"] = o.Subtype + } toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/checkout/model_line_item.go b/src/checkout/model_line_item.go index 01fe7e087..a4fcb0dd5 100644 --- a/src/checkout/model_line_item.go +++ b/src/checkout/model_line_item.go @@ -33,7 +33,7 @@ type LineItem struct { Id *string `json:"id,omitempty"` // Link to the picture of the purchased item. ImageUrl *string `json:"imageUrl,omitempty"` - // Item category, used by the RatePay payment method. + // Item category, used by the payment methods PayPal and Ratepay. ItemCategory *string `json:"itemCategory,omitempty"` // Manufacturer of the item. Manufacturer *string `json:"manufacturer,omitempty"` diff --git a/src/checkout/model_pay_pal_details.go b/src/checkout/model_pay_pal_details.go index b430bfc3e..e8e6b0f66 100644 --- a/src/checkout/model_pay_pal_details.go +++ b/src/checkout/model_pay_pal_details.go @@ -23,8 +23,12 @@ type PayPalDetails struct { CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` // The unique ID associated with the order. OrderID *string `json:"orderID,omitempty"` + // IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED + PayeePreferred *string `json:"payeePreferred,omitempty"` // The unique ID associated with the payer. PayerID *string `json:"payerID,omitempty"` + // PAYPAL or PAYPAL_CREDIT + PayerSelected *string `json:"payerSelected,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. // Deprecated RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` @@ -120,6 +124,38 @@ func (o *PayPalDetails) SetOrderID(v string) { o.OrderID = &v } +// GetPayeePreferred returns the PayeePreferred field value if set, zero value otherwise. +func (o *PayPalDetails) GetPayeePreferred() string { + if o == nil || common.IsNil(o.PayeePreferred) { + var ret string + return ret + } + return *o.PayeePreferred +} + +// GetPayeePreferredOk returns a tuple with the PayeePreferred field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPalDetails) GetPayeePreferredOk() (*string, bool) { + if o == nil || common.IsNil(o.PayeePreferred) { + return nil, false + } + return o.PayeePreferred, true +} + +// HasPayeePreferred returns a boolean if a field has been set. +func (o *PayPalDetails) HasPayeePreferred() bool { + if o != nil && !common.IsNil(o.PayeePreferred) { + return true + } + + return false +} + +// SetPayeePreferred gets a reference to the given string and assigns it to the PayeePreferred field. +func (o *PayPalDetails) SetPayeePreferred(v string) { + o.PayeePreferred = &v +} + // GetPayerID returns the PayerID field value if set, zero value otherwise. func (o *PayPalDetails) GetPayerID() string { if o == nil || common.IsNil(o.PayerID) { @@ -152,6 +188,38 @@ func (o *PayPalDetails) SetPayerID(v string) { o.PayerID = &v } +// GetPayerSelected returns the PayerSelected field value if set, zero value otherwise. +func (o *PayPalDetails) GetPayerSelected() string { + if o == nil || common.IsNil(o.PayerSelected) { + var ret string + return ret + } + return *o.PayerSelected +} + +// GetPayerSelectedOk returns a tuple with the PayerSelected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayPalDetails) GetPayerSelectedOk() (*string, bool) { + if o == nil || common.IsNil(o.PayerSelected) { + return nil, false + } + return o.PayerSelected, true +} + +// HasPayerSelected returns a boolean if a field has been set. +func (o *PayPalDetails) HasPayerSelected() bool { + if o != nil && !common.IsNil(o.PayerSelected) { + return true + } + + return false +} + +// SetPayerSelected gets a reference to the given string and assigns it to the PayerSelected field. +func (o *PayPalDetails) SetPayerSelected(v string) { + o.PayerSelected = &v +} + // GetRecurringDetailReference returns the RecurringDetailReference field value if set, zero value otherwise. // Deprecated func (o *PayPalDetails) GetRecurringDetailReference() string { @@ -291,9 +359,15 @@ func (o PayPalDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.OrderID) { toSerialize["orderID"] = o.OrderID } + if !common.IsNil(o.PayeePreferred) { + toSerialize["payeePreferred"] = o.PayeePreferred + } if !common.IsNil(o.PayerID) { toSerialize["payerID"] = o.PayerID } + if !common.IsNil(o.PayerSelected) { + toSerialize["payerSelected"] = o.PayerSelected + } if !common.IsNil(o.RecurringDetailReference) { toSerialize["recurringDetailReference"] = o.RecurringDetailReference } diff --git a/src/checkout/model_payment_amount_update_resource.go b/src/checkout/model_payment_amount_update_resource.go deleted file mode 100644 index 9983f9682..000000000 --- a/src/checkout/model_payment_amount_update_resource.go +++ /dev/null @@ -1,348 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentAmountUpdateResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentAmountUpdateResource{} - -// PaymentAmountUpdateResource struct for PaymentAmountUpdateResource -type PaymentAmountUpdateResource struct { - Amount Amount `json:"amount"` - // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - IndustryUsage *string `json:"industryUsage,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. - PaymentPspReference string `json:"paymentPspReference"` - // Adyen's 16-character reference associated with the amount update request. - PspReference string `json:"pspReference"` - // Your reference for the amount update request. Maximum length: 80 characters. - Reference string `json:"reference"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewPaymentAmountUpdateResource instantiates a new PaymentAmountUpdateResource 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 NewPaymentAmountUpdateResource(amount Amount, merchantAccount string, paymentPspReference string, pspReference string, reference string, status string) *PaymentAmountUpdateResource { - this := PaymentAmountUpdateResource{} - this.Amount = amount - this.MerchantAccount = merchantAccount - this.PaymentPspReference = paymentPspReference - this.PspReference = pspReference - this.Reference = reference - this.Status = status - return &this -} - -// NewPaymentAmountUpdateResourceWithDefaults instantiates a new PaymentAmountUpdateResource 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 NewPaymentAmountUpdateResourceWithDefaults() *PaymentAmountUpdateResource { - this := PaymentAmountUpdateResource{} - return &this -} - -// GetAmount returns the Amount field value -func (o *PaymentAmountUpdateResource) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *PaymentAmountUpdateResource) SetAmount(v Amount) { - o.Amount = v -} - -// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. -func (o *PaymentAmountUpdateResource) GetIndustryUsage() string { - if o == nil || common.IsNil(o.IndustryUsage) { - var ret string - return ret - } - return *o.IndustryUsage -} - -// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetIndustryUsageOk() (*string, bool) { - if o == nil || common.IsNil(o.IndustryUsage) { - return nil, false - } - return o.IndustryUsage, true -} - -// HasIndustryUsage returns a boolean if a field has been set. -func (o *PaymentAmountUpdateResource) HasIndustryUsage() bool { - if o != nil && !common.IsNil(o.IndustryUsage) { - return true - } - - return false -} - -// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. -func (o *PaymentAmountUpdateResource) SetIndustryUsage(v string) { - o.IndustryUsage = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentAmountUpdateResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentAmountUpdateResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentPspReference returns the PaymentPspReference field value -func (o *PaymentAmountUpdateResource) GetPaymentPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentPspReference -} - -// GetPaymentPspReferenceOk returns a tuple with the PaymentPspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetPaymentPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentPspReference, true -} - -// SetPaymentPspReference sets field value -func (o *PaymentAmountUpdateResource) SetPaymentPspReference(v string) { - o.PaymentPspReference = v -} - -// GetPspReference returns the PspReference field value -func (o *PaymentAmountUpdateResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *PaymentAmountUpdateResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value -func (o *PaymentAmountUpdateResource) GetReference() string { - if o == nil { - var ret string - return ret - } - - return o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Reference, true -} - -// SetReference sets field value -func (o *PaymentAmountUpdateResource) SetReference(v string) { - o.Reference = v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *PaymentAmountUpdateResource) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *PaymentAmountUpdateResource) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *PaymentAmountUpdateResource) SetSplits(v []Split) { - o.Splits = v -} - -// GetStatus returns the Status field value -func (o *PaymentAmountUpdateResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *PaymentAmountUpdateResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *PaymentAmountUpdateResource) SetStatus(v string) { - o.Status = v -} - -func (o PaymentAmountUpdateResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentAmountUpdateResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.IndustryUsage) { - toSerialize["industryUsage"] = o.IndustryUsage - } - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentPspReference"] = o.PaymentPspReference - toSerialize["pspReference"] = o.PspReference - toSerialize["reference"] = o.Reference - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullablePaymentAmountUpdateResource struct { - value *PaymentAmountUpdateResource - isSet bool -} - -func (v NullablePaymentAmountUpdateResource) Get() *PaymentAmountUpdateResource { - return v.value -} - -func (v *NullablePaymentAmountUpdateResource) Set(val *PaymentAmountUpdateResource) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentAmountUpdateResource) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentAmountUpdateResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentAmountUpdateResource(val *PaymentAmountUpdateResource) *NullablePaymentAmountUpdateResource { - return &NullablePaymentAmountUpdateResource{value: val, isSet: true} -} - -func (v NullablePaymentAmountUpdateResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentAmountUpdateResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentAmountUpdateResource) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false -} -func (o *PaymentAmountUpdateResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_cancel_resource.go b/src/checkout/model_payment_cancel_resource.go deleted file mode 100644 index cf4bd9a18..000000000 --- a/src/checkout/model_payment_cancel_resource.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentCancelResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentCancelResource{} - -// PaymentCancelResource struct for PaymentCancelResource -type PaymentCancelResource struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. - PaymentPspReference string `json:"paymentPspReference"` - // Adyen's 16-character reference associated with the cancel request. - PspReference string `json:"pspReference"` - // Your reference for the cancel request. - Reference *string `json:"reference,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewPaymentCancelResource instantiates a new PaymentCancelResource 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 NewPaymentCancelResource(merchantAccount string, paymentPspReference string, pspReference string, status string) *PaymentCancelResource { - this := PaymentCancelResource{} - this.MerchantAccount = merchantAccount - this.PaymentPspReference = paymentPspReference - this.PspReference = pspReference - this.Status = status - return &this -} - -// NewPaymentCancelResourceWithDefaults instantiates a new PaymentCancelResource 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 NewPaymentCancelResourceWithDefaults() *PaymentCancelResource { - this := PaymentCancelResource{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentCancelResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentCancelResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentCancelResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentPspReference returns the PaymentPspReference field value -func (o *PaymentCancelResource) GetPaymentPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentPspReference -} - -// GetPaymentPspReferenceOk returns a tuple with the PaymentPspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentCancelResource) GetPaymentPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentPspReference, true -} - -// SetPaymentPspReference sets field value -func (o *PaymentCancelResource) SetPaymentPspReference(v string) { - o.PaymentPspReference = v -} - -// GetPspReference returns the PspReference field value -func (o *PaymentCancelResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentCancelResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *PaymentCancelResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *PaymentCancelResource) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentCancelResource) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *PaymentCancelResource) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *PaymentCancelResource) SetReference(v string) { - o.Reference = &v -} - -// GetStatus returns the Status field value -func (o *PaymentCancelResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *PaymentCancelResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *PaymentCancelResource) SetStatus(v string) { - o.Status = v -} - -func (o PaymentCancelResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentCancelResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentPspReference"] = o.PaymentPspReference - toSerialize["pspReference"] = o.PspReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullablePaymentCancelResource struct { - value *PaymentCancelResource - isSet bool -} - -func (v NullablePaymentCancelResource) Get() *PaymentCancelResource { - return v.value -} - -func (v *NullablePaymentCancelResource) Set(val *PaymentCancelResource) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentCancelResource) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentCancelResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentCancelResource(val *PaymentCancelResource) *NullablePaymentCancelResource { - return &NullablePaymentCancelResource{value: val, isSet: true} -} - -func (v NullablePaymentCancelResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentCancelResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentCancelResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 8fb270a06..80f2de18f 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -30,7 +30,7 @@ type PaymentCaptureRequest struct { // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). Splits []Split `json:"splits,omitempty"` // A List of sub-merchants. - SubMerchants []SubMerchant2 `json:"subMerchants,omitempty"` + SubMerchants []SubMerchantInfo `json:"subMerchants,omitempty"` } // NewPaymentCaptureRequest instantiates a new PaymentCaptureRequest object @@ -229,9 +229,9 @@ func (o *PaymentCaptureRequest) SetSplits(v []Split) { } // GetSubMerchants returns the SubMerchants field value if set, zero value otherwise. -func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchant2 { +func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchantInfo { if o == nil || common.IsNil(o.SubMerchants) { - var ret []SubMerchant2 + var ret []SubMerchantInfo return ret } return o.SubMerchants @@ -239,7 +239,7 @@ func (o *PaymentCaptureRequest) GetSubMerchants() []SubMerchant2 { // GetSubMerchantsOk returns a tuple with the SubMerchants field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentCaptureRequest) GetSubMerchantsOk() ([]SubMerchant2, bool) { +func (o *PaymentCaptureRequest) GetSubMerchantsOk() ([]SubMerchantInfo, bool) { if o == nil || common.IsNil(o.SubMerchants) { return nil, false } @@ -255,8 +255,8 @@ func (o *PaymentCaptureRequest) HasSubMerchants() bool { return false } -// SetSubMerchants gets a reference to the given []SubMerchant2 and assigns it to the SubMerchants field. -func (o *PaymentCaptureRequest) SetSubMerchants(v []SubMerchant2) { +// SetSubMerchants gets a reference to the given []SubMerchantInfo and assigns it to the SubMerchants field. +func (o *PaymentCaptureRequest) SetSubMerchants(v []SubMerchantInfo) { o.SubMerchants = v } diff --git a/src/checkout/model_payment_capture_resource.go b/src/checkout/model_payment_capture_resource.go deleted file mode 100644 index 4259343d5..000000000 --- a/src/checkout/model_payment_capture_resource.go +++ /dev/null @@ -1,348 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentCaptureResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentCaptureResource{} - -// PaymentCaptureResource struct for PaymentCaptureResource -type PaymentCaptureResource struct { - Amount Amount `json:"amount"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. - PaymentPspReference string `json:"paymentPspReference"` - // Adyen's 16-character reference associated with the capture request. - PspReference string `json:"pspReference"` - // Your reference for the capture request. - Reference *string `json:"reference,omitempty"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewPaymentCaptureResource instantiates a new PaymentCaptureResource 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 NewPaymentCaptureResource(amount Amount, merchantAccount string, paymentPspReference string, pspReference string, status string) *PaymentCaptureResource { - this := PaymentCaptureResource{} - this.Amount = amount - this.MerchantAccount = merchantAccount - this.PaymentPspReference = paymentPspReference - this.PspReference = pspReference - this.Status = status - return &this -} - -// NewPaymentCaptureResourceWithDefaults instantiates a new PaymentCaptureResource 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 NewPaymentCaptureResourceWithDefaults() *PaymentCaptureResource { - this := PaymentCaptureResource{} - return &this -} - -// GetAmount returns the Amount field value -func (o *PaymentCaptureResource) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *PaymentCaptureResource) SetAmount(v Amount) { - o.Amount = v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *PaymentCaptureResource) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *PaymentCaptureResource) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *PaymentCaptureResource) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentCaptureResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentCaptureResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentPspReference returns the PaymentPspReference field value -func (o *PaymentCaptureResource) GetPaymentPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentPspReference -} - -// GetPaymentPspReferenceOk returns a tuple with the PaymentPspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetPaymentPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentPspReference, true -} - -// SetPaymentPspReference sets field value -func (o *PaymentCaptureResource) SetPaymentPspReference(v string) { - o.PaymentPspReference = v -} - -// GetPspReference returns the PspReference field value -func (o *PaymentCaptureResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *PaymentCaptureResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *PaymentCaptureResource) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *PaymentCaptureResource) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *PaymentCaptureResource) SetReference(v string) { - o.Reference = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *PaymentCaptureResource) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *PaymentCaptureResource) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *PaymentCaptureResource) SetSplits(v []Split) { - o.Splits = v -} - -// GetStatus returns the Status field value -func (o *PaymentCaptureResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *PaymentCaptureResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *PaymentCaptureResource) SetStatus(v string) { - o.Status = v -} - -func (o PaymentCaptureResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentCaptureResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentPspReference"] = o.PaymentPspReference - toSerialize["pspReference"] = o.PspReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullablePaymentCaptureResource struct { - value *PaymentCaptureResource - isSet bool -} - -func (v NullablePaymentCaptureResource) Get() *PaymentCaptureResource { - return v.value -} - -func (v *NullablePaymentCaptureResource) Set(val *PaymentCaptureResource) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentCaptureResource) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentCaptureResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentCaptureResource(val *PaymentCaptureResource) *NullablePaymentCaptureResource { - return &NullablePaymentCaptureResource{value: val, isSet: true} -} - -func (v NullablePaymentCaptureResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentCaptureResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentCaptureResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_capture_response.go b/src/checkout/model_payment_capture_response.go index 19cb39c4f..9fd22ca2c 100644 --- a/src/checkout/model_payment_capture_response.go +++ b/src/checkout/model_payment_capture_response.go @@ -36,7 +36,7 @@ type PaymentCaptureResponse struct { // The status of your request. This will always have the value **received**. Status string `json:"status"` // List of sub-merchants. - SubMerchants []SubMerchant2 `json:"subMerchants,omitempty"` + SubMerchants []SubMerchantInfo `json:"subMerchants,omitempty"` } // NewPaymentCaptureResponse instantiates a new PaymentCaptureResponse object @@ -310,9 +310,9 @@ func (o *PaymentCaptureResponse) SetStatus(v string) { } // GetSubMerchants returns the SubMerchants field value if set, zero value otherwise. -func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchant2 { +func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchantInfo { if o == nil || common.IsNil(o.SubMerchants) { - var ret []SubMerchant2 + var ret []SubMerchantInfo return ret } return o.SubMerchants @@ -320,7 +320,7 @@ func (o *PaymentCaptureResponse) GetSubMerchants() []SubMerchant2 { // GetSubMerchantsOk returns a tuple with the SubMerchants field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentCaptureResponse) GetSubMerchantsOk() ([]SubMerchant2, bool) { +func (o *PaymentCaptureResponse) GetSubMerchantsOk() ([]SubMerchantInfo, bool) { if o == nil || common.IsNil(o.SubMerchants) { return nil, false } @@ -336,8 +336,8 @@ func (o *PaymentCaptureResponse) HasSubMerchants() bool { return false } -// SetSubMerchants gets a reference to the given []SubMerchant2 and assigns it to the SubMerchants field. -func (o *PaymentCaptureResponse) SetSubMerchants(v []SubMerchant2) { +// SetSubMerchants gets a reference to the given []SubMerchantInfo and assigns it to the SubMerchants field. +func (o *PaymentCaptureResponse) SetSubMerchants(v []SubMerchantInfo) { o.SubMerchants = v } diff --git a/src/checkout/model_payment_completion_details.go b/src/checkout/model_payment_completion_details.go index 3d85e18a7..3b411e676 100644 --- a/src/checkout/model_payment_completion_details.go +++ b/src/checkout/model_payment_completion_details.go @@ -24,7 +24,8 @@ type PaymentCompletionDetails struct { // (3D) Payment Authentication Request data for the card issuer. PaReq *string `json:"PaReq,omitempty"` // (3D) Payment Authentication Response data by the card issuer. - PaRes *string `json:"PaRes,omitempty"` + PaRes *string `json:"PaRes,omitempty"` + AuthorizationToken *string `json:"authorization_token,omitempty"` // PayPal-generated token for recurring payments. BillingToken *string `json:"billingToken,omitempty"` // The SMS verification code collected from the shopper. @@ -168,6 +169,38 @@ func (o *PaymentCompletionDetails) SetPaRes(v string) { o.PaRes = &v } +// GetAuthorizationToken returns the AuthorizationToken field value if set, zero value otherwise. +func (o *PaymentCompletionDetails) GetAuthorizationToken() string { + if o == nil || common.IsNil(o.AuthorizationToken) { + var ret string + return ret + } + return *o.AuthorizationToken +} + +// GetAuthorizationTokenOk returns a tuple with the AuthorizationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCompletionDetails) GetAuthorizationTokenOk() (*string, bool) { + if o == nil || common.IsNil(o.AuthorizationToken) { + return nil, false + } + return o.AuthorizationToken, true +} + +// HasAuthorizationToken returns a boolean if a field has been set. +func (o *PaymentCompletionDetails) HasAuthorizationToken() bool { + if o != nil && !common.IsNil(o.AuthorizationToken) { + return true + } + + return false +} + +// SetAuthorizationToken gets a reference to the given string and assigns it to the AuthorizationToken field. +func (o *PaymentCompletionDetails) SetAuthorizationToken(v string) { + o.AuthorizationToken = &v +} + // GetBillingToken returns the BillingToken field value if set, zero value otherwise. func (o *PaymentCompletionDetails) GetBillingToken() string { if o == nil || common.IsNil(o.BillingToken) { @@ -635,6 +668,9 @@ func (o PaymentCompletionDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.PaRes) { toSerialize["PaRes"] = o.PaRes } + if !common.IsNil(o.AuthorizationToken) { + toSerialize["authorization_token"] = o.AuthorizationToken + } if !common.IsNil(o.BillingToken) { toSerialize["billingToken"] = o.BillingToken } diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 296da25b7..428554319 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -162,7 +162,7 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { } func (o *PaymentDetails) isValidType() bool { - var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "walley", "walley_b2b", "pix", "bizum", "alma", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "dana", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "poli", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} + var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_payment_details_response.go b/src/checkout/model_payment_details_response.go index b4ddd7b75..dc8c4ae87 100644 --- a/src/checkout/model_payment_details_response.go +++ b/src/checkout/model_payment_details_response.go @@ -35,7 +35,7 @@ type PaymentDetailsResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` - // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` // The shopperLocale. ShopperLocale *string `json:"shopperLocale,omitempty"` @@ -637,7 +637,7 @@ func (v *NullablePaymentDetailsResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentDetailsResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_payment_donation_request.go b/src/checkout/model_payment_donation_request.go deleted file mode 100644 index a17e2ea20..000000000 --- a/src/checkout/model_payment_donation_request.go +++ /dev/null @@ -1,2552 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentDonationRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentDonationRequest{} - -// PaymentDonationRequest struct for PaymentDonationRequest -type PaymentDonationRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` - // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` - // The delay between the authorisation and scheduled auto-capture, specified in hours. - CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` - // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - Channel *string `json:"channel,omitempty"` - // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Company *Company `json:"company,omitempty"` - // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - // Deprecated - ConversionId *string `json:"conversionId,omitempty"` - // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - CountryCode *string `json:"countryCode,omitempty"` - // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` - // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliveryDate *time.Time `json:"deliveryDate,omitempty"` - // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` - // Donation account to which the transaction is credited. - DonationAccount string `json:"donationAccount"` - // PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. - DonationOriginalPspReference *string `json:"donationOriginalPspReference,omitempty"` - // Donation token received in the `/payments` call. - DonationToken *string `json:"donationToken,omitempty"` - // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. - EnableOneClick *bool `json:"enableOneClick,omitempty"` - // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - EnablePayOut *bool `json:"enablePayOut,omitempty"` - // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. - EnableRecurring *bool `json:"enableRecurring,omitempty"` - // The type of the entity the payment is processed for. - EntityType *string `json:"entityType,omitempty"` - // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - IndustryUsage *string `json:"industryUsage,omitempty"` - Installments *Installments `json:"installments,omitempty"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. - LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` - // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - Mcc *string `json:"mcc,omitempty"` - // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` - Order *EncryptedOrderData `json:"order,omitempty"` - // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` - // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - Origin *string `json:"origin,omitempty"` - PaymentMethod CheckoutPaymentMethod `json:"paymentMethod"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` - // Date after which no further authorisations shall be performed. Only for 3D Secure 2. - RecurringExpiry *string `json:"recurringExpiry,omitempty"` - // Minimum number of days between authorisations. Only for 3D Secure 2. - RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` - // Specifies the redirect method (GET or POST) when redirecting back from the issuer. - RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` - // Specifies the redirect method (GET or POST) when redirecting to the issuer. - RedirectToIssuerMethod *string `json:"redirectToIssuerMethod,omitempty"` - // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - Reference string `json:"reference"` - // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` - // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - SessionValidity *string `json:"sessionValidity,omitempty"` - // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - ShopperEmail *string `json:"shopperEmail,omitempty"` - // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - ShopperIP *string `json:"shopperIP,omitempty"` - // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - // The combination of a language code and a country code to specify the language to be used in the payment. - ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` - // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - ShopperReference *string `json:"shopperReference,omitempty"` - // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - ShopperStatement *string `json:"shopperStatement,omitempty"` - // The shopper's social security number. - SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. - Store *string `json:"store,omitempty"` - // When true and `shopperReference` is provided, the payment details will be stored. - StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` - // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` - // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - // Deprecated - ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` - // Set to true if the payment should be routed to a trusted MID. - TrustedShopper *bool `json:"trustedShopper,omitempty"` -} - -// NewPaymentDonationRequest instantiates a new PaymentDonationRequest 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 NewPaymentDonationRequest(amount Amount, donationAccount string, merchantAccount string, paymentMethod CheckoutPaymentMethod, reference string, returnUrl string) *PaymentDonationRequest { - this := PaymentDonationRequest{} - this.Amount = amount - this.DonationAccount = donationAccount - this.MerchantAccount = merchantAccount - this.PaymentMethod = paymentMethod - this.Reference = reference - this.ReturnUrl = returnUrl - var threeDSAuthenticationOnly bool = false - this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly - return &this -} - -// NewPaymentDonationRequestWithDefaults instantiates a new PaymentDonationRequest 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 NewPaymentDonationRequestWithDefaults() *PaymentDonationRequest { - this := PaymentDonationRequest{} - var threeDSAuthenticationOnly bool = false - this.ThreeDSAuthenticationOnly = &threeDSAuthenticationOnly - return &this -} - -// GetAccountInfo returns the AccountInfo field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetAccountInfo() AccountInfo { - if o == nil || common.IsNil(o.AccountInfo) { - var ret AccountInfo - return ret - } - return *o.AccountInfo -} - -// GetAccountInfoOk returns a tuple with the AccountInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetAccountInfoOk() (*AccountInfo, bool) { - if o == nil || common.IsNil(o.AccountInfo) { - return nil, false - } - return o.AccountInfo, true -} - -// HasAccountInfo returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasAccountInfo() bool { - if o != nil && !common.IsNil(o.AccountInfo) { - return true - } - - return false -} - -// SetAccountInfo gets a reference to the given AccountInfo and assigns it to the AccountInfo field. -func (o *PaymentDonationRequest) SetAccountInfo(v AccountInfo) { - o.AccountInfo = &v -} - -// GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetAdditionalAmount() Amount { - if o == nil || common.IsNil(o.AdditionalAmount) { - var ret Amount - return ret - } - return *o.AdditionalAmount -} - -// GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetAdditionalAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.AdditionalAmount) { - return nil, false - } - return o.AdditionalAmount, true -} - -// HasAdditionalAmount returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasAdditionalAmount() bool { - if o != nil && !common.IsNil(o.AdditionalAmount) { - return true - } - - return false -} - -// SetAdditionalAmount gets a reference to the given Amount and assigns it to the AdditionalAmount field. -func (o *PaymentDonationRequest) SetAdditionalAmount(v Amount) { - o.AdditionalAmount = &v -} - -// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetAdditionalData() map[string]string { - if o == nil || common.IsNil(o.AdditionalData) { - var ret map[string]string - return ret - } - return *o.AdditionalData -} - -// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetAdditionalDataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.AdditionalData) { - return nil, false - } - return o.AdditionalData, true -} - -// HasAdditionalData returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasAdditionalData() bool { - if o != nil && !common.IsNil(o.AdditionalData) { - return true - } - - return false -} - -// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field. -func (o *PaymentDonationRequest) SetAdditionalData(v map[string]string) { - o.AdditionalData = &v -} - -// GetAmount returns the Amount field value -func (o *PaymentDonationRequest) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *PaymentDonationRequest) SetAmount(v Amount) { - o.Amount = v -} - -// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetApplicationInfo() ApplicationInfo { - if o == nil || common.IsNil(o.ApplicationInfo) { - var ret ApplicationInfo - return ret - } - return *o.ApplicationInfo -} - -// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { - if o == nil || common.IsNil(o.ApplicationInfo) { - return nil, false - } - return o.ApplicationInfo, true -} - -// HasApplicationInfo returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasApplicationInfo() bool { - if o != nil && !common.IsNil(o.ApplicationInfo) { - return true - } - - return false -} - -// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. -func (o *PaymentDonationRequest) SetApplicationInfo(v ApplicationInfo) { - o.ApplicationInfo = &v -} - -// GetAuthenticationData returns the AuthenticationData field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetAuthenticationData() AuthenticationData { - if o == nil || common.IsNil(o.AuthenticationData) { - var ret AuthenticationData - return ret - } - return *o.AuthenticationData -} - -// GetAuthenticationDataOk returns a tuple with the AuthenticationData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetAuthenticationDataOk() (*AuthenticationData, bool) { - if o == nil || common.IsNil(o.AuthenticationData) { - return nil, false - } - return o.AuthenticationData, true -} - -// HasAuthenticationData returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasAuthenticationData() bool { - if o != nil && !common.IsNil(o.AuthenticationData) { - return true - } - - return false -} - -// SetAuthenticationData gets a reference to the given AuthenticationData and assigns it to the AuthenticationData field. -func (o *PaymentDonationRequest) SetAuthenticationData(v AuthenticationData) { - o.AuthenticationData = &v -} - -// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetBillingAddress() Address { - if o == nil || common.IsNil(o.BillingAddress) { - var ret Address - return ret - } - return *o.BillingAddress -} - -// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetBillingAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.BillingAddress) { - return nil, false - } - return o.BillingAddress, true -} - -// HasBillingAddress returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasBillingAddress() bool { - if o != nil && !common.IsNil(o.BillingAddress) { - return true - } - - return false -} - -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *PaymentDonationRequest) SetBillingAddress(v Address) { - o.BillingAddress = &v -} - -// GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetBrowserInfo() BrowserInfo { - if o == nil || common.IsNil(o.BrowserInfo) { - var ret BrowserInfo - return ret - } - return *o.BrowserInfo -} - -// GetBrowserInfoOk returns a tuple with the BrowserInfo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetBrowserInfoOk() (*BrowserInfo, bool) { - if o == nil || common.IsNil(o.BrowserInfo) { - return nil, false - } - return o.BrowserInfo, true -} - -// HasBrowserInfo returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasBrowserInfo() bool { - if o != nil && !common.IsNil(o.BrowserInfo) { - return true - } - - return false -} - -// SetBrowserInfo gets a reference to the given BrowserInfo and assigns it to the BrowserInfo field. -func (o *PaymentDonationRequest) SetBrowserInfo(v BrowserInfo) { - o.BrowserInfo = &v -} - -// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetCaptureDelayHours() int32 { - if o == nil || common.IsNil(o.CaptureDelayHours) { - var ret int32 - return ret - } - return *o.CaptureDelayHours -} - -// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetCaptureDelayHoursOk() (*int32, bool) { - if o == nil || common.IsNil(o.CaptureDelayHours) { - return nil, false - } - return o.CaptureDelayHours, true -} - -// HasCaptureDelayHours returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasCaptureDelayHours() bool { - if o != nil && !common.IsNil(o.CaptureDelayHours) { - return true - } - - return false -} - -// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. -func (o *PaymentDonationRequest) SetCaptureDelayHours(v int32) { - o.CaptureDelayHours = &v -} - -// GetChannel returns the Channel field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetChannel() string { - if o == nil || common.IsNil(o.Channel) { - var ret string - return ret - } - return *o.Channel -} - -// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetChannelOk() (*string, bool) { - if o == nil || common.IsNil(o.Channel) { - return nil, false - } - return o.Channel, true -} - -// HasChannel returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasChannel() bool { - if o != nil && !common.IsNil(o.Channel) { - return true - } - - return false -} - -// SetChannel gets a reference to the given string and assigns it to the Channel field. -func (o *PaymentDonationRequest) SetChannel(v string) { - o.Channel = &v -} - -// GetCheckoutAttemptId returns the CheckoutAttemptId field value if set, zero value otherwise. -func (o *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) SetCheckoutAttemptId(v string) { - o.CheckoutAttemptId = &v -} - -// GetCompany returns the Company field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetCompany() Company { - if o == nil || common.IsNil(o.Company) { - var ret Company - return ret - } - return *o.Company -} - -// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetCompanyOk() (*Company, bool) { - if o == nil || common.IsNil(o.Company) { - return nil, false - } - return o.Company, true -} - -// HasCompany returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasCompany() bool { - if o != nil && !common.IsNil(o.Company) { - return true - } - - return false -} - -// SetCompany gets a reference to the given Company and assigns it to the Company field. -func (o *PaymentDonationRequest) SetCompany(v Company) { - o.Company = &v -} - -// GetConversionId returns the ConversionId field value if set, zero value otherwise. -// Deprecated -func (o *PaymentDonationRequest) GetConversionId() string { - if o == nil || common.IsNil(o.ConversionId) { - var ret string - return ret - } - return *o.ConversionId -} - -// GetConversionIdOk returns a tuple with the ConversionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *PaymentDonationRequest) GetConversionIdOk() (*string, bool) { - if o == nil || common.IsNil(o.ConversionId) { - return nil, false - } - return o.ConversionId, true -} - -// HasConversionId returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasConversionId() bool { - if o != nil && !common.IsNil(o.ConversionId) { - return true - } - - return false -} - -// SetConversionId gets a reference to the given string and assigns it to the ConversionId field. -// Deprecated -func (o *PaymentDonationRequest) SetConversionId(v string) { - o.ConversionId = &v -} - -// GetCountryCode returns the CountryCode field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetCountryCode() string { - if o == nil || common.IsNil(o.CountryCode) { - var ret string - return ret - } - return *o.CountryCode -} - -// GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetCountryCodeOk() (*string, bool) { - if o == nil || common.IsNil(o.CountryCode) { - return nil, false - } - return o.CountryCode, true -} - -// HasCountryCode returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasCountryCode() bool { - if o != nil && !common.IsNil(o.CountryCode) { - return true - } - - return false -} - -// SetCountryCode gets a reference to the given string and assigns it to the CountryCode field. -func (o *PaymentDonationRequest) SetCountryCode(v string) { - o.CountryCode = &v -} - -// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDateOfBirth() string { - if o == nil || common.IsNil(o.DateOfBirth) { - var ret string - return ret - } - return *o.DateOfBirth -} - -// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDateOfBirthOk() (*string, bool) { - if o == nil || common.IsNil(o.DateOfBirth) { - return nil, false - } - return o.DateOfBirth, true -} - -// HasDateOfBirth returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDateOfBirth() bool { - if o != nil && !common.IsNil(o.DateOfBirth) { - return true - } - - return false -} - -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *PaymentDonationRequest) SetDateOfBirth(v string) { - o.DateOfBirth = &v -} - -// GetDccQuote returns the DccQuote field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDccQuote() ForexQuote { - if o == nil || common.IsNil(o.DccQuote) { - var ret ForexQuote - return ret - } - return *o.DccQuote -} - -// GetDccQuoteOk returns a tuple with the DccQuote field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDccQuoteOk() (*ForexQuote, bool) { - if o == nil || common.IsNil(o.DccQuote) { - return nil, false - } - return o.DccQuote, true -} - -// HasDccQuote returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDccQuote() bool { - if o != nil && !common.IsNil(o.DccQuote) { - return true - } - - return false -} - -// SetDccQuote gets a reference to the given ForexQuote and assigns it to the DccQuote field. -func (o *PaymentDonationRequest) SetDccQuote(v ForexQuote) { - o.DccQuote = &v -} - -// GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDeliveryAddress() Address { - if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address - return ret - } - return *o.DeliveryAddress -} - -// GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDeliveryAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.DeliveryAddress) { - return nil, false - } - return o.DeliveryAddress, true -} - -// HasDeliveryAddress returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDeliveryAddress() bool { - if o != nil && !common.IsNil(o.DeliveryAddress) { - return true - } - - return false -} - -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *PaymentDonationRequest) SetDeliveryAddress(v Address) { - o.DeliveryAddress = &v -} - -// GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDeliveryDate() time.Time { - if o == nil || common.IsNil(o.DeliveryDate) { - var ret time.Time - return ret - } - return *o.DeliveryDate -} - -// GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDeliveryDateOk() (*time.Time, bool) { - if o == nil || common.IsNil(o.DeliveryDate) { - return nil, false - } - return o.DeliveryDate, true -} - -// HasDeliveryDate returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDeliveryDate() bool { - if o != nil && !common.IsNil(o.DeliveryDate) { - return true - } - - return false -} - -// SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. -func (o *PaymentDonationRequest) SetDeliveryDate(v time.Time) { - o.DeliveryDate = &v -} - -// GetDeviceFingerprint returns the DeviceFingerprint field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDeviceFingerprint() string { - if o == nil || common.IsNil(o.DeviceFingerprint) { - var ret string - return ret - } - return *o.DeviceFingerprint -} - -// GetDeviceFingerprintOk returns a tuple with the DeviceFingerprint field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDeviceFingerprintOk() (*string, bool) { - if o == nil || common.IsNil(o.DeviceFingerprint) { - return nil, false - } - return o.DeviceFingerprint, true -} - -// HasDeviceFingerprint returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDeviceFingerprint() bool { - if o != nil && !common.IsNil(o.DeviceFingerprint) { - return true - } - - return false -} - -// SetDeviceFingerprint gets a reference to the given string and assigns it to the DeviceFingerprint field. -func (o *PaymentDonationRequest) SetDeviceFingerprint(v string) { - o.DeviceFingerprint = &v -} - -// GetDonationAccount returns the DonationAccount field value -func (o *PaymentDonationRequest) GetDonationAccount() string { - if o == nil { - var ret string - return ret - } - - return o.DonationAccount -} - -// GetDonationAccountOk returns a tuple with the DonationAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDonationAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DonationAccount, true -} - -// SetDonationAccount sets field value -func (o *PaymentDonationRequest) SetDonationAccount(v string) { - o.DonationAccount = v -} - -// GetDonationOriginalPspReference returns the DonationOriginalPspReference field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDonationOriginalPspReference() string { - if o == nil || common.IsNil(o.DonationOriginalPspReference) { - var ret string - return ret - } - return *o.DonationOriginalPspReference -} - -// GetDonationOriginalPspReferenceOk returns a tuple with the DonationOriginalPspReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDonationOriginalPspReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.DonationOriginalPspReference) { - return nil, false - } - return o.DonationOriginalPspReference, true -} - -// HasDonationOriginalPspReference returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDonationOriginalPspReference() bool { - if o != nil && !common.IsNil(o.DonationOriginalPspReference) { - return true - } - - return false -} - -// SetDonationOriginalPspReference gets a reference to the given string and assigns it to the DonationOriginalPspReference field. -func (o *PaymentDonationRequest) SetDonationOriginalPspReference(v string) { - o.DonationOriginalPspReference = &v -} - -// GetDonationToken returns the DonationToken field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetDonationToken() string { - if o == nil || common.IsNil(o.DonationToken) { - var ret string - return ret - } - return *o.DonationToken -} - -// GetDonationTokenOk returns a tuple with the DonationToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetDonationTokenOk() (*string, bool) { - if o == nil || common.IsNil(o.DonationToken) { - return nil, false - } - return o.DonationToken, true -} - -// HasDonationToken returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasDonationToken() bool { - if o != nil && !common.IsNil(o.DonationToken) { - return true - } - - return false -} - -// SetDonationToken gets a reference to the given string and assigns it to the DonationToken field. -func (o *PaymentDonationRequest) SetDonationToken(v string) { - o.DonationToken = &v -} - -// GetEnableOneClick returns the EnableOneClick field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetEnableOneClick() bool { - if o == nil || common.IsNil(o.EnableOneClick) { - var ret bool - return ret - } - return *o.EnableOneClick -} - -// GetEnableOneClickOk returns a tuple with the EnableOneClick field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetEnableOneClickOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnableOneClick) { - return nil, false - } - return o.EnableOneClick, true -} - -// HasEnableOneClick returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasEnableOneClick() bool { - if o != nil && !common.IsNil(o.EnableOneClick) { - return true - } - - return false -} - -// SetEnableOneClick gets a reference to the given bool and assigns it to the EnableOneClick field. -func (o *PaymentDonationRequest) SetEnableOneClick(v bool) { - o.EnableOneClick = &v -} - -// GetEnablePayOut returns the EnablePayOut field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetEnablePayOut() bool { - if o == nil || common.IsNil(o.EnablePayOut) { - var ret bool - return ret - } - return *o.EnablePayOut -} - -// GetEnablePayOutOk returns a tuple with the EnablePayOut field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetEnablePayOutOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnablePayOut) { - return nil, false - } - return o.EnablePayOut, true -} - -// HasEnablePayOut returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasEnablePayOut() bool { - if o != nil && !common.IsNil(o.EnablePayOut) { - return true - } - - return false -} - -// SetEnablePayOut gets a reference to the given bool and assigns it to the EnablePayOut field. -func (o *PaymentDonationRequest) SetEnablePayOut(v bool) { - o.EnablePayOut = &v -} - -// GetEnableRecurring returns the EnableRecurring field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetEnableRecurring() bool { - if o == nil || common.IsNil(o.EnableRecurring) { - var ret bool - return ret - } - return *o.EnableRecurring -} - -// GetEnableRecurringOk returns a tuple with the EnableRecurring field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetEnableRecurringOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnableRecurring) { - return nil, false - } - return o.EnableRecurring, true -} - -// HasEnableRecurring returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasEnableRecurring() bool { - if o != nil && !common.IsNil(o.EnableRecurring) { - return true - } - - return false -} - -// SetEnableRecurring gets a reference to the given bool and assigns it to the EnableRecurring field. -func (o *PaymentDonationRequest) SetEnableRecurring(v bool) { - o.EnableRecurring = &v -} - -// GetEntityType returns the EntityType field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetEntityType() string { - if o == nil || common.IsNil(o.EntityType) { - var ret string - return ret - } - return *o.EntityType -} - -// GetEntityTypeOk returns a tuple with the EntityType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetEntityTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.EntityType) { - return nil, false - } - return o.EntityType, true -} - -// HasEntityType returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasEntityType() bool { - if o != nil && !common.IsNil(o.EntityType) { - return true - } - - return false -} - -// SetEntityType gets a reference to the given string and assigns it to the EntityType field. -func (o *PaymentDonationRequest) SetEntityType(v string) { - o.EntityType = &v -} - -// GetFraudOffset returns the FraudOffset field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetFraudOffset() int32 { - if o == nil || common.IsNil(o.FraudOffset) { - var ret int32 - return ret - } - return *o.FraudOffset -} - -// GetFraudOffsetOk returns a tuple with the FraudOffset field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetFraudOffsetOk() (*int32, bool) { - if o == nil || common.IsNil(o.FraudOffset) { - return nil, false - } - return o.FraudOffset, true -} - -// HasFraudOffset returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasFraudOffset() bool { - if o != nil && !common.IsNil(o.FraudOffset) { - return true - } - - return false -} - -// SetFraudOffset gets a reference to the given int32 and assigns it to the FraudOffset field. -func (o *PaymentDonationRequest) SetFraudOffset(v int32) { - o.FraudOffset = &v -} - -// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetIndustryUsage() string { - if o == nil || common.IsNil(o.IndustryUsage) { - var ret string - return ret - } - return *o.IndustryUsage -} - -// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetIndustryUsageOk() (*string, bool) { - if o == nil || common.IsNil(o.IndustryUsage) { - return nil, false - } - return o.IndustryUsage, true -} - -// HasIndustryUsage returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasIndustryUsage() bool { - if o != nil && !common.IsNil(o.IndustryUsage) { - return true - } - - return false -} - -// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. -func (o *PaymentDonationRequest) SetIndustryUsage(v string) { - o.IndustryUsage = &v -} - -// GetInstallments returns the Installments field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetInstallments() Installments { - if o == nil || common.IsNil(o.Installments) { - var ret Installments - return ret - } - return *o.Installments -} - -// GetInstallmentsOk returns a tuple with the Installments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetInstallmentsOk() (*Installments, bool) { - if o == nil || common.IsNil(o.Installments) { - return nil, false - } - return o.Installments, true -} - -// HasInstallments returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasInstallments() bool { - if o != nil && !common.IsNil(o.Installments) { - return true - } - - return false -} - -// SetInstallments gets a reference to the given Installments and assigns it to the Installments field. -func (o *PaymentDonationRequest) SetInstallments(v Installments) { - o.Installments = &v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *PaymentDonationRequest) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetLocalizedShopperStatement returns the LocalizedShopperStatement field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetLocalizedShopperStatement() map[string]string { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - var ret map[string]string - return ret - } - return *o.LocalizedShopperStatement -} - -// GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - return nil, false - } - return o.LocalizedShopperStatement, true -} - -// HasLocalizedShopperStatement returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasLocalizedShopperStatement() bool { - if o != nil && !common.IsNil(o.LocalizedShopperStatement) { - return true - } - - return false -} - -// SetLocalizedShopperStatement gets a reference to the given map[string]string and assigns it to the LocalizedShopperStatement field. -func (o *PaymentDonationRequest) SetLocalizedShopperStatement(v map[string]string) { - o.LocalizedShopperStatement = &v -} - -// GetMandate returns the Mandate field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetMandate() Mandate { - if o == nil || common.IsNil(o.Mandate) { - var ret Mandate - return ret - } - return *o.Mandate -} - -// GetMandateOk returns a tuple with the Mandate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMandateOk() (*Mandate, bool) { - if o == nil || common.IsNil(o.Mandate) { - return nil, false - } - return o.Mandate, true -} - -// HasMandate returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasMandate() bool { - if o != nil && !common.IsNil(o.Mandate) { - return true - } - - return false -} - -// SetMandate gets a reference to the given Mandate and assigns it to the Mandate field. -func (o *PaymentDonationRequest) SetMandate(v Mandate) { - o.Mandate = &v -} - -// GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) SetMcc(v string) { - o.Mcc = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentDonationRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentDonationRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetMerchantOrderReference() string { - if o == nil || common.IsNil(o.MerchantOrderReference) { - var ret string - return ret - } - return *o.MerchantOrderReference -} - -// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMerchantOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantOrderReference) { - return nil, false - } - return o.MerchantOrderReference, true -} - -// HasMerchantOrderReference returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasMerchantOrderReference() bool { - if o != nil && !common.IsNil(o.MerchantOrderReference) { - return true - } - - return false -} - -// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. -func (o *PaymentDonationRequest) SetMerchantOrderReference(v string) { - o.MerchantOrderReference = &v -} - -// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetMerchantRiskIndicator() MerchantRiskIndicator { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - var ret MerchantRiskIndicator - return ret - } - return *o.MerchantRiskIndicator -} - -// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator, bool) { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - return nil, false - } - return o.MerchantRiskIndicator, true -} - -// HasMerchantRiskIndicator returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasMerchantRiskIndicator() bool { - if o != nil && !common.IsNil(o.MerchantRiskIndicator) { - return true - } - - return false -} - -// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator and assigns it to the MerchantRiskIndicator field. -func (o *PaymentDonationRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator) { - o.MerchantRiskIndicator = &v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetMetadata() map[string]string { - if o == nil || common.IsNil(o.Metadata) { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMetadataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.Metadata) { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasMetadata() bool { - if o != nil && !common.IsNil(o.Metadata) { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *PaymentDonationRequest) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetMpiData returns the MpiData field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetMpiData() ThreeDSecureData { - if o == nil || common.IsNil(o.MpiData) { - var ret ThreeDSecureData - return ret - } - return *o.MpiData -} - -// GetMpiDataOk returns a tuple with the MpiData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetMpiDataOk() (*ThreeDSecureData, bool) { - if o == nil || common.IsNil(o.MpiData) { - return nil, false - } - return o.MpiData, true -} - -// HasMpiData returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasMpiData() bool { - if o != nil && !common.IsNil(o.MpiData) { - return true - } - - return false -} - -// SetMpiData gets a reference to the given ThreeDSecureData and assigns it to the MpiData field. -func (o *PaymentDonationRequest) SetMpiData(v ThreeDSecureData) { - o.MpiData = &v -} - -// GetOrder returns the Order field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetOrder() EncryptedOrderData { - if o == nil || common.IsNil(o.Order) { - var ret EncryptedOrderData - return ret - } - return *o.Order -} - -// GetOrderOk returns a tuple with the Order field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetOrderOk() (*EncryptedOrderData, bool) { - if o == nil || common.IsNil(o.Order) { - return nil, false - } - return o.Order, true -} - -// HasOrder returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasOrder() bool { - if o != nil && !common.IsNil(o.Order) { - return true - } - - return false -} - -// SetOrder gets a reference to the given EncryptedOrderData and assigns it to the Order field. -func (o *PaymentDonationRequest) SetOrder(v EncryptedOrderData) { - o.Order = &v -} - -// GetOrderReference returns the OrderReference field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetOrderReference() string { - if o == nil || common.IsNil(o.OrderReference) { - var ret string - return ret - } - return *o.OrderReference -} - -// GetOrderReferenceOk returns a tuple with the OrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.OrderReference) { - return nil, false - } - return o.OrderReference, true -} - -// HasOrderReference returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasOrderReference() bool { - if o != nil && !common.IsNil(o.OrderReference) { - return true - } - - return false -} - -// SetOrderReference gets a reference to the given string and assigns it to the OrderReference field. -func (o *PaymentDonationRequest) SetOrderReference(v string) { - o.OrderReference = &v -} - -// GetOrigin returns the Origin field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetOrigin() string { - if o == nil || common.IsNil(o.Origin) { - var ret string - return ret - } - return *o.Origin -} - -// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetOriginOk() (*string, bool) { - if o == nil || common.IsNil(o.Origin) { - return nil, false - } - return o.Origin, true -} - -// HasOrigin returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasOrigin() bool { - if o != nil && !common.IsNil(o.Origin) { - return true - } - - return false -} - -// SetOrigin gets a reference to the given string and assigns it to the Origin field. -func (o *PaymentDonationRequest) SetOrigin(v string) { - o.Origin = &v -} - -// GetPaymentMethod returns the PaymentMethod field value -func (o *PaymentDonationRequest) GetPaymentMethod() CheckoutPaymentMethod { - if o == nil { - var ret CheckoutPaymentMethod - return ret - } - - return o.PaymentMethod -} - -// GetPaymentMethodOk returns a tuple with the PaymentMethod field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetPaymentMethodOk() (*CheckoutPaymentMethod, bool) { - if o == nil { - return nil, false - } - return &o.PaymentMethod, true -} - -// SetPaymentMethod sets field value -func (o *PaymentDonationRequest) SetPaymentMethod(v CheckoutPaymentMethod) { - o.PaymentMethod = v -} - -// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { - if o == nil || common.IsNil(o.PlatformChargebackLogic) { - var ret PlatformChargebackLogic - return ret - } - return *o.PlatformChargebackLogic -} - -// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { - if o == nil || common.IsNil(o.PlatformChargebackLogic) { - return nil, false - } - return o.PlatformChargebackLogic, true -} - -// HasPlatformChargebackLogic returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasPlatformChargebackLogic() bool { - if o != nil && !common.IsNil(o.PlatformChargebackLogic) { - return true - } - - return false -} - -// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. -func (o *PaymentDonationRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { - o.PlatformChargebackLogic = &v -} - -// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRecurringExpiry() string { - if o == nil || common.IsNil(o.RecurringExpiry) { - var ret string - return ret - } - return *o.RecurringExpiry -} - -// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRecurringExpiryOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringExpiry) { - return nil, false - } - return o.RecurringExpiry, true -} - -// HasRecurringExpiry returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRecurringExpiry() bool { - if o != nil && !common.IsNil(o.RecurringExpiry) { - return true - } - - return false -} - -// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. -func (o *PaymentDonationRequest) SetRecurringExpiry(v string) { - o.RecurringExpiry = &v -} - -// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRecurringFrequency() string { - if o == nil || common.IsNil(o.RecurringFrequency) { - var ret string - return ret - } - return *o.RecurringFrequency -} - -// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRecurringFrequencyOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringFrequency) { - return nil, false - } - return o.RecurringFrequency, true -} - -// HasRecurringFrequency returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRecurringFrequency() bool { - if o != nil && !common.IsNil(o.RecurringFrequency) { - return true - } - - return false -} - -// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. -func (o *PaymentDonationRequest) SetRecurringFrequency(v string) { - o.RecurringFrequency = &v -} - -// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRecurringProcessingModel() string { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - var ret string - return ret - } - return *o.RecurringProcessingModel -} - -// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRecurringProcessingModelOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - return nil, false - } - return o.RecurringProcessingModel, true -} - -// HasRecurringProcessingModel returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRecurringProcessingModel() bool { - if o != nil && !common.IsNil(o.RecurringProcessingModel) { - return true - } - - return false -} - -// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. -func (o *PaymentDonationRequest) SetRecurringProcessingModel(v string) { - o.RecurringProcessingModel = &v -} - -// GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRedirectFromIssuerMethod() string { - if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { - var ret string - return ret - } - return *o.RedirectFromIssuerMethod -} - -// GetRedirectFromIssuerMethodOk returns a tuple with the RedirectFromIssuerMethod field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRedirectFromIssuerMethodOk() (*string, bool) { - if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { - return nil, false - } - return o.RedirectFromIssuerMethod, true -} - -// HasRedirectFromIssuerMethod returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRedirectFromIssuerMethod() bool { - if o != nil && !common.IsNil(o.RedirectFromIssuerMethod) { - return true - } - - return false -} - -// SetRedirectFromIssuerMethod gets a reference to the given string and assigns it to the RedirectFromIssuerMethod field. -func (o *PaymentDonationRequest) SetRedirectFromIssuerMethod(v string) { - o.RedirectFromIssuerMethod = &v -} - -// GetRedirectToIssuerMethod returns the RedirectToIssuerMethod field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRedirectToIssuerMethod() string { - if o == nil || common.IsNil(o.RedirectToIssuerMethod) { - var ret string - return ret - } - return *o.RedirectToIssuerMethod -} - -// GetRedirectToIssuerMethodOk returns a tuple with the RedirectToIssuerMethod field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRedirectToIssuerMethodOk() (*string, bool) { - if o == nil || common.IsNil(o.RedirectToIssuerMethod) { - return nil, false - } - return o.RedirectToIssuerMethod, true -} - -// HasRedirectToIssuerMethod returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRedirectToIssuerMethod() bool { - if o != nil && !common.IsNil(o.RedirectToIssuerMethod) { - return true - } - - return false -} - -// SetRedirectToIssuerMethod gets a reference to the given string and assigns it to the RedirectToIssuerMethod field. -func (o *PaymentDonationRequest) SetRedirectToIssuerMethod(v string) { - o.RedirectToIssuerMethod = &v -} - -// GetReference returns the Reference field value -func (o *PaymentDonationRequest) GetReference() string { - if o == nil { - var ret string - return ret - } - - return o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Reference, true -} - -// SetReference sets field value -func (o *PaymentDonationRequest) SetReference(v string) { - o.Reference = v -} - -// GetReturnUrl returns the ReturnUrl field value -func (o *PaymentDonationRequest) GetReturnUrl() string { - if o == nil { - var ret string - return ret - } - - return o.ReturnUrl -} - -// GetReturnUrlOk returns a tuple with the ReturnUrl field value -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetReturnUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ReturnUrl, true -} - -// SetReturnUrl sets field value -func (o *PaymentDonationRequest) SetReturnUrl(v string) { - o.ReturnUrl = v -} - -// GetRiskData returns the RiskData field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetRiskData() RiskData { - if o == nil || common.IsNil(o.RiskData) { - var ret RiskData - return ret - } - return *o.RiskData -} - -// GetRiskDataOk returns a tuple with the RiskData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetRiskDataOk() (*RiskData, bool) { - if o == nil || common.IsNil(o.RiskData) { - return nil, false - } - return o.RiskData, true -} - -// HasRiskData returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasRiskData() bool { - if o != nil && !common.IsNil(o.RiskData) { - return true - } - - return false -} - -// SetRiskData gets a reference to the given RiskData and assigns it to the RiskData field. -func (o *PaymentDonationRequest) SetRiskData(v RiskData) { - o.RiskData = &v -} - -// GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetSessionValidity() string { - if o == nil || common.IsNil(o.SessionValidity) { - var ret string - return ret - } - return *o.SessionValidity -} - -// GetSessionValidityOk returns a tuple with the SessionValidity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetSessionValidityOk() (*string, bool) { - if o == nil || common.IsNil(o.SessionValidity) { - return nil, false - } - return o.SessionValidity, true -} - -// HasSessionValidity returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasSessionValidity() bool { - if o != nil && !common.IsNil(o.SessionValidity) { - return true - } - - return false -} - -// SetSessionValidity gets a reference to the given string and assigns it to the SessionValidity field. -func (o *PaymentDonationRequest) SetSessionValidity(v string) { - o.SessionValidity = &v -} - -// GetShopperEmail returns the ShopperEmail field value if set, zero value otherwise. -func (o *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) SetShopperEmail(v string) { - o.ShopperEmail = &v -} - -// GetShopperIP returns the ShopperIP field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperIP() string { - if o == nil || common.IsNil(o.ShopperIP) { - var ret string - return ret - } - return *o.ShopperIP -} - -// GetShopperIPOk returns a tuple with the ShopperIP field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperIPOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperIP) { - return nil, false - } - return o.ShopperIP, true -} - -// HasShopperIP returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperIP() bool { - if o != nil && !common.IsNil(o.ShopperIP) { - return true - } - - return false -} - -// SetShopperIP gets a reference to the given string and assigns it to the ShopperIP field. -func (o *PaymentDonationRequest) SetShopperIP(v string) { - o.ShopperIP = &v -} - -// GetShopperInteraction returns the ShopperInteraction field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperInteraction() string { - if o == nil || common.IsNil(o.ShopperInteraction) { - var ret string - return ret - } - return *o.ShopperInteraction -} - -// GetShopperInteractionOk returns a tuple with the ShopperInteraction field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperInteractionOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperInteraction) { - return nil, false - } - return o.ShopperInteraction, true -} - -// HasShopperInteraction returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperInteraction() bool { - if o != nil && !common.IsNil(o.ShopperInteraction) { - return true - } - - return false -} - -// SetShopperInteraction gets a reference to the given string and assigns it to the ShopperInteraction field. -func (o *PaymentDonationRequest) SetShopperInteraction(v string) { - o.ShopperInteraction = &v -} - -// GetShopperLocale returns the ShopperLocale field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperLocale() string { - if o == nil || common.IsNil(o.ShopperLocale) { - var ret string - return ret - } - return *o.ShopperLocale -} - -// GetShopperLocaleOk returns a tuple with the ShopperLocale field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperLocaleOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperLocale) { - return nil, false - } - return o.ShopperLocale, true -} - -// HasShopperLocale returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperLocale() bool { - if o != nil && !common.IsNil(o.ShopperLocale) { - return true - } - - return false -} - -// SetShopperLocale gets a reference to the given string and assigns it to the ShopperLocale field. -func (o *PaymentDonationRequest) SetShopperLocale(v string) { - o.ShopperLocale = &v -} - -// GetShopperName returns the ShopperName field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperName() Name { - if o == nil || common.IsNil(o.ShopperName) { - var ret Name - return ret - } - return *o.ShopperName -} - -// GetShopperNameOk returns a tuple with the ShopperName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperNameOk() (*Name, bool) { - if o == nil || common.IsNil(o.ShopperName) { - return nil, false - } - return o.ShopperName, true -} - -// HasShopperName returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperName() bool { - if o != nil && !common.IsNil(o.ShopperName) { - return true - } - - return false -} - -// SetShopperName gets a reference to the given Name and assigns it to the ShopperName field. -func (o *PaymentDonationRequest) SetShopperName(v Name) { - o.ShopperName = &v -} - -// GetShopperReference returns the ShopperReference field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperReference() string { - if o == nil || common.IsNil(o.ShopperReference) { - var ret string - return ret - } - return *o.ShopperReference -} - -// GetShopperReferenceOk returns a tuple with the ShopperReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperReference) { - return nil, false - } - return o.ShopperReference, true -} - -// HasShopperReference returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperReference() bool { - if o != nil && !common.IsNil(o.ShopperReference) { - return true - } - - return false -} - -// SetShopperReference gets a reference to the given string and assigns it to the ShopperReference field. -func (o *PaymentDonationRequest) SetShopperReference(v string) { - o.ShopperReference = &v -} - -// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetShopperStatement() string { - if o == nil || common.IsNil(o.ShopperStatement) { - var ret string - return ret - } - return *o.ShopperStatement -} - -// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetShopperStatementOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperStatement) { - return nil, false - } - return o.ShopperStatement, true -} - -// HasShopperStatement returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasShopperStatement() bool { - if o != nil && !common.IsNil(o.ShopperStatement) { - return true - } - - return false -} - -// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. -func (o *PaymentDonationRequest) SetShopperStatement(v string) { - o.ShopperStatement = &v -} - -// GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetSocialSecurityNumber() string { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - var ret string - return ret - } - return *o.SocialSecurityNumber -} - -// GetSocialSecurityNumberOk returns a tuple with the SocialSecurityNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetSocialSecurityNumberOk() (*string, bool) { - if o == nil || common.IsNil(o.SocialSecurityNumber) { - return nil, false - } - return o.SocialSecurityNumber, true -} - -// HasSocialSecurityNumber returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasSocialSecurityNumber() bool { - if o != nil && !common.IsNil(o.SocialSecurityNumber) { - return true - } - - return false -} - -// SetSocialSecurityNumber gets a reference to the given string and assigns it to the SocialSecurityNumber field. -func (o *PaymentDonationRequest) SetSocialSecurityNumber(v string) { - o.SocialSecurityNumber = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *PaymentDonationRequest) SetSplits(v []Split) { - o.Splits = v -} - -// GetStore returns the Store field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetStore() string { - if o == nil || common.IsNil(o.Store) { - var ret string - return ret - } - return *o.Store -} - -// GetStoreOk returns a tuple with the Store field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetStoreOk() (*string, bool) { - if o == nil || common.IsNil(o.Store) { - return nil, false - } - return o.Store, true -} - -// HasStore returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasStore() bool { - if o != nil && !common.IsNil(o.Store) { - return true - } - - return false -} - -// SetStore gets a reference to the given string and assigns it to the Store field. -func (o *PaymentDonationRequest) SetStore(v string) { - o.Store = &v -} - -// GetStorePaymentMethod returns the StorePaymentMethod field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetStorePaymentMethod() bool { - if o == nil || common.IsNil(o.StorePaymentMethod) { - var ret bool - return ret - } - return *o.StorePaymentMethod -} - -// GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetStorePaymentMethodOk() (*bool, bool) { - if o == nil || common.IsNil(o.StorePaymentMethod) { - return nil, false - } - return o.StorePaymentMethod, true -} - -// HasStorePaymentMethod returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasStorePaymentMethod() bool { - if o != nil && !common.IsNil(o.StorePaymentMethod) { - return true - } - - return false -} - -// SetStorePaymentMethod gets a reference to the given bool and assigns it to the StorePaymentMethod field. -func (o *PaymentDonationRequest) SetStorePaymentMethod(v bool) { - o.StorePaymentMethod = &v -} - -// GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. -func (o *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) 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 *PaymentDonationRequest) SetTelephoneNumber(v string) { - o.TelephoneNumber = &v -} - -// GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetThreeDS2RequestData() ThreeDS2RequestData { - if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData - return ret - } - return *o.ThreeDS2RequestData -} - -// GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData, bool) { - if o == nil || common.IsNil(o.ThreeDS2RequestData) { - return nil, false - } - return o.ThreeDS2RequestData, true -} - -// HasThreeDS2RequestData returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasThreeDS2RequestData() bool { - if o != nil && !common.IsNil(o.ThreeDS2RequestData) { - return true - } - - return false -} - -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData and assigns it to the ThreeDS2RequestData field. -func (o *PaymentDonationRequest) SetThreeDS2RequestData(v ThreeDS2RequestData) { - o.ThreeDS2RequestData = &v -} - -// GetThreeDSAuthenticationOnly returns the ThreeDSAuthenticationOnly field value if set, zero value otherwise. -// Deprecated -func (o *PaymentDonationRequest) GetThreeDSAuthenticationOnly() bool { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - var ret bool - return ret - } - return *o.ThreeDSAuthenticationOnly -} - -// GetThreeDSAuthenticationOnlyOk returns a tuple with the ThreeDSAuthenticationOnly field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *PaymentDonationRequest) GetThreeDSAuthenticationOnlyOk() (*bool, bool) { - if o == nil || common.IsNil(o.ThreeDSAuthenticationOnly) { - return nil, false - } - return o.ThreeDSAuthenticationOnly, true -} - -// HasThreeDSAuthenticationOnly returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasThreeDSAuthenticationOnly() bool { - if o != nil && !common.IsNil(o.ThreeDSAuthenticationOnly) { - return true - } - - return false -} - -// SetThreeDSAuthenticationOnly gets a reference to the given bool and assigns it to the ThreeDSAuthenticationOnly field. -// Deprecated -func (o *PaymentDonationRequest) SetThreeDSAuthenticationOnly(v bool) { - o.ThreeDSAuthenticationOnly = &v -} - -// GetTrustedShopper returns the TrustedShopper field value if set, zero value otherwise. -func (o *PaymentDonationRequest) GetTrustedShopper() bool { - if o == nil || common.IsNil(o.TrustedShopper) { - var ret bool - return ret - } - return *o.TrustedShopper -} - -// GetTrustedShopperOk returns a tuple with the TrustedShopper field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentDonationRequest) GetTrustedShopperOk() (*bool, bool) { - if o == nil || common.IsNil(o.TrustedShopper) { - return nil, false - } - return o.TrustedShopper, true -} - -// HasTrustedShopper returns a boolean if a field has been set. -func (o *PaymentDonationRequest) HasTrustedShopper() bool { - if o != nil && !common.IsNil(o.TrustedShopper) { - return true - } - - return false -} - -// SetTrustedShopper gets a reference to the given bool and assigns it to the TrustedShopper field. -func (o *PaymentDonationRequest) SetTrustedShopper(v bool) { - o.TrustedShopper = &v -} - -func (o PaymentDonationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentDonationRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.AccountInfo) { - toSerialize["accountInfo"] = o.AccountInfo - } - if !common.IsNil(o.AdditionalAmount) { - toSerialize["additionalAmount"] = o.AdditionalAmount - } - if !common.IsNil(o.AdditionalData) { - toSerialize["additionalData"] = o.AdditionalData - } - toSerialize["amount"] = o.Amount - if !common.IsNil(o.ApplicationInfo) { - toSerialize["applicationInfo"] = o.ApplicationInfo - } - if !common.IsNil(o.AuthenticationData) { - toSerialize["authenticationData"] = o.AuthenticationData - } - if !common.IsNil(o.BillingAddress) { - toSerialize["billingAddress"] = o.BillingAddress - } - if !common.IsNil(o.BrowserInfo) { - toSerialize["browserInfo"] = o.BrowserInfo - } - if !common.IsNil(o.CaptureDelayHours) { - toSerialize["captureDelayHours"] = o.CaptureDelayHours - } - if !common.IsNil(o.Channel) { - toSerialize["channel"] = o.Channel - } - if !common.IsNil(o.CheckoutAttemptId) { - toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId - } - if !common.IsNil(o.Company) { - toSerialize["company"] = o.Company - } - if !common.IsNil(o.ConversionId) { - toSerialize["conversionId"] = o.ConversionId - } - if !common.IsNil(o.CountryCode) { - toSerialize["countryCode"] = o.CountryCode - } - if !common.IsNil(o.DateOfBirth) { - toSerialize["dateOfBirth"] = o.DateOfBirth - } - if !common.IsNil(o.DccQuote) { - toSerialize["dccQuote"] = o.DccQuote - } - if !common.IsNil(o.DeliveryAddress) { - toSerialize["deliveryAddress"] = o.DeliveryAddress - } - if !common.IsNil(o.DeliveryDate) { - toSerialize["deliveryDate"] = o.DeliveryDate - } - if !common.IsNil(o.DeviceFingerprint) { - toSerialize["deviceFingerprint"] = o.DeviceFingerprint - } - toSerialize["donationAccount"] = o.DonationAccount - if !common.IsNil(o.DonationOriginalPspReference) { - toSerialize["donationOriginalPspReference"] = o.DonationOriginalPspReference - } - if !common.IsNil(o.DonationToken) { - toSerialize["donationToken"] = o.DonationToken - } - if !common.IsNil(o.EnableOneClick) { - toSerialize["enableOneClick"] = o.EnableOneClick - } - if !common.IsNil(o.EnablePayOut) { - toSerialize["enablePayOut"] = o.EnablePayOut - } - if !common.IsNil(o.EnableRecurring) { - toSerialize["enableRecurring"] = o.EnableRecurring - } - if !common.IsNil(o.EntityType) { - toSerialize["entityType"] = o.EntityType - } - if !common.IsNil(o.FraudOffset) { - toSerialize["fraudOffset"] = o.FraudOffset - } - if !common.IsNil(o.IndustryUsage) { - toSerialize["industryUsage"] = o.IndustryUsage - } - if !common.IsNil(o.Installments) { - toSerialize["installments"] = o.Installments - } - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - if !common.IsNil(o.LocalizedShopperStatement) { - toSerialize["localizedShopperStatement"] = o.LocalizedShopperStatement - } - if !common.IsNil(o.Mandate) { - toSerialize["mandate"] = o.Mandate - } - if !common.IsNil(o.Mcc) { - toSerialize["mcc"] = o.Mcc - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantOrderReference) { - toSerialize["merchantOrderReference"] = o.MerchantOrderReference - } - if !common.IsNil(o.MerchantRiskIndicator) { - toSerialize["merchantRiskIndicator"] = o.MerchantRiskIndicator - } - if !common.IsNil(o.Metadata) { - toSerialize["metadata"] = o.Metadata - } - if !common.IsNil(o.MpiData) { - toSerialize["mpiData"] = o.MpiData - } - if !common.IsNil(o.Order) { - toSerialize["order"] = o.Order - } - if !common.IsNil(o.OrderReference) { - toSerialize["orderReference"] = o.OrderReference - } - if !common.IsNil(o.Origin) { - toSerialize["origin"] = o.Origin - } - toSerialize["paymentMethod"] = o.PaymentMethod - if !common.IsNil(o.PlatformChargebackLogic) { - toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic - } - if !common.IsNil(o.RecurringExpiry) { - toSerialize["recurringExpiry"] = o.RecurringExpiry - } - if !common.IsNil(o.RecurringFrequency) { - toSerialize["recurringFrequency"] = o.RecurringFrequency - } - if !common.IsNil(o.RecurringProcessingModel) { - toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel - } - if !common.IsNil(o.RedirectFromIssuerMethod) { - toSerialize["redirectFromIssuerMethod"] = o.RedirectFromIssuerMethod - } - if !common.IsNil(o.RedirectToIssuerMethod) { - toSerialize["redirectToIssuerMethod"] = o.RedirectToIssuerMethod - } - toSerialize["reference"] = o.Reference - toSerialize["returnUrl"] = o.ReturnUrl - if !common.IsNil(o.RiskData) { - toSerialize["riskData"] = o.RiskData - } - if !common.IsNil(o.SessionValidity) { - toSerialize["sessionValidity"] = o.SessionValidity - } - if !common.IsNil(o.ShopperEmail) { - toSerialize["shopperEmail"] = o.ShopperEmail - } - if !common.IsNil(o.ShopperIP) { - toSerialize["shopperIP"] = o.ShopperIP - } - if !common.IsNil(o.ShopperInteraction) { - toSerialize["shopperInteraction"] = o.ShopperInteraction - } - if !common.IsNil(o.ShopperLocale) { - toSerialize["shopperLocale"] = o.ShopperLocale - } - if !common.IsNil(o.ShopperName) { - toSerialize["shopperName"] = o.ShopperName - } - if !common.IsNil(o.ShopperReference) { - toSerialize["shopperReference"] = o.ShopperReference - } - if !common.IsNil(o.ShopperStatement) { - toSerialize["shopperStatement"] = o.ShopperStatement - } - if !common.IsNil(o.SocialSecurityNumber) { - toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - if !common.IsNil(o.Store) { - toSerialize["store"] = o.Store - } - if !common.IsNil(o.StorePaymentMethod) { - toSerialize["storePaymentMethod"] = o.StorePaymentMethod - } - if !common.IsNil(o.TelephoneNumber) { - toSerialize["telephoneNumber"] = o.TelephoneNumber - } - if !common.IsNil(o.ThreeDS2RequestData) { - toSerialize["threeDS2RequestData"] = o.ThreeDS2RequestData - } - if !common.IsNil(o.ThreeDSAuthenticationOnly) { - toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly - } - if !common.IsNil(o.TrustedShopper) { - toSerialize["trustedShopper"] = o.TrustedShopper - } - return toSerialize, nil -} - -type NullablePaymentDonationRequest struct { - value *PaymentDonationRequest - isSet bool -} - -func (v NullablePaymentDonationRequest) Get() *PaymentDonationRequest { - return v.value -} - -func (v *NullablePaymentDonationRequest) Set(val *PaymentDonationRequest) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentDonationRequest) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentDonationRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentDonationRequest(val *PaymentDonationRequest) *NullablePaymentDonationRequest { - return &NullablePaymentDonationRequest{value: val, isSet: true} -} - -func (v NullablePaymentDonationRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentDonationRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentDonationRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false -} -func (o *PaymentDonationRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false -} -func (o *PaymentDonationRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false -} -func (o *PaymentDonationRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false -} -func (o *PaymentDonationRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_link_response.go b/src/checkout/model_payment_link_response.go index 4881565a1..f947f87b9 100644 --- a/src/checkout/model_payment_link_response.go +++ b/src/checkout/model_payment_link_response.go @@ -38,7 +38,7 @@ type PaymentLinkResponse struct { DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. ExpiresAt *string `json:"expiresAt,omitempty"` // A unique identifier of the payment link. Id string `json:"id"` @@ -56,7 +56,7 @@ type PaymentLinkResponse struct { MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // A reference that is used to uniquely identify the payment in future communications about the payment status. Reference string `json:"reference"` @@ -82,13 +82,13 @@ type PaymentLinkResponse struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` // Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. Status string `json:"status"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` - // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + // Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. StorePaymentMethodMode *string `json:"storePaymentMethodMode,omitempty"` // The shopper's telephone number. TelephoneNumber *string `json:"telephoneNumber,omitempty"` diff --git a/src/checkout/model_payment_methods_request.go b/src/checkout/model_payment_methods_request.go index 13fefd243..0a9db2091 100644 --- a/src/checkout/model_payment_methods_request.go +++ b/src/checkout/model_payment_methods_request.go @@ -39,7 +39,7 @@ type PaymentMethodsRequest struct { ShopperReference *string `json:"shopperReference,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. SplitCardFundingSources *bool `json:"splitCardFundingSources,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` } diff --git a/src/checkout/model_payment_refund_resource.go b/src/checkout/model_payment_refund_resource.go deleted file mode 100644 index 5142f32f4..000000000 --- a/src/checkout/model_payment_refund_resource.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentRefundResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentRefundResource{} - -// PaymentRefundResource struct for PaymentRefundResource -type PaymentRefundResource struct { - Amount Amount `json:"amount"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - LineItems []LineItem `json:"lineItems,omitempty"` - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // Your reason for the refund request. - MerchantRefundReason *string `json:"merchantRefundReason,omitempty"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. - PaymentPspReference string `json:"paymentPspReference"` - // Adyen's 16-character reference associated with the refund request. - PspReference string `json:"pspReference"` - // Your reference for the refund request. - Reference *string `json:"reference,omitempty"` - // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). - Splits []Split `json:"splits,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewPaymentRefundResource instantiates a new PaymentRefundResource 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 NewPaymentRefundResource(amount Amount, merchantAccount string, paymentPspReference string, pspReference string, status string) *PaymentRefundResource { - this := PaymentRefundResource{} - this.Amount = amount - this.MerchantAccount = merchantAccount - this.PaymentPspReference = paymentPspReference - this.PspReference = pspReference - this.Status = status - return &this -} - -// NewPaymentRefundResourceWithDefaults instantiates a new PaymentRefundResource 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 NewPaymentRefundResourceWithDefaults() *PaymentRefundResource { - this := PaymentRefundResource{} - return &this -} - -// GetAmount returns the Amount field value -func (o *PaymentRefundResource) GetAmount() Amount { - if o == nil { - var ret Amount - return ret - } - - return o.Amount -} - -// GetAmountOk returns a tuple with the Amount field value -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetAmountOk() (*Amount, bool) { - if o == nil { - return nil, false - } - return &o.Amount, true -} - -// SetAmount sets field value -func (o *PaymentRefundResource) SetAmount(v Amount) { - o.Amount = v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *PaymentRefundResource) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *PaymentRefundResource) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *PaymentRefundResource) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentRefundResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentRefundResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantRefundReason returns the MerchantRefundReason field value if set, zero value otherwise. -func (o *PaymentRefundResource) GetMerchantRefundReason() string { - if o == nil || common.IsNil(o.MerchantRefundReason) { - var ret string - return ret - } - return *o.MerchantRefundReason -} - -// GetMerchantRefundReasonOk returns a tuple with the MerchantRefundReason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetMerchantRefundReasonOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantRefundReason) { - return nil, false - } - return o.MerchantRefundReason, true -} - -// HasMerchantRefundReason returns a boolean if a field has been set. -func (o *PaymentRefundResource) HasMerchantRefundReason() bool { - if o != nil && !common.IsNil(o.MerchantRefundReason) { - return true - } - - return false -} - -// SetMerchantRefundReason gets a reference to the given string and assigns it to the MerchantRefundReason field. -func (o *PaymentRefundResource) SetMerchantRefundReason(v string) { - o.MerchantRefundReason = &v -} - -// GetPaymentPspReference returns the PaymentPspReference field value -func (o *PaymentRefundResource) GetPaymentPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentPspReference -} - -// GetPaymentPspReferenceOk returns a tuple with the PaymentPspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetPaymentPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentPspReference, true -} - -// SetPaymentPspReference sets field value -func (o *PaymentRefundResource) SetPaymentPspReference(v string) { - o.PaymentPspReference = v -} - -// GetPspReference returns the PspReference field value -func (o *PaymentRefundResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *PaymentRefundResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *PaymentRefundResource) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *PaymentRefundResource) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *PaymentRefundResource) SetReference(v string) { - o.Reference = &v -} - -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *PaymentRefundResource) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *PaymentRefundResource) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *PaymentRefundResource) SetSplits(v []Split) { - o.Splits = v -} - -// GetStatus returns the Status field value -func (o *PaymentRefundResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *PaymentRefundResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *PaymentRefundResource) SetStatus(v string) { - o.Status = v -} - -func (o PaymentRefundResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentRefundResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["amount"] = o.Amount - if !common.IsNil(o.LineItems) { - toSerialize["lineItems"] = o.LineItems - } - toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantRefundReason) { - toSerialize["merchantRefundReason"] = o.MerchantRefundReason - } - toSerialize["paymentPspReference"] = o.PaymentPspReference - toSerialize["pspReference"] = o.PspReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullablePaymentRefundResource struct { - value *PaymentRefundResource - isSet bool -} - -func (v NullablePaymentRefundResource) Get() *PaymentRefundResource { - return v.value -} - -func (v *NullablePaymentRefundResource) Set(val *PaymentRefundResource) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentRefundResource) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentRefundResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentRefundResource(val *PaymentRefundResource) *NullablePaymentRefundResource { - return &NullablePaymentRefundResource{value: val, isSet: true} -} - -func (v NullablePaymentRefundResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentRefundResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentRefundResource) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false -} -func (o *PaymentRefundResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index eeccf097a..f6157c2b0 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -27,7 +27,7 @@ type PaymentRequest struct { Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` @@ -42,10 +42,13 @@ type PaymentRequest struct { // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` + // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + // Deprecated DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` @@ -58,13 +61,15 @@ type PaymentRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` Installments *Installments `json:"installments,omitempty"` - // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. @@ -116,15 +121,15 @@ type PaymentRequest struct { ShopperStatement *string `json:"shopperStatement,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When true and `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -343,9 +348,9 @@ func (o *PaymentRequest) SetAuthenticationData(v AuthenticationData) { } // GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. -func (o *PaymentRequest) GetBillingAddress() Address { +func (o *PaymentRequest) GetBillingAddress() BillingAddress { if o == nil || common.IsNil(o.BillingAddress) { - var ret Address + var ret BillingAddress return ret } return *o.BillingAddress @@ -353,7 +358,7 @@ func (o *PaymentRequest) GetBillingAddress() Address { // GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetBillingAddressOk() (*Address, bool) { +func (o *PaymentRequest) GetBillingAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.BillingAddress) { return nil, false } @@ -369,8 +374,8 @@ func (o *PaymentRequest) HasBillingAddress() bool { return false } -// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. -func (o *PaymentRequest) SetBillingAddress(v Address) { +// SetBillingAddress gets a reference to the given BillingAddress and assigns it to the BillingAddress field. +func (o *PaymentRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } @@ -602,9 +607,9 @@ func (o *PaymentRequest) SetCountryCode(v string) { } // GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. -func (o *PaymentRequest) GetDateOfBirth() string { +func (o *PaymentRequest) GetDateOfBirth() time.Time { if o == nil || common.IsNil(o.DateOfBirth) { - var ret string + var ret time.Time return ret } return *o.DateOfBirth @@ -612,7 +617,7 @@ func (o *PaymentRequest) GetDateOfBirth() string { // GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetDateOfBirthOk() (*string, bool) { +func (o *PaymentRequest) GetDateOfBirthOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DateOfBirth) { return nil, false } @@ -628,8 +633,8 @@ func (o *PaymentRequest) HasDateOfBirth() bool { return false } -// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. -func (o *PaymentRequest) SetDateOfBirth(v string) { +// SetDateOfBirth gets a reference to the given time.Time and assigns it to the DateOfBirth field. +func (o *PaymentRequest) SetDateOfBirth(v time.Time) { o.DateOfBirth = &v } @@ -665,10 +670,42 @@ func (o *PaymentRequest) SetDccQuote(v ForexQuote) { o.DccQuote = &v } +// GetDeliverAt returns the DeliverAt field value if set, zero value otherwise. +func (o *PaymentRequest) GetDeliverAt() time.Time { + if o == nil || common.IsNil(o.DeliverAt) { + var ret time.Time + return ret + } + return *o.DeliverAt +} + +// GetDeliverAtOk returns a tuple with the DeliverAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetDeliverAtOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.DeliverAt) { + return nil, false + } + return o.DeliverAt, true +} + +// HasDeliverAt returns a boolean if a field has been set. +func (o *PaymentRequest) HasDeliverAt() bool { + if o != nil && !common.IsNil(o.DeliverAt) { + return true + } + + return false +} + +// SetDeliverAt gets a reference to the given time.Time and assigns it to the DeliverAt field. +func (o *PaymentRequest) SetDeliverAt(v time.Time) { + o.DeliverAt = &v +} + // GetDeliveryAddress returns the DeliveryAddress field value if set, zero value otherwise. -func (o *PaymentRequest) GetDeliveryAddress() Address { +func (o *PaymentRequest) GetDeliveryAddress() DeliveryAddress { if o == nil || common.IsNil(o.DeliveryAddress) { - var ret Address + var ret DeliveryAddress return ret } return *o.DeliveryAddress @@ -676,7 +713,7 @@ func (o *PaymentRequest) GetDeliveryAddress() Address { // GetDeliveryAddressOk returns a tuple with the DeliveryAddress field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetDeliveryAddressOk() (*Address, bool) { +func (o *PaymentRequest) GetDeliveryAddressOk() (*DeliveryAddress, bool) { if o == nil || common.IsNil(o.DeliveryAddress) { return nil, false } @@ -692,12 +729,13 @@ func (o *PaymentRequest) HasDeliveryAddress() bool { return false } -// SetDeliveryAddress gets a reference to the given Address and assigns it to the DeliveryAddress field. -func (o *PaymentRequest) SetDeliveryAddress(v Address) { +// SetDeliveryAddress gets a reference to the given DeliveryAddress and assigns it to the DeliveryAddress field. +func (o *PaymentRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } // GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. +// Deprecated func (o *PaymentRequest) GetDeliveryDate() time.Time { if o == nil || common.IsNil(o.DeliveryDate) { var ret time.Time @@ -708,6 +746,7 @@ func (o *PaymentRequest) GetDeliveryDate() time.Time { // GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *PaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { if o == nil || common.IsNil(o.DeliveryDate) { return nil, false @@ -725,6 +764,7 @@ func (o *PaymentRequest) HasDeliveryDate() bool { } // SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. +// Deprecated func (o *PaymentRequest) SetDeliveryDate(v time.Time) { o.DeliveryDate = &v } @@ -921,6 +961,70 @@ func (o *PaymentRequest) SetFraudOffset(v int32) { o.FraudOffset = &v } +// GetFundOrigin returns the FundOrigin field value if set, zero value otherwise. +func (o *PaymentRequest) GetFundOrigin() FundOrigin { + if o == nil || common.IsNil(o.FundOrigin) { + var ret FundOrigin + return ret + } + return *o.FundOrigin +} + +// GetFundOriginOk returns a tuple with the FundOrigin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetFundOriginOk() (*FundOrigin, bool) { + if o == nil || common.IsNil(o.FundOrigin) { + return nil, false + } + return o.FundOrigin, true +} + +// HasFundOrigin returns a boolean if a field has been set. +func (o *PaymentRequest) HasFundOrigin() bool { + if o != nil && !common.IsNil(o.FundOrigin) { + return true + } + + return false +} + +// SetFundOrigin gets a reference to the given FundOrigin and assigns it to the FundOrigin field. +func (o *PaymentRequest) SetFundOrigin(v FundOrigin) { + o.FundOrigin = &v +} + +// GetFundRecipient returns the FundRecipient field value if set, zero value otherwise. +func (o *PaymentRequest) GetFundRecipient() FundRecipient { + if o == nil || common.IsNil(o.FundRecipient) { + var ret FundRecipient + return ret + } + return *o.FundRecipient +} + +// GetFundRecipientOk returns a tuple with the FundRecipient field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetFundRecipientOk() (*FundRecipient, bool) { + if o == nil || common.IsNil(o.FundRecipient) { + return nil, false + } + return o.FundRecipient, true +} + +// HasFundRecipient returns a boolean if a field has been set. +func (o *PaymentRequest) HasFundRecipient() bool { + if o != nil && !common.IsNil(o.FundRecipient) { + return true + } + + return false +} + +// SetFundRecipient gets a reference to the given FundRecipient and assigns it to the FundRecipient field. +func (o *PaymentRequest) SetFundRecipient(v FundRecipient) { + o.FundRecipient = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *PaymentRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -2074,9 +2178,9 @@ func (o *PaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData { +func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData + var ret ThreeDS2RequestData2 return ret } return *o.ThreeDS2RequestData @@ -2084,7 +2188,7 @@ func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData { // GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData, bool) { +func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2100,8 +2204,8 @@ func (o *PaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData and assigns it to the ThreeDS2RequestData field. -func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. +func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { o.ThreeDS2RequestData = &v } @@ -2228,6 +2332,9 @@ func (o PaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DccQuote) { toSerialize["dccQuote"] = o.DccQuote } + if !common.IsNil(o.DeliverAt) { + toSerialize["deliverAt"] = o.DeliverAt + } if !common.IsNil(o.DeliveryAddress) { toSerialize["deliveryAddress"] = o.DeliveryAddress } @@ -2252,6 +2359,12 @@ func (o PaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.FraudOffset) { toSerialize["fraudOffset"] = o.FraudOffset } + if !common.IsNil(o.FundOrigin) { + toSerialize["fundOrigin"] = o.FundOrigin + } + if !common.IsNil(o.FundRecipient) { + toSerialize["fundRecipient"] = o.FundRecipient + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } diff --git a/src/checkout/model_payment_response.go b/src/checkout/model_payment_response.go index 5931f90a1..a17eec40a 100644 --- a/src/checkout/model_payment_response.go +++ b/src/checkout/model_payment_response.go @@ -36,7 +36,7 @@ type PaymentResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` - // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` @@ -636,7 +636,7 @@ func (v *NullablePaymentResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_payment_response_action.go b/src/checkout/model_payment_response_action.go index 8f3f16605..be125e42c 100644 --- a/src/checkout/model_payment_response_action.go +++ b/src/checkout/model_payment_response_action.go @@ -15,13 +15,14 @@ import ( // PaymentResponseAction - Action to be taken for completing the payment. type PaymentResponseAction struct { - CheckoutAwaitAction *CheckoutAwaitAction - CheckoutNativeRedirectAction *CheckoutNativeRedirectAction - CheckoutQrCodeAction *CheckoutQrCodeAction - CheckoutRedirectAction *CheckoutRedirectAction - CheckoutSDKAction *CheckoutSDKAction - CheckoutThreeDS2Action *CheckoutThreeDS2Action - CheckoutVoucherAction *CheckoutVoucherAction + CheckoutAwaitAction *CheckoutAwaitAction + CheckoutDelegatedAuthenticationAction *CheckoutDelegatedAuthenticationAction + CheckoutNativeRedirectAction *CheckoutNativeRedirectAction + CheckoutQrCodeAction *CheckoutQrCodeAction + CheckoutRedirectAction *CheckoutRedirectAction + CheckoutSDKAction *CheckoutSDKAction + CheckoutThreeDS2Action *CheckoutThreeDS2Action + CheckoutVoucherAction *CheckoutVoucherAction } // CheckoutAwaitActionAsPaymentResponseAction is a convenience function that returns CheckoutAwaitAction wrapped in PaymentResponseAction @@ -31,6 +32,13 @@ func CheckoutAwaitActionAsPaymentResponseAction(v *CheckoutAwaitAction) PaymentR } } +// CheckoutDelegatedAuthenticationActionAsPaymentResponseAction is a convenience function that returns CheckoutDelegatedAuthenticationAction wrapped in PaymentResponseAction +func CheckoutDelegatedAuthenticationActionAsPaymentResponseAction(v *CheckoutDelegatedAuthenticationAction) PaymentResponseAction { + return PaymentResponseAction{ + CheckoutDelegatedAuthenticationAction: v, + } +} + // CheckoutNativeRedirectActionAsPaymentResponseAction is a convenience function that returns CheckoutNativeRedirectAction wrapped in PaymentResponseAction func CheckoutNativeRedirectActionAsPaymentResponseAction(v *CheckoutNativeRedirectAction) PaymentResponseAction { return PaymentResponseAction{ @@ -90,6 +98,19 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { dst.CheckoutAwaitAction = nil } + // try to unmarshal data into CheckoutDelegatedAuthenticationAction + err = json.Unmarshal(data, &dst.CheckoutDelegatedAuthenticationAction) + if err == nil { + jsonCheckoutDelegatedAuthenticationAction, _ := json.Marshal(dst.CheckoutDelegatedAuthenticationAction) + if string(jsonCheckoutDelegatedAuthenticationAction) == "{}" || !dst.CheckoutDelegatedAuthenticationAction.isValidType() { // empty struct + dst.CheckoutDelegatedAuthenticationAction = nil + } else { + match++ + } + } else { + dst.CheckoutDelegatedAuthenticationAction = nil + } + // try to unmarshal data into CheckoutNativeRedirectAction err = json.Unmarshal(data, &dst.CheckoutNativeRedirectAction) if err == nil { @@ -171,6 +192,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { if match > 1 { // more than 1 match // reset to nil dst.CheckoutAwaitAction = nil + dst.CheckoutDelegatedAuthenticationAction = nil dst.CheckoutNativeRedirectAction = nil dst.CheckoutQrCodeAction = nil dst.CheckoutRedirectAction = nil @@ -192,6 +214,10 @@ func (src PaymentResponseAction) MarshalJSON() ([]byte, error) { return json.Marshal(&src.CheckoutAwaitAction) } + if src.CheckoutDelegatedAuthenticationAction != nil { + return json.Marshal(&src.CheckoutDelegatedAuthenticationAction) + } + if src.CheckoutNativeRedirectAction != nil { return json.Marshal(&src.CheckoutNativeRedirectAction) } @@ -228,6 +254,10 @@ func (obj *PaymentResponseAction) GetActualInstance() interface{} { return obj.CheckoutAwaitAction } + if obj.CheckoutDelegatedAuthenticationAction != nil { + return obj.CheckoutDelegatedAuthenticationAction + } + if obj.CheckoutNativeRedirectAction != nil { return obj.CheckoutNativeRedirectAction } diff --git a/src/checkout/model_payment_reversal_resource.go b/src/checkout/model_payment_reversal_resource.go deleted file mode 100644 index 1021d1239..000000000 --- a/src/checkout/model_payment_reversal_resource.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the PaymentReversalResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &PaymentReversalResource{} - -// PaymentReversalResource struct for PaymentReversalResource -type PaymentReversalResource struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. - PaymentPspReference string `json:"paymentPspReference"` - // Adyen's 16-character reference associated with the reversal request. - PspReference string `json:"pspReference"` - // Your reference for the reversal request. - Reference *string `json:"reference,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewPaymentReversalResource instantiates a new PaymentReversalResource 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 NewPaymentReversalResource(merchantAccount string, paymentPspReference string, pspReference string, status string) *PaymentReversalResource { - this := PaymentReversalResource{} - this.MerchantAccount = merchantAccount - this.PaymentPspReference = paymentPspReference - this.PspReference = pspReference - this.Status = status - return &this -} - -// NewPaymentReversalResourceWithDefaults instantiates a new PaymentReversalResource 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 NewPaymentReversalResourceWithDefaults() *PaymentReversalResource { - this := PaymentReversalResource{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *PaymentReversalResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *PaymentReversalResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *PaymentReversalResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentPspReference returns the PaymentPspReference field value -func (o *PaymentReversalResource) GetPaymentPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentPspReference -} - -// GetPaymentPspReferenceOk returns a tuple with the PaymentPspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentReversalResource) GetPaymentPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentPspReference, true -} - -// SetPaymentPspReference sets field value -func (o *PaymentReversalResource) SetPaymentPspReference(v string) { - o.PaymentPspReference = v -} - -// GetPspReference returns the PspReference field value -func (o *PaymentReversalResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *PaymentReversalResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *PaymentReversalResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *PaymentReversalResource) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PaymentReversalResource) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *PaymentReversalResource) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *PaymentReversalResource) SetReference(v string) { - o.Reference = &v -} - -// GetStatus returns the Status field value -func (o *PaymentReversalResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *PaymentReversalResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *PaymentReversalResource) SetStatus(v string) { - o.Status = v -} - -func (o PaymentReversalResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PaymentReversalResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentPspReference"] = o.PaymentPspReference - toSerialize["pspReference"] = o.PspReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullablePaymentReversalResource struct { - value *PaymentReversalResource - isSet bool -} - -func (v NullablePaymentReversalResource) Get() *PaymentReversalResource { - return v.value -} - -func (v *NullablePaymentReversalResource) Set(val *PaymentReversalResource) { - v.value = val - v.isSet = true -} - -func (v NullablePaymentReversalResource) IsSet() bool { - return v.isSet -} - -func (v *NullablePaymentReversalResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePaymentReversalResource(val *PaymentReversalResource) *NullablePaymentReversalResource { - return &NullablePaymentReversalResource{value: val, isSet: true} -} - -func (v NullablePaymentReversalResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePaymentReversalResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *PaymentReversalResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_payment_setup_request.go b/src/checkout/model_payment_setup_request.go index d179f1b69..b1cdb784d 100644 --- a/src/checkout/model_payment_setup_request.go +++ b/src/checkout/model_payment_setup_request.go @@ -62,7 +62,7 @@ type PaymentSetupRequest struct { Installments *Installments `json:"installments,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. @@ -108,7 +108,7 @@ type PaymentSetupRequest struct { SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // When true and `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 18a6a1c2a..5e39e03d2 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -31,7 +31,7 @@ type PaymentVerificationResponse struct { RefusalReason *string `json:"refusalReason,omitempty"` // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` - // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` ServiceError *ServiceError2 `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. @@ -437,7 +437,7 @@ func (v *NullablePaymentVerificationResponse) UnmarshalJSON(src []byte) error { } func (o *PaymentVerificationResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/checkout/model_platform_chargeback_logic.go b/src/checkout/model_platform_chargeback_logic.go index 018218fc9..d1d848dd7 100644 --- a/src/checkout/model_platform_chargeback_logic.go +++ b/src/checkout/model_platform_chargeback_logic.go @@ -19,9 +19,12 @@ var _ common.MappedNullable = &PlatformChargebackLogic{} // PlatformChargebackLogic struct for PlatformChargebackLogic type PlatformChargebackLogic struct { - Behavior *string `json:"behavior,omitempty"` + // The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + Behavior *string `json:"behavior,omitempty"` + // The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. CostAllocationAccount *string `json:"costAllocationAccount,omitempty"` - TargetAccount *string `json:"targetAccount,omitempty"` + // The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. + TargetAccount *string `json:"targetAccount,omitempty"` } // NewPlatformChargebackLogic instantiates a new PlatformChargebackLogic object diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index 32e4f589f..b647c0201 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -254,7 +254,7 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { } func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} + var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_standalone_payment_cancel_resource.go b/src/checkout/model_standalone_payment_cancel_resource.go deleted file mode 100644 index ac0efafbc..000000000 --- a/src/checkout/model_standalone_payment_cancel_resource.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the StandalonePaymentCancelResource type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &StandalonePaymentCancelResource{} - -// StandalonePaymentCancelResource struct for StandalonePaymentCancelResource -type StandalonePaymentCancelResource struct { - // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - // The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. - PaymentReference string `json:"paymentReference"` - // Adyen's 16-character reference associated with the cancel request. - PspReference string `json:"pspReference"` - // Your reference for the cancel request. - Reference *string `json:"reference,omitempty"` - // The status of your request. This will always have the value **received**. - Status string `json:"status"` -} - -// NewStandalonePaymentCancelResource instantiates a new StandalonePaymentCancelResource 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 NewStandalonePaymentCancelResource(merchantAccount string, paymentReference string, pspReference string, status string) *StandalonePaymentCancelResource { - this := StandalonePaymentCancelResource{} - this.MerchantAccount = merchantAccount - this.PaymentReference = paymentReference - this.PspReference = pspReference - this.Status = status - return &this -} - -// NewStandalonePaymentCancelResourceWithDefaults instantiates a new StandalonePaymentCancelResource 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 NewStandalonePaymentCancelResourceWithDefaults() *StandalonePaymentCancelResource { - this := StandalonePaymentCancelResource{} - return &this -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *StandalonePaymentCancelResource) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *StandalonePaymentCancelResource) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *StandalonePaymentCancelResource) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetPaymentReference returns the PaymentReference field value -func (o *StandalonePaymentCancelResource) GetPaymentReference() string { - if o == nil { - var ret string - return ret - } - - return o.PaymentReference -} - -// GetPaymentReferenceOk returns a tuple with the PaymentReference field value -// and a boolean to check if the value has been set. -func (o *StandalonePaymentCancelResource) GetPaymentReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PaymentReference, true -} - -// SetPaymentReference sets field value -func (o *StandalonePaymentCancelResource) SetPaymentReference(v string) { - o.PaymentReference = v -} - -// GetPspReference returns the PspReference field value -func (o *StandalonePaymentCancelResource) GetPspReference() string { - if o == nil { - var ret string - return ret - } - - return o.PspReference -} - -// GetPspReferenceOk returns a tuple with the PspReference field value -// and a boolean to check if the value has been set. -func (o *StandalonePaymentCancelResource) GetPspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PspReference, true -} - -// SetPspReference sets field value -func (o *StandalonePaymentCancelResource) SetPspReference(v string) { - o.PspReference = v -} - -// GetReference returns the Reference field value if set, zero value otherwise. -func (o *StandalonePaymentCancelResource) GetReference() string { - if o == nil || common.IsNil(o.Reference) { - var ret string - return ret - } - return *o.Reference -} - -// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StandalonePaymentCancelResource) GetReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.Reference) { - return nil, false - } - return o.Reference, true -} - -// HasReference returns a boolean if a field has been set. -func (o *StandalonePaymentCancelResource) HasReference() bool { - if o != nil && !common.IsNil(o.Reference) { - return true - } - - return false -} - -// SetReference gets a reference to the given string and assigns it to the Reference field. -func (o *StandalonePaymentCancelResource) SetReference(v string) { - o.Reference = &v -} - -// GetStatus returns the Status field value -func (o *StandalonePaymentCancelResource) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *StandalonePaymentCancelResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *StandalonePaymentCancelResource) SetStatus(v string) { - o.Status = v -} - -func (o StandalonePaymentCancelResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o StandalonePaymentCancelResource) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["merchantAccount"] = o.MerchantAccount - toSerialize["paymentReference"] = o.PaymentReference - toSerialize["pspReference"] = o.PspReference - if !common.IsNil(o.Reference) { - toSerialize["reference"] = o.Reference - } - toSerialize["status"] = o.Status - return toSerialize, nil -} - -type NullableStandalonePaymentCancelResource struct { - value *StandalonePaymentCancelResource - isSet bool -} - -func (v NullableStandalonePaymentCancelResource) Get() *StandalonePaymentCancelResource { - return v.value -} - -func (v *NullableStandalonePaymentCancelResource) Set(val *StandalonePaymentCancelResource) { - v.value = val - v.isSet = true -} - -func (v NullableStandalonePaymentCancelResource) IsSet() bool { - return v.isSet -} - -func (v *NullableStandalonePaymentCancelResource) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStandalonePaymentCancelResource(val *StandalonePaymentCancelResource) *NullableStandalonePaymentCancelResource { - return &NullableStandalonePaymentCancelResource{value: val, isSet: true} -} - -func (v NullableStandalonePaymentCancelResource) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStandalonePaymentCancelResource) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -func (o *StandalonePaymentCancelResource) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false -} diff --git a/src/checkout/model_stored_payment_method_details.go b/src/checkout/model_stored_payment_method_details.go index 911f8d674..ddbc4a426 100644 --- a/src/checkout/model_stored_payment_method_details.go +++ b/src/checkout/model_stored_payment_method_details.go @@ -240,7 +240,7 @@ func (v *NullableStoredPaymentMethodDetails) UnmarshalJSON(src []byte) error { } func (o *StoredPaymentMethodDetails) isValidType() bool { - var allowedEnumValues = []string{"bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "kakaopay", "truemoney", "twint_pos"} + var allowedEnumValues = []string{"bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "dana", "kakaopay", "truemoney"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_sub_merchant_2.go b/src/checkout/model_sub_merchant_2.go deleted file mode 100644 index 2f7194621..000000000 --- a/src/checkout/model_sub_merchant_2.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -Adyen Checkout API - -API version: 70 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package checkout - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the SubMerchant2 type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &SubMerchant2{} - -// SubMerchant2 struct for SubMerchant2 -type SubMerchant2 struct { - Address *Address `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Mcc *string `json:"mcc,omitempty"` - Name *string `json:"name,omitempty"` - TaxId *string `json:"taxId,omitempty"` -} - -// NewSubMerchant2 instantiates a new SubMerchant2 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 NewSubMerchant2() *SubMerchant2 { - this := SubMerchant2{} - return &this -} - -// NewSubMerchant2WithDefaults instantiates a new SubMerchant2 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 NewSubMerchant2WithDefaults() *SubMerchant2 { - this := SubMerchant2{} - return &this -} - -// GetAddress returns the Address field value if set, zero value otherwise. -func (o *SubMerchant2) GetAddress() Address { - if o == nil || common.IsNil(o.Address) { - var ret Address - return ret - } - return *o.Address -} - -// GetAddressOk returns a tuple with the Address field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SubMerchant2) GetAddressOk() (*Address, bool) { - if o == nil || common.IsNil(o.Address) { - return nil, false - } - return o.Address, true -} - -// HasAddress returns a boolean if a field has been set. -func (o *SubMerchant2) HasAddress() bool { - if o != nil && !common.IsNil(o.Address) { - return true - } - - return false -} - -// SetAddress gets a reference to the given Address and assigns it to the Address field. -func (o *SubMerchant2) SetAddress(v Address) { - o.Address = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *SubMerchant2) GetId() string { - if o == nil || common.IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SubMerchant2) GetIdOk() (*string, bool) { - if o == nil || common.IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *SubMerchant2) HasId() bool { - if o != nil && !common.IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *SubMerchant2) SetId(v string) { - o.Id = &v -} - -// GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *SubMerchant2) 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 *SubMerchant2) 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 *SubMerchant2) 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 *SubMerchant2) SetMcc(v string) { - o.Mcc = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *SubMerchant2) 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 *SubMerchant2) 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 *SubMerchant2) 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 *SubMerchant2) SetName(v string) { - o.Name = &v -} - -// GetTaxId returns the TaxId field value if set, zero value otherwise. -func (o *SubMerchant2) GetTaxId() string { - if o == nil || common.IsNil(o.TaxId) { - var ret string - return ret - } - return *o.TaxId -} - -// GetTaxIdOk returns a tuple with the TaxId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SubMerchant2) GetTaxIdOk() (*string, bool) { - if o == nil || common.IsNil(o.TaxId) { - return nil, false - } - return o.TaxId, true -} - -// HasTaxId returns a boolean if a field has been set. -func (o *SubMerchant2) HasTaxId() bool { - if o != nil && !common.IsNil(o.TaxId) { - return true - } - - return false -} - -// SetTaxId gets a reference to the given string and assigns it to the TaxId field. -func (o *SubMerchant2) SetTaxId(v string) { - o.TaxId = &v -} - -func (o SubMerchant2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SubMerchant2) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.Address) { - toSerialize["address"] = o.Address - } - if !common.IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !common.IsNil(o.Mcc) { - toSerialize["mcc"] = o.Mcc - } - if !common.IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !common.IsNil(o.TaxId) { - toSerialize["taxId"] = o.TaxId - } - return toSerialize, nil -} - -type NullableSubMerchant2 struct { - value *SubMerchant2 - isSet bool -} - -func (v NullableSubMerchant2) Get() *SubMerchant2 { - return v.value -} - -func (v *NullableSubMerchant2) Set(val *SubMerchant2) { - v.value = val - v.isSet = true -} - -func (v NullableSubMerchant2) IsSet() bool { - return v.isSet -} - -func (v *NullableSubMerchant2) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSubMerchant2(val *SubMerchant2) *NullableSubMerchant2 { - return &NullableSubMerchant2{value: val, isSet: true} -} - -func (v NullableSubMerchant2) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSubMerchant2) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/checkout/model_sub_merchant_info.go b/src/checkout/model_sub_merchant_info.go index 3ce6bf070..91b80c990 100644 --- a/src/checkout/model_sub_merchant_info.go +++ b/src/checkout/model_sub_merchant_info.go @@ -19,11 +19,11 @@ var _ common.MappedNullable = &SubMerchantInfo{} // SubMerchantInfo struct for SubMerchantInfo type SubMerchantInfo struct { - Address *Address `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Mcc *string `json:"mcc,omitempty"` - Name *string `json:"name,omitempty"` - TaxId *string `json:"taxId,omitempty"` + Address *BillingAddress `json:"address,omitempty"` + Id *string `json:"id,omitempty"` + Mcc *string `json:"mcc,omitempty"` + Name *string `json:"name,omitempty"` + TaxId *string `json:"taxId,omitempty"` } // NewSubMerchantInfo instantiates a new SubMerchantInfo object @@ -44,9 +44,9 @@ func NewSubMerchantInfoWithDefaults() *SubMerchantInfo { } // GetAddress returns the Address field value if set, zero value otherwise. -func (o *SubMerchantInfo) GetAddress() Address { +func (o *SubMerchantInfo) GetAddress() BillingAddress { if o == nil || common.IsNil(o.Address) { - var ret Address + var ret BillingAddress return ret } return *o.Address @@ -54,7 +54,7 @@ func (o *SubMerchantInfo) GetAddress() Address { // GetAddressOk returns a tuple with the Address field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SubMerchantInfo) GetAddressOk() (*Address, bool) { +func (o *SubMerchantInfo) GetAddressOk() (*BillingAddress, bool) { if o == nil || common.IsNil(o.Address) { return nil, false } @@ -70,8 +70,8 @@ func (o *SubMerchantInfo) HasAddress() bool { return false } -// SetAddress gets a reference to the given Address and assigns it to the Address field. -func (o *SubMerchantInfo) SetAddress(v Address) { +// SetAddress gets a reference to the given BillingAddress and assigns it to the Address field. +func (o *SubMerchantInfo) SetAddress(v BillingAddress) { o.Address = &v } diff --git a/src/checkout/model_three_ds2_request_data.go b/src/checkout/model_three_ds2_request_data.go index cf99196ea..82eac06c7 100644 --- a/src/checkout/model_three_ds2_request_data.go +++ b/src/checkout/model_three_ds2_request_data.go @@ -102,8 +102,6 @@ func NewThreeDS2RequestData(deviceChannel string) *ThreeDS2RequestData { var authenticationOnly bool = false this.AuthenticationOnly = &authenticationOnly this.DeviceChannel = deviceChannel - var messageVersion string = "2.1.0" - this.MessageVersion = &messageVersion var sdkMaxTimeout int32 = 60 this.SdkMaxTimeout = &sdkMaxTimeout return &this @@ -116,8 +114,6 @@ func NewThreeDS2RequestDataWithDefaults() *ThreeDS2RequestData { this := ThreeDS2RequestData{} var authenticationOnly bool = false this.AuthenticationOnly = &authenticationOnly - var messageVersion string = "2.1.0" - this.MessageVersion = &messageVersion var sdkMaxTimeout int32 = 60 this.SdkMaxTimeout = &sdkMaxTimeout return &this diff --git a/src/checkout/model_three_ds2_result.go b/src/checkout/model_three_ds2_result.go index 84ab7677d..3d62b699b 100644 --- a/src/checkout/model_three_ds2_result.go +++ b/src/checkout/model_three_ds2_result.go @@ -25,8 +25,6 @@ type ThreeDS2Result struct { CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` // Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). ChallengeCancel *string `json:"challengeCancel,omitempty"` - // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The `dsTransID` value as defined in the 3D Secure 2 specification. DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. @@ -37,6 +35,8 @@ type ThreeDS2Result struct { MessageVersion *string `json:"messageVersion,omitempty"` // Risk score calculated by Cartes Bancaires Directory Server (DS). RiskScore *string `json:"riskScore,omitempty"` + // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` // The `timestamp` value of the 3D Secure 2 authentication. @@ -162,38 +162,6 @@ func (o *ThreeDS2Result) SetChallengeCancel(v string) { o.ChallengeCancel = &v } -// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. -func (o *ThreeDS2Result) GetChallengeIndicator() string { - if o == nil || common.IsNil(o.ChallengeIndicator) { - var ret string - return ret - } - return *o.ChallengeIndicator -} - -// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ThreeDS2Result) GetChallengeIndicatorOk() (*string, bool) { - if o == nil || common.IsNil(o.ChallengeIndicator) { - return nil, false - } - return o.ChallengeIndicator, true -} - -// HasChallengeIndicator returns a boolean if a field has been set. -func (o *ThreeDS2Result) HasChallengeIndicator() bool { - if o != nil && !common.IsNil(o.ChallengeIndicator) { - return true - } - - return false -} - -// SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. -func (o *ThreeDS2Result) SetChallengeIndicator(v string) { - o.ChallengeIndicator = &v -} - // GetDsTransID returns the DsTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetDsTransID() string { if o == nil || common.IsNil(o.DsTransID) { @@ -354,6 +322,38 @@ func (o *ThreeDS2Result) SetRiskScore(v string) { o.RiskScore = &v } +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorChallengeInd +} + +// GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + return nil, false + } + return o.ThreeDSRequestorChallengeInd, true +} + +// HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. +func (o *ThreeDS2Result) HasThreeDSRequestorChallengeInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { + return true + } + + return false +} + +// SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. +func (o *ThreeDS2Result) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + // GetThreeDSServerTransID returns the ThreeDSServerTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetThreeDSServerTransID() string { if o == nil || common.IsNil(o.ThreeDSServerTransID) { @@ -533,9 +533,6 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ChallengeCancel) { toSerialize["challengeCancel"] = o.ChallengeCancel } - if !common.IsNil(o.ChallengeIndicator) { - toSerialize["challengeIndicator"] = o.ChallengeIndicator - } if !common.IsNil(o.DsTransID) { toSerialize["dsTransID"] = o.DsTransID } @@ -551,6 +548,9 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskScore) { toSerialize["riskScore"] = o.RiskScore } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } if !common.IsNil(o.ThreeDSServerTransID) { toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID } @@ -614,19 +614,19 @@ func (o *ThreeDS2Result) isValidChallengeCancel() bool { } return false } -func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} +func (o *ThreeDS2Result) isValidExemptionIndicator() bool { + var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { + if o.GetExemptionIndicator() == allowed { return true } } return false } -func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} +func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { + if o.GetThreeDSRequestorChallengeInd() == allowed { return true } } diff --git a/templates/custom/api.mustache b/templates/custom/api.mustache index f8366ce5d..1a9fd1e80 100644 --- a/templates/custom/api.mustache +++ b/templates/custom/api.mustache @@ -109,13 +109,15 @@ func (a *{{{classname}}}) {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecas headerParams, ) - if httpRes == nil { +{{#hasRestServiceError}} +{{#responses}} + {{#-first}} + if httpRes == nil { return {{#returnType}}*res, {{/returnType}}httpRes, err } -{{#hasRestServiceError}} -{{#responses}} - {{#-first}}var serviceError common.RestServiceError{{/-first}} + var serviceError common.RestServiceError + {{/-first}} {{#dataType}} {{^is1xx}} {{^is2xx}} diff --git a/tests/api_modifications_test.go b/tests/api_modifications_test.go index aecd1a469..b9f2afc27 100644 --- a/tests/api_modifications_test.go +++ b/tests/api_modifications_test.go @@ -30,7 +30,7 @@ func Test_API_Modifications(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { pspReference := "psp0001" req := service.ModificationsApi.CaptureAuthorisedPaymentInput(pspReference) - req = req.CreatePaymentCaptureRequest(checkout.CreatePaymentCaptureRequest{ + req = req.PaymentCaptureRequest(checkout.PaymentCaptureRequest{ MerchantAccount: MerchantAccount, Amount: checkout.Amount{ Value: 1250, @@ -50,7 +50,7 @@ func Test_API_Modifications(t *testing.T) { t.Run("API Modifications - Cancels", func(t *testing.T) { t.Run("Create an API request that should pass", func(t *testing.T) { req := service.ModificationsApi.CancelAuthorisedPaymentInput() - req = req.CreateStandalonePaymentCancelRequest(checkout.CreateStandalonePaymentCancelRequest{ + req = req.StandalonePaymentCancelRequest(checkout.StandalonePaymentCancelRequest{ MerchantAccount: MerchantAccount, PaymentReference: "paymentReference01", Reference: common.PtrString("reference01"), @@ -66,7 +66,7 @@ func Test_API_Modifications(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { req := service.ModificationsApi.CancelAuthorisedPaymentInput() - req = req.CreateStandalonePaymentCancelRequest(checkout.CreateStandalonePaymentCancelRequest{ + req = req.StandalonePaymentCancelRequest(checkout.StandalonePaymentCancelRequest{ MerchantAccount: MerchantAccount, PaymentReference: "", Reference: common.PtrString("reference01"), @@ -83,7 +83,7 @@ func Test_API_Modifications(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { pspReference := "psp0001" req := service.ModificationsApi.RefundCapturedPaymentInput(pspReference) - req = req.CreatePaymentRefundRequest(checkout.CreatePaymentRefundRequest{ + req = req.PaymentRefundRequest(checkout.PaymentRefundRequest{ MerchantAccount: MerchantAccount, Reference: common.PtrString("reference01"), Amount: checkout.Amount{ @@ -103,7 +103,7 @@ func Test_API_Modifications(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { pspReference := "psp0001" req := service.ModificationsApi.RefundOrCancelPaymentInput(pspReference) - req = req.CreatePaymentReversalRequest(checkout.CreatePaymentReversalRequest{ + req = req.PaymentReversalRequest(checkout.PaymentReversalRequest{ MerchantAccount: MerchantAccount, Reference: common.PtrString("reference01"), }) diff --git a/tests/checkout_test.go b/tests/checkout_test.go index 07ff0d5f5..5d1808f0c 100644 --- a/tests/checkout_test.go +++ b/tests/checkout_test.go @@ -180,7 +180,7 @@ func Test_Checkout(t *testing.T) { t.Run("PaymentDetails", func(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { req := service.PaymentsApi.PaymentsDetailsInput() - req = req.DetailsRequest(checkout.DetailsRequest{ + req = req.PaymentDetailsRequest(checkout.PaymentDetailsRequest{ PaymentData: common.PtrString("1234"), Details: checkout.PaymentCompletionDetails{ MD: common.PtrString("Ab02b4c0!BQABAgCW5sxB4e/=="), @@ -201,7 +201,7 @@ func Test_Checkout(t *testing.T) { t.Run("PaymentLinks", func(t *testing.T) { createPaymentLink := func() (checkout.PaymentLinkResponse, *_nethttp.Response, error) { req := service.PaymentLinksApi.PaymentLinksInput() - req = req.CreatePaymentLinkRequest(checkout.CreatePaymentLinkRequest{ + req = req.PaymentLinkRequest(checkout.PaymentLinkRequest{ Reference: "123456781235", Amount: checkout.Amount{ Value: 1250, @@ -226,7 +226,7 @@ func Test_Checkout(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { req := service.PaymentLinksApi.PaymentLinksInput() - req = req.CreatePaymentLinkRequest(checkout.CreatePaymentLinkRequest{ + req = req.PaymentLinkRequest(checkout.PaymentLinkRequest{ Amount: checkout.Amount{ Value: 1250, Currency: "EUR", @@ -356,7 +356,7 @@ func Test_Checkout(t *testing.T) { t.Run("Get origin keys", func(t *testing.T) { domain := "https://adyen.com" req := service.UtilityApi.OriginKeysInput() - req = req.CheckoutUtilityRequest(checkout.CheckoutUtilityRequest{ + req = req.UtilityRequest(checkout.UtilityRequest{ OriginDomains: []string{ domain, }, @@ -378,7 +378,7 @@ func Test_Checkout(t *testing.T) { // @TODO review this test/config t.Skip("Payment method not correctly configured in the backoffice") req := service.OrdersApi.GetBalanceOfGiftCardInput() - req = req.CheckoutBalanceCheckRequest(checkout.CheckoutBalanceCheckRequest{ + req = req.BalanceCheckRequest(checkout.BalanceCheckRequest{ MerchantAccount: MerchantAccount, PaymentMethod: map[string]string{ "type": "giftcard", @@ -399,7 +399,7 @@ func Test_Checkout(t *testing.T) { t.Run("Create order", func(t *testing.T) { req := service.OrdersApi.OrdersInput() - req = req.CheckoutCreateOrderRequest(checkout.CheckoutCreateOrderRequest{ + req = req.CreateOrderRequest(checkout.CreateOrderRequest{ Amount: checkout.Amount{ Currency: "EUR", Value: 1000, @@ -418,7 +418,7 @@ func Test_Checkout(t *testing.T) { t.Run("Cancel order", func(t *testing.T) { req := service.OrdersApi.OrdersInput() - req = req.CheckoutCreateOrderRequest(checkout.CheckoutCreateOrderRequest{ + req = req.CreateOrderRequest(checkout.CreateOrderRequest{ Amount: checkout.Amount{ Currency: "EUR", Value: 1000, @@ -429,7 +429,7 @@ func Test_Checkout(t *testing.T) { order, _, _ := service.OrdersApi.Orders(context.Background(), req) cancelReq := service.OrdersApi.CancelOrderInput() - cancelReq = cancelReq.CheckoutCancelOrderRequest(checkout.CheckoutCancelOrderRequest{ + cancelReq = cancelReq.CancelOrderRequest(checkout.CancelOrderRequest{ MerchantAccount: MerchantAccount, Order: checkout.EncryptedOrderData{ OrderData: order.OrderData, @@ -448,7 +448,7 @@ func Test_Checkout(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { req := service.OrdersApi.OrdersInput() // missing required "reference" field - req = req.CheckoutCreateOrderRequest(checkout.CheckoutCreateOrderRequest{ + req = req.CreateOrderRequest(checkout.CreateOrderRequest{ Amount: checkout.Amount{ Currency: "EUR", Value: 1000, From 5803e7f6877bcede5fe6b2d08a916e497a966870 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:56:29 +0200 Subject: [PATCH 2/9] fix(deps): update module github.com/google/uuid to v1.4.0 (#259) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a6789f691..cd4e54ad3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/adyen/adyen-go-api-library/v8 go 1.13 require ( - github.com/google/uuid v1.3.1 + github.com/google/uuid v1.4.0 github.com/joho/godotenv v1.5.1 github.com/stretchr/testify v1.8.2 golang.org/x/oauth2 v0.11.0 diff --git a/go.sum b/go.sum index f9502e3f4..b91b65b37 100644 --- a/go.sum +++ b/go.sum @@ -757,6 +757,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= From 81e5da9cbaa13e7e0dcacd309e3572f9b00e2123 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Fri, 3 Nov 2023 13:57:54 +0100 Subject: [PATCH 3/9] Run integration tests only before releases (#257) * Tagging integration tests * Use 'unit' tag on regular PR's * Mocking tests * Fix conflicts * Mock response function * Renaming Balance Platform tests --- .github/workflows/go.yml | 8 +- src/adyen/api_test.go | 3 + tests/api_modifications_test.go | 3 + .../acswebhook_test.go} | 4 +- .../configurationwebhook_test.go} | 5 +- .../reportwebhook_test.go} | 5 +- .../transferwebhook_test.go} | 5 +- .../unit_test.go} | 41 +- tests/binlookup_test.go | 3 + .../idempotency_test.go} | 2 +- .../integration_test.go} | 235 +------ tests/checkout/unit_test.go | 244 +++++++ tests/fixtures/checkout/authorised_card.json | 15 + .../fixtures/checkout/gift_card_balance.json | 8 + tests/fixtures/checkout/order_created.json | 15 + tests/fixtures/checkout/payment_link.json | 15 + tests/fixtures/checkout/payment_methods.json | 621 ++++++++++++++++++ tests/fixtures/checkout/session_created.json | 13 + tests/legalentity/integration_test.go | 3 + tests/management/integration_test.go | 7 +- tests/mocking.go | 36 + tests/model_payment_response_test.go | 10 - tests/payment_test.go | 3 + tests/platforms_test.go | 7 +- tests/recurring_test.go | 3 + tests/storedvalue_test.go | 4 +- tests/transfers_test.go | 13 +- 27 files changed, 1056 insertions(+), 275 deletions(-) rename tests/{balanceplatform_acs_webhooks_handler_test.go => balanceplatform/acswebhook_test.go} (95%) rename tests/{balanceplatform_configuration_webhooks_handler_test.go => balanceplatform/configurationwebhook_test.go} (95%) rename tests/{balanceplatform_report_webhooks_handler_test.go => balanceplatform/reportwebhook_test.go} (93%) rename tests/{balanceplatform_transfer_webhooks_handler_test.go => balanceplatform/transferwebhook_test.go} (91%) rename tests/{balanceplatform_test.go => balanceplatform/unit_test.go} (84%) rename tests/{checkoutidempotency_test.go => checkout/idempotency_test.go} (99%) rename tests/{checkout_test.go => checkout/integration_test.go} (64%) create mode 100644 tests/checkout/unit_test.go create mode 100644 tests/fixtures/checkout/authorised_card.json create mode 100644 tests/fixtures/checkout/gift_card_balance.json create mode 100644 tests/fixtures/checkout/order_created.json create mode 100644 tests/fixtures/checkout/payment_link.json create mode 100644 tests/fixtures/checkout/payment_methods.json create mode 100644 tests/fixtures/checkout/session_created.json create mode 100644 tests/mocking.go diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c2344cf83..84b7ffec1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -9,22 +9,18 @@ jobs: name: Build & Verify runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-go@v4 with: go-version: 1.13 - - name: Get dependencies run: go get -v -t -d ./... - - name: Build run: go build -v . - - name: Test - run: go test ./... + run: go test -v ./... -tags $GO_TEST_TAGS env: + GO_TEST_TAGS: ${{ github.ref == 'refs/heads/main' && 'integration' || 'unit' }} ADYEN_API_KEY: ${{ secrets.ADYEN_API_KEY }} ADYEN_MERCHANT: ${{ secrets.ADYEN_MERCHANT }} ADYEN_PASSWORD: ${{ secrets.ADYEN_PASSWORD }} diff --git a/src/adyen/api_test.go b/src/adyen/api_test.go index 2bc80ddb9..29d874920 100644 --- a/src/adyen/api_test.go +++ b/src/adyen/api_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package adyen import ( diff --git a/tests/api_modifications_test.go b/tests/api_modifications_test.go index b9f2afc27..6f542154c 100644 --- a/tests/api_modifications_test.go +++ b/tests/api_modifications_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package tests import ( diff --git a/tests/balanceplatform_acs_webhooks_handler_test.go b/tests/balanceplatform/acswebhook_test.go similarity index 95% rename from tests/balanceplatform_acs_webhooks_handler_test.go rename to tests/balanceplatform/acswebhook_test.go index 3498b9bff..0e3119a44 100644 --- a/tests/balanceplatform_acs_webhooks_handler_test.go +++ b/tests/balanceplatform/acswebhook_test.go @@ -1,4 +1,4 @@ -package tests +package balanceplatform import ( "github.com/adyen/adyen-go-api-library/v8/src/acswebhook" @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" ) -func Test_BalancePlatform_Acs_Webhooks_HandleRequest(t *testing.T) { +func TestHandleAuthenticationNotificationRequest(t *testing.T) { t.Run("on balancePlatform.authentication.created", func(t *testing.T) { notificationJson := `{ "data": { diff --git a/tests/balanceplatform_configuration_webhooks_handler_test.go b/tests/balanceplatform/configurationwebhook_test.go similarity index 95% rename from tests/balanceplatform_configuration_webhooks_handler_test.go rename to tests/balanceplatform/configurationwebhook_test.go index 95f783648..71833c895 100644 --- a/tests/balanceplatform_configuration_webhooks_handler_test.go +++ b/tests/balanceplatform/configurationwebhook_test.go @@ -1,4 +1,4 @@ -package tests +package balanceplatform import ( "testing" @@ -9,8 +9,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/configurationwebhook" ) -func Test_BalancePlatform_Configuration_Webhooks_HandleRequest(t *testing.T) { - +func TestHandleAccountHolderNotificationRequest(t *testing.T) { t.Run("should return accountHolder created success", func(t *testing.T) { notificationJson := `{ "data": { diff --git a/tests/balanceplatform_report_webhooks_handler_test.go b/tests/balanceplatform/reportwebhook_test.go similarity index 93% rename from tests/balanceplatform_report_webhooks_handler_test.go rename to tests/balanceplatform/reportwebhook_test.go index 19daada61..22560d38f 100644 --- a/tests/balanceplatform_report_webhooks_handler_test.go +++ b/tests/balanceplatform/reportwebhook_test.go @@ -1,4 +1,4 @@ -package tests +package balanceplatform import ( "testing" @@ -8,8 +8,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/reportwebhook" ) -func Test_BalancePlatform_Report_Webhooks_HandleRequest(t *testing.T) { - +func TestHandleReportNotificationRequest(t *testing.T) { t.Run("should return report created success", func(t *testing.T) { notificationJson := `{ "data": { diff --git a/tests/balanceplatform_transfer_webhooks_handler_test.go b/tests/balanceplatform/transferwebhook_test.go similarity index 91% rename from tests/balanceplatform_transfer_webhooks_handler_test.go rename to tests/balanceplatform/transferwebhook_test.go index 47a5d57df..b879a07fd 100644 --- a/tests/balanceplatform_transfer_webhooks_handler_test.go +++ b/tests/balanceplatform/transferwebhook_test.go @@ -1,4 +1,4 @@ -package tests +package balanceplatform import ( "testing" @@ -8,8 +8,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/transferwebhook" ) -func Test_BalancePlatform_Transfer_Webhooks_HandleRequest(t *testing.T) { - +func TestHandleTransferNotificationRequest(t *testing.T) { t.Run("should return transfer success", func(t *testing.T) { notificationJson := `{ "data": { diff --git a/tests/balanceplatform_test.go b/tests/balanceplatform/unit_test.go similarity index 84% rename from tests/balanceplatform_test.go rename to tests/balanceplatform/unit_test.go index 251b0218d..787c3dae6 100644 --- a/tests/balanceplatform_test.go +++ b/tests/balanceplatform/unit_test.go @@ -1,4 +1,4 @@ -package tests +package balanceplatform import ( "context" @@ -6,6 +6,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/adyen" "github.com/adyen/adyen-go-api-library/v8/src/balanceplatform" "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/tests" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "io" @@ -15,7 +16,7 @@ import ( "testing" ) -func Test_BalancePlatform(t *testing.T) { +func TestBalancePlatform(t *testing.T) { client := adyen.NewClient(&common.Config{ ApiKey: "YOUR_ADYEN_API_KEY", Environment: "TEST", @@ -24,19 +25,16 @@ func Test_BalancePlatform(t *testing.T) { service := client.BalancePlatform() mux := http.NewServeMux() - // Success case - mux.HandleFunc("/accountHolders/123", func(w http.ResponseWriter, r *http.Request) { - assert.Contains(t, [2]string{"GET", "PATCH"}, r.Method) - w.Header().Set("Content-Type", "application/json") - file, _ := os.Open("fixtures/account_holder.json") - io.Copy(w, file) - }) + mockResponse := tests.MockResponse(t, mux) + + // Success cases + mockResponse(http.StatusOK, "GET PATCH", "/accountHolders/123", "account_holder.json") mux.HandleFunc("/accountHolders/123/balanceAccounts", func(w http.ResponseWriter, r *http.Request) { require.Equal(t, "GET", r.Method) assert.Equal(t, "5", r.URL.Query().Get("limit")) assert.Equal(t, "42", r.URL.Query().Get("offset")) w.Header().Set("Content-Type", "application/json") - file, _ := os.Open("fixtures/paginated_balance_accounts_response.json") + file, _ := os.Open("../fixtures/paginated_balance_accounts_response.json") io.Copy(w, file) }) mux.HandleFunc("/balanceAccounts/balanceAccountId/sweeps/sweepId", func(w http.ResponseWriter, r *http.Request) { @@ -48,26 +46,11 @@ func Test_BalancePlatform(t *testing.T) { require.Equal(t, "POST", r.Method) // no response }) - mux.HandleFunc("/balanceAccounts/BA123/sweeps/SWPC123", func(w http.ResponseWriter, r *http.Request) { - assert.Contains(t, [2]string{"GET", "PATCH"}, r.Method) - w.Header().Set("Content-Type", "application/json") - file, _ := os.Open("fixtures/sweep.json") - io.Copy(w, file) - }) - mux.HandleFunc("/transactionRules/transactionRuleId", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "DELETE", r.Method) - w.Header().Set("Content-Type", "application/json") - file, _ := os.Open("fixtures/transaction_rule.json") - io.Copy(w, file) - }) + mockResponse(http.StatusOK, "GET PATCH", "/balanceAccounts/BA123/sweeps/SWPC123", "sweep.json") + mockResponse(http.StatusOK, "DELETE", "/transactionRules/transactionRuleId", "transaction_rule.json") + // Error case - mux.HandleFunc("/paymentInstruments/666", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "PATCH", r.Method) - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusUnprocessableEntity) - file, _ := os.Open("fixtures/not_found.json") - io.Copy(w, file) - }) + mockResponse(http.StatusUnprocessableEntity, "PATCH", "/paymentInstruments/666", "not_found.json") mockServer := httptest.NewServer(mux) defer mockServer.Close() diff --git a/tests/binlookup_test.go b/tests/binlookup_test.go index d2adfcb34..440607919 100644 --- a/tests/binlookup_test.go +++ b/tests/binlookup_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package tests import ( diff --git a/tests/checkoutidempotency_test.go b/tests/checkout/idempotency_test.go similarity index 99% rename from tests/checkoutidempotency_test.go rename to tests/checkout/idempotency_test.go index fee7f38ff..1ae19c28b 100644 --- a/tests/checkoutidempotency_test.go +++ b/tests/checkout/idempotency_test.go @@ -1,4 +1,4 @@ -package tests +package checkout import ( "context" diff --git a/tests/checkout_test.go b/tests/checkout/integration_test.go similarity index 64% rename from tests/checkout_test.go rename to tests/checkout/integration_test.go index 5d1808f0c..f7e368935 100644 --- a/tests/checkout_test.go +++ b/tests/checkout/integration_test.go @@ -1,4 +1,7 @@ -package tests +//go:build integration +// +build integration + +package checkout import ( "context" @@ -6,9 +9,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/adyen" "github.com/adyen/adyen-go-api-library/v8/src/checkout" "github.com/adyen/adyen-go-api-library/v8/src/common" - "github.com/google/uuid" "io/ioutil" - _nethttp "net/http" "os" "strings" "testing" @@ -19,10 +20,10 @@ import ( "github.com/stretchr/testify/require" ) -func Test_Checkout(t *testing.T) { - godotenv.Load("./../.env") +func TestCheckoutIntegration(t *testing.T) { + godotenv.Load("./../../.env") - MerchantAccount := os.Getenv("ADYEN_MERCHANT") + merchantAccount := os.Getenv("ADYEN_MERCHANT") client := adyen.NewClient(&common.Config{ ApiKey: os.Getenv("ADYEN_API_KEY"), @@ -31,16 +32,6 @@ func Test_Checkout(t *testing.T) { }) service := client.Checkout() - t.Run("Configuration", func(t *testing.T) { - liveClient := adyen.NewClient(&common.Config{ - ApiKey: "LIVE_API_KEY", - Environment: common.LiveEnv, - LiveEndpointURLPrefix: "abc123", - Debug: false, - }) - require.Equal(t, "https://abc123-checkout-live.adyenpayments.com/checkout/v70", liveClient.Checkout().PaymentsApi.BasePath()) - }) - t.Run("PaymentMethods", func(t *testing.T) { t.Run("Create an API request that should fail", func(t *testing.T) { req := service.PaymentsApi.PaymentMethodsInput(). @@ -55,7 +46,7 @@ func Test_Checkout(t *testing.T) { }) t.Run("Create an API request that should pass", func(t *testing.T) { - paymentMethodsRequest := *checkout.NewPaymentMethodsRequest(MerchantAccount) + paymentMethodsRequest := *checkout.NewPaymentMethodsRequest(merchantAccount) req := service.PaymentsApi.PaymentMethodsInput().PaymentMethodsRequest(paymentMethodsRequest) res, httpRes, err := service.PaymentsApi.PaymentMethods(context.Background(), req) @@ -70,21 +61,6 @@ func Test_Checkout(t *testing.T) { }) t.Run("Payments", func(t *testing.T) { - t.Run("Create an API request that should fail", func(t *testing.T) { - res, httpRes, err := service.PaymentsApi.Payments( - context.Background(), - // missing payment method - service.PaymentsApi.PaymentsInput().PaymentRequest(checkout.PaymentRequest{ - MerchantAccount: MerchantAccount, - }), - ) - - require.NotNil(t, err) - assert.Contains(t, err.Error(), "error calling MarshalJSON for type checkout.CheckoutPaymentMethod") - require.Nil(t, httpRes) - require.NotNil(t, res) - }) - t.Run("Credit card payment", func(t *testing.T) { card := checkout.NewCardDetails() card.SetEncryptedCardNumber("test_4111111111111111") @@ -93,7 +69,7 @@ func Test_Checkout(t *testing.T) { card.SetEncryptedSecurityCode("test_737") paymentRequest := *checkout.NewPaymentRequest( *checkout.NewAmount("EUR", int64(1234)), - MerchantAccount, + merchantAccount, checkout.CardDetailsAsCheckoutPaymentMethod(card), "Reference_example", "ReturnUrl_example", @@ -121,7 +97,7 @@ func Test_Checkout(t *testing.T) { ideal := checkout.NewIdealDetails("1121") paymentRequest := *checkout.NewPaymentRequest( *checkout.NewAmount("EUR", int64(1234)), - MerchantAccount, + merchantAccount, checkout.IdealDetailsAsCheckoutPaymentMethod(ideal), "Reference_example", "ReturnUrl_example", @@ -140,41 +116,6 @@ func Test_Checkout(t *testing.T) { assert.Equal(t, "ideal", res.GetAction().CheckoutRedirectAction.GetPaymentMethodType()) assert.NotEmpty(t, res.GetResultCode()) }) - - t.Run("Create two APIs requests that should be identical when using the same Idempotency Key", func(t *testing.T) { - card := checkout.NewCardDetails() - card.SetEncryptedCardNumber("test_4111111111111111") - card.SetEncryptedExpiryMonth("test_03") - card.SetEncryptedExpiryYear("test_2030") - card.SetEncryptedSecurityCode("test_737") - card.SetHolderName("John Smith") - body := checkout.PaymentRequest{ - Reference: "123456781235", - Amount: checkout.Amount{ - Value: 1250, - Currency: "EUR", - }, - CountryCode: common.PtrString("NL"), - MerchantAccount: MerchantAccount, - Channel: common.PtrString("Web"), - ReturnUrl: "http://localhost:3000/redirect", - PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(card), - } - iKey := uuid.New().String() - ctx := context.Background() - - req := service.PaymentsApi.PaymentsInput().IdempotencyKey(iKey).PaymentRequest(body) - res, _, _ := service.PaymentsApi.Payments(ctx, req) - pspRef := res.GetPspReference() - - res, _, _ = service.PaymentsApi.Payments(ctx, req) - require.Equal(t, pspRef, res.GetPspReference()) - - // Idempotency Key is not set for this request. Should have a new PspReference. - req = service.PaymentsApi.PaymentsInput().PaymentRequest(body) - res, _, _ = service.PaymentsApi.Payments(context.Background(), req) - require.NotEqual(t, pspRef, res.GetPspReference()) - }) }) t.Run("PaymentDetails", func(t *testing.T) { @@ -199,7 +140,24 @@ func Test_Checkout(t *testing.T) { }) t.Run("PaymentLinks", func(t *testing.T) { - createPaymentLink := func() (checkout.PaymentLinkResponse, *_nethttp.Response, error) { + t.Run("Create an API request that should fail", func(t *testing.T) { + req := service.PaymentLinksApi.PaymentLinksInput() + req = req.PaymentLinkRequest(checkout.PaymentLinkRequest{ + Amount: checkout.Amount{ + Value: 1250, + Currency: "EUR", + }, + MerchantAccount: merchantAccount, + }) + res, httpRes, err := service.PaymentLinksApi.PaymentLinks(context.Background(), req) + + require.NotNil(t, err) + assert.Contains(t, err.Error(), "'reference' is not provided") + require.NotNil(t, httpRes) + require.NotNil(t, res) + }) + + t.Run("Create an API request that should pass", func(t *testing.T) { req := service.PaymentLinksApi.PaymentLinksInput() req = req.PaymentLinkRequest(checkout.PaymentLinkRequest{ Reference: "123456781235", @@ -219,30 +177,10 @@ func Test_Checkout(t *testing.T) { Country: "BR", StateOrProvince: common.PtrString("SP"), }, - MerchantAccount: MerchantAccount, - }) - return service.PaymentLinksApi.PaymentLinks(context.Background(), req) - } - - t.Run("Create an API request that should fail", func(t *testing.T) { - req := service.PaymentLinksApi.PaymentLinksInput() - req = req.PaymentLinkRequest(checkout.PaymentLinkRequest{ - Amount: checkout.Amount{ - Value: 1250, - Currency: "EUR", - }, - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, }) res, httpRes, err := service.PaymentLinksApi.PaymentLinks(context.Background(), req) - require.NotNil(t, err) - assert.Contains(t, err.Error(), "'reference' is not provided") - require.NotNil(t, httpRes) - require.NotNil(t, res) - }) - t.Run("Create an API request that should pass", func(t *testing.T) { - res, httpRes, err := createPaymentLink() - require.Nil(t, err) require.NotNil(t, httpRes) assert.Equal(t, 201, httpRes.StatusCode) @@ -250,37 +188,6 @@ func Test_Checkout(t *testing.T) { assert.Equal(t, checkout.Amount{Currency: "EUR", Value: 1250}, res.Amount) assert.NotNil(t, res.Url) }) - - t.Run("Get payment link", func(t *testing.T) { - paymentLink, _, _ := createPaymentLink() - req := service.PaymentLinksApi.GetPaymentLinkInput(paymentLink.Id) - res, httpRes, err := service.PaymentLinksApi.GetPaymentLink(context.Background(), req) - - require.Nil(t, err) - require.NotNil(t, httpRes) - assert.Equal(t, 200, httpRes.StatusCode) - require.NotNil(t, res) - assert.Equal(t, paymentLink.Reference, res.Reference) - assert.Equal(t, paymentLink.Status, res.Status) - assert.NotNil(t, res.Url) - }) - - t.Run("Update payment link", func(t *testing.T) { - paymentLink, _, _ := createPaymentLink() - req := service.PaymentLinksApi.UpdatePaymentLinkInput(paymentLink.Id) - req = req.UpdatePaymentLinkRequest(checkout.UpdatePaymentLinkRequest{ - Status: "expired", - }) - res, httpRes, err := service.PaymentLinksApi.UpdatePaymentLink(context.Background(), req) - - require.Nil(t, err) - require.NotNil(t, httpRes) - assert.Equal(t, 200, httpRes.StatusCode) - require.NotNil(t, res) - assert.Equal(t, paymentLink.Reference, res.Reference) - assert.NotEqual(t, paymentLink.Status, res.Status) - assert.NotNil(t, res.Url) - }) }) t.Run("PaymentSession", func(t *testing.T) { @@ -293,7 +200,7 @@ func Test_Checkout(t *testing.T) { Currency: "EUR", }, CountryCode: "NL", - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, Channel: common.PtrString("iOS"), ReturnUrl: "http://localhost:3000/redirect", }) @@ -305,6 +212,7 @@ func Test_Checkout(t *testing.T) { assert.Equal(t, 422, httpRes.StatusCode) require.NotNil(t, res) }) + t.Run("Create an API request that should pass", func(t *testing.T) { req := service.ClassicCheckoutSDKApi.PaymentSessionInput() req = req.PaymentSetupRequest(checkout.PaymentSetupRequest{ @@ -314,7 +222,7 @@ func Test_Checkout(t *testing.T) { Currency: "EUR", }, CountryCode: "NL", - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, Channel: common.PtrString("Web"), ReturnUrl: "http://localhost:3000/redirect", SdkVersion: common.PtrString("1.9.5"), @@ -374,77 +282,6 @@ func Test_Checkout(t *testing.T) { }) t.Run("Orders", func(t *testing.T) { - t.Run("Get balance", func(t *testing.T) { - // @TODO review this test/config - t.Skip("Payment method not correctly configured in the backoffice") - req := service.OrdersApi.GetBalanceOfGiftCardInput() - req = req.BalanceCheckRequest(checkout.BalanceCheckRequest{ - MerchantAccount: MerchantAccount, - PaymentMethod: map[string]string{ - "type": "giftcard", - "brand": "givex", - "number": "603628672882001915092", - "holderName": "balance EUR 100", - "cvc": "5754", - }, - }) - res, httpRes, err := service.OrdersApi.GetBalanceOfGiftCard(context.Background(), req) - - require.Nil(t, err) - require.NotNil(t, httpRes) - assert.Equal(t, 200, httpRes.StatusCode) - require.NotNil(t, res) - assert.Equal(t, int64(100), res.Balance.Value) - }) - - t.Run("Create order", func(t *testing.T) { - req := service.OrdersApi.OrdersInput() - req = req.CreateOrderRequest(checkout.CreateOrderRequest{ - Amount: checkout.Amount{ - Currency: "EUR", - Value: 1000, - }, - MerchantAccount: MerchantAccount, - Reference: "CREATE_ORDER_REF", - }) - res, httpRes, err := service.OrdersApi.Orders(context.Background(), req) - - require.Nil(t, err) - require.NotNil(t, httpRes) - assert.Equal(t, 200, httpRes.StatusCode) - require.NotNil(t, res) - assert.Equal(t, int64(1000), res.RemainingAmount.Value) - }) - - t.Run("Cancel order", func(t *testing.T) { - req := service.OrdersApi.OrdersInput() - req = req.CreateOrderRequest(checkout.CreateOrderRequest{ - Amount: checkout.Amount{ - Currency: "EUR", - Value: 1000, - }, - MerchantAccount: MerchantAccount, - Reference: "CREATE_ORDER_REF", - }) - order, _, _ := service.OrdersApi.Orders(context.Background(), req) - - cancelReq := service.OrdersApi.CancelOrderInput() - cancelReq = cancelReq.CancelOrderRequest(checkout.CancelOrderRequest{ - MerchantAccount: MerchantAccount, - Order: checkout.EncryptedOrderData{ - OrderData: order.OrderData, - PspReference: order.GetPspReference(), - }, - }) - res, httpRes, err := service.OrdersApi.CancelOrder(context.Background(), cancelReq) - - require.Nil(t, err) - require.NotNil(t, httpRes) - assert.Equal(t, 200, httpRes.StatusCode) - require.NotNil(t, res) - assert.Equal(t, "Received", res.ResultCode) - }) - t.Run("Create an API request that should fail", func(t *testing.T) { req := service.OrdersApi.OrdersInput() // missing required "reference" field @@ -453,7 +290,7 @@ func Test_Checkout(t *testing.T) { Currency: "EUR", Value: 1000, }, - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, }) res, httpRes, err := service.OrdersApi.Orders(context.Background(), req) @@ -474,7 +311,7 @@ func Test_Checkout(t *testing.T) { Currency: "EUR", }, CountryCode: common.PtrString("NL"), - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, Channel: common.PtrString("Web"), ReturnUrl: "http://localhost:3000/redirect", } @@ -507,7 +344,7 @@ func Test_Checkout(t *testing.T) { body := checkout.CardDetailsRequest{ CardNumber: "37000000", CountryCode: common.PtrString("NL"), - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, } req := service.PaymentsApi.CardDetailsInput().CardDetailsRequest(body) @@ -524,7 +361,7 @@ func Test_Checkout(t *testing.T) { body := checkout.CardDetailsRequest{ CardNumber: "3700", CountryCode: common.PtrString("NL"), - MerchantAccount: MerchantAccount, + MerchantAccount: merchantAccount, } req := service.PaymentsApi.CardDetailsInput().CardDetailsRequest(body) diff --git a/tests/checkout/unit_test.go b/tests/checkout/unit_test.go new file mode 100644 index 000000000..4f4377fbc --- /dev/null +++ b/tests/checkout/unit_test.go @@ -0,0 +1,244 @@ +package checkout + +import ( + "context" + "github.com/adyen/adyen-go-api-library/v8/src/adyen" + "github.com/adyen/adyen-go-api-library/v8/src/checkout" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/tests" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "io" + "io/ioutil" + "net/http" + "net/http/httptest" + "testing" +) + +func TestCheckout(t *testing.T) { + client := adyen.NewClient(&common.Config{ + ApiKey: "YOUR_ADYEN_API_KEY", + Environment: "TEST", + }) + merchantAccount := "YOUR_MERCHANT_ACCOUNT" + + mux := http.NewServeMux() + + mockResponse := tests.MockResponse(t, mux) + mockOk := func(method, endpoint, fixture string) { + mockResponse(http.StatusOK, method, endpoint, fixture) + } + mockCreated := func(method, endpoint, fixture string) { + mockResponse(http.StatusCreated, method, endpoint, fixture) + } + + // Success cases + mockOk("POST", "/payments", "checkout/authorised_card.json") + mockOk("POST", "/paymentMethods", "checkout/payment_methods.json") + mockOk("POST", "/paymentMethods/balance", "checkout/gift_card_balance.json") + mockOk("POST", "/orders", "checkout/order_created.json") + mockOk("GET PATCH", "/paymentLinks/PL61C53A8B97E6915A", "checkout/payment_link.json") + mockCreated("POST", "/sessions", "checkout/session_created.json") + + mux.HandleFunc("/orders/cancel", func(w http.ResponseWriter, r *http.Request) { + require.Equal(t, "POST", r.Method) + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, `{ + "pspReference": "8816178914079738", + "resultCode": "Received" + }`) + }) + + mockServer := httptest.NewServer(mux) + defer mockServer.Close() + client.Checkout().PaymentsApi.BasePath = func() string { return mockServer.URL } + service := client.Checkout() + + t.Run("Configuration", func(t *testing.T) { + liveClient := adyen.NewClient(&common.Config{ + ApiKey: "LIVE_API_KEY", + Environment: common.LiveEnv, + LiveEndpointURLPrefix: "abc123", + Debug: false, + }) + require.Equal(t, "https://abc123-checkout-live.adyenpayments.com/checkout/"+adyen.CheckoutAPIVersion, liveClient.Checkout().PaymentsApi.BasePath()) + }) + + t.Run("PaymentMethods", func(t *testing.T) { + t.Run("Create an API request that should pass", func(t *testing.T) { + paymentMethodsRequest := *checkout.NewPaymentMethodsRequest(merchantAccount) + req := service.PaymentsApi.PaymentMethodsInput().PaymentMethodsRequest(paymentMethodsRequest) + res, httpRes, err := service.PaymentsApi.PaymentMethods(context.Background(), req) + + require.NotNil(t, res) + require.NotNil(t, httpRes) + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + resBody, readErr := ioutil.ReadAll(httpRes.Body) + require.NoError(t, readErr) + assert.Contains(t, string(resBody), "paymentMethods") + }) + }) + + t.Run("Payments", func(t *testing.T) { + t.Run("Create an API request that should fail", func(t *testing.T) { + res, httpRes, err := service.PaymentsApi.Payments( + context.Background(), + // missing payment method + service.PaymentsApi.PaymentsInput().PaymentRequest(checkout.PaymentRequest{ + MerchantAccount: merchantAccount, + }), + ) + + require.NotNil(t, err) + assert.Contains(t, err.Error(), "error calling MarshalJSON for type checkout.CheckoutPaymentMethod") + require.Nil(t, httpRes) + require.NotNil(t, res) + }) + + t.Run("Credit card payment", func(t *testing.T) { + card := checkout.NewCardDetails() + card.SetEncryptedCardNumber("test_4111111111111111") + card.SetEncryptedExpiryMonth("test_03") + card.SetEncryptedExpiryYear("test_2030") + card.SetEncryptedSecurityCode("test_737") + paymentRequest := *checkout.NewPaymentRequest( + *checkout.NewAmount("EUR", int64(1234)), + merchantAccount, + checkout.CardDetailsAsCheckoutPaymentMethod(card), + "Reference_example", + "ReturnUrl_example", + ) + paymentRequest.SetCaptureDelayHours(0) // assert int zero value is sent + + req := service.PaymentsApi.PaymentsInput() + req = req.PaymentRequest(paymentRequest) + res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) + + require.NotNil(t, res) + require.NotNil(t, httpRes) + require.Nil(t, err) + + assert.Equal(t, 200, httpRes.StatusCode) + assert.Equal(t, "Authorised", res.GetResultCode()) + require.False(t, res.HasAction()) + assert.NotEmpty(t, res.GetPspReference()) + assert.NotEmpty(t, res.GetResultCode()) + }) + }) + + t.Run("Sessions", func(t *testing.T) { + t.Run("Create an API request that should pass", func(t *testing.T) { + body := checkout.CreateCheckoutSessionRequest{ + Reference: "123456781235", + Amount: checkout.Amount{ + Value: 1250, + Currency: "EUR", + }, + CountryCode: common.PtrString("NL"), + MerchantAccount: merchantAccount, + Channel: common.PtrString("Web"), + ReturnUrl: "http://localhost:3000/redirect", + } + req := service.PaymentsApi.SessionsInput().CreateCheckoutSessionRequest(body) + + res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 201, httpRes.StatusCode) + require.Equal(t, "CS451F2AB1ED897A94", res.GetId()) + }) + }) + + t.Run("Orders", func(t *testing.T) { + t.Run("Get balance", func(t *testing.T) { + req := service.OrdersApi.GetBalanceOfGiftCardInput() + req = req.BalanceCheckRequest(checkout.BalanceCheckRequest{ + MerchantAccount: merchantAccount, + PaymentMethod: map[string]string{ + "type": "giftcard", + "brand": "givex", + "number": "603628672882001915092", + "holderName": "balance EUR 100", + "cvc": "5754", + }, + }) + res, httpRes, err := service.OrdersApi.GetBalanceOfGiftCard(context.Background(), req) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, res) + assert.Equal(t, int64(5000), res.Balance.Value) + }) + + t.Run("Create order", func(t *testing.T) { + req := service.OrdersApi.OrdersInput() + req = req.CreateOrderRequest(checkout.CreateOrderRequest{ + Amount: checkout.Amount{ + Currency: "EUR", + Value: 2500, + }, + MerchantAccount: merchantAccount, + Reference: "CREATE_ORDER_REF", + }) + res, httpRes, err := service.OrdersApi.Orders(context.Background(), req) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, res) + assert.Equal(t, int64(2500), res.RemainingAmount.Value) + }) + + t.Run("Cancel order", func(t *testing.T) { + cancelReq := service.OrdersApi.CancelOrderInput() + cancelReq = cancelReq.CancelOrderRequest(checkout.CancelOrderRequest{ + MerchantAccount: merchantAccount, + Order: checkout.EncryptedOrderData{ + OrderData: "823fh892f8f18f4...148f13f9f3f", + PspReference: "8815517812932012", + }, + }) + res, httpRes, err := service.OrdersApi.CancelOrder(context.Background(), cancelReq) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, res) + assert.Equal(t, "Received", res.ResultCode) + }) + }) + + t.Run("PaymentLinks", func(t *testing.T) { + paymentLinkId := "PL61C53A8B97E6915A" + t.Run("Get payment link", func(t *testing.T) { + req := service.PaymentLinksApi.GetPaymentLinkInput(paymentLinkId) + res, httpRes, err := service.PaymentLinksApi.GetPaymentLink(context.Background(), req) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, res) + assert.Equal(t, "shopper-reference-ekvL83", res.Reference) + assert.Equal(t, "active", res.Status) + assert.NotNil(t, res.Url) + }) + + t.Run("Update payment link", func(t *testing.T) { + req := service.PaymentLinksApi.UpdatePaymentLinkInput(paymentLinkId) + req = req.UpdatePaymentLinkRequest(checkout.UpdatePaymentLinkRequest{ + Status: "expired", + }) + res, httpRes, err := service.PaymentLinksApi.UpdatePaymentLink(context.Background(), req) + + require.Nil(t, err) + require.NotNil(t, httpRes) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, res) + assert.Equal(t, "shopper-reference-ekvL83", res.Reference) + assert.NotNil(t, res.Url) + }) + }) +} diff --git a/tests/fixtures/checkout/authorised_card.json b/tests/fixtures/checkout/authorised_card.json new file mode 100644 index 000000000..2a0d70891 --- /dev/null +++ b/tests/fixtures/checkout/authorised_card.json @@ -0,0 +1,15 @@ +{ + "additionalData": { + "cvcResult": "1 Matches", + "authCode": "065696", + "avsResult": "4 AVS not supported for this card type", + "avsResultRaw": "4", + "cvcResultRaw": "M", + "refusalReasonRaw": "AUTHORISED", + "acquirerCode": "TestPmmAcquirer", + "acquirerReference": "8PQMP9VIE9N" + }, + "pspReference": "993617895215577D", + "resultCode": "Authorised", + "merchantReference": "string" +} \ No newline at end of file diff --git a/tests/fixtures/checkout/gift_card_balance.json b/tests/fixtures/checkout/gift_card_balance.json new file mode 100644 index 000000000..f233c12d1 --- /dev/null +++ b/tests/fixtures/checkout/gift_card_balance.json @@ -0,0 +1,8 @@ +{ + "pspReference": "KHQC5N7G84BLNK43", + "resultCode": "Success", + "balance": { + "currency": "EUR", + "value": 5000 + } +} \ No newline at end of file diff --git a/tests/fixtures/checkout/order_created.json b/tests/fixtures/checkout/order_created.json new file mode 100644 index 000000000..04c5d26fc --- /dev/null +++ b/tests/fixtures/checkout/order_created.json @@ -0,0 +1,15 @@ +{ + "pspReference": "8616178914061985", + "resultCode": "Success", + "expiresAt": "2021-04-09T14:16:46Z", + "orderData": "Ab02b4c0!BQABAgCxXvknCldOcRElkxY8Za7iyym4Wv8aDzyNwmj/3nh4G6YtwnUIJHaK62NlN4oIsACdkn1FEjBwKlheG40jvXcYGBk4KFV5WvOhTVCpv/KXnkrI7xQv/u2lE7U4wA+HPB6K4Zj2L8xO/ogZi+zGZqFs5m16jmkH7ku6FzXygXLNuUCuOlmlXSZhdkHHTNVQSq1MELDK9OL74y532ETRPTCNxx8WlEiZB+LDqYrPvH9GgigtD5kw8Do45jfFfG72kWBEgfYqp4mbUmBB9ebXFYZKfF0qvW1x7A2Y9+/MFlTIdXfKW484bJeDBCTTrmKGXIj+U4r5imr5fXTyNLcrxyUqwrb9jg+5B4qg1XB6Cgj5UPlSI4O62I7v0s5TTj69dzLwUQRxSQbwLrZVGYavXzeVKI54BVLRV3d/+BbPvTqnTo34UhfZbPlOx9F2eyaS0ZXdOKnHw89uGUgxUpLsMqnbRysi/pxpZaulel+0mExb68wVxb/7Teob5eRG4gp7cfZVZs6tLXOYWL+W0TqIlsa3hWsfM0LeaovzkoDtW/pK5JABXwMtLig9tsxoEh9ONYtIzkXC21LZ8ebiuSIMaPizjF8yca+QxrCZalQsu6uKnBz/mm8nnsflaGU2QS5zcoxk1RudL1Bl36LM9UZGPpFEYWiYA4sUsnNLw7peJjWCGhDepnwMv4TlgsEtoDtz1T54AEp7ImtleSI6IkFGMEFBQTEwM0NBNTM3RUFFRDg3QzI0REQ1MzkwOUI4MEE3OEE5MjNFMzgyM0Q2OERBQ0M5NEI5RkY4MzA1REMifRslOdmfgUHTXl66WPD9xoW2whIeRx/jR++2MqNE16x6zQy+KtDN8/h60crZwmqkjVTQYqQlsYSYDHSIyb4wnnay16/5il1yS7vN3UCLaTXjYBIAyyx6Wr9j4P3CI/etB+PpviHoESC4mV6ZN4whMDQyziQ8s230GtboXbh42qND7rk9phySBogowQlXrtF+l2n2F46nyif0owEgik5fGARfvjZtY2w23s30KMLNwU4gWSvX4H6RMVS8TfZH2fKfNrwB3tZUXwYkELs5ntaHysswq5Mn5aq2BKAMHu/Rh/wureMSI73Qi0avjrzWCwzt3JH4wnzErMnOZwSdgA==", + "reference": "shopper-reference-ekvL83", + "remainingAmount": { + "currency": "EUR", + "value": 2500 + }, + "amount": { + "currency": "EUR", + "value": 300 + } +} \ No newline at end of file diff --git a/tests/fixtures/checkout/payment_link.json b/tests/fixtures/checkout/payment_link.json new file mode 100644 index 000000000..84a1b2166 --- /dev/null +++ b/tests/fixtures/checkout/payment_link.json @@ -0,0 +1,15 @@ +{ + "amount": { + "currency": "EUR", + "value": 8700 + }, + "countryCode": "NL", + "expiresAt": "2021-04-08T14:06:39Z", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "reference": "shopper-reference-ekvL83", + "shopperLocale": "hu-HU", + "shopperReference": "shopper-reference-LZfdWZ", + "status": "active", + "url": "https://test.adyen.link/PL61C53A8B97E6915A", + "id": "PL61C53A8B97E6915A" +} \ No newline at end of file diff --git a/tests/fixtures/checkout/payment_methods.json b/tests/fixtures/checkout/payment_methods.json new file mode 100644 index 000000000..56838b2f6 --- /dev/null +++ b/tests/fixtures/checkout/payment_methods.json @@ -0,0 +1,621 @@ +{ + "paymentMethods": [ + { + "details": [ + { + "items": [ + { + "id": "1121", + "name": "Test Issuer" + }, + { + "id": "1154", + "name": "Test Issuer 5" + }, + { + "id": "1153", + "name": "Test Issuer 4" + }, + { + "id": "1152", + "name": "Test Issuer 3" + }, + { + "id": "1151", + "name": "Test Issuer 2" + }, + { + "id": "1162", + "name": "Test Issuer Cancelled" + }, + { + "id": "1161", + "name": "Test Issuer Pending" + }, + { + "id": "1160", + "name": "Test Issuer Refused" + }, + { + "id": "1159", + "name": "Test Issuer 10" + }, + { + "id": "1158", + "name": "Test Issuer 9" + }, + { + "id": "1157", + "name": "Test Issuer 8" + }, + { + "id": "1156", + "name": "Test Issuer 7" + }, + { + "id": "1155", + "name": "Test Issuer 6" + } + ], + "key": "issuer", + "type": "select" + } + ], + "name": "iDEAL", + "type": "ideal" + }, + { + "details": [ + { + "key": "encryptedCardNumber", + "type": "cardToken" + }, + { + "key": "encryptedSecurityCode", + "type": "cardToken" + }, + { + "key": "encryptedExpiryMonth", + "type": "cardToken" + }, + { + "key": "encryptedExpiryYear", + "type": "cardToken" + }, + { + "key": "holderName", + "optional": true, + "type": "text" + } + ], + "name": "Credit Card", + "type": "scheme" + }, + { + "name": "PayPal", + "type": "paypal" + }, + { + "details": [ + { + "details": [ + { + "key": "firstName", + "type": "text" + }, + { + "key": "lastName", + "type": "text" + }, + { + "items": [ + { + "id": "M", + "name": "male" + }, + { + "id": "F", + "name": "female" + } + ], + "key": "gender", + "type": "radio" + }, + { + "key": "dateOfBirth", + "type": "date" + }, + { + "key": "telephoneNumber", + "type": "tel" + }, + { + "key": "shopperEmail", + "type": "emailAddress" + } + ], + "key": "personalDetails", + "type": "fieldSet" + }, + { + "details": [ + { + "key": "street", + "type": "text" + }, + { + "key": "houseNumberOrName", + "type": "text" + }, + { + "key": "city", + "type": "text" + }, + { + "key": "postalCode", + "type": "text" + }, + { + "key": "stateOrProvince", + "optional": true, + "type": "text" + }, + { + "items": [ + { + "id": "NL", + "name": "Netherlands" + }, + { + "id": "BE", + "name": "Belgium" + } + ], + "key": "country", + "type": "select", + "value": "NL" + } + ], + "key": "billingAddress", + "type": "address" + }, + { + "key": "separateDeliveryAddress", + "optional": true, + "type": "boolean", + "value": "false" + }, + { + "details": [ + { + "key": "street", + "type": "text" + }, + { + "key": "houseNumberOrName", + "type": "text" + }, + { + "key": "city", + "type": "text" + }, + { + "key": "postalCode", + "type": "text" + }, + { + "key": "stateOrProvince", + "optional": true, + "type": "text" + }, + { + "items": [ + { + "id": "NL", + "name": "Netherlands" + }, + { + "id": "BE", + "name": "Belgium" + } + ], + "key": "country", + "type": "select", + "value": "NL" + } + ], + "key": "deliveryAddress", + "optional": true, + "type": "address" + } + ], + "name": "AfterPay Invoice", + "type": "afterpay_default" + }, + { + "name": "Pay later with Klarna.", + "type": "klarna" + }, + { + "details": [ + { + "key": "sepa.ownerName", + "type": "text" + }, + { + "key": "sepa.ibanNumber", + "type": "text" + } + ], + "name": "SEPA Direct Debit", + "type": "sepadirectdebit" + }, + { + "name": "Paysafecard", + "type": "paysafecard" + }, + { + "name": "Bijenkorf Cadeaucard", + "type": "bijcadeaucard" + }, + { + "name": "Fonq Giftcard", + "type": "fonqgiftcard" + }, + { + "name": "Bank Transfer (NL)", + "type": "bankTransfer_NL" + }, + { + "name": "Pathe Giftcard", + "type": "pathegiftcard" + }, + { + "name": "VVV Giftcard", + "type": "vvvgiftcard" + }, + { + "name": "Podium Card", + "type": "podiumcard" + }, + { + "name": "RatePay Direct Debit", + "type": "ratepay_directdebit" + }, + { + "name": "Rituals Giftcard", + "type": "rituals" + }, + { + "name": "Hunkemoller Lingerie Card", + "type": "hmlingerie" + }, + { + "name": "Primera Cadeaukaart", + "type": "primeracadeaucard" + }, + { + "name": "Fashioncheque", + "type": "fashioncheque" + }, + { + "name": "NETELLER", + "type": "neteller" + }, + { + "name": "Adyen Voucher", + "type": "adyen_test_voucher" + }, + { + "name": "AfterPay B2B", + "type": "afterpay_b2b" + }, + { + "name": "AfterPay DirectDebit", + "type": "afterpay_directdebit" + }, + { + "name": "AliPay", + "type": "alipay" + }, + { + "name": "AliPay", + "type": "alipay_wap" + }, + { + "details": [ + { + "key": "additionalData.androidpay.token", + "type": "androidPayToken" + } + ], + "name": "Android Pay", + "type": "androidpay" + }, + { + "details": [ + { + "key": "additionalData.applepay.token", + "type": "applePayToken" + } + ], + "name": "Apple Pay", + "type": "applepay" + }, + { + "name": "Baby Gift Card", + "type": "babygiftcard" + }, + { + "name": "SEPA Bank Transfer", + "type": "bankTransfer_IBAN" + }, + { + "name": "Bloemen Giftcard", + "type": "bloemengiftcard" + }, + { + "name": "Boekenbon Giftcard", + "type": "boekenbon" + }, + { + "name": "Cash-Ticket", + "type": "cashticket" + }, + { + "name": "Chasin Giftcard", + "type": "chasingiftcard" + }, + { + "name": "ClickandBuy", + "type": "clickandbuy" + }, + { + "name": "Costes Giftcard", + "type": "costesgiftcard" + }, + { + "name": "custom_settlement", + "type": "custom_settlement" + }, + { + "name": "eft_directdebit_CA", + "type": "eft_directdebit_CA" + }, + { + "name": "Nationale Entertainment Card", + "type": "entertainmentcard" + }, + { + "name": "Expert Cadeaukaart", + "type": "expertgiftcard" + }, + { + "name": "FijnCadeau", + "type": "fijncadeau" + }, + { + "name": "Fleurop Bloemenbon", + "type": "fleuropbloemenbon" + }, + { + "name": "Gall & Gall", + "type": "gallgall" + }, + { + "name": "Generic GiftCard", + "type": "genericgiftcard" + }, + { + "name": "GiftFor2", + "type": "giftfor2card" + }, + { + "name": "Givex", + "type": "givex" + }, + { + "name": "Goldsmiths Card", + "type": "goldsmithscard" + }, + { + "name": "Hunkemoller Member Card", + "type": "hmclub" + }, + { + "name": "Phone Payment", + "type": "ivr" + }, + { + "name": "Landline phone", + "type": "ivrLandline" + }, + { + "name": "Mobile phone", + "type": "ivrMobile" + }, + { + "name": "Kado Wereld", + "type": "kadowereld" + }, + { + "name": "Karen Millen GiftCard", + "type": "karenmillengiftcard" + }, + { + "name": "Leisure Card", + "type": "leisurecard" + }, + { + "name": "Loods5 Cadeaukaart", + "type": "loods5giftcard" + }, + { + "name": "Loods5 Tegoedbon", + "type": "loods5prepaidcard" + }, + { + "details": [ + { + "key": "additionalData.amazonPayToken", + "type": "text" + } + ], + "name": "Amazon Pay", + "supportsRecurring": true, + "type": "amazonpay" + }, + { + "name": "MOLPoints", + "type": "molpay_points" + }, + { + "name": "Moneybookers", + "type": "moneybookers" + }, + { + "name": "De Nationale Musicalcard", + "type": "musicalcard" + }, + { + "name": "Nationale Bioscoopbon", + "type": "nationalebioscoopbon" + }, + { + "name": "Nationale Tuinbon", + "type": "nationaletuinbon" + }, + { + "name": "Nationale Verwen Cadeaubon", + "type": "nationaleverwencadeaubon" + }, + { + "name": "Onebip", + "type": "onebip" + }, + { + "details": [ + { + "key": "additionalData.paywithgoogle.token", + "type": "payWithGoogleToken" + } + ], + "name": "Google Pay", + "type": "paywithgoogle" + }, + { + "name": "Plastix", + "type": "plastix" + }, + { + "name": "Pluim", + "type": "pluimgiftcard" + }, + { + "name": "Illicado Gift Card", + "type": "prosodie_illicado" + }, + { + "name": "RatePay Invoice", + "type": "ratepay" + }, + { + "name": "Rob Peetoom Giftcard", + "type": "robpeetoomgiftcard" + }, + { + "name": "Shoes&Accessories Cadeau", + "type": "sagiftcard" + }, + { + "name": "Score Giftcard", + "type": "scoregiftcard" + }, + { + "name": "Premium SMS", + "type": "sms" + }, + { + "name": "SVS", + "type": "svs" + }, + { + "name": "TCS Test GiftCard", + "type": "tcstestgiftcard" + }, + { + "name": "The Sting Giftcard", + "type": "thestinggiftcard" + }, + { + "name": "Ukash", + "type": "ukash" + }, + { + "name": "UnionPay", + "type": "unionpay" + }, + { + "name": "Valuelink", + "type": "valuelink" + }, + { + "name": "V&D Cadeaukaart", + "type": "vdcadeaucard" + }, + { + "details": [ + { + "key": "additionalData.visacheckout.callId", + "type": "text" + } + ], + "name": "Visa Checkout", + "type": "visacheckout" + }, + { + "name": "VVV Cadeaubon", + "type": "vvvcadeaubon" + }, + { + "name": "Webshop Giftcard", + "type": "webshopgiftcard" + }, + { + "name": "WE Fashion Giftcard", + "type": "wefashiongiftcard" + }, + { + "name": "Western Union", + "type": "westernunion" + }, + { + "name": "Winkel Cheque", + "type": "winkelcheque" + }, + { + "name": "Your Gift", + "type": "yourgift" + } + ], + "storedPaymentMethods": [ + { + "brand": "visa", + "expiryMonth": "10", + "expiryYear": "30", + "holderName": "John Smith", + "id": "7219687191761347", + "issuerName": "ISSUER_NAME", + "lastFour": "1111", + "name": "VISA", + "shopperEmail": "john.smith@example.com", + "shopperReference": "YOUR_SHOPPER_REFERENCE", + "supportedRecurringProcessingModels": [ + "CardOnFile", + "Subscription", + "UnscheduledCardOnFile" + ], + "type": "scheme" + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/checkout/session_created.json b/tests/fixtures/checkout/session_created.json new file mode 100644 index 000000000..82d76cdc4 --- /dev/null +++ b/tests/fixtures/checkout/session_created.json @@ -0,0 +1,13 @@ +{ + "amount": { + "currency": "EUR", + "value": 100 + }, + "countryCode": "NL", + "expiresAt": "2022-01-11T13:53:18+01:00", + "id": "CS451F2AB1ED897A94", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "reference": "YOUR_PAYMENT_REFERENCE", + "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", + "sessionData": "Ab02b4c0!BQABAgBfYI29..." +} \ No newline at end of file diff --git a/tests/legalentity/integration_test.go b/tests/legalentity/integration_test.go index 96a56acc2..47c1c247c 100644 --- a/tests/legalentity/integration_test.go +++ b/tests/legalentity/integration_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package legalentity import ( diff --git a/tests/management/integration_test.go b/tests/management/integration_test.go index f30d67e6e..4dc947823 100644 --- a/tests/management/integration_test.go +++ b/tests/management/integration_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package management import ( @@ -15,10 +18,6 @@ import ( func Test_ManagementAPI_Integration(t *testing.T) { godotenv.Load("./../../.env") - if os.Getenv("ADYEN_API_KEY") == "" { - t.Skip("Integration tests require credentials") - } - client := adyen.NewClient(&common.Config{ ApiKey: os.Getenv("ADYEN_API_KEY"), Environment: common.TestEnv, diff --git a/tests/mocking.go b/tests/mocking.go new file mode 100644 index 000000000..11ca271f7 --- /dev/null +++ b/tests/mocking.go @@ -0,0 +1,36 @@ +package tests + +import ( + "github.com/stretchr/testify/assert" + "io" + "log" + "net/http" + "os" + "path/filepath" + "strings" + "testing" +) + +type MockHandlerFunc func(status int, method, endpoint, fixture string) + +func MockResponse(t *testing.T, mux *http.ServeMux) MockHandlerFunc { + return func(status int, method, endpoint, fixture string) { + mux.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) { + assert.Contains(t, strings.Fields(method), r.Method) + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(status) + + file, err := os.Open(filepath.Join("fixtures", fixture)) + if err != nil { + file, err = os.Open(filepath.Join("..", "fixtures", fixture)) + } + if err != nil { + log.Fatal(err) + } + if _, err := io.Copy(w, file); err != nil { + log.Fatal(err) + } + }) + } +} diff --git a/tests/model_payment_response_test.go b/tests/model_payment_response_test.go index 415f1f16d..00aceb2de 100644 --- a/tests/model_payment_response_test.go +++ b/tests/model_payment_response_test.go @@ -1,13 +1,3 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/online-payments). ## Authentication Each response to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v67/payments ``` - * - * API version: 67 - * Contact: developer-experience@adyen.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - package tests import ( diff --git a/tests/payment_test.go b/tests/payment_test.go index 05d0c6e98..22187275e 100644 --- a/tests/payment_test.go +++ b/tests/payment_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package tests import ( diff --git a/tests/platforms_test.go b/tests/platforms_test.go index 217d12f00..714b5446c 100644 --- a/tests/platforms_test.go +++ b/tests/platforms_test.go @@ -1,8 +1,5 @@ -/* - * Adyen API Client - * - * Contact: support@adyen.com - */ +//go:build integration +// +build integration package tests diff --git a/tests/recurring_test.go b/tests/recurring_test.go index 901b9e0af..25cb0ddc1 100644 --- a/tests/recurring_test.go +++ b/tests/recurring_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package tests import ( diff --git a/tests/storedvalue_test.go b/tests/storedvalue_test.go index 2fff17fdd..ed77d3c46 100644 --- a/tests/storedvalue_test.go +++ b/tests/storedvalue_test.go @@ -2,6 +2,7 @@ package tests import ( "context" + "errors" "github.com/adyen/adyen-go-api-library/v8/src/adyen" "github.com/adyen/adyen-go-api-library/v8/src/common" "github.com/adyen/adyen-go-api-library/v8/src/storedvalue" @@ -89,7 +90,8 @@ func Test_StoredValue(t *testing.T) { _, httpRes, err := client.StoredValue().VoidTransaction(context.Background(), req) assert.Equal(t, 500, httpRes.StatusCode) - apiError := err.(common.APIError) + var apiError common.APIError + errors.As(err, &apiError) assert.Equal(t, "306", apiError.Code) assert.Equal(t, "No voidable transaction found", apiError.Message) }) diff --git a/tests/transfers_test.go b/tests/transfers_test.go index 4c795de17..527b46426 100644 --- a/tests/transfers_test.go +++ b/tests/transfers_test.go @@ -7,7 +7,6 @@ import ( "io" "net/http" "net/http/httptest" - "os" "testing" "time" @@ -25,7 +24,7 @@ func Test_Transfers(t *testing.T) { mux := http.NewServeMux() - // Success case + // Success cases mux.HandleFunc("/transfers", func(w http.ResponseWriter, r *http.Request) { require.Equal(t, "POST", r.Method) w.Header().Set("Content-Type", "application/json") @@ -92,13 +91,9 @@ func Test_Transfers(t *testing.T) { "status": "Pending" }`) }) - mux.HandleFunc("/transactions", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "GET", r.Method) - assert.Equal(t, "2022-01-01T01:02:03Z", r.URL.Query().Get("createdSince")) - w.Header().Set("Content-Type", "application/json") - file, _ := os.Open("fixtures/all_transactions.json") - io.Copy(w, file) - }) + + mockResponse := MockResponse(t, mux) + mockResponse(http.StatusOK, "GET", "/transactions", "all_transactions.json") // Error case mux.HandleFunc("/transactions/ERRForbidden403", func(w http.ResponseWriter, r *http.Request) { From 653e0a86fda68580c6fbe5dfe551aa42ab67781c Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Fri, 3 Nov 2023 14:23:31 +0100 Subject: [PATCH 4/9] Update all models/services (#260) * [create-pull-request] automated change * Fix Classic Payments API --------- Co-authored-by: Adyen Automation --- src/adyen/api.go | 2 +- src/balanceplatform/api_account_holders.go | 129 +++- src/balanceplatform/api_balance_accounts.go | 55 +- .../api_bank_account_validation.go | 4 - src/balanceplatform/api_grant_accounts.go | 5 - src/balanceplatform/api_grant_offers.go | 10 - src/balanceplatform/api_network_tokens.go | 8 - .../api_payment_instrument_groups.go | 15 - .../api_payment_instruments.go | 30 - src/balanceplatform/api_platform.go | 10 - src/balanceplatform/api_transaction_rules.go | 20 - src/balanceplatform/api_transfer_routes.go | 107 +++ src/balanceplatform/client.go | 3 + .../model_address_requirement.go | 202 ++++++ .../model_amount_min_max_requirement.go | 239 +++++++ src/balanceplatform/model_balance_account.go | 2 +- .../model_balance_account_base.go | 2 +- .../model_balance_account_info.go | 2 +- .../model_balance_account_update_request.go | 37 -- src/balanceplatform/model_bank_account.go | 115 ++++ ...del_bank_account_account_identification.go | 563 ++++++++++++++++ ...account_identification_type_requirement.go | 202 ++++++ .../model_bank_identification.go | 206 ++++++ src/balanceplatform/model_counterparty.go | 161 +++++ .../model_counterparty_bank_restriction.go | 153 +++++ .../model_create_sweep_configuration_v2.go | 541 +++++++++++++++ src/balanceplatform/model_delivery_address.go | 6 +- .../model_get_tax_form_response.go | 163 +++++ .../model_hk_local_account_identification.go | 30 +- .../model_nz_local_account_identification.go | 60 +- .../model_payment_instrument_requirement.go | 285 ++++++++ .../model_platform_payment_configuration.go | 4 +- .../model_sweep_configuration_v2.go | 2 +- .../model_sweep_counterparty.go | 4 +- src/balanceplatform/model_transaction_rule.go | 2 +- .../model_transaction_rule_info.go | 2 +- .../model_transaction_rule_restrictions.go | 36 + src/balanceplatform/model_transfer_route.go | 291 ++++++++ .../model_transfer_route_request.go | 329 ++++++++++ .../model_transfer_route_requirements.go | 203 ++++++ .../model_transfer_route_response.go | 125 ++++ .../model_update_sweep_configuration_v2.go | 2 +- src/binlookup/model_ds_public_key_detail.go | 37 ++ .../model_create_checkout_session_request.go | 37 ++ .../model_create_checkout_session_response.go | 37 ++ .../model_payment_amount_update_request.go | 38 +- src/checkout/model_payment_cancel_request.go | 36 + src/checkout/model_payment_capture_request.go | 38 +- src/checkout/model_payment_details.go | 2 +- src/checkout/model_payment_refund_request.go | 38 +- src/checkout/model_payment_request.go | 2 +- .../model_payment_reversal_request.go | 36 + src/checkout/model_split.go | 45 +- src/checkout/model_split_amount.go | 4 +- ...model_standalone_payment_cancel_request.go | 36 + .../model_account_holder_capability.go | 37 -- .../model_balance_account.go | 2 +- .../model_platform_payment_configuration.go | 4 +- .../model_sweep_configuration_v2.go | 2 +- .../model_sweep_counterparty.go | 4 +- src/legalentity/api_documents.go | 18 +- src/legalentity/api_legal_entities.go | 14 +- src/legalentity/api_pci_questionnaires.go | 4 +- src/legalentity/api_terms_of_service.go | 8 +- src/legalentity/api_transfer_instruments.go | 14 +- .../model_accept_terms_of_service_request.go | 2 +- .../model_accept_terms_of_service_response.go | 2 +- src/legalentity/model_bank_account_info.go | 37 ++ ...ank_account_info_account_identification.go | 30 + src/legalentity/model_business_line.go | 2 +- .../model_generate_pci_description_request.go | 37 ++ ...l_get_terms_of_service_document_request.go | 70 +- ..._get_terms_of_service_document_response.go | 2 +- .../model_hk_local_account_identification.go | 30 +- src/legalentity/model_identification_data.go | 4 +- src/legalentity/model_legal_entity.go | 2 +- .../model_legal_entity_capability.go | 6 +- .../model_nz_local_account_identification.go | 156 +++++ src/legalentity/model_onboarding_link_info.go | 2 +- .../model_supporting_entity_capability.go | 4 +- src/legalentity/model_transfer_instrument.go | 4 +- src/management/api_account_company_level.go | 15 - src/management/api_account_merchant_level.go | 20 - src/management/api_account_store_level.go | 40 -- .../api_allowed_origins_company_level.go | 20 - .../api_allowed_origins_merchant_level.go | 20 - .../api_android_files_company_level.go | 19 - .../api_api_credentials_company_level.go | 20 - .../api_api_credentials_merchant_level.go | 20 - src/management/api_api_key_company_level.go | 5 - src/management/api_api_key_merchant_level.go | 5 - .../api_client_key_company_level.go | 5 - .../api_client_key_merchant_level.go | 5 - src/management/api_my_api_credential.go | 30 - .../api_payment_methods_merchant_level.go | 30 - .../api_payout_settings_merchant_level.go | 25 - .../api_split_configuration_merchant_level.go | 45 -- .../api_terminal_actions_company_level.go | 10 - .../api_terminal_actions_terminal_level.go | 5 - .../api_terminal_orders_company_level.go | 50 -- .../api_terminal_orders_merchant_level.go | 50 -- .../api_terminal_settings_company_level.go | 20 - .../api_terminal_settings_merchant_level.go | 20 - .../api_terminal_settings_store_level.go | 40 -- .../api_terminal_settings_terminal_level.go | 20 - .../api_terminals_terminal_level.go | 10 - src/management/api_users_company_level.go | 20 - src/management/api_users_merchant_level.go | 20 - src/management/api_webhooks_company_level.go | 35 - src/management/api_webhooks_merchant_level.go | 35 - src/payments/api_payments.go | 260 ++++++++ src/payments/client.go | 6 +- src/payments/model_additional_data_airline.go | 26 +- .../model_additional_data_car_rental.go | 24 +- src/payments/model_additional_data_level23.go | 34 +- src/payments/model_additional_data_lodging.go | 10 +- ...odel_additional_data_temporary_services.go | 4 +- src/payments/model_payment_request.go | 2 +- src/payments/model_payment_request3d.go | 2 +- src/payments/model_payment_request3ds2.go | 2 +- src/payments/model_payment_result.go | 4 +- src/payments/model_split.go | 47 +- src/payments/model_split_amount.go | 4 +- src/payments/model_three_ds2_result.go | 86 +-- src/transfers/api_capital.go | 18 - src/transfers/api_transactions.go | 8 - src/transfers/api_transfers.go | 8 - src/transfers/model_rest_service_error.go | 21 +- src/transfers/model_transaction.go | 37 -- .../model_additional_bank_identification.go | 2 +- src/transferwebhook/model_address.go | 2 +- src/transferwebhook/model_amount.go | 2 +- .../model_amount_adjustment.go | 2 +- .../model_au_local_account_identification.go | 2 +- src/transferwebhook/model_balance_mutation.go | 2 +- ..._balance_platform_notification_response.go | 2 +- src/transferwebhook/model_bank_account_v3.go | 2 +- ..._bank_account_v3_account_identification.go | 2 +- .../model_bank_category_data.go | 185 ++++++ .../model_br_local_account_identification.go | 2 +- .../model_ca_local_account_identification.go | 2 +- src/transferwebhook/model_counterparty_v3.go | 2 +- .../model_cz_local_account_identification.go | 2 +- .../model_dk_local_account_identification.go | 2 +- .../model_hk_local_account_identification.go | 32 +- .../model_hu_local_account_identification.go | 2 +- .../model_iban_account_identification.go | 2 +- .../model_internal_category_data.go | 213 ++++++ src/transferwebhook/model_issued_card.go | 304 +++++++++ src/transferwebhook/model_merchant_data.go | 39 +- src/transferwebhook/model_modification.go | 283 ++++++++ src/transferwebhook/model_name_location.go | 2 +- .../model_no_local_account_identification.go | 2 +- ...l_number_and_bic_account_identification.go | 2 +- .../model_nz_local_account_identification.go | 62 +- .../model_party_identification.go | 2 +- .../model_payment_instrument.go | 2 +- .../model_pl_local_account_identification.go | 2 +- src/transferwebhook/model_platform_payment.go | 333 ++++++++++ .../model_relayed_authorisation_data.go | 2 +- src/transferwebhook/model_resource.go | 2 +- .../model_resource_reference.go | 2 +- .../model_se_local_account_identification.go | 2 +- .../model_sg_local_account_identification.go | 2 +- .../model_transaction_event_violation.go | 2 +- .../model_transaction_rule_reference.go | 76 ++- .../model_transaction_rule_source.go | 2 +- .../model_transaction_rules_result.go | 108 +-- src/transferwebhook/model_transfer_data.go | 620 ++---------------- .../model_transfer_data_category_data.go | 203 ++++++ src/transferwebhook/model_transfer_event.go | 156 +++-- .../model_transfer_notification_request.go | 2 +- ...transfer_notification_transfer_tracking.go | 2 +- ...l_transfer_notification_validation_fact.go | 2 +- .../model_uk_local_account_identification.go | 2 +- .../model_us_local_account_identification.go | 2 +- tests/payment_test.go | 20 +- 177 files changed, 7115 insertions(+), 2099 deletions(-) create mode 100644 src/balanceplatform/api_transfer_routes.go create mode 100644 src/balanceplatform/model_address_requirement.go create mode 100644 src/balanceplatform/model_amount_min_max_requirement.go create mode 100644 src/balanceplatform/model_bank_account.go create mode 100644 src/balanceplatform/model_bank_account_account_identification.go create mode 100644 src/balanceplatform/model_bank_account_identification_type_requirement.go create mode 100644 src/balanceplatform/model_bank_identification.go create mode 100644 src/balanceplatform/model_counterparty.go create mode 100644 src/balanceplatform/model_counterparty_bank_restriction.go create mode 100644 src/balanceplatform/model_create_sweep_configuration_v2.go create mode 100644 src/balanceplatform/model_get_tax_form_response.go create mode 100644 src/balanceplatform/model_payment_instrument_requirement.go create mode 100644 src/balanceplatform/model_transfer_route.go create mode 100644 src/balanceplatform/model_transfer_route_request.go create mode 100644 src/balanceplatform/model_transfer_route_requirements.go create mode 100644 src/balanceplatform/model_transfer_route_response.go create mode 100644 src/legalentity/model_nz_local_account_identification.go create mode 100644 src/payments/api_payments.go create mode 100644 src/transferwebhook/model_bank_category_data.go create mode 100644 src/transferwebhook/model_internal_category_data.go create mode 100644 src/transferwebhook/model_issued_card.go create mode 100644 src/transferwebhook/model_modification.go create mode 100644 src/transferwebhook/model_platform_payment.go create mode 100644 src/transferwebhook/model_transfer_data_category_data.go diff --git a/src/adyen/api.go b/src/adyen/api.go index efaa79d38..4e0c633c2 100644 --- a/src/adyen/api.go +++ b/src/adyen/api.go @@ -201,7 +201,7 @@ func (c *APIClient) Checkout() *checkout.APIClient { func (c *APIClient) Payments() *payments.APIClient { if c.payments == nil { c.payments = payments.NewAPIClient(c.client) - c.payments.GeneralApi.BasePath = func() string { + c.payments.PaymentsApi.BasePath = func() string { return fmt.Sprintf("%s/pal/servlet/Payment/%s", c.client.Cfg.Endpoint, PaymentAPIVersion) } } diff --git a/src/balanceplatform/api_account_holders.go b/src/balanceplatform/api_account_holders.go index d051e561b..d2f272e21 100644 --- a/src/balanceplatform/api_account_holders.go +++ b/src/balanceplatform/api_account_holders.go @@ -73,7 +73,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -82,7 +81,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +89,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +97,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +105,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -169,7 +164,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +172,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +180,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +188,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +196,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,117 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + +// All parameters accepted by AccountHoldersApi.GetTaxForm +type AccountHoldersApiGetTaxFormInput struct { + id string + formType *string + year *int32 +} + +// The type of tax form you want to retrieve. Accepted values are **us1099k** and **us1099nec** +func (r AccountHoldersApiGetTaxFormInput) FormType(formType string) AccountHoldersApiGetTaxFormInput { + r.formType = &formType + return r +} + +// The tax year in YYYY format for the tax form you want to retrieve +func (r AccountHoldersApiGetTaxFormInput) Year(year int32) AccountHoldersApiGetTaxFormInput { + r.year = &year + return r +} + +/* +Prepare a request for GetTaxForm +@param id The unique identifier of the account holder. +@return AccountHoldersApiGetTaxFormInput +*/ +func (a *AccountHoldersApi) GetTaxFormInput(id string) AccountHoldersApiGetTaxFormInput { + return AccountHoldersApiGetTaxFormInput{ + id: id, + } +} + +/* +GetTaxForm Get a tax form + +Generates a tax form for account holders operating in the US. For more information, refer to [Providing tax forms](https://docs.adyen.com/marketplaces-and-platforms/us-tax-forms/). +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r AccountHoldersApiGetTaxFormInput - Request parameters, see GetTaxFormInput +@return GetTaxFormResponse, *http.Response, error +*/ +func (a *AccountHoldersApi) GetTaxForm(ctx context.Context, r AccountHoldersApiGetTaxFormInput) (GetTaxFormResponse, *http.Response, error) { + res := &GetTaxFormResponse{} + path := "/accountHolders/{id}/taxForms" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.formType != nil { + common.ParameterAddToQuery(queryParams, "formType", r.formType, "") + } + if r.year != nil { + common.ParameterAddToQuery(queryParams, "year", r.year, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -389,7 +485,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -398,7 +493,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -407,7 +501,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +509,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +517,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index b612f9d62..44981ac51 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -71,7 +71,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -122,12 +117,12 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance // All parameters accepted by BalanceAccountsApi.CreateSweep type BalanceAccountsApiCreateSweepInput struct { - balanceAccountId string - sweepConfigurationV2 *SweepConfigurationV2 + balanceAccountId string + createSweepConfigurationV2 *CreateSweepConfigurationV2 } -func (r BalanceAccountsApiCreateSweepInput) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) BalanceAccountsApiCreateSweepInput { - r.sweepConfigurationV2 = &sweepConfigurationV2 +func (r BalanceAccountsApiCreateSweepInput) CreateSweepConfigurationV2(createSweepConfigurationV2 CreateSweepConfigurationV2) BalanceAccountsApiCreateSweepInput { + r.createSweepConfigurationV2 = &createSweepConfigurationV2 return r } @@ -162,7 +157,7 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.sweepConfigurationV2, + r.createSweepConfigurationV2, res, http.MethodPost, a.BasePath()+path, @@ -175,7 +170,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +178,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -193,7 +186,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -202,7 +194,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -211,7 +202,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -274,7 +264,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -283,7 +272,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -292,7 +280,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -301,7 +288,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -310,7 +296,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -392,7 +377,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -401,7 +385,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -410,7 +393,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -419,7 +401,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +409,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +490,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +498,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +506,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +514,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -546,7 +522,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -606,7 +581,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -615,7 +589,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -624,7 +597,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -633,7 +605,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -642,7 +613,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -705,7 +675,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -714,7 +683,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -723,7 +691,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -732,7 +699,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -741,7 +707,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -807,7 +772,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -816,7 +780,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -825,7 +788,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -834,7 +796,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -843,7 +804,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -912,7 +872,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -921,7 +880,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -930,7 +888,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -939,7 +896,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -948,7 +904,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_bank_account_validation.go b/src/balanceplatform/api_bank_account_validation.go index 4b6571115..60dc68a92 100644 --- a/src/balanceplatform/api_bank_account_validation.go +++ b/src/balanceplatform/api_bank_account_validation.go @@ -70,7 +70,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -79,7 +78,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +86,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +94,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_grant_accounts.go b/src/balanceplatform/api_grant_accounts.go index 183b9c35a..f1673a092 100644 --- a/src/balanceplatform/api_grant_accounts.go +++ b/src/balanceplatform/api_grant_accounts.go @@ -69,7 +69,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -78,7 +77,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +85,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +93,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +101,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_grant_offers.go b/src/balanceplatform/api_grant_offers.go index dc9d0637e..7ef6c3142 100644 --- a/src/balanceplatform/api_grant_offers.go +++ b/src/balanceplatform/api_grant_offers.go @@ -75,7 +75,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -171,7 +166,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +190,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +198,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_network_tokens.go b/src/balanceplatform/api_network_tokens.go index 591a29632..cd0062d0b 100644 --- a/src/balanceplatform/api_network_tokens.go +++ b/src/balanceplatform/api_network_tokens.go @@ -69,7 +69,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -78,7 +77,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +85,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +93,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -162,7 +158,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -171,7 +166,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_payment_instrument_groups.go b/src/balanceplatform/api_payment_instrument_groups.go index ffbdb0f25..45f8fe373 100644 --- a/src/balanceplatform/api_payment_instrument_groups.go +++ b/src/balanceplatform/api_payment_instrument_groups.go @@ -71,7 +71,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -263,7 +253,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -272,7 +261,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -281,7 +269,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +277,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +285,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_payment_instruments.go b/src/balanceplatform/api_payment_instruments.go index 8228fddee..22f04a2df 100644 --- a/src/balanceplatform/api_payment_instruments.go +++ b/src/balanceplatform/api_payment_instruments.go @@ -73,7 +73,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -82,7 +81,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +89,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +97,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +105,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -169,7 +164,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +172,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +180,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +188,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +196,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -269,7 +259,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -278,7 +267,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +275,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +283,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +291,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -365,7 +350,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -374,7 +358,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -383,7 +366,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -392,7 +374,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -401,7 +382,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -461,7 +441,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -470,7 +449,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -479,7 +457,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -488,7 +465,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -497,7 +473,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -563,7 +538,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -572,7 +546,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -581,7 +554,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -590,7 +562,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -599,7 +570,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_platform.go b/src/balanceplatform/api_platform.go index 423b78c72..3dab7f7b1 100644 --- a/src/balanceplatform/api_platform.go +++ b/src/balanceplatform/api_platform.go @@ -91,7 +91,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +99,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +107,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -118,7 +115,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -127,7 +123,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +182,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +190,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +198,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +206,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -223,7 +214,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_transaction_rules.go b/src/balanceplatform/api_transaction_rules.go index 44c23f8b2..27c676d54 100644 --- a/src/balanceplatform/api_transaction_rules.go +++ b/src/balanceplatform/api_transaction_rules.go @@ -71,7 +71,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -263,7 +253,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -272,7 +261,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -281,7 +269,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +277,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +285,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -369,7 +354,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -378,7 +362,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -387,7 +370,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -396,7 +378,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -405,7 +386,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_transfer_routes.go b/src/balanceplatform/api_transfer_routes.go new file mode 100644 index 000000000..505f739c5 --- /dev/null +++ b/src/balanceplatform/api_transfer_routes.go @@ -0,0 +1,107 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// TransferRoutesApi service +type TransferRoutesApi common.Service + +// All parameters accepted by TransferRoutesApi.CalculateTransferRoutes +type TransferRoutesApiCalculateTransferRoutesInput struct { + transferRouteRequest *TransferRouteRequest +} + +func (r TransferRoutesApiCalculateTransferRoutesInput) TransferRouteRequest(transferRouteRequest TransferRouteRequest) TransferRoutesApiCalculateTransferRoutesInput { + r.transferRouteRequest = &transferRouteRequest + return r +} + +/* +Prepare a request for CalculateTransferRoutes + +@return TransferRoutesApiCalculateTransferRoutesInput +*/ +func (a *TransferRoutesApi) CalculateTransferRoutesInput() TransferRoutesApiCalculateTransferRoutesInput { + return TransferRoutesApiCalculateTransferRoutesInput{} +} + +/* +CalculateTransferRoutes Calculate transfer routes + +Returns available transfer routes based on a combination of transfer `country`, `currency`, `counterparty`, and `priorities`. Use this endpoint to find optimal transfer priorities and associated requirements before you [make a transfer](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers). + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r TransferRoutesApiCalculateTransferRoutesInput - Request parameters, see CalculateTransferRoutesInput +@return TransferRouteResponse, *http.Response, error +*/ +func (a *TransferRoutesApi) CalculateTransferRoutes(ctx context.Context, r TransferRoutesApiCalculateTransferRoutesInput) (TransferRouteResponse, *http.Response, error) { + res := &TransferRouteResponse{} + path := "/transferRoutes/calculate" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferRouteRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} diff --git a/src/balanceplatform/client.go b/src/balanceplatform/client.go index 1a44dc259..8785e817d 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -38,6 +38,8 @@ type APIClient struct { PlatformApi *PlatformApi TransactionRulesApi *TransactionRulesApi + + TransferRoutesApi *TransferRoutesApi } // NewAPIClient creates a new API client. @@ -59,6 +61,7 @@ func NewAPIClient(client *common.Client) *APIClient { c.PaymentInstrumentsApi = (*PaymentInstrumentsApi)(&c.common) c.PlatformApi = (*PlatformApi)(&c.common) c.TransactionRulesApi = (*TransactionRulesApi)(&c.common) + c.TransferRoutesApi = (*TransferRoutesApi)(&c.common) return c } \ No newline at end of file diff --git a/src/balanceplatform/model_address_requirement.go b/src/balanceplatform/model_address_requirement.go new file mode 100644 index 000000000..4d0d511cb --- /dev/null +++ b/src/balanceplatform/model_address_requirement.go @@ -0,0 +1,202 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AddressRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AddressRequirement{} + +// AddressRequirement struct for AddressRequirement +type AddressRequirement struct { + // Specifies the required address related fields for a particular route. + Description *string `json:"description,omitempty"` + // List of address fields. + RequiredAddressFields []string `json:"requiredAddressFields,omitempty"` + // **addressRequirement** + Type string `json:"type"` +} + +// NewAddressRequirement instantiates a new AddressRequirement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddressRequirement(type_ string) *AddressRequirement { + this := AddressRequirement{} + this.Type = type_ + return &this +} + +// NewAddressRequirementWithDefaults instantiates a new AddressRequirement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddressRequirementWithDefaults() *AddressRequirement { + this := AddressRequirement{} + var type_ string = "addressRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddressRequirement) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddressRequirement) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AddressRequirement) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AddressRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetRequiredAddressFields returns the RequiredAddressFields field value if set, zero value otherwise. +func (o *AddressRequirement) GetRequiredAddressFields() []string { + if o == nil || common.IsNil(o.RequiredAddressFields) { + var ret []string + return ret + } + return o.RequiredAddressFields +} + +// GetRequiredAddressFieldsOk returns a tuple with the RequiredAddressFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddressRequirement) GetRequiredAddressFieldsOk() ([]string, bool) { + if o == nil || common.IsNil(o.RequiredAddressFields) { + return nil, false + } + return o.RequiredAddressFields, true +} + +// HasRequiredAddressFields returns a boolean if a field has been set. +func (o *AddressRequirement) HasRequiredAddressFields() bool { + if o != nil && !common.IsNil(o.RequiredAddressFields) { + return true + } + + return false +} + +// SetRequiredAddressFields gets a reference to the given []string and assigns it to the RequiredAddressFields field. +func (o *AddressRequirement) SetRequiredAddressFields(v []string) { + o.RequiredAddressFields = v +} + +// GetType returns the Type field value +func (o *AddressRequirement) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AddressRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AddressRequirement) SetType(v string) { + o.Type = v +} + +func (o AddressRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddressRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.RequiredAddressFields) { + toSerialize["requiredAddressFields"] = o.RequiredAddressFields + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAddressRequirement struct { + value *AddressRequirement + isSet bool +} + +func (v NullableAddressRequirement) Get() *AddressRequirement { + return v.value +} + +func (v *NullableAddressRequirement) Set(val *AddressRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAddressRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAddressRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddressRequirement(val *AddressRequirement) *NullableAddressRequirement { + return &NullableAddressRequirement{value: val, isSet: true} +} + +func (v NullableAddressRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddressRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *AddressRequirement) isValidType() bool { + var allowedEnumValues = []string{"addressRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_amount_min_max_requirement.go b/src/balanceplatform/model_amount_min_max_requirement.go new file mode 100644 index 000000000..23ec876cf --- /dev/null +++ b/src/balanceplatform/model_amount_min_max_requirement.go @@ -0,0 +1,239 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AmountMinMaxRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AmountMinMaxRequirement{} + +// AmountMinMaxRequirement struct for AmountMinMaxRequirement +type AmountMinMaxRequirement struct { + // Specifies the eligible amounts for a particular route. + Description *string `json:"description,omitempty"` + // Maximum amount. + Max *int64 `json:"max,omitempty"` + // Minimum amount. + Min *int64 `json:"min,omitempty"` + // **amountMinMaxRequirement** + Type string `json:"type"` +} + +// NewAmountMinMaxRequirement instantiates a new AmountMinMaxRequirement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAmountMinMaxRequirement(type_ string) *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + this.Type = type_ + return &this +} + +// NewAmountMinMaxRequirementWithDefaults instantiates a new AmountMinMaxRequirement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAmountMinMaxRequirementWithDefaults() *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + var type_ string = "amountMinMaxRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AmountMinMaxRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMax() int64 { + if o == nil || common.IsNil(o.Max) { + var ret int64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMaxOk() (*int64, bool) { + if o == nil || common.IsNil(o.Max) { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMax() bool { + if o != nil && !common.IsNil(o.Max) { + return true + } + + return false +} + +// SetMax gets a reference to the given int64 and assigns it to the Max field. +func (o *AmountMinMaxRequirement) SetMax(v int64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMin() int64 { + if o == nil || common.IsNil(o.Min) { + var ret int64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMinOk() (*int64, bool) { + if o == nil || common.IsNil(o.Min) { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMin() bool { + if o != nil && !common.IsNil(o.Min) { + return true + } + + return false +} + +// SetMin gets a reference to the given int64 and assigns it to the Min field. +func (o *AmountMinMaxRequirement) SetMin(v int64) { + o.Min = &v +} + +// GetType returns the Type field value +func (o *AmountMinMaxRequirement) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AmountMinMaxRequirement) SetType(v string) { + o.Type = v +} + +func (o AmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AmountMinMaxRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Max) { + toSerialize["max"] = o.Max + } + if !common.IsNil(o.Min) { + toSerialize["min"] = o.Min + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAmountMinMaxRequirement struct { + value *AmountMinMaxRequirement + isSet bool +} + +func (v NullableAmountMinMaxRequirement) Get() *AmountMinMaxRequirement { + return v.value +} + +func (v *NullableAmountMinMaxRequirement) Set(val *AmountMinMaxRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAmountMinMaxRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAmountMinMaxRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmountMinMaxRequirement(val *AmountMinMaxRequirement) *NullableAmountMinMaxRequirement { + return &NullableAmountMinMaxRequirement{value: val, isSet: true} +} + +func (v NullableAmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmountMinMaxRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *AmountMinMaxRequirement) isValidType() bool { + var allowedEnumValues = []string{"amountMinMaxRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_balance_account.go b/src/balanceplatform/model_balance_account.go index ec97eadd0..3c6453366 100644 --- a/src/balanceplatform/model_balance_account.go +++ b/src/balanceplatform/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { AccountHolderId string `json:"accountHolderId"` // List of balances with the amount and currency. Balances []Balance `json:"balances,omitempty"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` diff --git a/src/balanceplatform/model_balance_account_base.go b/src/balanceplatform/model_balance_account_base.go index c648c2607..441ce0b3f 100644 --- a/src/balanceplatform/model_balance_account_base.go +++ b/src/balanceplatform/model_balance_account_base.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountBase{} type BalanceAccountBase struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId string `json:"accountHolderId"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` diff --git a/src/balanceplatform/model_balance_account_info.go b/src/balanceplatform/model_balance_account_info.go index 365fa8833..e68ba81cb 100644 --- a/src/balanceplatform/model_balance_account_info.go +++ b/src/balanceplatform/model_balance_account_info.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountInfo{} type BalanceAccountInfo struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId string `json:"accountHolderId"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` diff --git a/src/balanceplatform/model_balance_account_update_request.go b/src/balanceplatform/model_balance_account_update_request.go index fd5cd1fcd..136322d03 100644 --- a/src/balanceplatform/model_balance_account_update_request.go +++ b/src/balanceplatform/model_balance_account_update_request.go @@ -21,8 +21,6 @@ var _ common.MappedNullable = &BalanceAccountUpdateRequest{} type BalanceAccountUpdateRequest struct { // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. AccountHolderId *string `json:"accountHolderId,omitempty"` - // The default currency code of this balance account, in three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) format. The default value is **EUR**. - DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. @@ -85,38 +83,6 @@ func (o *BalanceAccountUpdateRequest) SetAccountHolderId(v string) { o.AccountHolderId = &v } -// GetDefaultCurrencyCode returns the DefaultCurrencyCode field value if set, zero value otherwise. -func (o *BalanceAccountUpdateRequest) GetDefaultCurrencyCode() string { - if o == nil || common.IsNil(o.DefaultCurrencyCode) { - var ret string - return ret - } - return *o.DefaultCurrencyCode -} - -// GetDefaultCurrencyCodeOk returns a tuple with the DefaultCurrencyCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BalanceAccountUpdateRequest) GetDefaultCurrencyCodeOk() (*string, bool) { - if o == nil || common.IsNil(o.DefaultCurrencyCode) { - return nil, false - } - return o.DefaultCurrencyCode, true -} - -// HasDefaultCurrencyCode returns a boolean if a field has been set. -func (o *BalanceAccountUpdateRequest) HasDefaultCurrencyCode() bool { - if o != nil && !common.IsNil(o.DefaultCurrencyCode) { - return true - } - - return false -} - -// SetDefaultCurrencyCode gets a reference to the given string and assigns it to the DefaultCurrencyCode field. -func (o *BalanceAccountUpdateRequest) SetDefaultCurrencyCode(v string) { - o.DefaultCurrencyCode = &v -} - // GetDescription returns the Description field value if set, zero value otherwise. func (o *BalanceAccountUpdateRequest) GetDescription() string { if o == nil || common.IsNil(o.Description) { @@ -322,9 +288,6 @@ func (o BalanceAccountUpdateRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountHolderId) { toSerialize["accountHolderId"] = o.AccountHolderId } - if !common.IsNil(o.DefaultCurrencyCode) { - toSerialize["defaultCurrencyCode"] = o.DefaultCurrencyCode - } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } diff --git a/src/balanceplatform/model_bank_account.go b/src/balanceplatform/model_bank_account.go new file mode 100644 index 000000000..41a3e744c --- /dev/null +++ b/src/balanceplatform/model_bank_account.go @@ -0,0 +1,115 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankAccount type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccount{} + +// BankAccount struct for BankAccount +type BankAccount struct { + AccountIdentification BankAccountAccountIdentification `json:"accountIdentification"` +} + +// NewBankAccount instantiates a new BankAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBankAccount(accountIdentification BankAccountAccountIdentification) *BankAccount { + this := BankAccount{} + this.AccountIdentification = accountIdentification + return &this +} + +// NewBankAccountWithDefaults instantiates a new BankAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBankAccountWithDefaults() *BankAccount { + this := BankAccount{} + return &this +} + +// GetAccountIdentification returns the AccountIdentification field value +func (o *BankAccount) GetAccountIdentification() BankAccountAccountIdentification { + if o == nil { + var ret BankAccountAccountIdentification + return ret + } + + return o.AccountIdentification +} + +// GetAccountIdentificationOk returns a tuple with the AccountIdentification field value +// and a boolean to check if the value has been set. +func (o *BankAccount) GetAccountIdentificationOk() (*BankAccountAccountIdentification, bool) { + if o == nil { + return nil, false + } + return &o.AccountIdentification, true +} + +// SetAccountIdentification sets field value +func (o *BankAccount) SetAccountIdentification(v BankAccountAccountIdentification) { + o.AccountIdentification = v +} + +func (o BankAccount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountIdentification"] = o.AccountIdentification + return toSerialize, nil +} + +type NullableBankAccount struct { + value *BankAccount + isSet bool +} + +func (v NullableBankAccount) Get() *BankAccount { + return v.value +} + +func (v *NullableBankAccount) Set(val *BankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccount(val *BankAccount) *NullableBankAccount { + return &NullableBankAccount{value: val, isSet: true} +} + +func (v NullableBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_bank_account_account_identification.go b/src/balanceplatform/model_bank_account_account_identification.go new file mode 100644 index 000000000..3537d8b5a --- /dev/null +++ b/src/balanceplatform/model_bank_account_account_identification.go @@ -0,0 +1,563 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "fmt" +) + +// BankAccountAccountIdentification - Contains the bank account details. The fields required in this object depend on the country of the bank account and the currency of the transfer. +type BankAccountAccountIdentification struct { + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification + NumberAndBicAccountIdentification *NumberAndBicAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification +} + +// AULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountAccountIdentification +func AULocalAccountIdentificationAsBankAccountAccountIdentification(v *AULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + AULocalAccountIdentification: v, + } +} + +// BRLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns BRLocalAccountIdentification wrapped in BankAccountAccountIdentification +func BRLocalAccountIdentificationAsBankAccountAccountIdentification(v *BRLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + BRLocalAccountIdentification: v, + } +} + +// CALocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CALocalAccountIdentification wrapped in BankAccountAccountIdentification +func CALocalAccountIdentificationAsBankAccountAccountIdentification(v *CALocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CALocalAccountIdentification: v, + } +} + +// CZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func CZLocalAccountIdentificationAsBankAccountAccountIdentification(v *CZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CZLocalAccountIdentification: v, + } +} + +// DKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns DKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func DKLocalAccountIdentificationAsBankAccountAccountIdentification(v *DKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + DKLocalAccountIdentification: v, + } +} + +// HKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func HKLocalAccountIdentificationAsBankAccountAccountIdentification(v *HKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HKLocalAccountIdentification: v, + } +} + +// HULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HULocalAccountIdentification wrapped in BankAccountAccountIdentification +func HULocalAccountIdentificationAsBankAccountAccountIdentification(v *HULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HULocalAccountIdentification: v, + } +} + +// IbanAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns IbanAccountIdentification wrapped in BankAccountAccountIdentification +func IbanAccountIdentificationAsBankAccountAccountIdentification(v *IbanAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + IbanAccountIdentification: v, + } +} + +// NOLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NOLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NOLocalAccountIdentificationAsBankAccountAccountIdentification(v *NOLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NOLocalAccountIdentification: v, + } +} + +// NZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NZLocalAccountIdentificationAsBankAccountAccountIdentification(v *NZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + +// NumberAndBicAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountAccountIdentification +func NumberAndBicAccountIdentificationAsBankAccountAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NumberAndBicAccountIdentification: v, + } +} + +// PLLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns PLLocalAccountIdentification wrapped in BankAccountAccountIdentification +func PLLocalAccountIdentificationAsBankAccountAccountIdentification(v *PLLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + PLLocalAccountIdentification: v, + } +} + +// SELocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SELocalAccountIdentification wrapped in BankAccountAccountIdentification +func SELocalAccountIdentificationAsBankAccountAccountIdentification(v *SELocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SELocalAccountIdentification: v, + } +} + +// SGLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SGLocalAccountIdentification wrapped in BankAccountAccountIdentification +func SGLocalAccountIdentificationAsBankAccountAccountIdentification(v *SGLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SGLocalAccountIdentification: v, + } +} + +// UKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns UKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func UKLocalAccountIdentificationAsBankAccountAccountIdentification(v *UKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + UKLocalAccountIdentification: v, + } +} + +// USLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns USLocalAccountIdentification wrapped in BankAccountAccountIdentification +func USLocalAccountIdentificationAsBankAccountAccountIdentification(v *USLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + USLocalAccountIdentification: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AULocalAccountIdentification + err = json.Unmarshal(data, &dst.AULocalAccountIdentification) + if err == nil { + jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) + if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct + dst.AULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.AULocalAccountIdentification = nil + } + + // try to unmarshal data into BRLocalAccountIdentification + err = json.Unmarshal(data, &dst.BRLocalAccountIdentification) + if err == nil { + jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) + if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct + dst.BRLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.BRLocalAccountIdentification = nil + } + + // try to unmarshal data into CALocalAccountIdentification + err = json.Unmarshal(data, &dst.CALocalAccountIdentification) + if err == nil { + jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) + if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct + dst.CALocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CALocalAccountIdentification = nil + } + + // try to unmarshal data into CZLocalAccountIdentification + err = json.Unmarshal(data, &dst.CZLocalAccountIdentification) + if err == nil { + jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) + if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct + dst.CZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CZLocalAccountIdentification = nil + } + + // try to unmarshal data into DKLocalAccountIdentification + err = json.Unmarshal(data, &dst.DKLocalAccountIdentification) + if err == nil { + jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) + if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct + dst.DKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.DKLocalAccountIdentification = nil + } + + // try to unmarshal data into HKLocalAccountIdentification + err = json.Unmarshal(data, &dst.HKLocalAccountIdentification) + if err == nil { + jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) + if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct + dst.HKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HKLocalAccountIdentification = nil + } + + // try to unmarshal data into HULocalAccountIdentification + err = json.Unmarshal(data, &dst.HULocalAccountIdentification) + if err == nil { + jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) + if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct + dst.HULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HULocalAccountIdentification = nil + } + + // try to unmarshal data into IbanAccountIdentification + err = json.Unmarshal(data, &dst.IbanAccountIdentification) + if err == nil { + jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) + if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct + dst.IbanAccountIdentification = nil + } else { + match++ + } + } else { + dst.IbanAccountIdentification = nil + } + + // try to unmarshal data into NOLocalAccountIdentification + err = json.Unmarshal(data, &dst.NOLocalAccountIdentification) + if err == nil { + jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) + if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct + dst.NOLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NOLocalAccountIdentification = nil + } + + // try to unmarshal data into NZLocalAccountIdentification + err = json.Unmarshal(data, &dst.NZLocalAccountIdentification) + if err == nil { + jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) + if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct + dst.NZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NZLocalAccountIdentification = nil + } + + // try to unmarshal data into NumberAndBicAccountIdentification + err = json.Unmarshal(data, &dst.NumberAndBicAccountIdentification) + if err == nil { + jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) + if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct + dst.NumberAndBicAccountIdentification = nil + } else { + match++ + } + } else { + dst.NumberAndBicAccountIdentification = nil + } + + // try to unmarshal data into PLLocalAccountIdentification + err = json.Unmarshal(data, &dst.PLLocalAccountIdentification) + if err == nil { + jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) + if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct + dst.PLLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.PLLocalAccountIdentification = nil + } + + // try to unmarshal data into SELocalAccountIdentification + err = json.Unmarshal(data, &dst.SELocalAccountIdentification) + if err == nil { + jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) + if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct + dst.SELocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.SELocalAccountIdentification = nil + } + + // try to unmarshal data into SGLocalAccountIdentification + err = json.Unmarshal(data, &dst.SGLocalAccountIdentification) + if err == nil { + jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) + if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct + dst.SGLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.SGLocalAccountIdentification = nil + } + + // try to unmarshal data into UKLocalAccountIdentification + err = json.Unmarshal(data, &dst.UKLocalAccountIdentification) + if err == nil { + jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) + if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct + dst.UKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.UKLocalAccountIdentification = nil + } + + // try to unmarshal data into USLocalAccountIdentification + err = json.Unmarshal(data, &dst.USLocalAccountIdentification) + if err == nil { + jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) + if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct + dst.USLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.USLocalAccountIdentification = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AULocalAccountIdentification = nil + dst.BRLocalAccountIdentification = nil + dst.CALocalAccountIdentification = nil + dst.CZLocalAccountIdentification = nil + dst.DKLocalAccountIdentification = nil + dst.HKLocalAccountIdentification = nil + dst.HULocalAccountIdentification = nil + dst.IbanAccountIdentification = nil + dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil + dst.NumberAndBicAccountIdentification = nil + dst.PLLocalAccountIdentification = nil + dst.SELocalAccountIdentification = nil + dst.SGLocalAccountIdentification = nil + dst.UKLocalAccountIdentification = nil + dst.USLocalAccountIdentification = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BankAccountAccountIdentification)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BankAccountAccountIdentification)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BankAccountAccountIdentification) MarshalJSON() ([]byte, error) { + if src.AULocalAccountIdentification != nil { + return json.Marshal(&src.AULocalAccountIdentification) + } + + if src.BRLocalAccountIdentification != nil { + return json.Marshal(&src.BRLocalAccountIdentification) + } + + if src.CALocalAccountIdentification != nil { + return json.Marshal(&src.CALocalAccountIdentification) + } + + if src.CZLocalAccountIdentification != nil { + return json.Marshal(&src.CZLocalAccountIdentification) + } + + if src.DKLocalAccountIdentification != nil { + return json.Marshal(&src.DKLocalAccountIdentification) + } + + if src.HKLocalAccountIdentification != nil { + return json.Marshal(&src.HKLocalAccountIdentification) + } + + if src.HULocalAccountIdentification != nil { + return json.Marshal(&src.HULocalAccountIdentification) + } + + if src.IbanAccountIdentification != nil { + return json.Marshal(&src.IbanAccountIdentification) + } + + if src.NOLocalAccountIdentification != nil { + return json.Marshal(&src.NOLocalAccountIdentification) + } + + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + + if src.NumberAndBicAccountIdentification != nil { + return json.Marshal(&src.NumberAndBicAccountIdentification) + } + + if src.PLLocalAccountIdentification != nil { + return json.Marshal(&src.PLLocalAccountIdentification) + } + + if src.SELocalAccountIdentification != nil { + return json.Marshal(&src.SELocalAccountIdentification) + } + + if src.SGLocalAccountIdentification != nil { + return json.Marshal(&src.SGLocalAccountIdentification) + } + + if src.UKLocalAccountIdentification != nil { + return json.Marshal(&src.UKLocalAccountIdentification) + } + + if src.USLocalAccountIdentification != nil { + return json.Marshal(&src.USLocalAccountIdentification) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BankAccountAccountIdentification) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AULocalAccountIdentification != nil { + return obj.AULocalAccountIdentification + } + + if obj.BRLocalAccountIdentification != nil { + return obj.BRLocalAccountIdentification + } + + if obj.CALocalAccountIdentification != nil { + return obj.CALocalAccountIdentification + } + + if obj.CZLocalAccountIdentification != nil { + return obj.CZLocalAccountIdentification + } + + if obj.DKLocalAccountIdentification != nil { + return obj.DKLocalAccountIdentification + } + + if obj.HKLocalAccountIdentification != nil { + return obj.HKLocalAccountIdentification + } + + if obj.HULocalAccountIdentification != nil { + return obj.HULocalAccountIdentification + } + + if obj.IbanAccountIdentification != nil { + return obj.IbanAccountIdentification + } + + if obj.NOLocalAccountIdentification != nil { + return obj.NOLocalAccountIdentification + } + + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + + if obj.NumberAndBicAccountIdentification != nil { + return obj.NumberAndBicAccountIdentification + } + + if obj.PLLocalAccountIdentification != nil { + return obj.PLLocalAccountIdentification + } + + if obj.SELocalAccountIdentification != nil { + return obj.SELocalAccountIdentification + } + + if obj.SGLocalAccountIdentification != nil { + return obj.SGLocalAccountIdentification + } + + if obj.UKLocalAccountIdentification != nil { + return obj.UKLocalAccountIdentification + } + + if obj.USLocalAccountIdentification != nil { + return obj.USLocalAccountIdentification + } + + // all schemas are nil + return nil +} + +type NullableBankAccountAccountIdentification struct { + value *BankAccountAccountIdentification + isSet bool +} + +func (v NullableBankAccountAccountIdentification) Get() *BankAccountAccountIdentification { + return v.value +} + +func (v *NullableBankAccountAccountIdentification) Set(val *BankAccountAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountAccountIdentification(val *BankAccountAccountIdentification) *NullableBankAccountAccountIdentification { + return &NullableBankAccountAccountIdentification{value: val, isSet: true} +} + +func (v NullableBankAccountAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_bank_account_identification_type_requirement.go b/src/balanceplatform/model_bank_account_identification_type_requirement.go new file mode 100644 index 000000000..77e73bbf7 --- /dev/null +++ b/src/balanceplatform/model_bank_account_identification_type_requirement.go @@ -0,0 +1,202 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankAccountIdentificationTypeRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccountIdentificationTypeRequirement{} + +// BankAccountIdentificationTypeRequirement struct for BankAccountIdentificationTypeRequirement +type BankAccountIdentificationTypeRequirement struct { + // List of bank account identification types: eg.; [iban , numberAndBic] + BankAccountIdentificationTypes []string `json:"bankAccountIdentificationTypes,omitempty"` + // Specifies the bank account details for a particular route per required field in this object depending on the country of the bank account and the currency of the transfer. + Description *string `json:"description,omitempty"` + // **bankAccountIdentificationTypeRequirement** + Type string `json:"type"` +} + +// NewBankAccountIdentificationTypeRequirement instantiates a new BankAccountIdentificationTypeRequirement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBankAccountIdentificationTypeRequirement(type_ string) *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + this.Type = type_ + return &this +} + +// NewBankAccountIdentificationTypeRequirementWithDefaults instantiates a new BankAccountIdentificationTypeRequirement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBankAccountIdentificationTypeRequirementWithDefaults() *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + var type_ string = "bankAccountIdentificationTypeRequirement" + this.Type = type_ + return &this +} + +// GetBankAccountIdentificationTypes returns the BankAccountIdentificationTypes field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypes() []string { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + var ret []string + return ret + } + return o.BankAccountIdentificationTypes +} + +// GetBankAccountIdentificationTypesOk returns a tuple with the BankAccountIdentificationTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypesOk() ([]string, bool) { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + return nil, false + } + return o.BankAccountIdentificationTypes, true +} + +// HasBankAccountIdentificationTypes returns a boolean if a field has been set. +func (o *BankAccountIdentificationTypeRequirement) HasBankAccountIdentificationTypes() bool { + if o != nil && !common.IsNil(o.BankAccountIdentificationTypes) { + return true + } + + return false +} + +// SetBankAccountIdentificationTypes gets a reference to the given []string and assigns it to the BankAccountIdentificationTypes field. +func (o *BankAccountIdentificationTypeRequirement) SetBankAccountIdentificationTypes(v []string) { + o.BankAccountIdentificationTypes = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountIdentificationTypeRequirement) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BankAccountIdentificationTypeRequirement) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BankAccountIdentificationTypeRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetType returns the Type field value +func (o *BankAccountIdentificationTypeRequirement) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BankAccountIdentificationTypeRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BankAccountIdentificationTypeRequirement) SetType(v string) { + o.Type = v +} + +func (o BankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccountIdentificationTypeRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccountIdentificationTypes) { + toSerialize["bankAccountIdentificationTypes"] = o.BankAccountIdentificationTypes + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBankAccountIdentificationTypeRequirement struct { + value *BankAccountIdentificationTypeRequirement + isSet bool +} + +func (v NullableBankAccountIdentificationTypeRequirement) Get() *BankAccountIdentificationTypeRequirement { + return v.value +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Set(val *BankAccountIdentificationTypeRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountIdentificationTypeRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountIdentificationTypeRequirement(val *BankAccountIdentificationTypeRequirement) *NullableBankAccountIdentificationTypeRequirement { + return &NullableBankAccountIdentificationTypeRequirement{value: val, isSet: true} +} + +func (v NullableBankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountIdentificationTypeRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankAccountIdentificationTypeRequirement) isValidType() bool { + var allowedEnumValues = []string{"bankAccountIdentificationTypeRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_bank_identification.go b/src/balanceplatform/model_bank_identification.go new file mode 100644 index 000000000..b32216178 --- /dev/null +++ b/src/balanceplatform/model_bank_identification.go @@ -0,0 +1,206 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankIdentification{} + +// BankIdentification struct for BankIdentification +type BankIdentification struct { + Country *string `json:"country,omitempty"` + Identification *string `json:"identification,omitempty"` + IdentificationType *string `json:"identificationType,omitempty"` +} + +// NewBankIdentification instantiates a new BankIdentification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBankIdentification() *BankIdentification { + this := BankIdentification{} + return &this +} + +// NewBankIdentificationWithDefaults instantiates a new BankIdentification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBankIdentificationWithDefaults() *BankIdentification { + this := BankIdentification{} + return &this +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *BankIdentification) GetCountry() string { + if o == nil || common.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetCountryOk() (*string, bool) { + if o == nil || common.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *BankIdentification) HasCountry() bool { + if o != nil && !common.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *BankIdentification) SetCountry(v string) { + o.Country = &v +} + +// GetIdentification returns the Identification field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentification() string { + if o == nil || common.IsNil(o.Identification) { + var ret string + return ret + } + return *o.Identification +} + +// GetIdentificationOk returns a tuple with the Identification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationOk() (*string, bool) { + if o == nil || common.IsNil(o.Identification) { + return nil, false + } + return o.Identification, true +} + +// HasIdentification returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentification() bool { + if o != nil && !common.IsNil(o.Identification) { + return true + } + + return false +} + +// SetIdentification gets a reference to the given string and assigns it to the Identification field. +func (o *BankIdentification) SetIdentification(v string) { + o.Identification = &v +} + +// GetIdentificationType returns the IdentificationType field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentificationType() string { + if o == nil || common.IsNil(o.IdentificationType) { + var ret string + return ret + } + return *o.IdentificationType +} + +// GetIdentificationTypeOk returns a tuple with the IdentificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.IdentificationType) { + return nil, false + } + return o.IdentificationType, true +} + +// HasIdentificationType returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentificationType() bool { + if o != nil && !common.IsNil(o.IdentificationType) { + return true + } + + return false +} + +// SetIdentificationType gets a reference to the given string and assigns it to the IdentificationType field. +func (o *BankIdentification) SetIdentificationType(v string) { + o.IdentificationType = &v +} + +func (o BankIdentification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Identification) { + toSerialize["identification"] = o.Identification + } + if !common.IsNil(o.IdentificationType) { + toSerialize["identificationType"] = o.IdentificationType + } + return toSerialize, nil +} + +type NullableBankIdentification struct { + value *BankIdentification + isSet bool +} + +func (v NullableBankIdentification) Get() *BankIdentification { + return v.value +} + +func (v *NullableBankIdentification) Set(val *BankIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankIdentification(val *BankIdentification) *NullableBankIdentification { + return &NullableBankIdentification{value: val, isSet: true} +} + +func (v NullableBankIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankIdentification) isValidIdentificationType() bool { + var allowedEnumValues = []string{"iban", "routingNumber"} + for _, allowed := range allowedEnumValues { + if o.GetIdentificationType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_counterparty.go b/src/balanceplatform/model_counterparty.go new file mode 100644 index 000000000..d1d386cf6 --- /dev/null +++ b/src/balanceplatform/model_counterparty.go @@ -0,0 +1,161 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Counterparty type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Counterparty{} + +// Counterparty struct for Counterparty +type Counterparty struct { + BankAccount *BankAccount `json:"bankAccount,omitempty"` + // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` +} + +// NewCounterparty instantiates a new Counterparty object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCounterparty() *Counterparty { + this := Counterparty{} + return &this +} + +// NewCounterpartyWithDefaults instantiates a new Counterparty object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCounterpartyWithDefaults() *Counterparty { + this := Counterparty{} + return &this +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *Counterparty) GetBankAccount() BankAccount { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccount + return ret + } + return *o.BankAccount +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Counterparty) GetBankAccountOk() (*BankAccount, bool) { + if o == nil || common.IsNil(o.BankAccount) { + return nil, false + } + return o.BankAccount, true +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *Counterparty) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccount and assigns it to the BankAccount field. +func (o *Counterparty) SetBankAccount(v BankAccount) { + o.BankAccount = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *Counterparty) GetTransferInstrumentId() string { + if o == nil || common.IsNil(o.TransferInstrumentId) { + var ret string + return ret + } + return *o.TransferInstrumentId +} + +// GetTransferInstrumentIdOk returns a tuple with the TransferInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Counterparty) GetTransferInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransferInstrumentId) { + return nil, false + } + return o.TransferInstrumentId, true +} + +// HasTransferInstrumentId returns a boolean if a field has been set. +func (o *Counterparty) HasTransferInstrumentId() bool { + if o != nil && !common.IsNil(o.TransferInstrumentId) { + return true + } + + return false +} + +// SetTransferInstrumentId gets a reference to the given string and assigns it to the TransferInstrumentId field. +func (o *Counterparty) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o Counterparty) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Counterparty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableCounterparty struct { + value *Counterparty + isSet bool +} + +func (v NullableCounterparty) Get() *Counterparty { + return v.value +} + +func (v *NullableCounterparty) Set(val *Counterparty) { + v.value = val + v.isSet = true +} + +func (v NullableCounterparty) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterparty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterparty(val *Counterparty) *NullableCounterparty { + return &NullableCounterparty{value: val, isSet: true} +} + +func (v NullableCounterparty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterparty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_counterparty_bank_restriction.go b/src/balanceplatform/model_counterparty_bank_restriction.go new file mode 100644 index 000000000..8a65eafa2 --- /dev/null +++ b/src/balanceplatform/model_counterparty_bank_restriction.go @@ -0,0 +1,153 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CounterpartyBankRestriction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CounterpartyBankRestriction{} + +// CounterpartyBankRestriction struct for CounterpartyBankRestriction +type CounterpartyBankRestriction struct { + // Defines how the condition must be evaluated. + Operation string `json:"operation"` + // List of counterparty Bank Institutions and the operation. + Value []BankIdentification `json:"value,omitempty"` +} + +// NewCounterpartyBankRestriction instantiates a new CounterpartyBankRestriction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCounterpartyBankRestriction(operation string) *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + this.Operation = operation + return &this +} + +// NewCounterpartyBankRestrictionWithDefaults instantiates a new CounterpartyBankRestriction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCounterpartyBankRestrictionWithDefaults() *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + return &this +} + +// GetOperation returns the Operation field value +func (o *CounterpartyBankRestriction) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *CounterpartyBankRestriction) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *CounterpartyBankRestriction) SetOperation(v string) { + o.Operation = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CounterpartyBankRestriction) GetValue() []BankIdentification { + if o == nil || common.IsNil(o.Value) { + var ret []BankIdentification + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyBankRestriction) GetValueOk() ([]BankIdentification, bool) { + if o == nil || common.IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CounterpartyBankRestriction) HasValue() bool { + if o != nil && !common.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given []BankIdentification and assigns it to the Value field. +func (o *CounterpartyBankRestriction) SetValue(v []BankIdentification) { + o.Value = v +} + +func (o CounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyBankRestriction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["operation"] = o.Operation + if !common.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableCounterpartyBankRestriction struct { + value *CounterpartyBankRestriction + isSet bool +} + +func (v NullableCounterpartyBankRestriction) Get() *CounterpartyBankRestriction { + return v.value +} + +func (v *NullableCounterpartyBankRestriction) Set(val *CounterpartyBankRestriction) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyBankRestriction) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyBankRestriction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyBankRestriction(val *CounterpartyBankRestriction) *NullableCounterpartyBankRestriction { + return &NullableCounterpartyBankRestriction{value: val, isSet: true} +} + +func (v NullableCounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyBankRestriction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_create_sweep_configuration_v2.go b/src/balanceplatform/model_create_sweep_configuration_v2.go new file mode 100644 index 000000000..57fbc2a00 --- /dev/null +++ b/src/balanceplatform/model_create_sweep_configuration_v2.go @@ -0,0 +1,541 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CreateSweepConfigurationV2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CreateSweepConfigurationV2{} + +// CreateSweepConfigurationV2 struct for CreateSweepConfigurationV2 +type CreateSweepConfigurationV2 struct { + // The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + Category *string `json:"category,omitempty"` + Counterparty SweepCounterparty `json:"counterparty"` + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + Currency string `json:"currency"` + // The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + Description *string `json:"description,omitempty"` + // The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + Priorities []string `json:"priorities,omitempty"` + // The reason for disabling the sweep. + Reason *string `json:"reason,omitempty"` + Schedule SweepSchedule `json:"schedule"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` + TriggerAmount *Amount `json:"triggerAmount,omitempty"` + // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + Type *string `json:"type,omitempty"` +} + +// NewCreateSweepConfigurationV2 instantiates a new CreateSweepConfigurationV2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSweepConfigurationV2(counterparty SweepCounterparty, currency string, schedule SweepSchedule) *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + this.Counterparty = counterparty + this.Currency = currency + this.Schedule = schedule + var type_ string = "push" + this.Type = &type_ + return &this +} + +// NewCreateSweepConfigurationV2WithDefaults instantiates a new CreateSweepConfigurationV2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSweepConfigurationV2WithDefaults() *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + var type_ string = "push" + this.Type = &type_ + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *CreateSweepConfigurationV2) SetCategory(v string) { + o.Category = &v +} + +// GetCounterparty returns the Counterparty field value +func (o *CreateSweepConfigurationV2) GetCounterparty() SweepCounterparty { + if o == nil { + var ret SweepCounterparty + return ret + } + + return o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCounterpartyOk() (*SweepCounterparty, bool) { + if o == nil { + return nil, false + } + return &o.Counterparty, true +} + +// SetCounterparty sets field value +func (o *CreateSweepConfigurationV2) SetCounterparty(v SweepCounterparty) { + o.Counterparty = v +} + +// GetCurrency returns the Currency field value +func (o *CreateSweepConfigurationV2) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *CreateSweepConfigurationV2) SetCurrency(v string) { + o.Currency = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSweepConfigurationV2) SetDescription(v string) { + o.Description = &v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *CreateSweepConfigurationV2) SetPriorities(v []string) { + o.Priorities = v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *CreateSweepConfigurationV2) SetReason(v string) { + o.Reason = &v +} + +// GetSchedule returns the Schedule field value +func (o *CreateSweepConfigurationV2) GetSchedule() SweepSchedule { + if o == nil { + var ret SweepSchedule + return ret + } + + return o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetScheduleOk() (*SweepSchedule, bool) { + if o == nil { + return nil, false + } + return &o.Schedule, true +} + +// SetSchedule sets field value +func (o *CreateSweepConfigurationV2) SetSchedule(v SweepSchedule) { + o.Schedule = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateSweepConfigurationV2) SetStatus(v string) { + o.Status = &v +} + +// GetSweepAmount returns the SweepAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetSweepAmount() Amount { + if o == nil || common.IsNil(o.SweepAmount) { + var ret Amount + return ret + } + return *o.SweepAmount +} + +// GetSweepAmountOk returns a tuple with the SweepAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetSweepAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.SweepAmount) { + return nil, false + } + return o.SweepAmount, true +} + +// HasSweepAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasSweepAmount() bool { + if o != nil && !common.IsNil(o.SweepAmount) { + return true + } + + return false +} + +// SetSweepAmount gets a reference to the given Amount and assigns it to the SweepAmount field. +func (o *CreateSweepConfigurationV2) SetSweepAmount(v Amount) { + o.SweepAmount = &v +} + +// GetTargetAmount returns the TargetAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetTargetAmount() Amount { + if o == nil || common.IsNil(o.TargetAmount) { + var ret Amount + return ret + } + return *o.TargetAmount +} + +// GetTargetAmountOk returns a tuple with the TargetAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetTargetAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TargetAmount) { + return nil, false + } + return o.TargetAmount, true +} + +// HasTargetAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasTargetAmount() bool { + if o != nil && !common.IsNil(o.TargetAmount) { + return true + } + + return false +} + +// SetTargetAmount gets a reference to the given Amount and assigns it to the TargetAmount field. +func (o *CreateSweepConfigurationV2) SetTargetAmount(v Amount) { + o.TargetAmount = &v +} + +// GetTriggerAmount returns the TriggerAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetTriggerAmount() Amount { + if o == nil || common.IsNil(o.TriggerAmount) { + var ret Amount + return ret + } + return *o.TriggerAmount +} + +// GetTriggerAmountOk returns a tuple with the TriggerAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetTriggerAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TriggerAmount) { + return nil, false + } + return o.TriggerAmount, true +} + +// HasTriggerAmount returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasTriggerAmount() bool { + if o != nil && !common.IsNil(o.TriggerAmount) { + return true + } + + return false +} + +// SetTriggerAmount gets a reference to the given Amount and assigns it to the TriggerAmount field. +func (o *CreateSweepConfigurationV2) SetTriggerAmount(v Amount) { + o.TriggerAmount = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CreateSweepConfigurationV2) SetType(v string) { + o.Type = &v +} + +func (o CreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSweepConfigurationV2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + toSerialize["counterparty"] = o.Counterparty + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + toSerialize["schedule"] = o.Schedule + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.SweepAmount) { + toSerialize["sweepAmount"] = o.SweepAmount + } + if !common.IsNil(o.TargetAmount) { + toSerialize["targetAmount"] = o.TargetAmount + } + if !common.IsNil(o.TriggerAmount) { + toSerialize["triggerAmount"] = o.TriggerAmount + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCreateSweepConfigurationV2 struct { + value *CreateSweepConfigurationV2 + isSet bool +} + +func (v NullableCreateSweepConfigurationV2) Get() *CreateSweepConfigurationV2 { + return v.value +} + +func (v *NullableCreateSweepConfigurationV2) Set(val *CreateSweepConfigurationV2) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSweepConfigurationV2) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSweepConfigurationV2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSweepConfigurationV2(val *CreateSweepConfigurationV2) *NullableCreateSweepConfigurationV2 { + return &NullableCreateSweepConfigurationV2{value: val, isSet: true} +} + +func (v NullableCreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSweepConfigurationV2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *CreateSweepConfigurationV2) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "internal", "platformPayment"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidReason() bool { + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidStatus() bool { + var allowedEnumValues = []string{"active", "inactive"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *CreateSweepConfigurationV2) isValidType() bool { + var allowedEnumValues = []string{"pull", "push"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_delivery_address.go b/src/balanceplatform/model_delivery_address.go index c3aa9827a..559831ea8 100644 --- a/src/balanceplatform/model_delivery_address.go +++ b/src/balanceplatform/model_delivery_address.go @@ -23,11 +23,11 @@ type DeliveryAddress struct { City *string `json:"city,omitempty"` // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. Country string `json:"country"` - // First line of the address. + // The street name. For example, if the address is \"Rokin 49\", provide \"Rokin\". Line1 *string `json:"line1,omitempty"` - // Second line of the address. + // The house number or name. For example, if the address is \"Rokin 49\", provide \"49\". Line2 *string `json:"line2,omitempty"` - // Third line of the address. + // Optional information about the address. Line3 *string `json:"line3,omitempty"` // The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. PostalCode *string `json:"postalCode,omitempty"` diff --git a/src/balanceplatform/model_get_tax_form_response.go b/src/balanceplatform/model_get_tax_form_response.go new file mode 100644 index 000000000..3daa40e9a --- /dev/null +++ b/src/balanceplatform/model_get_tax_form_response.go @@ -0,0 +1,163 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the GetTaxFormResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &GetTaxFormResponse{} + +// GetTaxFormResponse struct for GetTaxFormResponse +type GetTaxFormResponse struct { + // The content of the tax form in Base64 format. + Content string `json:"content"` + // The content type of the tax form. Possible values: * **application/pdf** + ContentType *string `json:"contentType,omitempty"` +} + +// NewGetTaxFormResponse instantiates a new GetTaxFormResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTaxFormResponse(content string) *GetTaxFormResponse { + this := GetTaxFormResponse{} + this.Content = content + return &this +} + +// NewGetTaxFormResponseWithDefaults instantiates a new GetTaxFormResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTaxFormResponseWithDefaults() *GetTaxFormResponse { + this := GetTaxFormResponse{} + return &this +} + +// GetContent returns the Content field value +func (o *GetTaxFormResponse) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *GetTaxFormResponse) SetContent(v string) { + o.Content = v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *GetTaxFormResponse) GetContentType() string { + if o == nil || common.IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *GetTaxFormResponse) HasContentType() bool { + if o != nil && !common.IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *GetTaxFormResponse) SetContentType(v string) { + o.ContentType = &v +} + +func (o GetTaxFormResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTaxFormResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content"] = o.Content + if !common.IsNil(o.ContentType) { + toSerialize["contentType"] = o.ContentType + } + return toSerialize, nil +} + +type NullableGetTaxFormResponse struct { + value *GetTaxFormResponse + isSet bool +} + +func (v NullableGetTaxFormResponse) Get() *GetTaxFormResponse { + return v.value +} + +func (v *NullableGetTaxFormResponse) Set(val *GetTaxFormResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTaxFormResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTaxFormResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTaxFormResponse(val *GetTaxFormResponse) *NullableGetTaxFormResponse { + return &NullableGetTaxFormResponse{value: val, isSet: true} +} + +func (v NullableGetTaxFormResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTaxFormResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *GetTaxFormResponse) isValidContentType() bool { + var allowedEnumValues = []string{"application/pdf"} + for _, allowed := range allowedEnumValues { + if o.GetContentType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_hk_local_account_identification.go b/src/balanceplatform/model_hk_local_account_identification.go index ed428fdc7..d59ee7d48 100644 --- a/src/balanceplatform/model_hk_local_account_identification.go +++ b/src/balanceplatform/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_nz_local_account_identification.go b/src/balanceplatform/model_nz_local_account_identification.go index 5ce8d0e2c..0017e8726 100644 --- a/src/balanceplatform/model_nz_local_account_identification.go +++ b/src/balanceplatform/model_nz_local_account_identification.go @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. AccountNumber string `json:"accountNumber"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNZLocalAccountIdentification(accountNumber string, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) GetBankCode() string { - if o == nil { - var ret string - return ret - } - - return o.BankCode -} - -// GetBankCodeOk returns a tuple with the BankCode field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_payment_instrument_requirement.go b/src/balanceplatform/model_payment_instrument_requirement.go new file mode 100644 index 000000000..99a73768f --- /dev/null +++ b/src/balanceplatform/model_payment_instrument_requirement.go @@ -0,0 +1,285 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentInstrumentRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrumentRequirement{} + +// PaymentInstrumentRequirement struct for PaymentInstrumentRequirement +type PaymentInstrumentRequirement struct { + // Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + Description *string `json:"description,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + IssuingCountryCode *string `json:"issuingCountryCode,omitempty"` + // Specifies if the requirement only applies to transfers to another balance platform. + OnlyForCrossBalancePlatform *bool `json:"onlyForCrossBalancePlatform,omitempty"` + // The type of the payment instrument. For example, \"BankAccount\" or \"Card\". + PaymentInstrumentType *string `json:"paymentInstrumentType,omitempty"` + // **paymentInstrumentRequirement** + Type string `json:"type"` +} + +// NewPaymentInstrumentRequirement instantiates a new PaymentInstrumentRequirement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentInstrumentRequirement(type_ string) *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + this.Type = type_ + return &this +} + +// NewPaymentInstrumentRequirementWithDefaults instantiates a new PaymentInstrumentRequirement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentInstrumentRequirementWithDefaults() *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + var type_ string = "paymentInstrumentRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PaymentInstrumentRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetIssuingCountryCode returns the IssuingCountryCode field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCode() string { + if o == nil || common.IsNil(o.IssuingCountryCode) { + var ret string + return ret + } + return *o.IssuingCountryCode +} + +// GetIssuingCountryCodeOk returns a tuple with the IssuingCountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.IssuingCountryCode) { + return nil, false + } + return o.IssuingCountryCode, true +} + +// HasIssuingCountryCode returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasIssuingCountryCode() bool { + if o != nil && !common.IsNil(o.IssuingCountryCode) { + return true + } + + return false +} + +// SetIssuingCountryCode gets a reference to the given string and assigns it to the IssuingCountryCode field. +func (o *PaymentInstrumentRequirement) SetIssuingCountryCode(v string) { + o.IssuingCountryCode = &v +} + +// GetOnlyForCrossBalancePlatform returns the OnlyForCrossBalancePlatform field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatform() bool { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + var ret bool + return ret + } + return *o.OnlyForCrossBalancePlatform +} + +// GetOnlyForCrossBalancePlatformOk returns a tuple with the OnlyForCrossBalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatformOk() (*bool, bool) { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + return nil, false + } + return o.OnlyForCrossBalancePlatform, true +} + +// HasOnlyForCrossBalancePlatform returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasOnlyForCrossBalancePlatform() bool { + if o != nil && !common.IsNil(o.OnlyForCrossBalancePlatform) { + return true + } + + return false +} + +// SetOnlyForCrossBalancePlatform gets a reference to the given bool and assigns it to the OnlyForCrossBalancePlatform field. +func (o *PaymentInstrumentRequirement) SetOnlyForCrossBalancePlatform(v bool) { + o.OnlyForCrossBalancePlatform = &v +} + +// GetPaymentInstrumentType returns the PaymentInstrumentType field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentType() string { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + var ret string + return ret + } + return *o.PaymentInstrumentType +} + +// GetPaymentInstrumentTypeOk returns a tuple with the PaymentInstrumentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + return nil, false + } + return o.PaymentInstrumentType, true +} + +// HasPaymentInstrumentType returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasPaymentInstrumentType() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentType) { + return true + } + + return false +} + +// SetPaymentInstrumentType gets a reference to the given string and assigns it to the PaymentInstrumentType field. +func (o *PaymentInstrumentRequirement) SetPaymentInstrumentType(v string) { + o.PaymentInstrumentType = &v +} + +// GetType returns the Type field value +func (o *PaymentInstrumentRequirement) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentInstrumentRequirement) SetType(v string) { + o.Type = v +} + +func (o PaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrumentRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.IssuingCountryCode) { + toSerialize["issuingCountryCode"] = o.IssuingCountryCode + } + if !common.IsNil(o.OnlyForCrossBalancePlatform) { + toSerialize["onlyForCrossBalancePlatform"] = o.OnlyForCrossBalancePlatform + } + if !common.IsNil(o.PaymentInstrumentType) { + toSerialize["paymentInstrumentType"] = o.PaymentInstrumentType + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePaymentInstrumentRequirement struct { + value *PaymentInstrumentRequirement + isSet bool +} + +func (v NullablePaymentInstrumentRequirement) Get() *PaymentInstrumentRequirement { + return v.value +} + +func (v *NullablePaymentInstrumentRequirement) Set(val *PaymentInstrumentRequirement) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentRequirement(val *PaymentInstrumentRequirement) *NullablePaymentInstrumentRequirement { + return &NullablePaymentInstrumentRequirement{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PaymentInstrumentRequirement) isValidPaymentInstrumentType() bool { + var allowedEnumValues = []string{"BankAccount", "Card"} + for _, allowed := range allowedEnumValues { + if o.GetPaymentInstrumentType() == allowed { + return true + } + } + return false +} +func (o *PaymentInstrumentRequirement) isValidType() bool { + var allowedEnumValues = []string{"paymentInstrumentRequirement"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_platform_payment_configuration.go b/src/balanceplatform/model_platform_payment_configuration.go index 3ca3a239b..e536afeea 100644 --- a/src/balanceplatform/model_platform_payment_configuration.go +++ b/src/balanceplatform/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &PlatformPaymentConfiguration{} // PlatformPaymentConfiguration struct for PlatformPaymentConfiguration type PlatformPaymentConfiguration struct { - // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. SalesDayClosingTime *string `json:"salesDayClosingTime,omitempty"` - // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. SettlementDelayDays *int32 `json:"settlementDelayDays,omitempty"` } diff --git a/src/balanceplatform/model_sweep_configuration_v2.go b/src/balanceplatform/model_sweep_configuration_v2.go index 958ef22a0..256a531d7 100644 --- a/src/balanceplatform/model_sweep_configuration_v2.go +++ b/src/balanceplatform/model_sweep_configuration_v2.go @@ -541,7 +541,7 @@ func (o *SweepConfigurationV2) isValidCategory() bool { return false } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/balanceplatform/model_sweep_counterparty.go b/src/balanceplatform/model_sweep_counterparty.go index 5b1661360..439d19a30 100644 --- a/src/balanceplatform/model_sweep_counterparty.go +++ b/src/balanceplatform/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &SweepCounterparty{} type SweepCounterparty struct { // The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. BalanceAccountId *string `json:"balanceAccountId,omitempty"` - // The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. MerchantAccount *string `json:"merchantAccount,omitempty"` - // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } diff --git a/src/balanceplatform/model_transaction_rule.go b/src/balanceplatform/model_transaction_rule.go index 5d8d16d24..9d37299d9 100644 --- a/src/balanceplatform/model_transaction_rule.go +++ b/src/balanceplatform/model_transaction_rule.go @@ -33,7 +33,7 @@ type TransactionRule struct { OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` - // Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. diff --git a/src/balanceplatform/model_transaction_rule_info.go b/src/balanceplatform/model_transaction_rule_info.go index 73ef9bf3d..b0b09402f 100644 --- a/src/balanceplatform/model_transaction_rule_info.go +++ b/src/balanceplatform/model_transaction_rule_info.go @@ -31,7 +31,7 @@ type TransactionRuleInfo struct { OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` - // Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. diff --git a/src/balanceplatform/model_transaction_rule_restrictions.go b/src/balanceplatform/model_transaction_rule_restrictions.go index 9cfc81a9e..04b9c830b 100644 --- a/src/balanceplatform/model_transaction_rule_restrictions.go +++ b/src/balanceplatform/model_transaction_rule_restrictions.go @@ -21,6 +21,7 @@ var _ common.MappedNullable = &TransactionRuleRestrictions{} type TransactionRuleRestrictions struct { ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` + CounterpartyBank *CounterpartyBankRestriction `json:"counterpartyBank,omitempty"` Countries *CountriesRestriction `json:"countries,omitempty"` DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` @@ -116,6 +117,38 @@ func (o *TransactionRuleRestrictions) SetBrandVariants(v BrandVariantsRestrictio o.BrandVariants = &v } +// GetCounterpartyBank returns the CounterpartyBank field value if set, zero value otherwise. +func (o *TransactionRuleRestrictions) GetCounterpartyBank() CounterpartyBankRestriction { + if o == nil || common.IsNil(o.CounterpartyBank) { + var ret CounterpartyBankRestriction + return ret + } + return *o.CounterpartyBank +} + +// GetCounterpartyBankOk returns a tuple with the CounterpartyBank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleRestrictions) GetCounterpartyBankOk() (*CounterpartyBankRestriction, bool) { + if o == nil || common.IsNil(o.CounterpartyBank) { + return nil, false + } + return o.CounterpartyBank, true +} + +// HasCounterpartyBank returns a boolean if a field has been set. +func (o *TransactionRuleRestrictions) HasCounterpartyBank() bool { + if o != nil && !common.IsNil(o.CounterpartyBank) { + return true + } + + return false +} + +// SetCounterpartyBank gets a reference to the given CounterpartyBankRestriction and assigns it to the CounterpartyBank field. +func (o *TransactionRuleRestrictions) SetCounterpartyBank(v CounterpartyBankRestriction) { + o.CounterpartyBank = &v +} + // GetCountries returns the Countries field value if set, zero value otherwise. func (o *TransactionRuleRestrictions) GetCountries() CountriesRestriction { if o == nil || common.IsNil(o.Countries) { @@ -516,6 +549,9 @@ func (o TransactionRuleRestrictions) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BrandVariants) { toSerialize["brandVariants"] = o.BrandVariants } + if !common.IsNil(o.CounterpartyBank) { + toSerialize["counterpartyBank"] = o.CounterpartyBank + } if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } diff --git a/src/balanceplatform/model_transfer_route.go b/src/balanceplatform/model_transfer_route.go new file mode 100644 index 000000000..d6e82ef49 --- /dev/null +++ b/src/balanceplatform/model_transfer_route.go @@ -0,0 +1,291 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRoute type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRoute{} + +// TransferRoute struct for TransferRoute +type TransferRoute struct { + // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + Category *string `json:"category,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + Country *string `json:"country,omitempty"` + // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + Currency *string `json:"currency,omitempty"` + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + Priority *string `json:"priority,omitempty"` + Requirements *TransferRouteRequirements `json:"requirements,omitempty"` +} + +// NewTransferRoute instantiates a new TransferRoute object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRoute() *TransferRoute { + this := TransferRoute{} + return &this +} + +// NewTransferRouteWithDefaults instantiates a new TransferRoute object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRouteWithDefaults() *TransferRoute { + this := TransferRoute{} + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *TransferRoute) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *TransferRoute) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *TransferRoute) SetCategory(v string) { + o.Category = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRoute) GetCountry() string { + if o == nil || common.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetCountryOk() (*string, bool) { + if o == nil || common.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *TransferRoute) HasCountry() bool { + if o != nil && !common.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *TransferRoute) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *TransferRoute) GetCurrency() string { + if o == nil || common.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetCurrencyOk() (*string, bool) { + if o == nil || common.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *TransferRoute) HasCurrency() bool { + if o != nil && !common.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *TransferRoute) SetCurrency(v string) { + o.Currency = &v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *TransferRoute) GetPriority() string { + if o == nil || common.IsNil(o.Priority) { + var ret string + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetPriorityOk() (*string, bool) { + if o == nil || common.IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *TransferRoute) HasPriority() bool { + if o != nil && !common.IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given string and assigns it to the Priority field. +func (o *TransferRoute) SetPriority(v string) { + o.Priority = &v +} + +// GetRequirements returns the Requirements field value if set, zero value otherwise. +func (o *TransferRoute) GetRequirements() TransferRouteRequirements { + if o == nil || common.IsNil(o.Requirements) { + var ret TransferRouteRequirements + return ret + } + return *o.Requirements +} + +// GetRequirementsOk returns a tuple with the Requirements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetRequirementsOk() (*TransferRouteRequirements, bool) { + if o == nil || common.IsNil(o.Requirements) { + return nil, false + } + return o.Requirements, true +} + +// HasRequirements returns a boolean if a field has been set. +func (o *TransferRoute) HasRequirements() bool { + if o != nil && !common.IsNil(o.Requirements) { + return true + } + + return false +} + +// SetRequirements gets a reference to the given TransferRouteRequirements and assigns it to the Requirements field. +func (o *TransferRoute) SetRequirements(v TransferRouteRequirements) { + o.Requirements = &v +} + +func (o TransferRoute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRoute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !common.IsNil(o.Requirements) { + toSerialize["requirements"] = o.Requirements + } + return toSerialize, nil +} + +type NullableTransferRoute struct { + value *TransferRoute + isSet bool +} + +func (v NullableTransferRoute) Get() *TransferRoute { + return v.value +} + +func (v *NullableTransferRoute) Set(val *TransferRoute) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRoute(val *TransferRoute) *NullableTransferRoute { + return &NullableTransferRoute{value: val, isSet: true} +} + +func (v NullableTransferRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransferRoute) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "upgrade"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *TransferRoute) isValidPriority() bool { + var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_transfer_route_request.go b/src/balanceplatform/model_transfer_route_request.go new file mode 100644 index 000000000..2f6c76195 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_request.go @@ -0,0 +1,329 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRouteRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteRequest{} + +// TransferRouteRequest struct for TransferRouteRequest +type TransferRouteRequest struct { + // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). Required if `counterparty` is **transferInstrumentId**. + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + // The unique identifier assigned to the balance platform associated with the account holder. + BalancePlatform string `json:"balancePlatform"` + // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + Category string `json:"category"` + Counterparty *Counterparty `json:"counterparty,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. > Either `counterparty` or `country` field must be provided in a transfer route request. + Country *string `json:"country,omitempty"` + // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + Currency string `json:"currency"` + // The list of priorities for the bank transfer. Priorities set the speed at which the transfer is sent and the fees that you have to pay. Multiple values can be provided. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + Priorities []string `json:"priorities,omitempty"` +} + +// NewTransferRouteRequest instantiates a new TransferRouteRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRouteRequest(balancePlatform string, category string, currency string) *TransferRouteRequest { + this := TransferRouteRequest{} + this.BalancePlatform = balancePlatform + this.Category = category + this.Currency = currency + return &this +} + +// NewTransferRouteRequestWithDefaults instantiates a new TransferRouteRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRouteRequestWithDefaults() *TransferRouteRequest { + this := TransferRouteRequest{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetBalanceAccountId() string { + if o == nil || common.IsNil(o.BalanceAccountId) { + var ret string + return ret + } + return *o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetBalanceAccountIdOk() (*string, bool) { + if o == nil || common.IsNil(o.BalanceAccountId) { + return nil, false + } + return o.BalanceAccountId, true +} + +// HasBalanceAccountId returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasBalanceAccountId() bool { + if o != nil && !common.IsNil(o.BalanceAccountId) { + return true + } + + return false +} + +// SetBalanceAccountId gets a reference to the given string and assigns it to the BalanceAccountId field. +func (o *TransferRouteRequest) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *TransferRouteRequest) GetBalancePlatform() string { + if o == nil { + var ret string + return ret + } + + return o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *TransferRouteRequest) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetCategory returns the Category field value +func (o *TransferRouteRequest) GetCategory() string { + if o == nil { + var ret string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *TransferRouteRequest) SetCategory(v string) { + o.Category = v +} + +// GetCounterparty returns the Counterparty field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetCounterparty() Counterparty { + if o == nil || common.IsNil(o.Counterparty) { + var ret Counterparty + return ret + } + return *o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCounterpartyOk() (*Counterparty, bool) { + if o == nil || common.IsNil(o.Counterparty) { + return nil, false + } + return o.Counterparty, true +} + +// HasCounterparty returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasCounterparty() bool { + if o != nil && !common.IsNil(o.Counterparty) { + return true + } + + return false +} + +// SetCounterparty gets a reference to the given Counterparty and assigns it to the Counterparty field. +func (o *TransferRouteRequest) SetCounterparty(v Counterparty) { + o.Counterparty = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetCountry() string { + if o == nil || common.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCountryOk() (*string, bool) { + if o == nil || common.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasCountry() bool { + if o != nil && !common.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *TransferRouteRequest) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value +func (o *TransferRouteRequest) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *TransferRouteRequest) SetCurrency(v string) { + o.Currency = v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *TransferRouteRequest) SetPriorities(v []string) { + o.Priorities = v +} + +func (o TransferRouteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["category"] = o.Category + if !common.IsNil(o.Counterparty) { + toSerialize["counterparty"] = o.Counterparty + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + return toSerialize, nil +} + +type NullableTransferRouteRequest struct { + value *TransferRouteRequest + isSet bool +} + +func (v NullableTransferRouteRequest) Get() *TransferRouteRequest { + return v.value +} + +func (v *NullableTransferRouteRequest) Set(val *TransferRouteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequest(val *TransferRouteRequest) *NullableTransferRouteRequest { + return &NullableTransferRouteRequest{value: val, isSet: true} +} + +func (v NullableTransferRouteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransferRouteRequest) isValidCategory() bool { + var allowedEnumValues = []string{"bank"} + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_transfer_route_requirements.go b/src/balanceplatform/model_transfer_route_requirements.go new file mode 100644 index 000000000..052b22446 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_requirements.go @@ -0,0 +1,203 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "fmt" +) + +// TransferRouteRequirements - A set of rules defined by clearing houses and banking partners. Your transfer request must adhere to these rules to ensure successful initiation of transfer. Based on the priority, one or more requirements may be returned. Each requirement is defined with a `type` and `description`. +type TransferRouteRequirements struct { + AddressRequirement *AddressRequirement + AmountMinMaxRequirement *AmountMinMaxRequirement + BankAccountIdentificationTypeRequirement *BankAccountIdentificationTypeRequirement + PaymentInstrumentRequirement *PaymentInstrumentRequirement +} + +// AddressRequirementAsTransferRouteRequirements is a convenience function that returns AddressRequirement wrapped in TransferRouteRequirements +func AddressRequirementAsTransferRouteRequirements(v *AddressRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AddressRequirement: v, + } +} + +// AmountMinMaxRequirementAsTransferRouteRequirements is a convenience function that returns AmountMinMaxRequirement wrapped in TransferRouteRequirements +func AmountMinMaxRequirementAsTransferRouteRequirements(v *AmountMinMaxRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AmountMinMaxRequirement: v, + } +} + +// BankAccountIdentificationTypeRequirementAsTransferRouteRequirements is a convenience function that returns BankAccountIdentificationTypeRequirement wrapped in TransferRouteRequirements +func BankAccountIdentificationTypeRequirementAsTransferRouteRequirements(v *BankAccountIdentificationTypeRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + BankAccountIdentificationTypeRequirement: v, + } +} + +// PaymentInstrumentRequirementAsTransferRouteRequirements is a convenience function that returns PaymentInstrumentRequirement wrapped in TransferRouteRequirements +func PaymentInstrumentRequirementAsTransferRouteRequirements(v *PaymentInstrumentRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + PaymentInstrumentRequirement: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AddressRequirement + err = json.Unmarshal(data, &dst.AddressRequirement) + if err == nil { + jsonAddressRequirement, _ := json.Marshal(dst.AddressRequirement) + if string(jsonAddressRequirement) == "{}" || !dst.AddressRequirement.isValidType() { // empty struct + dst.AddressRequirement = nil + } else { + match++ + } + } else { + dst.AddressRequirement = nil + } + + // try to unmarshal data into AmountMinMaxRequirement + err = json.Unmarshal(data, &dst.AmountMinMaxRequirement) + if err == nil { + jsonAmountMinMaxRequirement, _ := json.Marshal(dst.AmountMinMaxRequirement) + if string(jsonAmountMinMaxRequirement) == "{}" || !dst.AmountMinMaxRequirement.isValidType() { // empty struct + dst.AmountMinMaxRequirement = nil + } else { + match++ + } + } else { + dst.AmountMinMaxRequirement = nil + } + + // try to unmarshal data into BankAccountIdentificationTypeRequirement + err = json.Unmarshal(data, &dst.BankAccountIdentificationTypeRequirement) + if err == nil { + jsonBankAccountIdentificationTypeRequirement, _ := json.Marshal(dst.BankAccountIdentificationTypeRequirement) + if string(jsonBankAccountIdentificationTypeRequirement) == "{}" || !dst.BankAccountIdentificationTypeRequirement.isValidType() { // empty struct + dst.BankAccountIdentificationTypeRequirement = nil + } else { + match++ + } + } else { + dst.BankAccountIdentificationTypeRequirement = nil + } + + // try to unmarshal data into PaymentInstrumentRequirement + err = json.Unmarshal(data, &dst.PaymentInstrumentRequirement) + if err == nil { + jsonPaymentInstrumentRequirement, _ := json.Marshal(dst.PaymentInstrumentRequirement) + if string(jsonPaymentInstrumentRequirement) == "{}" || !dst.PaymentInstrumentRequirement.isValidType() { // empty struct + dst.PaymentInstrumentRequirement = nil + } else { + match++ + } + } else { + dst.PaymentInstrumentRequirement = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AddressRequirement = nil + dst.AmountMinMaxRequirement = nil + dst.BankAccountIdentificationTypeRequirement = nil + dst.PaymentInstrumentRequirement = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferRouteRequirements)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferRouteRequirements)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferRouteRequirements) MarshalJSON() ([]byte, error) { + if src.AddressRequirement != nil { + return json.Marshal(&src.AddressRequirement) + } + + if src.AmountMinMaxRequirement != nil { + return json.Marshal(&src.AmountMinMaxRequirement) + } + + if src.BankAccountIdentificationTypeRequirement != nil { + return json.Marshal(&src.BankAccountIdentificationTypeRequirement) + } + + if src.PaymentInstrumentRequirement != nil { + return json.Marshal(&src.PaymentInstrumentRequirement) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferRouteRequirements) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AddressRequirement != nil { + return obj.AddressRequirement + } + + if obj.AmountMinMaxRequirement != nil { + return obj.AmountMinMaxRequirement + } + + if obj.BankAccountIdentificationTypeRequirement != nil { + return obj.BankAccountIdentificationTypeRequirement + } + + if obj.PaymentInstrumentRequirement != nil { + return obj.PaymentInstrumentRequirement + } + + // all schemas are nil + return nil +} + +type NullableTransferRouteRequirements struct { + value *TransferRouteRequirements + isSet bool +} + +func (v NullableTransferRouteRequirements) Get() *TransferRouteRequirements { + return v.value +} + +func (v *NullableTransferRouteRequirements) Set(val *TransferRouteRequirements) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequirements) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequirements) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequirements(val *TransferRouteRequirements) *NullableTransferRouteRequirements { + return &NullableTransferRouteRequirements{value: val, isSet: true} +} + +func (v NullableTransferRouteRequirements) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteRequirements) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_transfer_route_response.go b/src/balanceplatform/model_transfer_route_response.go new file mode 100644 index 000000000..16bca6daf --- /dev/null +++ b/src/balanceplatform/model_transfer_route_response.go @@ -0,0 +1,125 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRouteResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteResponse{} + +// TransferRouteResponse struct for TransferRouteResponse +type TransferRouteResponse struct { + // List of available priorities for a transfer, along with requirements. Use this information to initiate a transfer. + TransferRoutes []TransferRoute `json:"transferRoutes,omitempty"` +} + +// NewTransferRouteResponse instantiates a new TransferRouteResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRouteResponse() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// NewTransferRouteResponseWithDefaults instantiates a new TransferRouteResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRouteResponseWithDefaults() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// GetTransferRoutes returns the TransferRoutes field value if set, zero value otherwise. +func (o *TransferRouteResponse) GetTransferRoutes() []TransferRoute { + if o == nil || common.IsNil(o.TransferRoutes) { + var ret []TransferRoute + return ret + } + return o.TransferRoutes +} + +// GetTransferRoutesOk returns a tuple with the TransferRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteResponse) GetTransferRoutesOk() ([]TransferRoute, bool) { + if o == nil || common.IsNil(o.TransferRoutes) { + return nil, false + } + return o.TransferRoutes, true +} + +// HasTransferRoutes returns a boolean if a field has been set. +func (o *TransferRouteResponse) HasTransferRoutes() bool { + if o != nil && !common.IsNil(o.TransferRoutes) { + return true + } + + return false +} + +// SetTransferRoutes gets a reference to the given []TransferRoute and assigns it to the TransferRoutes field. +func (o *TransferRouteResponse) SetTransferRoutes(v []TransferRoute) { + o.TransferRoutes = v +} + +func (o TransferRouteResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.TransferRoutes) { + toSerialize["transferRoutes"] = o.TransferRoutes + } + return toSerialize, nil +} + +type NullableTransferRouteResponse struct { + value *TransferRouteResponse + isSet bool +} + +func (v NullableTransferRouteResponse) Get() *TransferRouteResponse { + return v.value +} + +func (v *NullableTransferRouteResponse) Set(val *TransferRouteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteResponse(val *TransferRouteResponse) *NullableTransferRouteResponse { + return &NullableTransferRouteResponse{value: val, isSet: true} +} + +func (v NullableTransferRouteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_update_sweep_configuration_v2.go b/src/balanceplatform/model_update_sweep_configuration_v2.go index 2a78a5d5d..23f34ed9f 100644 --- a/src/balanceplatform/model_update_sweep_configuration_v2.go +++ b/src/balanceplatform/model_update_sweep_configuration_v2.go @@ -577,7 +577,7 @@ func (o *UpdateSweepConfigurationV2) isValidCategory() bool { return false } func (o *UpdateSweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/binlookup/model_ds_public_key_detail.go b/src/binlookup/model_ds_public_key_detail.go index 84e97b2c0..3edc29169 100644 --- a/src/binlookup/model_ds_public_key_detail.go +++ b/src/binlookup/model_ds_public_key_detail.go @@ -27,6 +27,8 @@ type DSPublicKeyDetail struct { FromSDKVersion *string `json:"fromSDKVersion,omitempty"` // Public key. The 3D Secure 2 SDK encrypts the device information by using the DS public key. PublicKey *string `json:"publicKey,omitempty"` + // Directory Server root certificates. The 3D Secure 2 SDK verifies the ACS signed content using the rootCertificates. + RootCertificates *string `json:"rootCertificates,omitempty"` } // NewDSPublicKeyDetail instantiates a new DSPublicKeyDetail object @@ -174,6 +176,38 @@ func (o *DSPublicKeyDetail) SetPublicKey(v string) { o.PublicKey = &v } +// GetRootCertificates returns the RootCertificates field value if set, zero value otherwise. +func (o *DSPublicKeyDetail) GetRootCertificates() string { + if o == nil || common.IsNil(o.RootCertificates) { + var ret string + return ret + } + return *o.RootCertificates +} + +// GetRootCertificatesOk returns a tuple with the RootCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DSPublicKeyDetail) GetRootCertificatesOk() (*string, bool) { + if o == nil || common.IsNil(o.RootCertificates) { + return nil, false + } + return o.RootCertificates, true +} + +// HasRootCertificates returns a boolean if a field has been set. +func (o *DSPublicKeyDetail) HasRootCertificates() bool { + if o != nil && !common.IsNil(o.RootCertificates) { + return true + } + + return false +} + +// SetRootCertificates gets a reference to the given string and assigns it to the RootCertificates field. +func (o *DSPublicKeyDetail) SetRootCertificates(v string) { + o.RootCertificates = &v +} + func (o DSPublicKeyDetail) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -196,6 +230,9 @@ func (o DSPublicKeyDetail) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.PublicKey) { toSerialize["publicKey"] = o.PublicKey } + if !common.IsNil(o.RootCertificates) { + toSerialize["rootCertificates"] = o.RootCertificates + } return toSerialize, nil } diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index 2b12d4406..4d05a9b9d 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -97,6 +97,8 @@ type CreateCheckoutSessionRequest struct { ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. ShopperStatement *string `json:"shopperStatement,omitempty"` + // Set to true to show the payment amount per installment. + ShowInstallmentAmount *bool `json:"showInstallmentAmount,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. @@ -1587,6 +1589,38 @@ func (o *CreateCheckoutSessionRequest) SetShopperStatement(v string) { o.ShopperStatement = &v } +// GetShowInstallmentAmount returns the ShowInstallmentAmount field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetShowInstallmentAmount() bool { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + var ret bool + return ret + } + return *o.ShowInstallmentAmount +} + +// GetShowInstallmentAmountOk returns a tuple with the ShowInstallmentAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetShowInstallmentAmountOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + return nil, false + } + return o.ShowInstallmentAmount, true +} + +// HasShowInstallmentAmount returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasShowInstallmentAmount() bool { + if o != nil && !common.IsNil(o.ShowInstallmentAmount) { + return true + } + + return false +} + +// SetShowInstallmentAmount gets a reference to the given bool and assigns it to the ShowInstallmentAmount field. +func (o *CreateCheckoutSessionRequest) SetShowInstallmentAmount(v bool) { + o.ShowInstallmentAmount = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2018,6 +2052,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShopperStatement) { toSerialize["shopperStatement"] = o.ShopperStatement } + if !common.IsNil(o.ShowInstallmentAmount) { + toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount + } 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 01e488960..87566c2f8 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -103,6 +103,8 @@ type CreateCheckoutSessionResponse struct { ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. ShopperStatement *string `json:"shopperStatement,omitempty"` + // Set to true to show the payment amount per installment. + ShowInstallmentAmount *bool `json:"showInstallmentAmount,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. @@ -1679,6 +1681,38 @@ func (o *CreateCheckoutSessionResponse) SetShopperStatement(v string) { o.ShopperStatement = &v } +// GetShowInstallmentAmount returns the ShowInstallmentAmount field value if set, zero value otherwise. +func (o *CreateCheckoutSessionResponse) GetShowInstallmentAmount() bool { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + var ret bool + return ret + } + return *o.ShowInstallmentAmount +} + +// GetShowInstallmentAmountOk returns a tuple with the ShowInstallmentAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionResponse) GetShowInstallmentAmountOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + return nil, false + } + return o.ShowInstallmentAmount, true +} + +// HasShowInstallmentAmount returns a boolean if a field has been set. +func (o *CreateCheckoutSessionResponse) HasShowInstallmentAmount() bool { + if o != nil && !common.IsNil(o.ShowInstallmentAmount) { + return true + } + + return false +} + +// SetShowInstallmentAmount gets a reference to the given bool and assigns it to the ShowInstallmentAmount field. +func (o *CreateCheckoutSessionResponse) SetShowInstallmentAmount(v bool) { + o.ShowInstallmentAmount = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionResponse) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2115,6 +2149,9 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShopperStatement) { toSerialize["shopperStatement"] = o.ShopperStatement } + if !common.IsNil(o.ShowInstallmentAmount) { + toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount + } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } diff --git a/src/checkout/model_payment_amount_update_request.go b/src/checkout/model_payment_amount_update_request.go index 2061b4d11..620310600 100644 --- a/src/checkout/model_payment_amount_update_request.go +++ b/src/checkout/model_payment_amount_update_request.go @@ -19,7 +19,8 @@ var _ common.MappedNullable = &PaymentAmountUpdateRequest{} // PaymentAmountUpdateRequest struct for PaymentAmountUpdateRequest type PaymentAmountUpdateRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. @@ -75,6 +76,38 @@ func (o *PaymentAmountUpdateRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentAmountUpdateRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentAmountUpdateRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentAmountUpdateRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentAmountUpdateRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *PaymentAmountUpdateRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -238,6 +271,9 @@ func (o PaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { func (o PaymentAmountUpdateRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } diff --git a/src/checkout/model_payment_cancel_request.go b/src/checkout/model_payment_cancel_request.go index e466d50f3..42aa856c7 100644 --- a/src/checkout/model_payment_cancel_request.go +++ b/src/checkout/model_payment_cancel_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &PaymentCancelRequest{} // PaymentCancelRequest struct for PaymentCancelRequest type PaymentCancelRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // Your reference for the cancel request. Maximum length: 80 characters. @@ -43,6 +44,38 @@ func NewPaymentCancelRequestWithDefaults() *PaymentCancelRequest { return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentCancelRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCancelRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentCancelRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentCancelRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *PaymentCancelRequest) GetMerchantAccount() string { if o == nil { @@ -109,6 +142,9 @@ func (o PaymentCancelRequest) MarshalJSON() ([]byte, error) { func (o PaymentCancelRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 80f2de18f..0b1be6715 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -19,7 +19,8 @@ var _ common.MappedNullable = &PaymentCaptureRequest{} // PaymentCaptureRequest struct for PaymentCaptureRequest type PaymentCaptureRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. @@ -76,6 +77,38 @@ func (o *PaymentCaptureRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentCaptureRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCaptureRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentCaptureRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentCaptureRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetLineItems returns the LineItems field value if set, zero value otherwise. func (o *PaymentCaptureRequest) GetLineItems() []LineItem { if o == nil || common.IsNil(o.LineItems) { @@ -271,6 +304,9 @@ func (o PaymentCaptureRequest) MarshalJSON() ([]byte, error) { func (o PaymentCaptureRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.LineItems) { toSerialize["lineItems"] = o.LineItems } diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 428554319..1d8f0c25f 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", "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", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "paypo", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/checkout/model_payment_refund_request.go b/src/checkout/model_payment_refund_request.go index 630288cbb..824bf95f1 100644 --- a/src/checkout/model_payment_refund_request.go +++ b/src/checkout/model_payment_refund_request.go @@ -19,7 +19,8 @@ var _ common.MappedNullable = &PaymentRefundRequest{} // PaymentRefundRequest struct for PaymentRefundRequest type PaymentRefundRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. @@ -75,6 +76,38 @@ func (o *PaymentRefundRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentRefundRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRefundRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentRefundRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentRefundRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetLineItems returns the LineItems field value if set, zero value otherwise. func (o *PaymentRefundRequest) GetLineItems() []LineItem { if o == nil || common.IsNil(o.LineItems) { @@ -238,6 +271,9 @@ func (o PaymentRefundRequest) MarshalJSON() ([]byte, error) { func (o PaymentRefundRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.LineItems) { toSerialize["lineItems"] = o.LineItems } diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index f6157c2b0..12d4b4426 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -101,7 +101,7 @@ type PaymentRequest struct { RedirectToIssuerMethod *string `json:"redirectToIssuerMethod,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` - // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + // The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` ReturnUrl string `json:"returnUrl"` RiskData *RiskData `json:"riskData,omitempty"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 diff --git a/src/checkout/model_payment_reversal_request.go b/src/checkout/model_payment_reversal_request.go index 9ed640e54..8aed58819 100644 --- a/src/checkout/model_payment_reversal_request.go +++ b/src/checkout/model_payment_reversal_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &PaymentReversalRequest{} // PaymentReversalRequest struct for PaymentReversalRequest type PaymentReversalRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // Your reference for the reversal request. Maximum length: 80 characters. @@ -43,6 +44,38 @@ func NewPaymentReversalRequestWithDefaults() *PaymentReversalRequest { return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentReversalRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentReversalRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentReversalRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentReversalRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *PaymentReversalRequest) GetMerchantAccount() string { if o == nil { @@ -109,6 +142,9 @@ func (o PaymentReversalRequest) MarshalJSON() ([]byte, error) { func (o PaymentReversalRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index b647c0201..513463d4f 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -19,14 +19,14 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` - // A description of this split. + // The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + Account *string `json:"account,omitempty"` + Amount *SplitAmount `json:"amount,omitempty"` + // Your description for the split item. Description *string `json:"description,omitempty"` - // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + // Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. Reference *string `json:"reference,omitempty"` - // The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + // The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. Type string `json:"type"` } @@ -34,9 +34,8 @@ type Split struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSplit(amount SplitAmount, type_ string) *Split { +func NewSplit(type_ string) *Split { this := Split{} - this.Amount = amount this.Type = type_ return &this } @@ -81,28 +80,36 @@ func (o *Split) SetAccount(v string) { o.Account = &v } -// GetAmount returns the Amount field value +// GetAmount returns the Amount field value if set, zero value otherwise. func (o *Split) GetAmount() SplitAmount { - if o == nil { + if o == nil || common.IsNil(o.Amount) { var ret SplitAmount return ret } - - return o.Amount + return *o.Amount } -// GetAmountOk returns a tuple with the Amount field value +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Split) GetAmountOk() (*SplitAmount, bool) { - if o == nil { + if o == nil || common.IsNil(o.Amount) { return nil, false } - return &o.Amount, true + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Split) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false } -// SetAmount sets field value +// SetAmount gets a reference to the given SplitAmount and assigns it to the Amount field. func (o *Split) SetAmount(v SplitAmount) { - o.Amount = v + o.Amount = &v } // GetDescription returns the Description field value if set, zero value otherwise. @@ -206,7 +213,9 @@ func (o Split) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Account) { toSerialize["account"] = o.Account } - toSerialize["amount"] = o.Amount + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } diff --git a/src/checkout/model_split_amount.go b/src/checkout/model_split_amount.go index 0a8d4f14f..d413fd197 100644 --- a/src/checkout/model_split_amount.go +++ b/src/checkout/model_split_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &SplitAmount{} // SplitAmount struct for SplitAmount type SplitAmount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. Currency *string `json:"currency,omitempty"` - // The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). Value int64 `json:"value"` } diff --git a/src/checkout/model_standalone_payment_cancel_request.go b/src/checkout/model_standalone_payment_cancel_request.go index fd7137ecc..22d47d117 100644 --- a/src/checkout/model_standalone_payment_cancel_request.go +++ b/src/checkout/model_standalone_payment_cancel_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &StandalonePaymentCancelRequest{} // StandalonePaymentCancelRequest struct for StandalonePaymentCancelRequest type StandalonePaymentCancelRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. @@ -46,6 +47,38 @@ func NewStandalonePaymentCancelRequestWithDefaults() *StandalonePaymentCancelReq return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *StandalonePaymentCancelRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandalonePaymentCancelRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *StandalonePaymentCancelRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *StandalonePaymentCancelRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *StandalonePaymentCancelRequest) GetMerchantAccount() string { if o == nil { @@ -136,6 +169,9 @@ func (o StandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { func (o StandalonePaymentCancelRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount toSerialize["paymentReference"] = o.PaymentReference if !common.IsNil(o.Reference) { diff --git a/src/configurationwebhook/model_account_holder_capability.go b/src/configurationwebhook/model_account_holder_capability.go index 34f36ef24..f9f3dc10c 100644 --- a/src/configurationwebhook/model_account_holder_capability.go +++ b/src/configurationwebhook/model_account_holder_capability.go @@ -33,8 +33,6 @@ type AccountHolderCapability struct { // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel *string `json:"requestedLevel,omitempty"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` - // Contains the status of the transfer instruments associated with this capability. - TransferInstruments []AccountSupportingEntityCapability `json:"transferInstruments,omitempty"` // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -312,38 +310,6 @@ func (o *AccountHolderCapability) SetRequestedSettings(v CapabilitySettings) { o.RequestedSettings = &v } -// GetTransferInstruments returns the TransferInstruments field value if set, zero value otherwise. -func (o *AccountHolderCapability) GetTransferInstruments() []AccountSupportingEntityCapability { - if o == nil || common.IsNil(o.TransferInstruments) { - var ret []AccountSupportingEntityCapability - return ret - } - return o.TransferInstruments -} - -// GetTransferInstrumentsOk returns a tuple with the TransferInstruments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AccountHolderCapability) GetTransferInstrumentsOk() ([]AccountSupportingEntityCapability, bool) { - if o == nil || common.IsNil(o.TransferInstruments) { - return nil, false - } - return o.TransferInstruments, true -} - -// HasTransferInstruments returns a boolean if a field has been set. -func (o *AccountHolderCapability) HasTransferInstruments() bool { - if o != nil && !common.IsNil(o.TransferInstruments) { - return true - } - - return false -} - -// SetTransferInstruments gets a reference to the given []AccountSupportingEntityCapability and assigns it to the TransferInstruments field. -func (o *AccountHolderCapability) SetTransferInstruments(v []AccountSupportingEntityCapability) { - o.TransferInstruments = v -} - // GetVerificationStatus returns the VerificationStatus field value if set, zero value otherwise. func (o *AccountHolderCapability) GetVerificationStatus() string { if o == nil || common.IsNil(o.VerificationStatus) { @@ -410,9 +376,6 @@ func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RequestedSettings) { toSerialize["requestedSettings"] = o.RequestedSettings } - if !common.IsNil(o.TransferInstruments) { - toSerialize["transferInstruments"] = o.TransferInstruments - } if !common.IsNil(o.VerificationStatus) { toSerialize["verificationStatus"] = o.VerificationStatus } diff --git a/src/configurationwebhook/model_balance_account.go b/src/configurationwebhook/model_balance_account.go index 1fdefcce4..fb22f8fed 100644 --- a/src/configurationwebhook/model_balance_account.go +++ b/src/configurationwebhook/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { AccountHolderId string `json:"accountHolderId"` // List of balances with the amount and currency. Balances []Balance `json:"balances,omitempty"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` diff --git a/src/configurationwebhook/model_platform_payment_configuration.go b/src/configurationwebhook/model_platform_payment_configuration.go index 9e96c6dcc..7385015f4 100644 --- a/src/configurationwebhook/model_platform_payment_configuration.go +++ b/src/configurationwebhook/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &PlatformPaymentConfiguration{} // PlatformPaymentConfiguration struct for PlatformPaymentConfiguration type PlatformPaymentConfiguration struct { - // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. SalesDayClosingTime *string `json:"salesDayClosingTime,omitempty"` - // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. SettlementDelayDays *int32 `json:"settlementDelayDays,omitempty"` } diff --git a/src/configurationwebhook/model_sweep_configuration_v2.go b/src/configurationwebhook/model_sweep_configuration_v2.go index 18a8d0bcb..6cb37c491 100644 --- a/src/configurationwebhook/model_sweep_configuration_v2.go +++ b/src/configurationwebhook/model_sweep_configuration_v2.go @@ -458,7 +458,7 @@ func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true diff --git a/src/configurationwebhook/model_sweep_counterparty.go b/src/configurationwebhook/model_sweep_counterparty.go index 20d3ab6fa..025d95528 100644 --- a/src/configurationwebhook/model_sweep_counterparty.go +++ b/src/configurationwebhook/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &SweepCounterparty{} type SweepCounterparty struct { // The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. BalanceAccountId *string `json:"balanceAccountId,omitempty"` - // The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. MerchantAccount *string `json:"merchantAccount,omitempty"` - // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } diff --git a/src/legalentity/api_documents.go b/src/legalentity/api_documents.go index e040092fe..13158172f 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -112,8 +112,15 @@ func (a *DocumentsApi) GetDocument(ctx context.Context, r DocumentsApiGetDocumen // All parameters accepted by DocumentsApi.UpdateDocument type DocumentsApiUpdateDocumentInput struct { - id string - document *Document + id string + xRequestedVerificationCode *string + document *Document +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the document. Requested verification codes can only be used in your test environment. +func (r DocumentsApiUpdateDocumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) DocumentsApiUpdateDocumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r DocumentsApiUpdateDocumentInput) Document(document Document) DocumentsApiUpdateDocumentInput { @@ -137,6 +144,8 @@ UpdateDocument Update a document Updates a document. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUpdateDocumentInput - Request parameters, see UpdateDocumentInput @return Document, *http.Response, error @@ -147,6 +156,9 @@ func (a *DocumentsApi) UpdateDocument(ctx context.Context, r DocumentsApiUpdateD path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, @@ -196,6 +208,8 @@ Uploads a document for verification checks. You should only upload documents when Adyen requests additional information for the legal entity. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUploadDocumentForVerificationChecksInput - Request parameters, see UploadDocumentForVerificationChecksInput @return Document, *http.Response, error diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index 448b74e98..df48c9006 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -220,8 +220,15 @@ func (a *LegalEntitiesApi) GetLegalEntity(ctx context.Context, r LegalEntitiesAp // All parameters accepted by LegalEntitiesApi.UpdateLegalEntity type LegalEntitiesApiUpdateLegalEntityInput struct { - id string - legalEntityInfo *LegalEntityInfo + id string + xRequestedVerificationCode *string + legalEntityInfo *LegalEntityInfo +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the legal entity. Requested verification codes can only be used in your test environment. +func (r LegalEntitiesApiUpdateLegalEntityInput) XRequestedVerificationCode(xRequestedVerificationCode string) LegalEntitiesApiUpdateLegalEntityInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r LegalEntitiesApiUpdateLegalEntityInput) LegalEntityInfo(legalEntityInfo LegalEntityInfo) LegalEntitiesApiUpdateLegalEntityInput { @@ -257,6 +264,9 @@ func (a *LegalEntitiesApi) UpdateLegalEntity(ctx context.Context, r LegalEntitie path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index 238ce1faa..b82fcc2d1 100644 --- a/src/legalentity/api_pci_questionnaires.go +++ b/src/legalentity/api_pci_questionnaires.go @@ -33,7 +33,7 @@ func (r PCIQuestionnairesApiGeneratePciQuestionnaireInput) GeneratePciDescriptio /* Prepare a request for GeneratePciQuestionnaire -@param id The legal entity ID of the individual who will sign the PCI questionnaire. +@param id The unique identifier of the legal entity to get PCI questionnaire information. @return PCIQuestionnairesApiGeneratePciQuestionnaireInput */ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuestionnairesApiGeneratePciQuestionnaireInput { @@ -45,7 +45,7 @@ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuest /* GeneratePciQuestionnaire Generate PCI questionnaire -Generates the required PCI questionnaire based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). If multiple questionnaires are required, this request creates a single consodilated document to be signed. +Generates the required PCI questionnaires based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PCIQuestionnairesApiGeneratePciQuestionnaireInput - Request parameters, see GeneratePciQuestionnaireInput diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index df787b600..914359de3 100644 --- a/src/legalentity/api_terms_of_service.go +++ b/src/legalentity/api_terms_of_service.go @@ -34,7 +34,7 @@ func (r TermsOfServiceApiAcceptTermsOfServiceInput) AcceptTermsOfServiceRequest( /* Prepare a request for AcceptTermsOfService -@param id The unique identifier of the legal entity.@param termsofservicedocumentid The unique identifier of the Terms of Service document. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.@param termsofservicedocumentid The unique identifier of the Terms of Service document. @return TermsOfServiceApiAcceptTermsOfServiceInput */ func (a *TermsOfServiceApi) AcceptTermsOfServiceInput(id string, termsofservicedocumentid string) TermsOfServiceApiAcceptTermsOfServiceInput { @@ -87,7 +87,7 @@ func (r TermsOfServiceApiGetTermsOfServiceDocumentInput) GetTermsOfServiceDocume /* Prepare a request for GetTermsOfServiceDocument -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceDocumentInput */ func (a *TermsOfServiceApi) GetTermsOfServiceDocumentInput(id string) TermsOfServiceApiGetTermsOfServiceDocumentInput { @@ -132,7 +132,7 @@ type TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput struct { /* Prepare a request for GetTermsOfServiceInformationForLegalEntity -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput */ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntityInput(id string) TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput { @@ -177,7 +177,7 @@ type TermsOfServiceApiGetTermsOfServiceStatusInput struct { /* Prepare a request for GetTermsOfServiceStatus -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceStatusInput */ func (a *TermsOfServiceApi) GetTermsOfServiceStatusInput(id string) TermsOfServiceApiGetTermsOfServiceStatusInput { diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index a46c35fde..81376a6ab 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -173,8 +173,15 @@ func (a *TransferInstrumentsApi) GetTransferInstrument(ctx context.Context, r Tr // All parameters accepted by TransferInstrumentsApi.UpdateTransferInstrument type TransferInstrumentsApiUpdateTransferInstrumentInput struct { - id string - transferInstrumentInfo *TransferInstrumentInfo + id string + xRequestedVerificationCode *string + transferInstrumentInfo *TransferInstrumentInfo +} + +// Use the requested verification code 0_0001 to resolve any suberrors associated with the transfer instrument. Requested verification codes can only be used in your test environment. +func (r TransferInstrumentsApiUpdateTransferInstrumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) TransferInstrumentsApiUpdateTransferInstrumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r TransferInstrumentsApiUpdateTransferInstrumentInput) TransferInstrumentInfo(transferInstrumentInfo TransferInstrumentInfo) TransferInstrumentsApiUpdateTransferInstrumentInput { @@ -208,6 +215,9 @@ func (a *TransferInstrumentsApi) UpdateTransferInstrument(ctx context.Context, r path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, diff --git a/src/legalentity/model_accept_terms_of_service_request.go b/src/legalentity/model_accept_terms_of_service_request.go index 88ee92570..eb7584e99 100644 --- a/src/legalentity/model_accept_terms_of_service_request.go +++ b/src/legalentity/model_accept_terms_of_service_request.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &AcceptTermsOfServiceRequest{} // AcceptTermsOfServiceRequest struct for AcceptTermsOfServiceRequest type AcceptTermsOfServiceRequest struct { - // The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. + // The legal entity ID of the user accepting the Terms of Service. For organizations, this must be the individual legal entity ID of an authorized signatory for the organization. For sole proprietorships, this must be the individual legal entity ID of the owner. AcceptedBy string `json:"acceptedBy"` // The IP address of the user accepting the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 5d301c62b..6164aabac 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -25,7 +25,7 @@ type AcceptTermsOfServiceResponse struct { Id *string `json:"id,omitempty"` // The IP address of the user that accepted the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` - // The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. + // The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` diff --git a/src/legalentity/model_bank_account_info.go b/src/legalentity/model_bank_account_info.go index 49db7668a..923d097dd 100644 --- a/src/legalentity/model_bank_account_info.go +++ b/src/legalentity/model_bank_account_info.go @@ -23,6 +23,8 @@ type BankAccountInfo struct { // The type of bank account. // Deprecated AccountType *string `json:"accountType,omitempty"` + // The name of the banking institution where the bank account is held. + BankName *string `json:"bankName,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the bank account is registered. For example, **NL**. CountryCode *string `json:"countryCode,omitempty"` // Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). @@ -113,6 +115,38 @@ func (o *BankAccountInfo) SetAccountType(v string) { o.AccountType = &v } +// GetBankName returns the BankName field value if set, zero value otherwise. +func (o *BankAccountInfo) GetBankName() string { + if o == nil || common.IsNil(o.BankName) { + var ret string + return ret + } + return *o.BankName +} + +// GetBankNameOk returns a tuple with the BankName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountInfo) GetBankNameOk() (*string, bool) { + if o == nil || common.IsNil(o.BankName) { + return nil, false + } + return o.BankName, true +} + +// HasBankName returns a boolean if a field has been set. +func (o *BankAccountInfo) HasBankName() bool { + if o != nil && !common.IsNil(o.BankName) { + return true + } + + return false +} + +// SetBankName gets a reference to the given string and assigns it to the BankName field. +func (o *BankAccountInfo) SetBankName(v string) { + o.BankName = &v +} + // GetCountryCode returns the CountryCode field value if set, zero value otherwise. func (o *BankAccountInfo) GetCountryCode() string { if o == nil || common.IsNil(o.CountryCode) { @@ -193,6 +227,9 @@ func (o BankAccountInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountType) { toSerialize["accountType"] = o.AccountType } + if !common.IsNil(o.BankName) { + toSerialize["bankName"] = o.BankName + } if !common.IsNil(o.CountryCode) { toSerialize["countryCode"] = o.CountryCode } diff --git a/src/legalentity/model_bank_account_info_account_identification.go b/src/legalentity/model_bank_account_info_account_identification.go index 207e2462b..6d0f54e95 100644 --- a/src/legalentity/model_bank_account_info_account_identification.go +++ b/src/legalentity/model_bank_account_info_account_identification.go @@ -23,6 +23,7 @@ type BankAccountInfoAccountIdentification struct { HULocalAccountIdentification *HULocalAccountIdentification IbanAccountIdentification *IbanAccountIdentification NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification PLLocalAccountIdentification *PLLocalAccountIdentification SELocalAccountIdentification *SELocalAccountIdentification @@ -87,6 +88,13 @@ func NOLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NOLoc } } +// NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountInfoAccountIdentification +func NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NZLocalAccountIdentification) BankAccountInfoAccountIdentification { + return BankAccountInfoAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + // NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountInfoAccountIdentification func NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountInfoAccountIdentification { return BankAccountInfoAccountIdentification{ @@ -237,6 +245,19 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.NOLocalAccountIdentification = nil } + // try to unmarshal data into NZLocalAccountIdentification + err = json.Unmarshal(data, &dst.NZLocalAccountIdentification) + if err == nil { + jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) + if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct + dst.NZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NZLocalAccountIdentification = nil + } + // try to unmarshal data into NumberAndBicAccountIdentification err = json.Unmarshal(data, &dst.NumberAndBicAccountIdentification) if err == nil { @@ -325,6 +346,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.HULocalAccountIdentification = nil dst.IbanAccountIdentification = nil dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil dst.NumberAndBicAccountIdentification = nil dst.PLLocalAccountIdentification = nil dst.SELocalAccountIdentification = nil @@ -374,6 +396,10 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { return json.Marshal(&src.NOLocalAccountIdentification) } + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + if src.NumberAndBicAccountIdentification != nil { return json.Marshal(&src.NumberAndBicAccountIdentification) } @@ -438,6 +464,10 @@ func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} return obj.NOLocalAccountIdentification } + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + if obj.NumberAndBicAccountIdentification != nil { return obj.NumberAndBicAccountIdentification } diff --git a/src/legalentity/model_business_line.go b/src/legalentity/model_business_line.go index ad63814c5..4b51b4d24 100644 --- a/src/legalentity/model_business_line.go +++ b/src/legalentity/model_business_line.go @@ -28,7 +28,7 @@ type BusinessLine struct { IndustryCode string `json:"industryCode"` // Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this supporting entity. Problems []CapabilityProblem `json:"problems,omitempty"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index 962c0c2bd..dfc6232b6 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -19,6 +19,8 @@ var _ common.MappedNullable = &GeneratePciDescriptionRequest{} // GeneratePciDescriptionRequest struct for GeneratePciDescriptionRequest type GeneratePciDescriptionRequest struct { + // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) for your user. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** + AdditionalSalesChannels []string `json:"additionalSalesChannels,omitempty"` // Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. Language *string `json:"language,omitempty"` } @@ -40,6 +42,38 @@ func NewGeneratePciDescriptionRequestWithDefaults() *GeneratePciDescriptionReque return &this } +// GetAdditionalSalesChannels returns the AdditionalSalesChannels field value if set, zero value otherwise. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannels() []string { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + var ret []string + return ret + } + return o.AdditionalSalesChannels +} + +// GetAdditionalSalesChannelsOk returns a tuple with the AdditionalSalesChannels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannelsOk() ([]string, bool) { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + return nil, false + } + return o.AdditionalSalesChannels, true +} + +// HasAdditionalSalesChannels returns a boolean if a field has been set. +func (o *GeneratePciDescriptionRequest) HasAdditionalSalesChannels() bool { + if o != nil && !common.IsNil(o.AdditionalSalesChannels) { + return true + } + + return false +} + +// SetAdditionalSalesChannels gets a reference to the given []string and assigns it to the AdditionalSalesChannels field. +func (o *GeneratePciDescriptionRequest) SetAdditionalSalesChannels(v []string) { + o.AdditionalSalesChannels = v +} + // GetLanguage returns the Language field value if set, zero value otherwise. func (o *GeneratePciDescriptionRequest) GetLanguage() string { if o == nil || common.IsNil(o.Language) { @@ -82,6 +116,9 @@ func (o GeneratePciDescriptionRequest) MarshalJSON() ([]byte, error) { func (o GeneratePciDescriptionRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AdditionalSalesChannels) { + toSerialize["additionalSalesChannels"] = o.AdditionalSalesChannels + } if !common.IsNil(o.Language) { toSerialize["language"] = o.Language } diff --git a/src/legalentity/model_get_terms_of_service_document_request.go b/src/legalentity/model_get_terms_of_service_document_request.go index f7dc763e8..b478465bf 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -19,18 +19,20 @@ var _ common.MappedNullable = &GetTermsOfServiceDocumentRequest{} // GetTermsOfServiceDocumentRequest struct for GetTermsOfServiceDocumentRequest type GetTermsOfServiceDocumentRequest struct { - // The language to be used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. - Language *string `json:"language,omitempty"` + // The language to be used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. + Language string `json:"language"` // The type of Terms of Service. - Type *string `json:"type,omitempty"` + Type string `json:"type"` } // NewGetTermsOfServiceDocumentRequest instantiates a new GetTermsOfServiceDocumentRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetTermsOfServiceDocumentRequest() *GetTermsOfServiceDocumentRequest { +func NewGetTermsOfServiceDocumentRequest(language string, type_ string) *GetTermsOfServiceDocumentRequest { this := GetTermsOfServiceDocumentRequest{} + this.Language = language + this.Type = type_ return &this } @@ -42,68 +44,52 @@ func NewGetTermsOfServiceDocumentRequestWithDefaults() *GetTermsOfServiceDocumen return &this } -// GetLanguage returns the Language field value if set, zero value otherwise. +// GetLanguage returns the Language field value func (o *GetTermsOfServiceDocumentRequest) GetLanguage() string { - if o == nil || common.IsNil(o.Language) { + if o == nil { var ret string return ret } - return *o.Language + + return o.Language } -// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// GetLanguageOk returns a tuple with the Language field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetLanguageOk() (*string, bool) { - if o == nil || common.IsNil(o.Language) { + if o == nil { return nil, false } - return o.Language, true + return &o.Language, true } -// HasLanguage returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) HasLanguage() bool { - if o != nil && !common.IsNil(o.Language) { - return true - } - - return false -} - -// SetLanguage gets a reference to the given string and assigns it to the Language field. +// SetLanguage sets field value func (o *GetTermsOfServiceDocumentRequest) SetLanguage(v string) { - o.Language = &v + o.Language = v } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *GetTermsOfServiceDocumentRequest) GetType() string { - if o == nil || common.IsNil(o.Type) { + if o == nil { var ret string return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + return &o.Type, true } -// HasType returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) HasType() bool { - if o != nil && !common.IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. +// SetType sets field value func (o *GetTermsOfServiceDocumentRequest) SetType(v string) { - o.Type = &v + o.Type = v } func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { @@ -116,12 +102,8 @@ func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { func (o GetTermsOfServiceDocumentRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.Language) { - toSerialize["language"] = o.Language - } - if !common.IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["language"] = o.Language + toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/legalentity/model_get_terms_of_service_document_response.go b/src/legalentity/model_get_terms_of_service_document_response.go index 4ef64ce62..686edf4bb 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -23,7 +23,7 @@ type GetTermsOfServiceDocumentResponse struct { Document *string `json:"document,omitempty"` // The unique identifier of the legal entity. Id *string `json:"id,omitempty"` - // The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. + // The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` diff --git a/src/legalentity/model_hk_local_account_identification.go b/src/legalentity/model_hk_local_account_identification.go index cc5234fe1..af026b211 100644 --- a/src/legalentity/model_hk_local_account_identification.go +++ b/src/legalentity/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index 06b376179..398b2aa24 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -33,7 +33,7 @@ type IdentificationData struct { NationalIdExempt *bool `json:"nationalIdExempt,omitempty"` // The number in the document. Number *string `json:"number,omitempty"` - // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + // Type of identity data. For **individual**, the `type` value is **nationalIdNumber**. Type string `json:"type"` } @@ -346,7 +346,7 @@ func (v *NullableIdentificationData) UnmarshalJSON(src []byte) error { } func (o *IdentificationData) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource"} + var allowedEnumValues = []string{"nationalIdNumber"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index 4d866cfb0..ec173b9d9 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -32,7 +32,7 @@ type LegalEntity struct { Id string `json:"id"` Individual *Individual `json:"individual,omitempty"` Organization *Organization `json:"organization,omitempty"` - // List of the verification errors from capabilities for the legal entity. + // List of verification errors related to capabilities for the legal entity. Problems []CapabilityProblem `json:"problems,omitempty"` // Your reference for the legal entity, maximum 150 characters. Reference *string `json:"reference,omitempty"` diff --git a/src/legalentity/model_legal_entity_capability.go b/src/legalentity/model_legal_entity_capability.go index 2d59edb3d..92e0c15c5 100644 --- a/src/legalentity/model_legal_entity_capability.go +++ b/src/legalentity/model_legal_entity_capability.go @@ -19,17 +19,17 @@ var _ common.MappedNullable = &LegalEntityCapability{} // LegalEntityCapability struct for LegalEntityCapability type LegalEntityCapability struct { - // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful + // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful. Allowed *bool `json:"allowed,omitempty"` // The capability level that is allowed for the legal entity. Possible values: **notApplicable**, **low**, **medium**, **high**. AllowedLevel *string `json:"allowedLevel,omitempty"` AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` - // Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, + // Indicates whether the capability is requested. To check whether the legal entity is permitted to use the capability, refer to the `allowed` field. Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel *string `json:"requestedLevel,omitempty"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` - // Capability status for transfer instruments associated with legal entity + // The capability status of transfer instruments associated with the legal entity. TransferInstruments []SupportingEntityCapability `json:"transferInstruments,omitempty"` // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` diff --git a/src/legalentity/model_nz_local_account_identification.go b/src/legalentity/model_nz_local_account_identification.go new file mode 100644 index 000000000..28da05b01 --- /dev/null +++ b/src/legalentity/model_nz_local_account_identification.go @@ -0,0 +1,156 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NZLocalAccountIdentification{} + +// NZLocalAccountIdentification struct for NZLocalAccountIdentification +type NZLocalAccountIdentification struct { + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. + AccountNumber string `json:"accountNumber"` + // **nzLocal** + Type string `json:"type"` +} + +// NewNZLocalAccountIdentification instantiates a new NZLocalAccountIdentification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewNZLocalAccountIdentificationWithDefaults instantiates a new NZLocalAccountIdentification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNZLocalAccountIdentificationWithDefaults() *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + var type_ string = "nzLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *NZLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *NZLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *NZLocalAccountIdentification) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NZLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NZLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableNZLocalAccountIdentification struct { + value *NZLocalAccountIdentification + isSet bool +} + +func (v NullableNZLocalAccountIdentification) Get() *NZLocalAccountIdentification { + return v.value +} + +func (v *NullableNZLocalAccountIdentification) Set(val *NZLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableNZLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableNZLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNZLocalAccountIdentification(val *NZLocalAccountIdentification) *NullableNZLocalAccountIdentification { + return &NullableNZLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableNZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *NZLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{"nzLocal"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/legalentity/model_onboarding_link_info.go b/src/legalentity/model_onboarding_link_info.go index 604f9d9e1..e0cecf57b 100644 --- a/src/legalentity/model_onboarding_link_info.go +++ b/src/legalentity/model_onboarding_link_info.go @@ -23,7 +23,7 @@ type OnboardingLinkInfo struct { Locale *string `json:"locale,omitempty"` // The URL where the user is redirected after they complete hosted onboarding. RedirectUrl *string `json:"redirectUrl,omitempty"` - // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, this value is set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. + // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, these values are set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. By default, these value are set to **false**. Set the following values to **true** to require the user to sign PCI questionnaires based on their sales channels. The user must sign PCI questionnaires for all relevant sales channels. - **requirePciSignEcommerce** - **requirePciSignPos** - **requirePciSignEcomMoto** - **requirePciSignPosMoto** Settings *map[string]bool `json:"settings,omitempty"` // The unique identifier of the hosted onboarding theme. ThemeId *string `json:"themeId,omitempty"` diff --git a/src/legalentity/model_supporting_entity_capability.go b/src/legalentity/model_supporting_entity_capability.go index 7267ffdb2..95246967a 100644 --- a/src/legalentity/model_supporting_entity_capability.go +++ b/src/legalentity/model_supporting_entity_capability.go @@ -19,13 +19,13 @@ var _ common.MappedNullable = &SupportingEntityCapability{} // SupportingEntityCapability struct for SupportingEntityCapability type SupportingEntityCapability struct { - // Indicates whether the supporting entity capability is allowed. If a supporting entity is allowed but its parent legal entity is not, it means there are other supporting entities that failed validation. **The allowed supporting entity can still be used** + // Indicates whether the capability is allowed for the supporting entity. If a capability is allowed for a supporting entity but not for the parent legal entity, this means the legal entity has other supporting entities that failed verification. **You can use the allowed supporting entity** regardless of the verification status of other supporting entities. Allowed *bool `json:"allowed,omitempty"` // Supporting entity reference Id *string `json:"id,omitempty"` // Indicates whether the supporting entity capability is requested. Requested *bool `json:"requested,omitempty"` - // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability of the supporting entity. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } diff --git a/src/legalentity/model_transfer_instrument.go b/src/legalentity/model_transfer_instrument.go index eea788f49..96b78cf26 100644 --- a/src/legalentity/model_transfer_instrument.go +++ b/src/legalentity/model_transfer_instrument.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &TransferInstrument{} // TransferInstrument struct for TransferInstrument type TransferInstrument struct { BankAccount BankAccountInfo `json:"bankAccount"` - // List of capabilities for this supporting entity. + // List of capabilities for this transfer instrument. Capabilities *map[string]SupportingEntityCapability `json:"capabilities,omitempty"` // List of documents uploaded for the transfer instrument. DocumentDetails []DocumentReference `json:"documentDetails,omitempty"` @@ -28,7 +28,7 @@ type TransferInstrument struct { Id string `json:"id"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) that owns the transfer instrument. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this transfer instrument. Problems []CapabilityProblem `json:"problems,omitempty"` // The type of transfer instrument. Possible value: **bankAccount**. Type string `json:"type"` diff --git a/src/management/api_account_company_level.go b/src/management/api_account_company_level.go index e32317765..b8daa34a4 100644 --- a/src/management/api_account_company_level.go +++ b/src/management/api_account_company_level.go @@ -72,7 +72,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -81,7 +80,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +88,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +96,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +104,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +183,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +191,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +199,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +207,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -224,7 +215,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +297,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +305,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +313,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +321,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +329,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_account_merchant_level.go b/src/management/api_account_merchant_level.go index 8027de6f8..207d9a7cf 100644 --- a/src/management/api_account_merchant_level.go +++ b/src/management/api_account_merchant_level.go @@ -76,7 +76,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -85,7 +84,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -94,7 +92,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -103,7 +100,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -112,7 +108,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -175,7 +170,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +178,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -193,7 +186,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -202,7 +194,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -211,7 +202,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +280,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +288,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +296,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +304,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +312,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_account_store_level.go b/src/management/api_account_store_level.go index 797050a50..81b8fb769 100644 --- a/src/management/api_account_store_level.go +++ b/src/management/api_account_store_level.go @@ -74,7 +74,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -179,7 +174,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +182,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +190,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +198,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +206,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -282,7 +272,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +280,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +288,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +296,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +304,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -382,7 +367,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -391,7 +375,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +383,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +391,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +399,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -518,7 +498,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -527,7 +506,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -536,7 +514,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -545,7 +522,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -554,7 +530,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -648,7 +623,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -657,7 +631,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -666,7 +639,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -675,7 +647,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -684,7 +655,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -756,7 +726,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -765,7 +734,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -774,7 +742,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -783,7 +750,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -792,7 +758,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -862,7 +827,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -871,7 +835,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -880,7 +843,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -889,7 +851,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -898,7 +859,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_allowed_origins_company_level.go b/src/management/api_allowed_origins_company_level.go index 280f0a606..84cbd7534 100644 --- a/src/management/api_allowed_origins_company_level.go +++ b/src/management/api_allowed_origins_company_level.go @@ -81,7 +81,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +281,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +289,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +297,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +305,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -327,7 +313,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_allowed_origins_merchant_level.go b/src/management/api_allowed_origins_merchant_level.go index 8746446a7..a0baae34b 100644 --- a/src/management/api_allowed_origins_merchant_level.go +++ b/src/management/api_allowed_origins_merchant_level.go @@ -81,7 +81,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +281,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +289,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +297,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +305,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -327,7 +313,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_android_files_company_level.go b/src/management/api_android_files_company_level.go index afea62701..e59f6ab47 100644 --- a/src/management/api_android_files_company_level.go +++ b/src/management/api_android_files_company_level.go @@ -77,7 +77,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -220,7 +215,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -229,7 +223,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -238,7 +231,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -247,7 +239,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -256,7 +247,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -353,7 +343,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -362,7 +351,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -371,7 +359,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -380,7 +367,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -389,7 +375,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -462,7 +447,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -471,7 +455,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -480,7 +463,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -489,7 +471,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_credentials_company_level.go b/src/management/api_api_credentials_company_level.go index 0f08de577..9dee75642 100644 --- a/src/management/api_api_credentials_company_level.go +++ b/src/management/api_api_credentials_company_level.go @@ -87,7 +87,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +95,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +103,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +111,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -123,7 +119,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +298,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +306,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +314,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -335,7 +322,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -344,7 +330,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +401,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +409,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -434,7 +417,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -443,7 +425,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -452,7 +433,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_credentials_merchant_level.go b/src/management/api_api_credentials_merchant_level.go index 9a246084f..131a71eb5 100644 --- a/src/management/api_api_credentials_merchant_level.go +++ b/src/management/api_api_credentials_merchant_level.go @@ -87,7 +87,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +95,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +103,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +111,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -123,7 +119,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +298,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +306,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +314,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -335,7 +322,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -344,7 +330,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +401,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +409,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -434,7 +417,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -443,7 +425,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -452,7 +433,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_key_company_level.go b/src/management/api_api_key_company_level.go index 297d771f6..e179e5fc6 100644 --- a/src/management/api_api_key_company_level.go +++ b/src/management/api_api_key_company_level.go @@ -75,7 +75,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_key_merchant_level.go b/src/management/api_api_key_merchant_level.go index 610efc8e3..5bd8ca341 100644 --- a/src/management/api_api_key_merchant_level.go +++ b/src/management/api_api_key_merchant_level.go @@ -75,7 +75,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_client_key_company_level.go b/src/management/api_client_key_company_level.go index de246ded7..d15e203b9 100644 --- a/src/management/api_client_key_company_level.go +++ b/src/management/api_client_key_company_level.go @@ -75,7 +75,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_client_key_merchant_level.go b/src/management/api_client_key_merchant_level.go index 24171eb06..fcaf77718 100644 --- a/src/management/api_client_key_merchant_level.go +++ b/src/management/api_client_key_merchant_level.go @@ -75,7 +75,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_my_api_credential.go b/src/management/api_my_api_credential.go index 5b58f4c9e..b746e73e6 100644 --- a/src/management/api_my_api_credential.go +++ b/src/management/api_my_api_credential.go @@ -74,7 +74,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -266,7 +256,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -275,7 +264,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -284,7 +272,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -293,7 +280,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -302,7 +288,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -360,7 +345,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -369,7 +353,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -378,7 +361,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -387,7 +369,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -396,7 +377,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -454,7 +434,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -463,7 +442,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -472,7 +450,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -481,7 +458,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -490,7 +466,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -553,7 +528,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -562,7 +536,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -571,7 +544,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -580,7 +552,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -589,7 +560,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_payment_methods_merchant_level.go b/src/management/api_payment_methods_merchant_level.go index 4efb0e502..d15383062 100644 --- a/src/management/api_payment_methods_merchant_level.go +++ b/src/management/api_payment_methods_merchant_level.go @@ -82,7 +82,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +90,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +98,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +106,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -118,7 +114,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +217,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -231,7 +225,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -240,7 +233,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -249,7 +241,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -258,7 +249,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +315,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +323,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +331,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -352,7 +339,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -361,7 +347,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +413,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -437,7 +421,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -446,7 +429,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -455,7 +437,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -464,7 +445,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -534,7 +514,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -543,7 +522,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -552,7 +530,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -561,7 +538,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -570,7 +546,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -643,7 +618,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -652,7 +626,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -661,7 +634,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -670,7 +642,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -679,7 +650,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_payout_settings_merchant_level.go b/src/management/api_payout_settings_merchant_level.go index 315d5002c..4c32aecdf 100644 --- a/src/management/api_payout_settings_merchant_level.go +++ b/src/management/api_payout_settings_merchant_level.go @@ -83,7 +83,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +91,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +99,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +107,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -119,7 +115,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +183,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +191,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +199,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +207,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -224,7 +215,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -292,7 +282,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -301,7 +290,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -310,7 +298,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -319,7 +306,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -328,7 +314,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -504,7 +484,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -513,7 +492,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -522,7 +500,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +508,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -540,7 +516,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_split_configuration_merchant_level.go b/src/management/api_split_configuration_merchant_level.go index 4f0f11a09..937e4ab9a 100644 --- a/src/management/api_split_configuration_merchant_level.go +++ b/src/management/api_split_configuration_merchant_level.go @@ -81,7 +81,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -288,7 +278,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -297,7 +286,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -306,7 +294,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -315,7 +302,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -324,7 +310,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -495,7 +475,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -504,7 +483,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -513,7 +491,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -522,7 +499,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +507,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -594,7 +569,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -603,7 +577,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -612,7 +585,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -621,7 +593,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -630,7 +601,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -705,7 +675,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -714,7 +683,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -723,7 +691,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -732,7 +699,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -741,7 +707,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -813,7 +778,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -822,7 +786,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -831,7 +794,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -840,7 +802,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -849,7 +810,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -927,7 +887,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -936,7 +895,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -945,7 +903,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -954,7 +911,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -963,7 +919,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_actions_company_level.go b/src/management/api_terminal_actions_company_level.go index aaf3099c1..d2220527a 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -75,7 +75,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +209,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -223,7 +217,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -232,7 +225,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -241,7 +233,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -250,7 +241,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_actions_terminal_level.go b/src/management/api_terminal_actions_terminal_level.go index de2514a95..450e61166 100644 --- a/src/management/api_terminal_actions_terminal_level.go +++ b/src/management/api_terminal_actions_terminal_level.go @@ -78,7 +78,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +86,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +94,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +102,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +110,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_orders_company_level.go b/src/management/api_terminal_orders_company_level.go index b74ccfb1b..c21e271f2 100644 --- a/src/management/api_terminal_orders_company_level.go +++ b/src/management/api_terminal_orders_company_level.go @@ -77,7 +77,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -390,7 +375,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -399,7 +383,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -408,7 +391,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -417,7 +399,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -426,7 +407,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -501,7 +481,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +489,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +497,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +505,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +513,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -642,7 +617,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -651,7 +625,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -660,7 +633,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -669,7 +641,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -678,7 +649,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -773,7 +743,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -782,7 +751,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -791,7 +759,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -800,7 +767,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -809,7 +775,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -874,7 +839,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -883,7 +847,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -892,7 +855,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -901,7 +863,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -910,7 +871,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1014,7 +974,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1023,7 +982,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1032,7 +990,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1041,7 +998,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1050,7 +1006,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1127,7 +1082,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1136,7 +1090,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1145,7 +1098,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1154,7 +1106,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1163,7 +1114,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_orders_merchant_level.go b/src/management/api_terminal_orders_merchant_level.go index 77afeaf9b..c9d27f743 100644 --- a/src/management/api_terminal_orders_merchant_level.go +++ b/src/management/api_terminal_orders_merchant_level.go @@ -77,7 +77,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -390,7 +375,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -399,7 +383,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -408,7 +391,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -417,7 +399,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -426,7 +407,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -501,7 +481,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +489,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +497,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +505,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +513,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -641,7 +616,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -650,7 +624,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -659,7 +632,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -668,7 +640,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -677,7 +648,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -772,7 +742,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -781,7 +750,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -790,7 +758,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -799,7 +766,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -808,7 +774,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -872,7 +837,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -881,7 +845,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -890,7 +853,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -899,7 +861,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -908,7 +869,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1012,7 +972,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1021,7 +980,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1030,7 +988,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1039,7 +996,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1048,7 +1004,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1125,7 +1080,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1134,7 +1088,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1143,7 +1096,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1152,7 +1104,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1161,7 +1112,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_company_level.go b/src/management/api_terminal_settings_company_level.go index 13e09bbba..69e06047e 100644 --- a/src/management/api_terminal_settings_company_level.go +++ b/src/management/api_terminal_settings_company_level.go @@ -86,7 +86,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +94,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +102,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +110,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -122,7 +118,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +297,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +305,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +313,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +321,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +329,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -419,7 +404,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +412,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -437,7 +420,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -446,7 +428,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -455,7 +436,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_merchant_level.go b/src/management/api_terminal_settings_merchant_level.go index 25ad83133..dfc194651 100644 --- a/src/management/api_terminal_settings_merchant_level.go +++ b/src/management/api_terminal_settings_merchant_level.go @@ -85,7 +85,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -94,7 +93,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -103,7 +101,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -112,7 +109,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -121,7 +117,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +180,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +188,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +196,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -212,7 +204,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -221,7 +212,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -304,7 +294,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -313,7 +302,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -322,7 +310,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -331,7 +318,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -340,7 +326,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -414,7 +399,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -423,7 +407,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -432,7 +415,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -441,7 +423,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -450,7 +431,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_store_level.go b/src/management/api_terminal_settings_store_level.go index 364af1d9e..146aed423 100644 --- a/src/management/api_terminal_settings_store_level.go +++ b/src/management/api_terminal_settings_store_level.go @@ -88,7 +88,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +96,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +104,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +112,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -124,7 +120,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +195,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +203,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +211,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -227,7 +219,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -236,7 +227,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -306,7 +296,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -315,7 +304,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -324,7 +312,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -333,7 +320,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -342,7 +328,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +394,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +402,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +410,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +418,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -445,7 +426,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +511,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -540,7 +519,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -549,7 +527,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -558,7 +535,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -567,7 +543,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -650,7 +625,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -659,7 +633,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -668,7 +641,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -677,7 +649,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -686,7 +657,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -765,7 +735,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -774,7 +743,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -783,7 +751,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -792,7 +759,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -801,7 +767,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -877,7 +842,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -886,7 +850,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -895,7 +858,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -904,7 +866,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -913,7 +874,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_terminal_level.go b/src/management/api_terminal_settings_terminal_level.go index d8f476422..c0e8b2506 100644 --- a/src/management/api_terminal_settings_terminal_level.go +++ b/src/management/api_terminal_settings_terminal_level.go @@ -74,7 +74,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -177,7 +172,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +180,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +188,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +196,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +204,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -285,7 +275,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -294,7 +283,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -303,7 +291,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +299,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +307,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -397,7 +382,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -406,7 +390,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -415,7 +398,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -424,7 +406,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -433,7 +414,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminals_terminal_level.go b/src/management/api_terminals_terminal_level.go index 8703540b2..1c5703f49 100644 --- a/src/management/api_terminals_terminal_level.go +++ b/src/management/api_terminals_terminal_level.go @@ -147,7 +147,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -156,7 +155,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -165,7 +163,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -174,7 +171,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -183,7 +179,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -252,7 +247,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -261,7 +255,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -270,7 +263,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -279,7 +271,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -288,7 +279,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_users_company_level.go b/src/management/api_users_company_level.go index da36f198b..bf7524b0c 100644 --- a/src/management/api_users_company_level.go +++ b/src/management/api_users_company_level.go @@ -79,7 +79,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +87,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +95,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +103,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +111,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +302,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +310,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -330,7 +318,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -339,7 +326,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -348,7 +334,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -421,7 +406,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -430,7 +414,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -439,7 +422,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -448,7 +430,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -457,7 +438,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_users_merchant_level.go b/src/management/api_users_merchant_level.go index 69ca71fe2..efc79a915 100644 --- a/src/management/api_users_merchant_level.go +++ b/src/management/api_users_merchant_level.go @@ -79,7 +79,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +87,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +95,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +103,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +111,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +302,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +310,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -330,7 +318,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -339,7 +326,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -348,7 +334,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -421,7 +406,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -430,7 +414,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -439,7 +422,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -448,7 +430,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -457,7 +438,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_webhooks_company_level.go b/src/management/api_webhooks_company_level.go index 76356b2a0..4463707b2 100644 --- a/src/management/api_webhooks_company_level.go +++ b/src/management/api_webhooks_company_level.go @@ -75,7 +75,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +173,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +181,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +189,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +197,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +205,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -298,7 +288,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +296,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +304,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +312,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +320,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +385,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +393,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +401,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +409,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +417,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -505,7 +485,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -514,7 +493,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -523,7 +501,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -532,7 +509,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -541,7 +517,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -619,7 +594,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -628,7 +602,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -637,7 +610,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -646,7 +618,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -655,7 +626,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -727,7 +697,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -736,7 +705,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -745,7 +713,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -754,7 +721,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -763,7 +729,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_webhooks_merchant_level.go b/src/management/api_webhooks_merchant_level.go index f3748756d..adcf3dff5 100644 --- a/src/management/api_webhooks_merchant_level.go +++ b/src/management/api_webhooks_merchant_level.go @@ -75,7 +75,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +173,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +181,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +189,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +197,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +205,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -298,7 +288,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +296,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +304,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +312,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +320,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +385,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +393,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +401,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +409,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +417,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -505,7 +485,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -514,7 +493,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -523,7 +501,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -532,7 +509,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -541,7 +517,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -617,7 +592,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -626,7 +600,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -635,7 +608,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -644,7 +616,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -653,7 +624,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -725,7 +695,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -734,7 +703,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -743,7 +711,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -752,7 +719,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -761,7 +727,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/payments/api_payments.go b/src/payments/api_payments.go new file mode 100644 index 000000000..ba2cce245 --- /dev/null +++ b/src/payments/api_payments.go @@ -0,0 +1,260 @@ +/* +Adyen Payment API + +API version: 68 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package payments + +import ( + "context" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// PaymentsApi service +type PaymentsApi common.Service + +// All parameters accepted by PaymentsApi.Authorise +type PaymentsApiAuthoriseInput struct { + paymentRequest *PaymentRequest +} + +func (r PaymentsApiAuthoriseInput) PaymentRequest(paymentRequest PaymentRequest) PaymentsApiAuthoriseInput { + r.paymentRequest = &paymentRequest + return r +} + +/* +Prepare a request for Authorise + +@return PaymentsApiAuthoriseInput +*/ +func (a *PaymentsApi) AuthoriseInput() PaymentsApiAuthoriseInput { + return PaymentsApiAuthoriseInput{} +} + +/* +Authorise Create an authorisation + +Creates a payment with a unique reference (`pspReference`) and attempts to obtain an authorisation hold. For cards, this amount can be captured or cancelled later. Non-card payment methods typically don't support this and will automatically capture as part of the authorisation. +> This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthoriseInput - Request parameters, see AuthoriseInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise(ctx context.Context, r PaymentsApiAuthoriseInput) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Authorise3d +type PaymentsApiAuthorise3dInput struct { + paymentRequest3d *PaymentRequest3d +} + +func (r PaymentsApiAuthorise3dInput) PaymentRequest3d(paymentRequest3d PaymentRequest3d) PaymentsApiAuthorise3dInput { + r.paymentRequest3d = &paymentRequest3d + return r +} + +/* +Prepare a request for Authorise3d + +@return PaymentsApiAuthorise3dInput +*/ +func (a *PaymentsApi) Authorise3dInput() PaymentsApiAuthorise3dInput { + return PaymentsApiAuthorise3dInput{} +} + +/* +Authorise3d Complete a 3DS authorisation + +For an authenticated 3D Secure session, completes the payment authorisation. This endpoint must receive the `md` and `paResponse` parameters that you get from the card issuer after a shopper pays via 3D Secure. + +> This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3dInput - Request parameters, see Authorise3dInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3d(ctx context.Context, r PaymentsApiAuthorise3dInput) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise3d" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3d, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Authorise3ds2 +type PaymentsApiAuthorise3ds2Input struct { + paymentRequest3ds2 *PaymentRequest3ds2 +} + +func (r PaymentsApiAuthorise3ds2Input) PaymentRequest3ds2(paymentRequest3ds2 PaymentRequest3ds2) PaymentsApiAuthorise3ds2Input { + r.paymentRequest3ds2 = &paymentRequest3ds2 + return r +} + +/* +Prepare a request for Authorise3ds2 + +@return PaymentsApiAuthorise3ds2Input +*/ +func (a *PaymentsApi) Authorise3ds2Input() PaymentsApiAuthorise3ds2Input { + return PaymentsApiAuthorise3ds2Input{} +} + +/* +Authorise3ds2 Complete a 3DS2 authorisation + +For an authenticated 3D Secure 2 session, completes the payment authorisation. This endpoint must receive the `threeDS2Token` and `threeDS2Result` parameters. + +> This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3ds2Input - Request parameters, see Authorise3ds2Input +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3ds2(ctx context.Context, r PaymentsApiAuthorise3ds2Input) (PaymentResult, *http.Response, error) { + res := &PaymentResult{} + path := "/authorise3ds2" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3ds2, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.GetAuthenticationResult +type PaymentsApiGetAuthenticationResultInput struct { + authenticationResultRequest *AuthenticationResultRequest +} + +func (r PaymentsApiGetAuthenticationResultInput) AuthenticationResultRequest(authenticationResultRequest AuthenticationResultRequest) PaymentsApiGetAuthenticationResultInput { + r.authenticationResultRequest = &authenticationResultRequest + return r +} + +/* +Prepare a request for GetAuthenticationResult + +@return PaymentsApiGetAuthenticationResultInput +*/ +func (a *PaymentsApi) GetAuthenticationResultInput() PaymentsApiGetAuthenticationResultInput { + return PaymentsApiGetAuthenticationResultInput{} +} + +/* +GetAuthenticationResult Get the 3DS authentication result + +Return the authentication result after doing a 3D Secure authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiGetAuthenticationResultInput - Request parameters, see GetAuthenticationResultInput +@return AuthenticationResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) GetAuthenticationResult(ctx context.Context, r PaymentsApiGetAuthenticationResultInput) (AuthenticationResultResponse, *http.Response, error) { + res := &AuthenticationResultResponse{} + path := "/getAuthenticationResult" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.authenticationResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} + +// All parameters accepted by PaymentsApi.Retrieve3ds2Result +type PaymentsApiRetrieve3ds2ResultInput struct { + threeDS2ResultRequest *ThreeDS2ResultRequest +} + +func (r PaymentsApiRetrieve3ds2ResultInput) ThreeDS2ResultRequest(threeDS2ResultRequest ThreeDS2ResultRequest) PaymentsApiRetrieve3ds2ResultInput { + r.threeDS2ResultRequest = &threeDS2ResultRequest + return r +} + +/* +Prepare a request for Retrieve3ds2Result + +@return PaymentsApiRetrieve3ds2ResultInput +*/ +func (a *PaymentsApi) Retrieve3ds2ResultInput() PaymentsApiRetrieve3ds2ResultInput { + return PaymentsApiRetrieve3ds2ResultInput{} +} + +/* +Retrieve3ds2Result Get the 3DS2 authentication result + +Retrieves the `threeDS2Result` after doing a 3D Secure 2 authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiRetrieve3ds2ResultInput - Request parameters, see Retrieve3ds2ResultInput +@return ThreeDS2ResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) Retrieve3ds2Result(ctx context.Context, r PaymentsApiRetrieve3ds2ResultInput) (ThreeDS2ResultResponse, *http.Response, error) { + res := &ThreeDS2ResultResponse{} + path := "/retrieve3ds2Result" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.threeDS2ResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + return *res, httpRes, err +} diff --git a/src/payments/client.go b/src/payments/client.go index 690fbea32..4c5b549cf 100644 --- a/src/payments/client.go +++ b/src/payments/client.go @@ -19,9 +19,9 @@ type APIClient struct { // API Services - GeneralApi *GeneralApi - ModificationsApi *ModificationsApi + + PaymentsApi *PaymentsApi } // NewAPIClient creates a new API client. @@ -33,8 +33,8 @@ func NewAPIClient(client *common.Client) *APIClient { } // API Services - c.GeneralApi = (*GeneralApi)(&c.common) c.ModificationsApi = (*ModificationsApi)(&c.common) + c.PaymentsApi = (*PaymentsApi)(&c.common) return c } \ No newline at end of file diff --git a/src/payments/model_additional_data_airline.go b/src/payments/model_additional_data_airline.go index 378744612..9d9ee676c 100644 --- a/src/payments/model_additional_data_airline.go +++ b/src/payments/model_additional_data_airline.go @@ -23,9 +23,9 @@ type AdditionalDataAirline struct { AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineCode *string `json:"airline.airline_code,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineDesignatorCode *string `json:"airline.airline_designator_code,omitempty"` // The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters AirlineBoardingFee *string `json:"airline.boarding_fee,omitempty"` @@ -37,21 +37,21 @@ type AdditionalDataAirline struct { AirlineDocumentType *string `json:"airline.document_type,omitempty"` // The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters AirlineFlightDate *string `json:"airline.flight_date,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineLegCarrierCode *string `json:"airline.leg.carrier_code,omitempty"` - // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros + // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros. AirlineLegClassOfTravel *string `json:"airline.leg.class_of_travel,omitempty"` // Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters AirlineLegDateOfTravel *string `json:"airline.leg.date_of_travel,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDepartAirport *string `json:"airline.leg.depart_airport,omitempty"` - // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros + // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 *Must not be all zeros. AirlineLegDepartTax *string `json:"airline.leg.depart_tax,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDestinationCode *string `json:"airline.leg.destination_code,omitempty"` - // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros + // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces *Must not be all zeros. AirlineLegFareBaseCode *string `json:"airline.leg.fare_base_code,omitempty"` - // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces *Must not be all zeros. AirlineLegFlightNumber *string `json:"airline.leg.flight_number,omitempty"` // A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character AirlineLegStopOverCode *string `json:"airline.leg.stop_over_code,omitempty"` @@ -65,15 +65,15 @@ type AdditionalDataAirline struct { AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros + // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces *Must not be all zeros. AirlinePassengerName string `json:"airline.passenger_name"` // The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters AirlineTicketIssueAddress *string `json:"airline.ticket_issue_address,omitempty"` - // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros + // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros. AirlineTicketNumber *string `json:"airline.ticket_number,omitempty"` - // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros + // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyCode *string `json:"airline.travel_agency_code,omitempty"` - // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyName *string `json:"airline.travel_agency_name,omitempty"` } diff --git a/src/payments/model_additional_data_car_rental.go b/src/payments/model_additional_data_car_rental.go index 6c0a5cff3..ae3f5ee1b 100644 --- a/src/payments/model_additional_data_car_rental.go +++ b/src/payments/model_additional_data_car_rental.go @@ -21,19 +21,19 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} type AdditionalDataCarRental struct { // The pick-up date. * Date format: `yyyyMMdd` CarRentalCheckOutDate *string `json:"carRental.checkOutDate,omitempty"` - // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` // Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 CarRentalFuelCharges *string `json:"carRental.fuelCharges,omitempty"` - // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros + // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. CarRentalInsuranceCharges *string `json:"carRental.insuranceCharges,omitempty"` - // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationCity *string `json:"carRental.locationCity,omitempty"` // The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalLocationCountry *string `json:"carRental.locationCountry,omitempty"` - // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationStateProvince *string `json:"carRental.locationStateProvince,omitempty"` // Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` @@ -43,25 +43,25 @@ type AdditionalDataCarRental struct { CarRentalRate *string `json:"carRental.rate,omitempty"` // Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate CarRentalRateIndicator *string `json:"carRental.rateIndicator,omitempty"` - // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros + // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalAgreementNumber *string `json:"carRental.rentalAgreementNumber,omitempty"` - // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros + // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalClassId *string `json:"carRental.rentalClassId,omitempty"` - // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros + // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRenterName *string `json:"carRental.renterName,omitempty"` - // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnCity *string `json:"carRental.returnCity,omitempty"` // The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalReturnCountry *string `json:"carRental.returnCountry,omitempty"` // The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros + // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnLocationId *string `json:"carRental.returnLocationId,omitempty"` - // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnStateProvince *string `json:"carRental.returnStateProvince,omitempty"` // Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected CarRentalTaxExemptIndicator *string `json:"carRental.taxExemptIndicator,omitempty"` - // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 + // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/payments/model_additional_data_level23.go b/src/payments/model_additional_data_level23.go index 9bf1f95be..879c31524 100644 --- a/src/payments/model_additional_data_level23.go +++ b/src/payments/model_additional_data_level23.go @@ -19,39 +19,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros + // The customer code. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters + // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters EnhancedSchemeDataDestinationCountryCode *string `json:"enhancedSchemeData.destinationCountryCode,omitempty"` - // The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + // The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space EnhancedSchemeDataDestinationPostalCode *string `json:"enhancedSchemeData.destinationPostalCode,omitempty"` - // Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space + // Destination state or province code. * Encoding: ASCII * Max length: 3 characters * Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters EnhancedSchemeDataDutyAmount *string `json:"enhancedSchemeData.dutyAmount,omitempty"` - // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric *Max length: 12 characters EnhancedSchemeDataFreightAmount *string `json:"enhancedSchemeData.freightAmount,omitempty"` - // The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The [UNSPC commodity code](https://www.unspsc.org/) of the item. * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrCommodityCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].commodityCode,omitempty"` - // A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros + // A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrDescription *string `json:"enhancedSchemeData.itemDetailLine[itemNr].description,omitempty"` - // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` - // The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces + // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` - // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` - // The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros + // The unit of measurement for an item. * Encoding: ASCII Max length: 3 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure,omitempty"` - // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters + // The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters EnhancedSchemeDataOrderDate *string `json:"enhancedSchemeData.orderDate,omitempty"` - // The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros + // The postal code of the address the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataShipFromPostalCode *string `json:"enhancedSchemeData.shipFromPostalCode,omitempty"` - // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. *Encoding: Numeric *Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } diff --git a/src/payments/model_additional_data_lodging.go b/src/payments/model_additional_data_lodging.go index 654fa1cbd..6be62328c 100644 --- a/src/payments/model_additional_data_lodging.go +++ b/src/payments/model_additional_data_lodging.go @@ -23,13 +23,13 @@ type AdditionalDataLodging struct { LodgingCheckInDate *string `json:"lodging.checkInDate,omitempty"` // The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. LodgingCheckOutDate *string `json:"lodging.checkOutDate,omitempty"` - // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` // Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character LodgingFireSafetyActIndicator *string `json:"lodging.fireSafetyActIndicator,omitempty"` // The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFolioCashAdvances *string `json:"lodging.folioCashAdvances,omitempty"` - // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros + // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space *Must not be all zeros. LodgingFolioNumber *string `json:"lodging.folioNumber,omitempty"` // Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFoodBeverageCharges *string `json:"lodging.foodBeverageCharges,omitempty"` @@ -37,9 +37,9 @@ type AdditionalDataLodging struct { LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` // The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingRoom1Rate *string `json:"lodging.room1.rate,omitempty"` @@ -47,7 +47,7 @@ type AdditionalDataLodging struct { LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingTotalTax *string `json:"lodging.totalTax,omitempty"` - // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters + // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/payments/model_additional_data_temporary_services.go b/src/payments/model_additional_data_temporary_services.go index c1f21aaad..8532bece7 100644 --- a/src/payments/model_additional_data_temporary_services.go +++ b/src/payments/model_additional_data_temporary_services.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} type AdditionalDataTemporaryServices struct { // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` // The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros EnhancedSchemeDataRegularHoursRate *string `json:"enhancedSchemeData.regularHoursRate,omitempty"` diff --git a/src/payments/model_payment_request.go b/src/payments/model_payment_request.go index 503c6a05e..932ce271a 100644 --- a/src/payments/model_payment_request.go +++ b/src/payments/model_payment_request.go @@ -49,7 +49,7 @@ type PaymentRequest struct { // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. FundingSource *string `json:"fundingSource,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. diff --git a/src/payments/model_payment_request3d.go b/src/payments/model_payment_request3d.go index 4f453e1af..8cc660132 100644 --- a/src/payments/model_payment_request3d.go +++ b/src/payments/model_payment_request3d.go @@ -41,7 +41,7 @@ type PaymentRequest3d struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` diff --git a/src/payments/model_payment_request3ds2.go b/src/payments/model_payment_request3ds2.go index 52ca20b06..22ed13853 100644 --- a/src/payments/model_payment_request3ds2.go +++ b/src/payments/model_payment_request3ds2.go @@ -41,7 +41,7 @@ type PaymentRequest3ds2 struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` diff --git a/src/payments/model_payment_result.go b/src/payments/model_payment_result.go index 26b469d0c..cc4fb6160 100644 --- a/src/payments/model_payment_result.go +++ b/src/payments/model_payment_result.go @@ -37,7 +37,7 @@ type PaymentResult struct { PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` } @@ -493,7 +493,7 @@ func (v *NullablePaymentResult) UnmarshalJSON(src []byte) error { } func (o *PaymentResult) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} for _, allowed := range allowedEnumValues { if o.GetResultCode() == allowed { return true diff --git a/src/payments/model_split.go b/src/payments/model_split.go index 76f449cbb..b9a006aa2 100644 --- a/src/payments/model_split.go +++ b/src/payments/model_split.go @@ -19,14 +19,14 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` - // A description of this split. + // The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + Account *string `json:"account,omitempty"` + Amount *SplitAmount `json:"amount,omitempty"` + // Your description for the split item. Description *string `json:"description,omitempty"` - // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + // Your reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. Reference *string `json:"reference,omitempty"` - // The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + // The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. Type string `json:"type"` } @@ -34,9 +34,8 @@ type Split struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSplit(amount SplitAmount, type_ string) *Split { +func NewSplit(type_ string) *Split { this := Split{} - this.Amount = amount this.Type = type_ return &this } @@ -81,28 +80,36 @@ func (o *Split) SetAccount(v string) { o.Account = &v } -// GetAmount returns the Amount field value +// GetAmount returns the Amount field value if set, zero value otherwise. func (o *Split) GetAmount() SplitAmount { - if o == nil { + if o == nil || common.IsNil(o.Amount) { var ret SplitAmount return ret } - - return o.Amount + return *o.Amount } -// GetAmountOk returns a tuple with the Amount field value +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Split) GetAmountOk() (*SplitAmount, bool) { - if o == nil { + if o == nil || common.IsNil(o.Amount) { return nil, false } - return &o.Amount, true + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Split) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false } -// SetAmount sets field value +// SetAmount gets a reference to the given SplitAmount and assigns it to the Amount field. func (o *Split) SetAmount(v SplitAmount) { - o.Amount = v + o.Amount = &v } // GetDescription returns the Description field value if set, zero value otherwise. @@ -206,7 +213,9 @@ func (o Split) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Account) { toSerialize["account"] = o.Account } - toSerialize["amount"] = o.Amount + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -254,7 +263,7 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { } func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} + var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/payments/model_split_amount.go b/src/payments/model_split_amount.go index 9c0eef857..ae2fd262f 100644 --- a/src/payments/model_split_amount.go +++ b/src/payments/model_split_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &SplitAmount{} // SplitAmount struct for SplitAmount type SplitAmount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. Currency *string `json:"currency,omitempty"` - // The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). Value int64 `json:"value"` } diff --git a/src/payments/model_three_ds2_result.go b/src/payments/model_three_ds2_result.go index a0274562a..af9e41568 100644 --- a/src/payments/model_three_ds2_result.go +++ b/src/payments/model_three_ds2_result.go @@ -25,8 +25,6 @@ type ThreeDS2Result struct { CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` // Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). ChallengeCancel *string `json:"challengeCancel,omitempty"` - // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The `dsTransID` value as defined in the 3D Secure 2 specification. DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. @@ -37,6 +35,8 @@ type ThreeDS2Result struct { MessageVersion *string `json:"messageVersion,omitempty"` // Risk score calculated by Cartes Bancaires Directory Server (DS). RiskScore *string `json:"riskScore,omitempty"` + // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` // The `timestamp` value of the 3D Secure 2 authentication. @@ -162,38 +162,6 @@ func (o *ThreeDS2Result) SetChallengeCancel(v string) { o.ChallengeCancel = &v } -// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. -func (o *ThreeDS2Result) GetChallengeIndicator() string { - if o == nil || common.IsNil(o.ChallengeIndicator) { - var ret string - return ret - } - return *o.ChallengeIndicator -} - -// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ThreeDS2Result) GetChallengeIndicatorOk() (*string, bool) { - if o == nil || common.IsNil(o.ChallengeIndicator) { - return nil, false - } - return o.ChallengeIndicator, true -} - -// HasChallengeIndicator returns a boolean if a field has been set. -func (o *ThreeDS2Result) HasChallengeIndicator() bool { - if o != nil && !common.IsNil(o.ChallengeIndicator) { - return true - } - - return false -} - -// SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. -func (o *ThreeDS2Result) SetChallengeIndicator(v string) { - o.ChallengeIndicator = &v -} - // GetDsTransID returns the DsTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetDsTransID() string { if o == nil || common.IsNil(o.DsTransID) { @@ -354,6 +322,38 @@ func (o *ThreeDS2Result) SetRiskScore(v string) { o.RiskScore = &v } +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorChallengeInd +} + +// GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + return nil, false + } + return o.ThreeDSRequestorChallengeInd, true +} + +// HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. +func (o *ThreeDS2Result) HasThreeDSRequestorChallengeInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { + return true + } + + return false +} + +// SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. +func (o *ThreeDS2Result) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + // GetThreeDSServerTransID returns the ThreeDSServerTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetThreeDSServerTransID() string { if o == nil || common.IsNil(o.ThreeDSServerTransID) { @@ -533,9 +533,6 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ChallengeCancel) { toSerialize["challengeCancel"] = o.ChallengeCancel } - if !common.IsNil(o.ChallengeIndicator) { - toSerialize["challengeIndicator"] = o.ChallengeIndicator - } if !common.IsNil(o.DsTransID) { toSerialize["dsTransID"] = o.DsTransID } @@ -551,6 +548,9 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskScore) { toSerialize["riskScore"] = o.RiskScore } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } if !common.IsNil(o.ThreeDSServerTransID) { toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID } @@ -614,19 +614,19 @@ func (o *ThreeDS2Result) isValidChallengeCancel() bool { } return false } -func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} +func (o *ThreeDS2Result) isValidExemptionIndicator() bool { + var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { + if o.GetExemptionIndicator() == allowed { return true } } return false } -func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} +func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { + if o.GetThreeDSRequestorChallengeInd() == allowed { return true } } diff --git a/src/transfers/api_capital.go b/src/transfers/api_capital.go index 7c531ee42..41089182b 100644 --- a/src/transfers/api_capital.go +++ b/src/transfers/api_capital.go @@ -75,7 +75,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -120,7 +115,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +190,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +198,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +206,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +214,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +275,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +283,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +291,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +299,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +307,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -332,7 +315,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go index 2b9d06c3b..8cc6ad2a2 100644 --- a/src/transfers/api_transactions.go +++ b/src/transfers/api_transactions.go @@ -157,7 +157,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -166,7 +165,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -175,7 +173,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +181,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -246,7 +242,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -255,7 +250,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -264,7 +258,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -273,7 +266,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go index e67ec5437..5a10065c4 100644 --- a/src/transfers/api_transfers.go +++ b/src/transfers/api_transfers.go @@ -75,7 +75,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +174,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +182,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +190,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +198,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/model_rest_service_error.go b/src/transfers/model_rest_service_error.go index 9f0cb1bf4..0e636d74d 100644 --- a/src/transfers/model_rest_service_error.go +++ b/src/transfers/model_rest_service_error.go @@ -28,8 +28,9 @@ 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"` - Response *JSONObject `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + // JSON response payload. + Response map[string]interface{} `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -205,19 +206,19 @@ func (o *RestServiceError) SetRequestId(v string) { } // GetResponse returns the Response field value if set, zero value otherwise. -func (o *RestServiceError) GetResponse() JSONObject { +func (o *RestServiceError) GetResponse() map[string]interface{} { if o == nil || common.IsNil(o.Response) { - var ret JSONObject + var ret map[string]interface{} return ret } - return *o.Response + return o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestServiceError) GetResponseOk() (*JSONObject, bool) { +func (o *RestServiceError) GetResponseOk() (map[string]interface{}, bool) { if o == nil || common.IsNil(o.Response) { - return nil, false + return map[string]interface{}{}, false } return o.Response, true } @@ -231,9 +232,9 @@ func (o *RestServiceError) HasResponse() bool { return false } -// SetResponse gets a reference to the given JSONObject and assigns it to the Response field. -func (o *RestServiceError) SetResponse(v JSONObject) { - o.Response = &v +// SetResponse gets a reference to the given map[string]interface{} and assigns it to the Response field. +func (o *RestServiceError) SetResponse(v map[string]interface{}) { + o.Response = v } // GetStatus returns the Status field value diff --git a/src/transfers/model_transaction.go b/src/transfers/model_transaction.go index fe1de6f4c..848758961 100644 --- a/src/transfers/model_transaction.go +++ b/src/transfers/model_transaction.go @@ -29,8 +29,6 @@ type Transaction struct { BookingDate time.Time `json:"bookingDate"` // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. CreationDate *time.Time `json:"creationDate,omitempty"` - // The PSP reference of the transaction in the journal. - EventId *string `json:"eventId,omitempty"` // The unique identifier of the transaction. Id string `json:"id"` // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. @@ -217,38 +215,6 @@ func (o *Transaction) SetCreationDate(v time.Time) { o.CreationDate = &v } -// GetEventId returns the EventId field value if set, zero value otherwise. -func (o *Transaction) GetEventId() string { - if o == nil || common.IsNil(o.EventId) { - var ret string - return ret - } - return *o.EventId -} - -// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Transaction) GetEventIdOk() (*string, bool) { - if o == nil || common.IsNil(o.EventId) { - return nil, false - } - return o.EventId, true -} - -// HasEventId returns a boolean if a field has been set. -func (o *Transaction) HasEventId() bool { - if o != nil && !common.IsNil(o.EventId) { - return true - } - - return false -} - -// SetEventId gets a reference to the given string and assigns it to the EventId field. -func (o *Transaction) SetEventId(v string) { - o.EventId = &v -} - // GetId returns the Id field value func (o *Transaction) GetId() string { if o == nil { @@ -371,9 +337,6 @@ func (o Transaction) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CreationDate) { toSerialize["creationDate"] = o.CreationDate } - if !common.IsNil(o.EventId) { - toSerialize["eventId"] = o.EventId - } toSerialize["id"] = o.Id toSerialize["status"] = o.Status if !common.IsNil(o.Transfer) { diff --git a/src/transferwebhook/model_additional_bank_identification.go b/src/transferwebhook/model_additional_bank_identification.go index 122183baf..e9ac24d0e 100644 --- a/src/transferwebhook/model_additional_bank_identification.go +++ b/src/transferwebhook/model_additional_bank_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_address.go b/src/transferwebhook/model_address.go index 3b09c42a2..ba1962e1d 100644 --- a/src/transferwebhook/model_address.go +++ b/src/transferwebhook/model_address.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_amount.go b/src/transferwebhook/model_amount.go index 96a6753f0..0e59e19a8 100644 --- a/src/transferwebhook/model_amount.go +++ b/src/transferwebhook/model_amount.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_amount_adjustment.go b/src/transferwebhook/model_amount_adjustment.go index 556344e5b..b6903d318 100644 --- a/src/transferwebhook/model_amount_adjustment.go +++ b/src/transferwebhook/model_amount_adjustment.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_au_local_account_identification.go b/src/transferwebhook/model_au_local_account_identification.go index 05cb5e3ee..f46c53bfc 100644 --- a/src/transferwebhook/model_au_local_account_identification.go +++ b/src/transferwebhook/model_au_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_balance_mutation.go b/src/transferwebhook/model_balance_mutation.go index b38a6897f..6aa344be8 100644 --- a/src/transferwebhook/model_balance_mutation.go +++ b/src/transferwebhook/model_balance_mutation.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_balance_platform_notification_response.go b/src/transferwebhook/model_balance_platform_notification_response.go index 2ec7cd2ad..61d09bc2a 100644 --- a/src/transferwebhook/model_balance_platform_notification_response.go +++ b/src/transferwebhook/model_balance_platform_notification_response.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_account_v3.go b/src/transferwebhook/model_bank_account_v3.go index 0c3fc99eb..038f008dd 100644 --- a/src/transferwebhook/model_bank_account_v3.go +++ b/src/transferwebhook/model_bank_account_v3.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_account_v3_account_identification.go b/src/transferwebhook/model_bank_account_v3_account_identification.go index 58afd2b2e..089e4dec7 100644 --- a/src/transferwebhook/model_bank_account_v3_account_identification.go +++ b/src/transferwebhook/model_bank_account_v3_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_category_data.go b/src/transferwebhook/model_bank_category_data.go new file mode 100644 index 000000000..01aa2a592 --- /dev/null +++ b/src/transferwebhook/model_bank_category_data.go @@ -0,0 +1,185 @@ +/* +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 BankCategoryData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankCategoryData{} + +// BankCategoryData struct for BankCategoryData +type BankCategoryData struct { + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + Priority *string `json:"priority,omitempty"` + // **bank** + Type *string `json:"type,omitempty"` +} + +// NewBankCategoryData instantiates a new BankCategoryData 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 NewBankCategoryData() *BankCategoryData { + this := BankCategoryData{} + var type_ string = "bank" + this.Type = &type_ + return &this +} + +// NewBankCategoryDataWithDefaults instantiates a new BankCategoryData 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 NewBankCategoryDataWithDefaults() *BankCategoryData { + this := BankCategoryData{} + var type_ string = "bank" + this.Type = &type_ + return &this +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *BankCategoryData) GetPriority() string { + if o == nil || common.IsNil(o.Priority) { + var ret string + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankCategoryData) GetPriorityOk() (*string, bool) { + if o == nil || common.IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *BankCategoryData) HasPriority() bool { + if o != nil && !common.IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given string and assigns it to the Priority field. +func (o *BankCategoryData) SetPriority(v string) { + o.Priority = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *BankCategoryData) 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 *BankCategoryData) 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 *BankCategoryData) 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 *BankCategoryData) SetType(v string) { + o.Type = &v +} + +func (o BankCategoryData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankCategoryData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableBankCategoryData struct { + value *BankCategoryData + isSet bool +} + +func (v NullableBankCategoryData) Get() *BankCategoryData { + return v.value +} + +func (v *NullableBankCategoryData) Set(val *BankCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableBankCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableBankCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankCategoryData(val *BankCategoryData) *NullableBankCategoryData { + return &NullableBankCategoryData{value: val, isSet: true} +} + +func (v NullableBankCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankCategoryData) isValidPriority() bool { + var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false +} +func (o *BankCategoryData) isValidType() bool { + var allowedEnumValues = []string{"bank"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_br_local_account_identification.go b/src/transferwebhook/model_br_local_account_identification.go index c4bd58d9e..bf220e344 100644 --- a/src/transferwebhook/model_br_local_account_identification.go +++ b/src/transferwebhook/model_br_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_ca_local_account_identification.go b/src/transferwebhook/model_ca_local_account_identification.go index 1383521ce..dca492314 100644 --- a/src/transferwebhook/model_ca_local_account_identification.go +++ b/src/transferwebhook/model_ca_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_counterparty_v3.go b/src/transferwebhook/model_counterparty_v3.go index 1eafb0b6b..d180afa38 100644 --- a/src/transferwebhook/model_counterparty_v3.go +++ b/src/transferwebhook/model_counterparty_v3.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_cz_local_account_identification.go b/src/transferwebhook/model_cz_local_account_identification.go index 7f213aae2..22edb653d 100644 --- a/src/transferwebhook/model_cz_local_account_identification.go +++ b/src/transferwebhook/model_cz_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_dk_local_account_identification.go b/src/transferwebhook/model_dk_local_account_identification.go index 590e580e3..23ef8a73d 100644 --- a/src/transferwebhook/model_dk_local_account_identification.go +++ b/src/transferwebhook/model_dk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_hk_local_account_identification.go b/src/transferwebhook/model_hk_local_account_identification.go index 76d2cdaeb..bc1761195 100644 --- a/src/transferwebhook/model_hk_local_account_identification.go +++ b/src/transferwebhook/model_hk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. AccountNumber string `json:"accountNumber"` - // The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewHKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_hu_local_account_identification.go b/src/transferwebhook/model_hu_local_account_identification.go index 96640f236..0c15be119 100644 --- a/src/transferwebhook/model_hu_local_account_identification.go +++ b/src/transferwebhook/model_hu_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_iban_account_identification.go b/src/transferwebhook/model_iban_account_identification.go index 6e77c6c7d..292d9613d 100644 --- a/src/transferwebhook/model_iban_account_identification.go +++ b/src/transferwebhook/model_iban_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_internal_category_data.go b/src/transferwebhook/model_internal_category_data.go new file mode 100644 index 000000000..2c2fe887f --- /dev/null +++ b/src/transferwebhook/model_internal_category_data.go @@ -0,0 +1,213 @@ +/* +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 InternalCategoryData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &InternalCategoryData{} + +// InternalCategoryData struct for InternalCategoryData +type InternalCategoryData struct { + // The capture's merchant reference included in the transfer. + ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` + // The capture reference included in the transfer. + ModificationPspReference *string `json:"modificationPspReference,omitempty"` + // **internal** + Type *string `json:"type,omitempty"` +} + +// NewInternalCategoryData instantiates a new InternalCategoryData 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 NewInternalCategoryData() *InternalCategoryData { + this := InternalCategoryData{} + var type_ string = "internal" + this.Type = &type_ + return &this +} + +// NewInternalCategoryDataWithDefaults instantiates a new InternalCategoryData 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 NewInternalCategoryDataWithDefaults() *InternalCategoryData { + this := InternalCategoryData{} + var type_ string = "internal" + this.Type = &type_ + return &this +} + +// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. +func (o *InternalCategoryData) GetModificationMerchantReference() string { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + var ret string + return ret + } + return *o.ModificationMerchantReference +} + +// GetModificationMerchantReferenceOk returns a tuple with the ModificationMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalCategoryData) GetModificationMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + return nil, false + } + return o.ModificationMerchantReference, true +} + +// HasModificationMerchantReference returns a boolean if a field has been set. +func (o *InternalCategoryData) HasModificationMerchantReference() bool { + if o != nil && !common.IsNil(o.ModificationMerchantReference) { + return true + } + + return false +} + +// SetModificationMerchantReference gets a reference to the given string and assigns it to the ModificationMerchantReference field. +func (o *InternalCategoryData) SetModificationMerchantReference(v string) { + o.ModificationMerchantReference = &v +} + +// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. +func (o *InternalCategoryData) GetModificationPspReference() string { + if o == nil || common.IsNil(o.ModificationPspReference) { + var ret string + return ret + } + return *o.ModificationPspReference +} + +// GetModificationPspReferenceOk returns a tuple with the ModificationPspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalCategoryData) GetModificationPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationPspReference) { + return nil, false + } + return o.ModificationPspReference, true +} + +// HasModificationPspReference returns a boolean if a field has been set. +func (o *InternalCategoryData) HasModificationPspReference() bool { + if o != nil && !common.IsNil(o.ModificationPspReference) { + return true + } + + return false +} + +// SetModificationPspReference gets a reference to the given string and assigns it to the ModificationPspReference field. +func (o *InternalCategoryData) SetModificationPspReference(v string) { + o.ModificationPspReference = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InternalCategoryData) 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 *InternalCategoryData) 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 *InternalCategoryData) 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 *InternalCategoryData) SetType(v string) { + o.Type = &v +} + +func (o InternalCategoryData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalCategoryData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ModificationMerchantReference) { + toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference + } + if !common.IsNil(o.ModificationPspReference) { + toSerialize["modificationPspReference"] = o.ModificationPspReference + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableInternalCategoryData struct { + value *InternalCategoryData + isSet bool +} + +func (v NullableInternalCategoryData) Get() *InternalCategoryData { + return v.value +} + +func (v *NullableInternalCategoryData) Set(val *InternalCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableInternalCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalCategoryData(val *InternalCategoryData) *NullableInternalCategoryData { + return &NullableInternalCategoryData{value: val, isSet: true} +} + +func (v NullableInternalCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *InternalCategoryData) isValidType() bool { + var allowedEnumValues = []string{"internal"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_issued_card.go b/src/transferwebhook/model_issued_card.go new file mode 100644 index 000000000..54eb8095e --- /dev/null +++ b/src/transferwebhook/model_issued_card.go @@ -0,0 +1,304 @@ +/* +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 IssuedCard type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &IssuedCard{} + +// IssuedCard struct for IssuedCard +type IssuedCard struct { + // 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"` + // **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. + ValidationFacts []TransferNotificationValidationFact `json:"validationFacts,omitempty"` +} + +// NewIssuedCard instantiates a new IssuedCard 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 NewIssuedCard() *IssuedCard { + this := IssuedCard{} + var type_ string = "issuedCard" + this.Type = &type_ + return &this +} + +// NewIssuedCardWithDefaults instantiates a new IssuedCard 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 NewIssuedCardWithDefaults() *IssuedCard { + this := IssuedCard{} + var type_ string = "issuedCard" + this.Type = &type_ + return &this +} + +// GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. +func (o *IssuedCard) GetPanEntryMode() string { + if o == nil || common.IsNil(o.PanEntryMode) { + var ret string + return ret + } + return *o.PanEntryMode +} + +// GetPanEntryModeOk returns a tuple with the PanEntryMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetPanEntryModeOk() (*string, bool) { + if o == nil || common.IsNil(o.PanEntryMode) { + return nil, false + } + return o.PanEntryMode, true +} + +// HasPanEntryMode returns a boolean if a field has been set. +func (o *IssuedCard) HasPanEntryMode() bool { + if o != nil && !common.IsNil(o.PanEntryMode) { + return true + } + + return false +} + +// SetPanEntryMode gets a reference to the given string and assigns it to the PanEntryMode field. +func (o *IssuedCard) SetPanEntryMode(v string) { + o.PanEntryMode = &v +} + +// GetProcessingType returns the ProcessingType field value if set, zero value otherwise. +func (o *IssuedCard) GetProcessingType() string { + if o == nil || common.IsNil(o.ProcessingType) { + var ret string + return ret + } + return *o.ProcessingType +} + +// GetProcessingTypeOk returns a tuple with the ProcessingType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetProcessingTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ProcessingType) { + return nil, false + } + return o.ProcessingType, true +} + +// HasProcessingType returns a boolean if a field has been set. +func (o *IssuedCard) HasProcessingType() bool { + if o != nil && !common.IsNil(o.ProcessingType) { + return true + } + + return false +} + +// SetProcessingType gets a reference to the given string and assigns it to the ProcessingType field. +func (o *IssuedCard) SetProcessingType(v string) { + o.ProcessingType = &v +} + +// GetRelayedAuthorisationData returns the RelayedAuthorisationData field value if set, zero value otherwise. +func (o *IssuedCard) GetRelayedAuthorisationData() RelayedAuthorisationData { + if o == nil || common.IsNil(o.RelayedAuthorisationData) { + var ret RelayedAuthorisationData + return ret + } + return *o.RelayedAuthorisationData +} + +// GetRelayedAuthorisationDataOk returns a tuple with the RelayedAuthorisationData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetRelayedAuthorisationDataOk() (*RelayedAuthorisationData, bool) { + if o == nil || common.IsNil(o.RelayedAuthorisationData) { + return nil, false + } + return o.RelayedAuthorisationData, true +} + +// HasRelayedAuthorisationData returns a boolean if a field has been set. +func (o *IssuedCard) HasRelayedAuthorisationData() bool { + if o != nil && !common.IsNil(o.RelayedAuthorisationData) { + return true + } + + return false +} + +// SetRelayedAuthorisationData gets a reference to the given RelayedAuthorisationData and assigns it to the RelayedAuthorisationData field. +func (o *IssuedCard) SetRelayedAuthorisationData(v RelayedAuthorisationData) { + o.RelayedAuthorisationData = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *IssuedCard) 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 *IssuedCard) 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 *IssuedCard) 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 *IssuedCard) SetType(v string) { + o.Type = &v +} + +// GetValidationFacts returns the ValidationFacts field value if set, zero value otherwise. +func (o *IssuedCard) GetValidationFacts() []TransferNotificationValidationFact { + if o == nil || common.IsNil(o.ValidationFacts) { + var ret []TransferNotificationValidationFact + return ret + } + return o.ValidationFacts +} + +// GetValidationFactsOk returns a tuple with the ValidationFacts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetValidationFactsOk() ([]TransferNotificationValidationFact, bool) { + if o == nil || common.IsNil(o.ValidationFacts) { + return nil, false + } + return o.ValidationFacts, true +} + +// HasValidationFacts returns a boolean if a field has been set. +func (o *IssuedCard) HasValidationFacts() bool { + if o != nil && !common.IsNil(o.ValidationFacts) { + return true + } + + return false +} + +// SetValidationFacts gets a reference to the given []TransferNotificationValidationFact and assigns it to the ValidationFacts field. +func (o *IssuedCard) SetValidationFacts(v []TransferNotificationValidationFact) { + o.ValidationFacts = v +} + +func (o IssuedCard) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IssuedCard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.PanEntryMode) { + toSerialize["panEntryMode"] = o.PanEntryMode + } + if !common.IsNil(o.ProcessingType) { + toSerialize["processingType"] = o.ProcessingType + } + if !common.IsNil(o.RelayedAuthorisationData) { + toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !common.IsNil(o.ValidationFacts) { + toSerialize["validationFacts"] = o.ValidationFacts + } + return toSerialize, nil +} + +type NullableIssuedCard struct { + value *IssuedCard + isSet bool +} + +func (v NullableIssuedCard) Get() *IssuedCard { + return v.value +} + +func (v *NullableIssuedCard) Set(val *IssuedCard) { + v.value = val + v.isSet = true +} + +func (v NullableIssuedCard) IsSet() bool { + return v.isSet +} + +func (v *NullableIssuedCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIssuedCard(val *IssuedCard) *NullableIssuedCard { + return &NullableIssuedCard{value: val, isSet: true} +} + +func (v NullableIssuedCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIssuedCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *IssuedCard) isValidPanEntryMode() bool { + var allowedEnumValues = []string{"chip", "cof", "contactless", "ecommerce", "magstripe", "manual", "token"} + for _, allowed := range allowedEnumValues { + if o.GetPanEntryMode() == allowed { + return true + } + } + return false +} +func (o *IssuedCard) isValidProcessingType() bool { + var allowedEnumValues = []string{"atmWithdraw", "balanceInquiry", "ecommerce", "moto", "pos", "purchaseWithCashback", "recurring", "token"} + for _, allowed := range allowedEnumValues { + if o.GetProcessingType() == allowed { + return true + } + } + return false +} +func (o *IssuedCard) isValidType() bool { + var allowedEnumValues = []string{"issuedCard"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_merchant_data.go b/src/transferwebhook/model_merchant_data.go index 080d913d1..9903ea66e 100644 --- a/src/transferwebhook/model_merchant_data.go +++ b/src/transferwebhook/model_merchant_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,6 +19,8 @@ var _ common.MappedNullable = &MerchantData{} // MerchantData struct for MerchantData type MerchantData struct { + // The unique identifier of the merchant's acquirer. + AcquirerId *string `json:"acquirerId,omitempty"` // The merchant category code. Mcc *string `json:"mcc,omitempty"` // The merchant identifier. @@ -45,6 +47,38 @@ func NewMerchantDataWithDefaults() *MerchantData { return &this } +// GetAcquirerId returns the AcquirerId field value if set, zero value otherwise. +func (o *MerchantData) GetAcquirerId() string { + if o == nil || common.IsNil(o.AcquirerId) { + var ret string + return ret + } + return *o.AcquirerId +} + +// GetAcquirerIdOk returns a tuple with the AcquirerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetAcquirerIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerId) { + return nil, false + } + return o.AcquirerId, true +} + +// HasAcquirerId returns a boolean if a field has been set. +func (o *MerchantData) HasAcquirerId() bool { + if o != nil && !common.IsNil(o.AcquirerId) { + return true + } + + return false +} + +// SetAcquirerId gets a reference to the given string and assigns it to the AcquirerId field. +func (o *MerchantData) SetAcquirerId(v string) { + o.AcquirerId = &v +} + // GetMcc returns the Mcc field value if set, zero value otherwise. func (o *MerchantData) GetMcc() string { if o == nil || common.IsNil(o.Mcc) { @@ -183,6 +217,9 @@ func (o MerchantData) MarshalJSON() ([]byte, error) { func (o MerchantData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquirerId) { + toSerialize["acquirerId"] = o.AcquirerId + } if !common.IsNil(o.Mcc) { toSerialize["mcc"] = o.Mcc } diff --git a/src/transferwebhook/model_modification.go b/src/transferwebhook/model_modification.go new file mode 100644 index 000000000..53df6b0d4 --- /dev/null +++ b/src/transferwebhook/model_modification.go @@ -0,0 +1,283 @@ +/* +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 Modification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Modification{} + +// Modification struct for Modification +type Modification struct { + // The direction of the money movement. + Direction *string `json:"direction,omitempty"` + // Our reference for the modification. + Id *string `json:"id,omitempty"` + // Your reference for the modification, used internally within your platform. + Reference *string `json:"reference,omitempty"` + // The status of the transfer event. + Status *string `json:"status,omitempty"` + // The type of transfer modification. + Type *string `json:"type,omitempty"` +} + +// NewModification instantiates a new Modification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModification() *Modification { + this := Modification{} + return &this +} + +// NewModificationWithDefaults instantiates a new Modification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModificationWithDefaults() *Modification { + this := Modification{} + return &this +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *Modification) GetDirection() string { + if o == nil || common.IsNil(o.Direction) { + var ret string + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetDirectionOk() (*string, bool) { + if o == nil || common.IsNil(o.Direction) { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *Modification) HasDirection() bool { + if o != nil && !common.IsNil(o.Direction) { + return true + } + + return false +} + +// SetDirection gets a reference to the given string and assigns it to the Direction field. +func (o *Modification) SetDirection(v string) { + o.Direction = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Modification) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Modification) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Modification) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *Modification) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *Modification) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *Modification) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Modification) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Modification) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Modification) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Modification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Modification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Modification) SetType(v string) { + o.Type = &v +} + +func (o Modification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Modification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Direction) { + toSerialize["direction"] = o.Direction + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableModification struct { + value *Modification + isSet bool +} + +func (v NullableModification) Get() *Modification { + return v.value +} + +func (v *NullableModification) Set(val *Modification) { + v.value = val + v.isSet = true +} + +func (v NullableModification) IsSet() bool { + return v.isSet +} + +func (v *NullableModification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModification(val *Modification) *NullableModification { + return &NullableModification{value: val, isSet: true} +} + +func (v NullableModification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *Modification) isValidStatus() bool { + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_name_location.go b/src/transferwebhook/model_name_location.go index e32271476..75cd5c42f 100644 --- a/src/transferwebhook/model_name_location.go +++ b/src/transferwebhook/model_name_location.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_no_local_account_identification.go b/src/transferwebhook/model_no_local_account_identification.go index 10f077f3d..dd6aa8f91 100644 --- a/src/transferwebhook/model_no_local_account_identification.go +++ b/src/transferwebhook/model_no_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_number_and_bic_account_identification.go b/src/transferwebhook/model_number_and_bic_account_identification.go index a30964dcc..0e17a775a 100644 --- a/src/transferwebhook/model_number_and_bic_account_identification.go +++ b/src/transferwebhook/model_number_and_bic_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_nz_local_account_identification.go b/src/transferwebhook/model_nz_local_account_identification.go index 6261840aa..b81e981be 100644 --- a/src/transferwebhook/model_nz_local_account_identification.go +++ b/src/transferwebhook/model_nz_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. AccountNumber string `json:"accountNumber"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNZLocalAccountIdentification(accountNumber string, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) GetBankCode() string { - if o == nil { - var ret string - return ret - } - - return o.BankCode -} - -// GetBankCodeOk returns a tuple with the BankCode field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_party_identification.go b/src/transferwebhook/model_party_identification.go index 1db60e5a9..57992ddb0 100644 --- a/src/transferwebhook/model_party_identification.go +++ b/src/transferwebhook/model_party_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_payment_instrument.go b/src/transferwebhook/model_payment_instrument.go index 9de2b2089..53ca16ac9 100644 --- a/src/transferwebhook/model_payment_instrument.go +++ b/src/transferwebhook/model_payment_instrument.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_pl_local_account_identification.go b/src/transferwebhook/model_pl_local_account_identification.go index 448cfb849..8815ba608 100644 --- a/src/transferwebhook/model_pl_local_account_identification.go +++ b/src/transferwebhook/model_pl_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_platform_payment.go b/src/transferwebhook/model_platform_payment.go new file mode 100644 index 000000000..d7a992d48 --- /dev/null +++ b/src/transferwebhook/model_platform_payment.go @@ -0,0 +1,333 @@ +/* +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 PlatformPayment type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PlatformPayment{} + +// PlatformPayment struct for PlatformPayment +type PlatformPayment struct { + // The capture's merchant reference included in the transfer. + ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` + // The capture reference included in the transfer. + ModificationPspReference *string `json:"modificationPspReference,omitempty"` + // The payment's merchant reference included in the transfer. + PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` + // The type of the related split. + PlatformPaymentType *string `json:"platformPaymentType,omitempty"` + // The payment reference included in the transfer. + PspPaymentReference *string `json:"pspPaymentReference,omitempty"` + // **platformPayment** + Type *string `json:"type,omitempty"` +} + +// NewPlatformPayment instantiates a new PlatformPayment 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 NewPlatformPayment() *PlatformPayment { + this := PlatformPayment{} + var type_ string = "platformPayment" + this.Type = &type_ + return &this +} + +// NewPlatformPaymentWithDefaults instantiates a new PlatformPayment 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 NewPlatformPaymentWithDefaults() *PlatformPayment { + this := PlatformPayment{} + var type_ string = "platformPayment" + this.Type = &type_ + return &this +} + +// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetModificationMerchantReference() string { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + var ret string + return ret + } + return *o.ModificationMerchantReference +} + +// GetModificationMerchantReferenceOk returns a tuple with the ModificationMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetModificationMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + return nil, false + } + return o.ModificationMerchantReference, true +} + +// HasModificationMerchantReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasModificationMerchantReference() bool { + if o != nil && !common.IsNil(o.ModificationMerchantReference) { + return true + } + + return false +} + +// SetModificationMerchantReference gets a reference to the given string and assigns it to the ModificationMerchantReference field. +func (o *PlatformPayment) SetModificationMerchantReference(v string) { + o.ModificationMerchantReference = &v +} + +// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetModificationPspReference() string { + if o == nil || common.IsNil(o.ModificationPspReference) { + var ret string + return ret + } + return *o.ModificationPspReference +} + +// GetModificationPspReferenceOk returns a tuple with the ModificationPspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetModificationPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationPspReference) { + return nil, false + } + return o.ModificationPspReference, true +} + +// HasModificationPspReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasModificationPspReference() bool { + if o != nil && !common.IsNil(o.ModificationPspReference) { + return true + } + + return false +} + +// SetModificationPspReference gets a reference to the given string and assigns it to the ModificationPspReference field. +func (o *PlatformPayment) SetModificationPspReference(v string) { + o.ModificationPspReference = &v +} + +// GetPaymentMerchantReference returns the PaymentMerchantReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetPaymentMerchantReference() string { + if o == nil || common.IsNil(o.PaymentMerchantReference) { + var ret string + return ret + } + return *o.PaymentMerchantReference +} + +// GetPaymentMerchantReferenceOk returns a tuple with the PaymentMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPaymentMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentMerchantReference) { + return nil, false + } + return o.PaymentMerchantReference, true +} + +// HasPaymentMerchantReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasPaymentMerchantReference() bool { + if o != nil && !common.IsNil(o.PaymentMerchantReference) { + return true + } + + return false +} + +// SetPaymentMerchantReference gets a reference to the given string and assigns it to the PaymentMerchantReference field. +func (o *PlatformPayment) SetPaymentMerchantReference(v string) { + o.PaymentMerchantReference = &v +} + +// GetPlatformPaymentType returns the PlatformPaymentType field value if set, zero value otherwise. +func (o *PlatformPayment) GetPlatformPaymentType() string { + if o == nil || common.IsNil(o.PlatformPaymentType) { + var ret string + return ret + } + return *o.PlatformPaymentType +} + +// GetPlatformPaymentTypeOk returns a tuple with the PlatformPaymentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPlatformPaymentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PlatformPaymentType) { + return nil, false + } + return o.PlatformPaymentType, true +} + +// HasPlatformPaymentType returns a boolean if a field has been set. +func (o *PlatformPayment) HasPlatformPaymentType() bool { + if o != nil && !common.IsNil(o.PlatformPaymentType) { + return true + } + + return false +} + +// SetPlatformPaymentType gets a reference to the given string and assigns it to the PlatformPaymentType field. +func (o *PlatformPayment) SetPlatformPaymentType(v string) { + o.PlatformPaymentType = &v +} + +// GetPspPaymentReference returns the PspPaymentReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetPspPaymentReference() string { + if o == nil || common.IsNil(o.PspPaymentReference) { + var ret string + return ret + } + return *o.PspPaymentReference +} + +// GetPspPaymentReferenceOk returns a tuple with the PspPaymentReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPspPaymentReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PspPaymentReference) { + return nil, false + } + return o.PspPaymentReference, true +} + +// HasPspPaymentReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasPspPaymentReference() bool { + if o != nil && !common.IsNil(o.PspPaymentReference) { + return true + } + + return false +} + +// SetPspPaymentReference gets a reference to the given string and assigns it to the PspPaymentReference field. +func (o *PlatformPayment) SetPspPaymentReference(v string) { + o.PspPaymentReference = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PlatformPayment) 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 *PlatformPayment) 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 *PlatformPayment) 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 *PlatformPayment) SetType(v string) { + o.Type = &v +} + +func (o PlatformPayment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlatformPayment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ModificationMerchantReference) { + toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference + } + if !common.IsNil(o.ModificationPspReference) { + toSerialize["modificationPspReference"] = o.ModificationPspReference + } + if !common.IsNil(o.PaymentMerchantReference) { + toSerialize["paymentMerchantReference"] = o.PaymentMerchantReference + } + if !common.IsNil(o.PlatformPaymentType) { + toSerialize["platformPaymentType"] = o.PlatformPaymentType + } + if !common.IsNil(o.PspPaymentReference) { + toSerialize["pspPaymentReference"] = o.PspPaymentReference + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullablePlatformPayment struct { + value *PlatformPayment + isSet bool +} + +func (v NullablePlatformPayment) Get() *PlatformPayment { + return v.value +} + +func (v *NullablePlatformPayment) Set(val *PlatformPayment) { + v.value = val + v.isSet = true +} + +func (v NullablePlatformPayment) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatformPayment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatformPayment(val *PlatformPayment) *NullablePlatformPayment { + return &NullablePlatformPayment{value: val, isSet: true} +} + +func (v NullablePlatformPayment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatformPayment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PlatformPayment) isValidPlatformPaymentType() bool { + var allowedEnumValues = []string{"AcquiringFees", "AdyenCommission", "AdyenFees", "AdyenMarkup", "BalanceAccount", "Commission", "Default", "Interchange", "PaymentFee", "Remainder", "SchemeFee", "TopUp", "VAT"} + for _, allowed := range allowedEnumValues { + if o.GetPlatformPaymentType() == allowed { + return true + } + } + return false +} +func (o *PlatformPayment) isValidType() bool { + var allowedEnumValues = []string{"platformPayment"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_relayed_authorisation_data.go b/src/transferwebhook/model_relayed_authorisation_data.go index 44fbcf92a..f7281fd02 100644 --- a/src/transferwebhook/model_relayed_authorisation_data.go +++ b/src/transferwebhook/model_relayed_authorisation_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_resource.go b/src/transferwebhook/model_resource.go index 85a8725b4..5dade0651 100644 --- a/src/transferwebhook/model_resource.go +++ b/src/transferwebhook/model_resource.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_resource_reference.go b/src/transferwebhook/model_resource_reference.go index 71e524f70..20ed9a853 100644 --- a/src/transferwebhook/model_resource_reference.go +++ b/src/transferwebhook/model_resource_reference.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_se_local_account_identification.go b/src/transferwebhook/model_se_local_account_identification.go index 146f13365..bd28144a1 100644 --- a/src/transferwebhook/model_se_local_account_identification.go +++ b/src/transferwebhook/model_se_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_sg_local_account_identification.go b/src/transferwebhook/model_sg_local_account_identification.go index f35c56212..88181bccf 100644 --- a/src/transferwebhook/model_sg_local_account_identification.go +++ b/src/transferwebhook/model_sg_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_event_violation.go b/src/transferwebhook/model_transaction_event_violation.go index 9bf9db1d6..311880dd2 100644 --- a/src/transferwebhook/model_transaction_event_violation.go +++ b/src/transferwebhook/model_transaction_event_violation.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_rule_reference.go b/src/transferwebhook/model_transaction_rule_reference.go index 4f795d3ff..8609c38dc 100644 --- a/src/transferwebhook/model_transaction_rule_reference.go +++ b/src/transferwebhook/model_transaction_rule_reference.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,8 +23,12 @@ type TransactionRuleReference struct { Description *string `json:"description,omitempty"` // The unique identifier of the resource. Id *string `json:"id,omitempty"` + // The outcome type of the rule. + OutcomeType *string `json:"outcomeType,omitempty"` // The reference for the resource. Reference *string `json:"reference,omitempty"` + // The score of the rule in case it's a scoreBased rule. + Score *int32 `json:"score,omitempty"` } // NewTransactionRuleReference instantiates a new TransactionRuleReference object @@ -108,6 +112,38 @@ func (o *TransactionRuleReference) SetId(v string) { o.Id = &v } +// GetOutcomeType returns the OutcomeType field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetOutcomeType() string { + if o == nil || common.IsNil(o.OutcomeType) { + var ret string + return ret + } + return *o.OutcomeType +} + +// GetOutcomeTypeOk returns a tuple with the OutcomeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetOutcomeTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.OutcomeType) { + return nil, false + } + return o.OutcomeType, true +} + +// HasOutcomeType returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasOutcomeType() bool { + if o != nil && !common.IsNil(o.OutcomeType) { + return true + } + + return false +} + +// SetOutcomeType gets a reference to the given string and assigns it to the OutcomeType field. +func (o *TransactionRuleReference) SetOutcomeType(v string) { + o.OutcomeType = &v +} + // GetReference returns the Reference field value if set, zero value otherwise. func (o *TransactionRuleReference) GetReference() string { if o == nil || common.IsNil(o.Reference) { @@ -140,6 +176,38 @@ func (o *TransactionRuleReference) SetReference(v string) { o.Reference = &v } +// GetScore returns the Score field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetScore() int32 { + if o == nil || common.IsNil(o.Score) { + var ret int32 + return ret + } + return *o.Score +} + +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetScoreOk() (*int32, bool) { + if o == nil || common.IsNil(o.Score) { + return nil, false + } + return o.Score, true +} + +// HasScore returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasScore() bool { + if o != nil && !common.IsNil(o.Score) { + return true + } + + return false +} + +// SetScore gets a reference to the given int32 and assigns it to the Score field. +func (o *TransactionRuleReference) SetScore(v int32) { + o.Score = &v +} + func (o TransactionRuleReference) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -156,9 +224,15 @@ func (o TransactionRuleReference) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Id) { toSerialize["id"] = o.Id } + if !common.IsNil(o.OutcomeType) { + toSerialize["outcomeType"] = o.OutcomeType + } if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference } + if !common.IsNil(o.Score) { + toSerialize["score"] = o.Score + } return toSerialize, nil } diff --git a/src/transferwebhook/model_transaction_rule_source.go b/src/transferwebhook/model_transaction_rule_source.go index 379e75f19..f31fb70d5 100644 --- a/src/transferwebhook/model_transaction_rule_source.go +++ b/src/transferwebhook/model_transaction_rule_source.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_rules_result.go b/src/transferwebhook/model_transaction_rules_result.go index 0468d481a..e4a87833a 100644 --- a/src/transferwebhook/model_transaction_rules_result.go +++ b/src/transferwebhook/model_transaction_rules_result.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,12 +21,12 @@ var _ common.MappedNullable = &TransactionRulesResult{} type TransactionRulesResult struct { // The advice given by the Risk analysis. Advice *string `json:"advice,omitempty"` - // Indicates whether the transaction passed the evaluation for all transaction rules. - AllRulesPassed *bool `json:"allRulesPassed,omitempty"` - // Array containing all the transaction rules that the transaction violated. This list is only sent when `allRulesPassed` is **false**. - FailedTransactionRules []TransactionEventViolation `json:"failedTransactionRules,omitempty"` + // Indicates whether the transaction passed the evaluation for all hardblock rules + AllHardBlockRulesPassed *bool `json:"allHardBlockRulesPassed,omitempty"` // The score of the Risk analysis. Score *int32 `json:"score,omitempty"` + // Array containing all the transaction rules that the transaction triggered. + TriggeredTransactionRules []TransactionEventViolation `json:"triggeredTransactionRules,omitempty"` } // NewTransactionRulesResult instantiates a new TransactionRulesResult object @@ -78,100 +78,100 @@ func (o *TransactionRulesResult) SetAdvice(v string) { o.Advice = &v } -// GetAllRulesPassed returns the AllRulesPassed field value if set, zero value otherwise. -func (o *TransactionRulesResult) GetAllRulesPassed() bool { - if o == nil || common.IsNil(o.AllRulesPassed) { +// GetAllHardBlockRulesPassed returns the AllHardBlockRulesPassed field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetAllHardBlockRulesPassed() bool { + if o == nil || common.IsNil(o.AllHardBlockRulesPassed) { var ret bool return ret } - return *o.AllRulesPassed + return *o.AllHardBlockRulesPassed } -// GetAllRulesPassedOk returns a tuple with the AllRulesPassed field value if set, nil otherwise +// GetAllHardBlockRulesPassedOk returns a tuple with the AllHardBlockRulesPassed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionRulesResult) GetAllRulesPassedOk() (*bool, bool) { - if o == nil || common.IsNil(o.AllRulesPassed) { +func (o *TransactionRulesResult) GetAllHardBlockRulesPassedOk() (*bool, bool) { + if o == nil || common.IsNil(o.AllHardBlockRulesPassed) { return nil, false } - return o.AllRulesPassed, true + return o.AllHardBlockRulesPassed, true } -// HasAllRulesPassed returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasAllRulesPassed() bool { - if o != nil && !common.IsNil(o.AllRulesPassed) { +// HasAllHardBlockRulesPassed returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasAllHardBlockRulesPassed() bool { + if o != nil && !common.IsNil(o.AllHardBlockRulesPassed) { return true } return false } -// SetAllRulesPassed gets a reference to the given bool and assigns it to the AllRulesPassed field. -func (o *TransactionRulesResult) SetAllRulesPassed(v bool) { - o.AllRulesPassed = &v +// SetAllHardBlockRulesPassed gets a reference to the given bool and assigns it to the AllHardBlockRulesPassed field. +func (o *TransactionRulesResult) SetAllHardBlockRulesPassed(v bool) { + o.AllHardBlockRulesPassed = &v } -// GetFailedTransactionRules returns the FailedTransactionRules field value if set, zero value otherwise. -func (o *TransactionRulesResult) GetFailedTransactionRules() []TransactionEventViolation { - if o == nil || common.IsNil(o.FailedTransactionRules) { - var ret []TransactionEventViolation +// GetScore returns the Score field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetScore() int32 { + if o == nil || common.IsNil(o.Score) { + var ret int32 return ret } - return o.FailedTransactionRules + return *o.Score } -// GetFailedTransactionRulesOk returns a tuple with the FailedTransactionRules field value if set, nil otherwise +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionRulesResult) GetFailedTransactionRulesOk() ([]TransactionEventViolation, bool) { - if o == nil || common.IsNil(o.FailedTransactionRules) { +func (o *TransactionRulesResult) GetScoreOk() (*int32, bool) { + if o == nil || common.IsNil(o.Score) { return nil, false } - return o.FailedTransactionRules, true + return o.Score, true } -// HasFailedTransactionRules returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasFailedTransactionRules() bool { - if o != nil && !common.IsNil(o.FailedTransactionRules) { +// HasScore returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasScore() bool { + if o != nil && !common.IsNil(o.Score) { return true } return false } -// SetFailedTransactionRules gets a reference to the given []TransactionEventViolation and assigns it to the FailedTransactionRules field. -func (o *TransactionRulesResult) SetFailedTransactionRules(v []TransactionEventViolation) { - o.FailedTransactionRules = v +// SetScore gets a reference to the given int32 and assigns it to the Score field. +func (o *TransactionRulesResult) SetScore(v int32) { + o.Score = &v } -// GetScore returns the Score field value if set, zero value otherwise. -func (o *TransactionRulesResult) GetScore() int32 { - if o == nil || common.IsNil(o.Score) { - var ret int32 +// GetTriggeredTransactionRules returns the TriggeredTransactionRules field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetTriggeredTransactionRules() []TransactionEventViolation { + if o == nil || common.IsNil(o.TriggeredTransactionRules) { + var ret []TransactionEventViolation return ret } - return *o.Score + return o.TriggeredTransactionRules } -// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// GetTriggeredTransactionRulesOk returns a tuple with the TriggeredTransactionRules field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TransactionRulesResult) GetScoreOk() (*int32, bool) { - if o == nil || common.IsNil(o.Score) { +func (o *TransactionRulesResult) GetTriggeredTransactionRulesOk() ([]TransactionEventViolation, bool) { + if o == nil || common.IsNil(o.TriggeredTransactionRules) { return nil, false } - return o.Score, true + return o.TriggeredTransactionRules, true } -// HasScore returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasScore() bool { - if o != nil && !common.IsNil(o.Score) { +// HasTriggeredTransactionRules returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasTriggeredTransactionRules() bool { + if o != nil && !common.IsNil(o.TriggeredTransactionRules) { return true } return false } -// SetScore gets a reference to the given int32 and assigns it to the Score field. -func (o *TransactionRulesResult) SetScore(v int32) { - o.Score = &v +// SetTriggeredTransactionRules gets a reference to the given []TransactionEventViolation and assigns it to the TriggeredTransactionRules field. +func (o *TransactionRulesResult) SetTriggeredTransactionRules(v []TransactionEventViolation) { + o.TriggeredTransactionRules = v } func (o TransactionRulesResult) MarshalJSON() ([]byte, error) { @@ -187,15 +187,15 @@ func (o TransactionRulesResult) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Advice) { toSerialize["advice"] = o.Advice } - if !common.IsNil(o.AllRulesPassed) { - toSerialize["allRulesPassed"] = o.AllRulesPassed - } - if !common.IsNil(o.FailedTransactionRules) { - toSerialize["failedTransactionRules"] = o.FailedTransactionRules + if !common.IsNil(o.AllHardBlockRulesPassed) { + toSerialize["allHardBlockRulesPassed"] = o.AllHardBlockRulesPassed } if !common.IsNil(o.Score) { toSerialize["score"] = o.Score } + if !common.IsNil(o.TriggeredTransactionRules) { + toSerialize["triggeredTransactionRules"] = o.TriggeredTransactionRules + } return toSerialize, nil } diff --git a/src/transferwebhook/model_transfer_data.go b/src/transferwebhook/model_transfer_data.go index 29ee0af56..94820aa14 100644 --- a/src/transferwebhook/model_transfer_data.go +++ b/src/transferwebhook/model_transfer_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,16 +23,14 @@ type TransferData struct { AccountHolder *ResourceReference `json:"accountHolder,omitempty"` Amount Amount `json:"amount"` BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` - // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - // Deprecated - BalanceAccountId *string `json:"balanceAccountId,omitempty"` // The unique identifier of the balance platform. BalancePlatform *string `json:"balancePlatform,omitempty"` // The list of the latest balance statuses in the transfer. Balances []BalanceMutation `json:"balances,omitempty"` - // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` - Counterparty *CounterpartyV3 `json:"counterparty,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"` // 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] & $ % # @** **~ = + - _ ' \" ! ?** @@ -42,55 +40,22 @@ type TransferData struct { // The list of events leading up to the current status of the transfer. Events []TransferEvent `json:"events,omitempty"` // The ID of the resource. - Id *string `json:"id,omitempty"` - // The capture's merchant reference included in the transfer. - // Deprecated - ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` - // The capture reference included in the transfer. - // Deprecated - ModificationPspReference *string `json:"modificationPspReference,omitempty"` - // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. - // Deprecated - PanEntryMode *string `json:"panEntryMode,omitempty"` + Id *string `json:"id,omitempty"` PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` - // The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. - // Deprecated - PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` - // The payment's merchant reference included in the transfer. - // Deprecated - PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. - // Deprecated - PlatformPaymentType *string `json:"platformPaymentType,omitempty"` - // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). - Priority *string `json:"priority,omitempty"` - // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. - // Deprecated - ProcessingType *string `json:"processingType,omitempty"` - // The payment reference included in the transfer. - // Deprecated - PspPaymentReference *string `json:"pspPaymentReference,omitempty"` // Additional information about the status of the transfer. Reason *string `json:"reason,omitempty"` // Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. Reference *string `json:"reference,omitempty"` // A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. - ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` - RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` + ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` // The sequence number of the transfer notification. The numbers start from 1 and increase with each new notification for a specific transfer. It can help you restore the correct sequence of events even if they arrive out of order. SequenceNumber *int32 `json:"sequenceNumber,omitempty"` // The result of the transfer. For example, **authorised**, **refused**, or **error**. - Status string `json:"status"` - Tracking *TransferNotificationTransferTracking `json:"tracking,omitempty"` - // The ID of the transaction that is created based on the transfer. - // Deprecated - TransactionId *string `json:"transactionId,omitempty"` - TransactionRulesResult *TransactionRulesResult `json:"transactionRulesResult,omitempty"` + Status string `json:"status"` + Tracking *TransferNotificationTransferTracking `json:"tracking,omitempty"` + TransactionRulesResult *TransactionRulesResult `json:"transactionRulesResult,omitempty"` // The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**. Type *string `json:"type,omitempty"` - // The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. - // Deprecated - ValidationFacts []TransferNotificationValidationFact `json:"validationFacts,omitempty"` } // NewTransferData instantiates a new TransferData object @@ -201,41 +166,6 @@ func (o *TransferData) SetBalanceAccount(v ResourceReference) { o.BalanceAccount = &v } -// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetBalanceAccountId(v string) { - o.BalanceAccountId = &v -} - // GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. func (o *TransferData) GetBalancePlatform() string { if o == nil || common.IsNil(o.BalancePlatform) { @@ -324,6 +254,38 @@ func (o *TransferData) SetCategory(v string) { o.Category = v } +// GetCategoryData returns the CategoryData field value if set, zero value otherwise. +func (o *TransferData) GetCategoryData() TransferDataCategoryData { + if o == nil || common.IsNil(o.CategoryData) { + var ret TransferDataCategoryData + return ret + } + return *o.CategoryData +} + +// GetCategoryDataOk returns a tuple with the CategoryData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetCategoryDataOk() (*TransferDataCategoryData, bool) { + if o == nil || common.IsNil(o.CategoryData) { + return nil, false + } + return o.CategoryData, true +} + +// HasCategoryData returns a boolean if a field has been set. +func (o *TransferData) HasCategoryData() bool { + if o != nil && !common.IsNil(o.CategoryData) { + return true + } + + return false +} + +// SetCategoryData gets a reference to the given TransferDataCategoryData and assigns it to the CategoryData field. +func (o *TransferData) SetCategoryData(v TransferDataCategoryData) { + o.CategoryData = &v +} + // GetCounterparty returns the Counterparty field value if set, zero value otherwise. func (o *TransferData) GetCounterparty() CounterpartyV3 { if o == nil || common.IsNil(o.Counterparty) { @@ -516,111 +478,6 @@ func (o *TransferData) SetId(v string) { o.Id = &v } -// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetModificationMerchantReference() string { - if o == nil || common.IsNil(o.ModificationMerchantReference) { - var ret string - return ret - } - return *o.ModificationMerchantReference -} - -// GetModificationMerchantReferenceOk returns a tuple with the ModificationMerchantReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetModificationMerchantReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.ModificationMerchantReference) { - return nil, false - } - return o.ModificationMerchantReference, true -} - -// HasModificationMerchantReference returns a boolean if a field has been set. -func (o *TransferData) HasModificationMerchantReference() bool { - if o != nil && !common.IsNil(o.ModificationMerchantReference) { - return true - } - - return false -} - -// SetModificationMerchantReference gets a reference to the given string and assigns it to the ModificationMerchantReference field. -// Deprecated -func (o *TransferData) SetModificationMerchantReference(v string) { - o.ModificationMerchantReference = &v -} - -// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetModificationPspReference() string { - if o == nil || common.IsNil(o.ModificationPspReference) { - var ret string - return ret - } - return *o.ModificationPspReference -} - -// GetModificationPspReferenceOk returns a tuple with the ModificationPspReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetModificationPspReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.ModificationPspReference) { - return nil, false - } - return o.ModificationPspReference, true -} - -// HasModificationPspReference returns a boolean if a field has been set. -func (o *TransferData) HasModificationPspReference() bool { - if o != nil && !common.IsNil(o.ModificationPspReference) { - return true - } - - return false -} - -// SetModificationPspReference gets a reference to the given string and assigns it to the ModificationPspReference field. -// Deprecated -func (o *TransferData) SetModificationPspReference(v string) { - o.ModificationPspReference = &v -} - -// GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetPanEntryMode() string { - if o == nil || common.IsNil(o.PanEntryMode) { - var ret string - return ret - } - return *o.PanEntryMode -} - -// GetPanEntryModeOk returns a tuple with the PanEntryMode field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetPanEntryModeOk() (*string, bool) { - if o == nil || common.IsNil(o.PanEntryMode) { - return nil, false - } - return o.PanEntryMode, true -} - -// HasPanEntryMode returns a boolean if a field has been set. -func (o *TransferData) HasPanEntryMode() bool { - if o != nil && !common.IsNil(o.PanEntryMode) { - return true - } - - return false -} - -// SetPanEntryMode gets a reference to the given string and assigns it to the PanEntryMode field. -// Deprecated -func (o *TransferData) SetPanEntryMode(v string) { - o.PanEntryMode = &v -} - // GetPaymentInstrument returns the PaymentInstrument field value if set, zero value otherwise. func (o *TransferData) GetPaymentInstrument() PaymentInstrument { if o == nil || common.IsNil(o.PaymentInstrument) { @@ -653,213 +510,6 @@ func (o *TransferData) SetPaymentInstrument(v PaymentInstrument) { o.PaymentInstrument = &v } -// GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetPaymentInstrumentId() string { - if o == nil || common.IsNil(o.PaymentInstrumentId) { - var ret string - return ret - } - return *o.PaymentInstrumentId -} - -// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetPaymentInstrumentIdOk() (*string, bool) { - if o == nil || common.IsNil(o.PaymentInstrumentId) { - return nil, false - } - return o.PaymentInstrumentId, true -} - -// HasPaymentInstrumentId returns a boolean if a field has been set. -func (o *TransferData) HasPaymentInstrumentId() bool { - if o != nil && !common.IsNil(o.PaymentInstrumentId) { - return true - } - - return false -} - -// SetPaymentInstrumentId gets a reference to the given string and assigns it to the PaymentInstrumentId field. -// Deprecated -func (o *TransferData) SetPaymentInstrumentId(v string) { - o.PaymentInstrumentId = &v -} - -// GetPaymentMerchantReference returns the PaymentMerchantReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetPaymentMerchantReference() string { - if o == nil || common.IsNil(o.PaymentMerchantReference) { - var ret string - return ret - } - return *o.PaymentMerchantReference -} - -// GetPaymentMerchantReferenceOk returns a tuple with the PaymentMerchantReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetPaymentMerchantReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.PaymentMerchantReference) { - return nil, false - } - return o.PaymentMerchantReference, true -} - -// HasPaymentMerchantReference returns a boolean if a field has been set. -func (o *TransferData) HasPaymentMerchantReference() bool { - if o != nil && !common.IsNil(o.PaymentMerchantReference) { - return true - } - - return false -} - -// SetPaymentMerchantReference gets a reference to the given string and assigns it to the PaymentMerchantReference field. -// Deprecated -func (o *TransferData) SetPaymentMerchantReference(v string) { - o.PaymentMerchantReference = &v -} - -// GetPlatformPaymentType returns the PlatformPaymentType field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetPlatformPaymentType() string { - if o == nil || common.IsNil(o.PlatformPaymentType) { - var ret string - return ret - } - return *o.PlatformPaymentType -} - -// GetPlatformPaymentTypeOk returns a tuple with the PlatformPaymentType field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetPlatformPaymentTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.PlatformPaymentType) { - return nil, false - } - return o.PlatformPaymentType, true -} - -// HasPlatformPaymentType returns a boolean if a field has been set. -func (o *TransferData) HasPlatformPaymentType() bool { - if o != nil && !common.IsNil(o.PlatformPaymentType) { - return true - } - - return false -} - -// SetPlatformPaymentType gets a reference to the given string and assigns it to the PlatformPaymentType field. -// Deprecated -func (o *TransferData) SetPlatformPaymentType(v string) { - o.PlatformPaymentType = &v -} - -// GetPriority returns the Priority field value if set, zero value otherwise. -func (o *TransferData) GetPriority() string { - if o == nil || common.IsNil(o.Priority) { - var ret string - return ret - } - return *o.Priority -} - -// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferData) GetPriorityOk() (*string, bool) { - if o == nil || common.IsNil(o.Priority) { - return nil, false - } - return o.Priority, true -} - -// HasPriority returns a boolean if a field has been set. -func (o *TransferData) HasPriority() bool { - if o != nil && !common.IsNil(o.Priority) { - return true - } - - return false -} - -// SetPriority gets a reference to the given string and assigns it to the Priority field. -func (o *TransferData) SetPriority(v string) { - o.Priority = &v -} - -// GetProcessingType returns the ProcessingType field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetProcessingType() string { - if o == nil || common.IsNil(o.ProcessingType) { - var ret string - return ret - } - return *o.ProcessingType -} - -// GetProcessingTypeOk returns a tuple with the ProcessingType field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetProcessingTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.ProcessingType) { - return nil, false - } - return o.ProcessingType, true -} - -// HasProcessingType returns a boolean if a field has been set. -func (o *TransferData) HasProcessingType() bool { - if o != nil && !common.IsNil(o.ProcessingType) { - return true - } - - return false -} - -// SetProcessingType gets a reference to the given string and assigns it to the ProcessingType field. -// Deprecated -func (o *TransferData) SetProcessingType(v string) { - o.ProcessingType = &v -} - -// GetPspPaymentReference returns the PspPaymentReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetPspPaymentReference() string { - if o == nil || common.IsNil(o.PspPaymentReference) { - var ret string - return ret - } - return *o.PspPaymentReference -} - -// GetPspPaymentReferenceOk returns a tuple with the PspPaymentReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetPspPaymentReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.PspPaymentReference) { - return nil, false - } - return o.PspPaymentReference, true -} - -// HasPspPaymentReference returns a boolean if a field has been set. -func (o *TransferData) HasPspPaymentReference() bool { - if o != nil && !common.IsNil(o.PspPaymentReference) { - return true - } - - return false -} - -// SetPspPaymentReference gets a reference to the given string and assigns it to the PspPaymentReference field. -// Deprecated -func (o *TransferData) SetPspPaymentReference(v string) { - o.PspPaymentReference = &v -} - // GetReason returns the Reason field value if set, zero value otherwise. func (o *TransferData) GetReason() string { if o == nil || common.IsNil(o.Reason) { @@ -956,38 +606,6 @@ func (o *TransferData) SetReferenceForBeneficiary(v string) { o.ReferenceForBeneficiary = &v } -// GetRelayedAuthorisationData returns the RelayedAuthorisationData field value if set, zero value otherwise. -func (o *TransferData) GetRelayedAuthorisationData() RelayedAuthorisationData { - if o == nil || common.IsNil(o.RelayedAuthorisationData) { - var ret RelayedAuthorisationData - return ret - } - return *o.RelayedAuthorisationData -} - -// GetRelayedAuthorisationDataOk returns a tuple with the RelayedAuthorisationData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferData) GetRelayedAuthorisationDataOk() (*RelayedAuthorisationData, bool) { - if o == nil || common.IsNil(o.RelayedAuthorisationData) { - return nil, false - } - return o.RelayedAuthorisationData, true -} - -// HasRelayedAuthorisationData returns a boolean if a field has been set. -func (o *TransferData) HasRelayedAuthorisationData() bool { - if o != nil && !common.IsNil(o.RelayedAuthorisationData) { - return true - } - - return false -} - -// SetRelayedAuthorisationData gets a reference to the given RelayedAuthorisationData and assigns it to the RelayedAuthorisationData field. -func (o *TransferData) SetRelayedAuthorisationData(v RelayedAuthorisationData) { - o.RelayedAuthorisationData = &v -} - // GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. func (o *TransferData) GetSequenceNumber() int32 { if o == nil || common.IsNil(o.SequenceNumber) { @@ -1076,41 +694,6 @@ func (o *TransferData) SetTracking(v TransferNotificationTransferTracking) { o.Tracking = &v } -// GetTransactionId returns the TransactionId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetTransactionId() string { - if o == nil || common.IsNil(o.TransactionId) { - var ret string - return ret - } - return *o.TransactionId -} - -// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetTransactionIdOk() (*string, bool) { - if o == nil || common.IsNil(o.TransactionId) { - return nil, false - } - return o.TransactionId, true -} - -// HasTransactionId returns a boolean if a field has been set. -func (o *TransferData) HasTransactionId() bool { - if o != nil && !common.IsNil(o.TransactionId) { - return true - } - - return false -} - -// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. -// Deprecated -func (o *TransferData) SetTransactionId(v string) { - o.TransactionId = &v -} - // GetTransactionRulesResult returns the TransactionRulesResult field value if set, zero value otherwise. func (o *TransferData) GetTransactionRulesResult() TransactionRulesResult { if o == nil || common.IsNil(o.TransactionRulesResult) { @@ -1175,41 +758,6 @@ func (o *TransferData) SetType(v string) { o.Type = &v } -// GetValidationFacts returns the ValidationFacts field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) GetValidationFacts() []TransferNotificationValidationFact { - if o == nil || common.IsNil(o.ValidationFacts) { - var ret []TransferNotificationValidationFact - return ret - } - return o.ValidationFacts -} - -// GetValidationFactsOk returns a tuple with the ValidationFacts field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated -func (o *TransferData) GetValidationFactsOk() ([]TransferNotificationValidationFact, bool) { - if o == nil || common.IsNil(o.ValidationFacts) { - return nil, false - } - return o.ValidationFacts, true -} - -// HasValidationFacts returns a boolean if a field has been set. -func (o *TransferData) HasValidationFacts() bool { - if o != nil && !common.IsNil(o.ValidationFacts) { - return true - } - - return false -} - -// SetValidationFacts gets a reference to the given []TransferNotificationValidationFact and assigns it to the ValidationFacts field. -// Deprecated -func (o *TransferData) SetValidationFacts(v []TransferNotificationValidationFact) { - o.ValidationFacts = v -} - func (o TransferData) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -1227,9 +775,6 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BalanceAccount) { toSerialize["balanceAccount"] = o.BalanceAccount } - if !common.IsNil(o.BalanceAccountId) { - toSerialize["balanceAccountId"] = o.BalanceAccountId - } if !common.IsNil(o.BalancePlatform) { toSerialize["balancePlatform"] = o.BalancePlatform } @@ -1237,6 +782,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { toSerialize["balances"] = o.Balances } toSerialize["category"] = o.Category + if !common.IsNil(o.CategoryData) { + toSerialize["categoryData"] = o.CategoryData + } if !common.IsNil(o.Counterparty) { toSerialize["counterparty"] = o.Counterparty } @@ -1255,36 +803,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Id) { toSerialize["id"] = o.Id } - if !common.IsNil(o.ModificationMerchantReference) { - toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference - } - if !common.IsNil(o.ModificationPspReference) { - toSerialize["modificationPspReference"] = o.ModificationPspReference - } - if !common.IsNil(o.PanEntryMode) { - toSerialize["panEntryMode"] = o.PanEntryMode - } if !common.IsNil(o.PaymentInstrument) { toSerialize["paymentInstrument"] = o.PaymentInstrument } - if !common.IsNil(o.PaymentInstrumentId) { - toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId - } - if !common.IsNil(o.PaymentMerchantReference) { - toSerialize["paymentMerchantReference"] = o.PaymentMerchantReference - } - if !common.IsNil(o.PlatformPaymentType) { - toSerialize["platformPaymentType"] = o.PlatformPaymentType - } - if !common.IsNil(o.Priority) { - toSerialize["priority"] = o.Priority - } - if !common.IsNil(o.ProcessingType) { - toSerialize["processingType"] = o.ProcessingType - } - if !common.IsNil(o.PspPaymentReference) { - toSerialize["pspPaymentReference"] = o.PspPaymentReference - } if !common.IsNil(o.Reason) { toSerialize["reason"] = o.Reason } @@ -1294,9 +815,6 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ReferenceForBeneficiary) { toSerialize["referenceForBeneficiary"] = o.ReferenceForBeneficiary } - if !common.IsNil(o.RelayedAuthorisationData) { - toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData - } if !common.IsNil(o.SequenceNumber) { toSerialize["sequenceNumber"] = o.SequenceNumber } @@ -1304,18 +822,12 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Tracking) { toSerialize["tracking"] = o.Tracking } - if !common.IsNil(o.TransactionId) { - toSerialize["transactionId"] = o.TransactionId - } if !common.IsNil(o.TransactionRulesResult) { toSerialize["transactionRulesResult"] = o.TransactionRulesResult } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } - if !common.IsNil(o.ValidationFacts) { - toSerialize["validationFacts"] = o.ValidationFacts - } return toSerialize, nil } @@ -1373,44 +885,8 @@ func (o *TransferData) isValidDirection() bool { } return false } -func (o *TransferData) isValidPanEntryMode() bool { - var allowedEnumValues = []string{"chip", "cof", "contactless", "ecommerce", "magstripe", "manual", "token"} - for _, allowed := range allowedEnumValues { - if o.GetPanEntryMode() == allowed { - return true - } - } - return false -} -func (o *TransferData) isValidPlatformPaymentType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "PaymentFee", "VAT"} - for _, allowed := range allowedEnumValues { - if o.GetPlatformPaymentType() == allowed { - return true - } - } - return false -} -func (o *TransferData) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false -} -func (o *TransferData) isValidProcessingType() bool { - var allowedEnumValues = []string{"atmWithdraw", "balanceInquiry", "ecommerce", "moto", "pos", "purchaseWithCashback", "recurring", "token"} - for _, allowed := range allowedEnumValues { - if o.GetProcessingType() == allowed { - return true - } - } - return false -} func (o *TransferData) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true @@ -1419,7 +895,7 @@ func (o *TransferData) isValidReason() bool { return false } func (o *TransferData) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true @@ -1428,7 +904,7 @@ func (o *TransferData) isValidStatus() bool { return false } func (o *TransferData) isValidType() bool { - var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "chargeback", "chargebackReversal", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback"} + var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceMigration", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "cashOutFee", "cashOutFunding", "cashOutInstruction", "chargeback", "chargebackCorrection", "chargebackReversal", "chargebackReversalCorrection", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback", "secondChargebackCorrection"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/transferwebhook/model_transfer_data_category_data.go b/src/transferwebhook/model_transfer_data_category_data.go new file mode 100644 index 000000000..7250ffb3d --- /dev/null +++ b/src/transferwebhook/model_transfer_data_category_data.go @@ -0,0 +1,203 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + "fmt" +) + +// TransferDataCategoryData - The relevant data according to the transfer category. +type TransferDataCategoryData struct { + BankCategoryData *BankCategoryData + InternalCategoryData *InternalCategoryData + IssuedCard *IssuedCard + PlatformPayment *PlatformPayment +} + +// BankCategoryDataAsTransferDataCategoryData is a convenience function that returns BankCategoryData wrapped in TransferDataCategoryData +func BankCategoryDataAsTransferDataCategoryData(v *BankCategoryData) TransferDataCategoryData { + return TransferDataCategoryData{ + BankCategoryData: v, + } +} + +// InternalCategoryDataAsTransferDataCategoryData is a convenience function that returns InternalCategoryData wrapped in TransferDataCategoryData +func InternalCategoryDataAsTransferDataCategoryData(v *InternalCategoryData) TransferDataCategoryData { + return TransferDataCategoryData{ + InternalCategoryData: v, + } +} + +// IssuedCardAsTransferDataCategoryData is a convenience function that returns IssuedCard wrapped in TransferDataCategoryData +func IssuedCardAsTransferDataCategoryData(v *IssuedCard) TransferDataCategoryData { + return TransferDataCategoryData{ + IssuedCard: v, + } +} + +// PlatformPaymentAsTransferDataCategoryData is a convenience function that returns PlatformPayment wrapped in TransferDataCategoryData +func PlatformPaymentAsTransferDataCategoryData(v *PlatformPayment) TransferDataCategoryData { + return TransferDataCategoryData{ + PlatformPayment: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferDataCategoryData) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into BankCategoryData + err = json.Unmarshal(data, &dst.BankCategoryData) + if err == nil { + jsonBankCategoryData, _ := json.Marshal(dst.BankCategoryData) + if string(jsonBankCategoryData) == "{}" || !dst.BankCategoryData.isValidType() { // empty struct + dst.BankCategoryData = nil + } else { + match++ + } + } else { + dst.BankCategoryData = nil + } + + // try to unmarshal data into InternalCategoryData + err = json.Unmarshal(data, &dst.InternalCategoryData) + if err == nil { + jsonInternalCategoryData, _ := json.Marshal(dst.InternalCategoryData) + if string(jsonInternalCategoryData) == "{}" || !dst.InternalCategoryData.isValidType() { // empty struct + dst.InternalCategoryData = nil + } else { + match++ + } + } else { + dst.InternalCategoryData = nil + } + + // try to unmarshal data into IssuedCard + err = json.Unmarshal(data, &dst.IssuedCard) + if err == nil { + jsonIssuedCard, _ := json.Marshal(dst.IssuedCard) + if string(jsonIssuedCard) == "{}" || !dst.IssuedCard.isValidType() { // empty struct + dst.IssuedCard = nil + } else { + match++ + } + } else { + dst.IssuedCard = nil + } + + // try to unmarshal data into PlatformPayment + err = json.Unmarshal(data, &dst.PlatformPayment) + if err == nil { + jsonPlatformPayment, _ := json.Marshal(dst.PlatformPayment) + if string(jsonPlatformPayment) == "{}" || !dst.PlatformPayment.isValidType() { // empty struct + dst.PlatformPayment = nil + } else { + match++ + } + } else { + dst.PlatformPayment = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.BankCategoryData = nil + dst.InternalCategoryData = nil + dst.IssuedCard = nil + dst.PlatformPayment = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferDataCategoryData)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferDataCategoryData)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferDataCategoryData) MarshalJSON() ([]byte, error) { + if src.BankCategoryData != nil { + return json.Marshal(&src.BankCategoryData) + } + + if src.InternalCategoryData != nil { + return json.Marshal(&src.InternalCategoryData) + } + + if src.IssuedCard != nil { + return json.Marshal(&src.IssuedCard) + } + + if src.PlatformPayment != nil { + return json.Marshal(&src.PlatformPayment) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferDataCategoryData) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BankCategoryData != nil { + return obj.BankCategoryData + } + + if obj.InternalCategoryData != nil { + return obj.InternalCategoryData + } + + if obj.IssuedCard != nil { + return obj.IssuedCard + } + + if obj.PlatformPayment != nil { + return obj.PlatformPayment + } + + // all schemas are nil + return nil +} + +type NullableTransferDataCategoryData struct { + value *TransferDataCategoryData + isSet bool +} + +func (v NullableTransferDataCategoryData) Get() *TransferDataCategoryData { + return v.value +} + +func (v *NullableTransferDataCategoryData) Set(val *TransferDataCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferDataCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferDataCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferDataCategoryData(val *TransferDataCategoryData) *NullableTransferDataCategoryData { + return &NullableTransferDataCategoryData{value: val, isSet: true} +} + +func (v NullableTransferDataCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferDataCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transferwebhook/model_transfer_event.go b/src/transferwebhook/model_transfer_event.go index 2f1ec1613..5e27a90d5 100644 --- a/src/transferwebhook/model_transfer_event.go +++ b/src/transferwebhook/model_transfer_event.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,17 +28,21 @@ type TransferEvent struct { // The estimated time the beneficiary should have access to the funds. EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` // The unique identifier of the transfer event. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + Modification *Modification `json:"modification,omitempty"` // The list of the balance mutation per event. Mutations []BalanceMutation `json:"mutations,omitempty"` OriginalAmount *Amount `json:"originalAmount,omitempty"` // The reason for the transfer status. Reason *string `json:"reason,omitempty"` + // SchemeTraceID retrieved from scheme. + SchemeTraceID *string `json:"schemeTraceID,omitempty"` + // SchemeUniqueTransactionID retrieved from scheme. + SchemeUniqueTransactionID *string `json:"schemeUniqueTransactionID,omitempty"` // The status of the transfer event. Status *string `json:"status,omitempty"` // The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. - TransactionId *string `json:"transactionId,omitempty"` - TransferOperation *TransferOperation `json:"transferOperation,omitempty"` + TransactionId *string `json:"transactionId,omitempty"` // The type of the transfer event. Possible values: **accounting**, **tracking**. Type *string `json:"type,omitempty"` // The date when the tracking status was updated. @@ -224,6 +228,38 @@ func (o *TransferEvent) SetId(v string) { o.Id = &v } +// GetModification returns the Modification field value if set, zero value otherwise. +func (o *TransferEvent) GetModification() Modification { + if o == nil || common.IsNil(o.Modification) { + var ret Modification + return ret + } + return *o.Modification +} + +// GetModificationOk returns a tuple with the Modification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetModificationOk() (*Modification, bool) { + if o == nil || common.IsNil(o.Modification) { + return nil, false + } + return o.Modification, true +} + +// HasModification returns a boolean if a field has been set. +func (o *TransferEvent) HasModification() bool { + if o != nil && !common.IsNil(o.Modification) { + return true + } + + return false +} + +// SetModification gets a reference to the given Modification and assigns it to the Modification field. +func (o *TransferEvent) SetModification(v Modification) { + o.Modification = &v +} + // GetMutations returns the Mutations field value if set, zero value otherwise. func (o *TransferEvent) GetMutations() []BalanceMutation { if o == nil || common.IsNil(o.Mutations) { @@ -320,6 +356,70 @@ func (o *TransferEvent) SetReason(v string) { o.Reason = &v } +// GetSchemeTraceID returns the SchemeTraceID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeTraceID() string { + if o == nil || common.IsNil(o.SchemeTraceID) { + var ret string + return ret + } + return *o.SchemeTraceID +} + +// GetSchemeTraceIDOk returns a tuple with the SchemeTraceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeTraceIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeTraceID) { + return nil, false + } + return o.SchemeTraceID, true +} + +// HasSchemeTraceID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeTraceID() bool { + if o != nil && !common.IsNil(o.SchemeTraceID) { + return true + } + + return false +} + +// SetSchemeTraceID gets a reference to the given string and assigns it to the SchemeTraceID field. +func (o *TransferEvent) SetSchemeTraceID(v string) { + o.SchemeTraceID = &v +} + +// GetSchemeUniqueTransactionID returns the SchemeUniqueTransactionID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeUniqueTransactionID() string { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + var ret string + return ret + } + return *o.SchemeUniqueTransactionID +} + +// GetSchemeUniqueTransactionIDOk returns a tuple with the SchemeUniqueTransactionID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeUniqueTransactionIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + return nil, false + } + return o.SchemeUniqueTransactionID, true +} + +// HasSchemeUniqueTransactionID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeUniqueTransactionID() bool { + if o != nil && !common.IsNil(o.SchemeUniqueTransactionID) { + return true + } + + return false +} + +// SetSchemeUniqueTransactionID gets a reference to the given string and assigns it to the SchemeUniqueTransactionID field. +func (o *TransferEvent) SetSchemeUniqueTransactionID(v string) { + o.SchemeUniqueTransactionID = &v +} + // GetStatus returns the Status field value if set, zero value otherwise. func (o *TransferEvent) GetStatus() string { if o == nil || common.IsNil(o.Status) { @@ -384,38 +484,6 @@ func (o *TransferEvent) SetTransactionId(v string) { o.TransactionId = &v } -// GetTransferOperation returns the TransferOperation field value if set, zero value otherwise. -func (o *TransferEvent) GetTransferOperation() TransferOperation { - if o == nil || common.IsNil(o.TransferOperation) { - var ret TransferOperation - return ret - } - return *o.TransferOperation -} - -// GetTransferOperationOk returns a tuple with the TransferOperation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferEvent) GetTransferOperationOk() (*TransferOperation, bool) { - if o == nil || common.IsNil(o.TransferOperation) { - return nil, false - } - return o.TransferOperation, true -} - -// HasTransferOperation returns a boolean if a field has been set. -func (o *TransferEvent) HasTransferOperation() bool { - if o != nil && !common.IsNil(o.TransferOperation) { - return true - } - - return false -} - -// SetTransferOperation gets a reference to the given TransferOperation and assigns it to the TransferOperation field. -func (o *TransferEvent) SetTransferOperation(v TransferOperation) { - o.TransferOperation = &v -} - // GetType returns the Type field value if set, zero value otherwise. func (o *TransferEvent) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -537,6 +605,9 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Id) { toSerialize["id"] = o.Id } + if !common.IsNil(o.Modification) { + toSerialize["modification"] = o.Modification + } if !common.IsNil(o.Mutations) { toSerialize["mutations"] = o.Mutations } @@ -546,15 +617,18 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Reason) { toSerialize["reason"] = o.Reason } + if !common.IsNil(o.SchemeTraceID) { + toSerialize["schemeTraceID"] = o.SchemeTraceID + } + if !common.IsNil(o.SchemeUniqueTransactionID) { + toSerialize["schemeUniqueTransactionID"] = o.SchemeUniqueTransactionID + } if !common.IsNil(o.Status) { toSerialize["status"] = o.Status } if !common.IsNil(o.TransactionId) { toSerialize["transactionId"] = o.TransactionId } - if !common.IsNil(o.TransferOperation) { - toSerialize["transferOperation"] = o.TransferOperation - } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } @@ -604,7 +678,7 @@ func (v *NullableTransferEvent) UnmarshalJSON(src []byte) error { } func (o *TransferEvent) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} for _, allowed := range allowedEnumValues { if o.GetReason() == allowed { return true @@ -613,7 +687,7 @@ func (o *TransferEvent) isValidReason() bool { return false } func (o *TransferEvent) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true diff --git a/src/transferwebhook/model_transfer_notification_request.go b/src/transferwebhook/model_transfer_notification_request.go index df09ce6fb..ba32057c1 100644 --- a/src/transferwebhook/model_transfer_notification_request.go +++ b/src/transferwebhook/model_transfer_notification_request.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transfer_notification_transfer_tracking.go b/src/transferwebhook/model_transfer_notification_transfer_tracking.go index 1c6673738..73149f240 100644 --- a/src/transferwebhook/model_transfer_notification_transfer_tracking.go +++ b/src/transferwebhook/model_transfer_notification_transfer_tracking.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transfer_notification_validation_fact.go b/src/transferwebhook/model_transfer_notification_validation_fact.go index e3c9e050c..615542d0b 100644 --- a/src/transferwebhook/model_transfer_notification_validation_fact.go +++ b/src/transferwebhook/model_transfer_notification_validation_fact.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_uk_local_account_identification.go b/src/transferwebhook/model_uk_local_account_identification.go index 51f2181c8..a2adbfa5a 100644 --- a/src/transferwebhook/model_uk_local_account_identification.go +++ b/src/transferwebhook/model_uk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_us_local_account_identification.go b/src/transferwebhook/model_us_local_account_identification.go index df4be937f..665fadb94 100644 --- a/src/transferwebhook/model_us_local_account_identification.go +++ b/src/transferwebhook/model_us_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/tests/payment_test.go b/tests/payment_test.go index 22187275e..f6195eed3 100644 --- a/tests/payment_test.go +++ b/tests/payment_test.go @@ -63,22 +63,22 @@ func Test_Payment(t *testing.T) { Reference: time.Now().String(), MerchantAccount: MerchantAccount, } - req := service.GeneralApi.AuthoriseInput().PaymentRequest(body) - return service.GeneralApi.Authorise(context.Background(), req) + req := service.PaymentsApi.AuthoriseInput().PaymentRequest(body) + return service.PaymentsApi.Authorise(context.Background(), req) } t.Run("General", func(t *testing.T) { t.Run("Authorise3d", func(t *testing.T) { t.Skip("skipping since 3d requires manual user authentication") - req := service.GeneralApi.Authorise3dInput().PaymentRequest3d(payments.PaymentRequest3d{}) - res, httpRes, err := service.GeneralApi.Authorise3d(context.Background(), req) + req := service.PaymentsApi.Authorise3dInput().PaymentRequest3d(payments.PaymentRequest3d{}) + res, httpRes, err := service.PaymentsApi.Authorise3d(context.Background(), req) assertForSuccessResponse(res, httpRes, err) }) t.Run("Authorise3ds2", func(t *testing.T) { t.Skip("skipping since 3d requires manual user authentication") - req := service.GeneralApi.Authorise3ds2Input().PaymentRequest3ds2(payments.PaymentRequest3ds2{}) - res, httpRes, err := service.GeneralApi.Authorise3ds2(context.Background(), req) + req := service.PaymentsApi.Authorise3ds2Input().PaymentRequest3ds2(payments.PaymentRequest3ds2{}) + res, httpRes, err := service.PaymentsApi.Authorise3ds2(context.Background(), req) assertForSuccessResponse(res, httpRes, err) }) @@ -92,15 +92,15 @@ func Test_Payment(t *testing.T) { t.Run("GetAuthenticationResult", func(t *testing.T) { t.Skip("skipping since this returns auth result after a 3d auth") - req := service.GeneralApi.GetAuthenticationResultInput() - res, httpRes, err := service.GeneralApi.GetAuthenticationResult(context.Background(), req) + req := service.PaymentsApi.GetAuthenticationResultInput() + res, httpRes, err := service.PaymentsApi.GetAuthenticationResult(context.Background(), req) assertForSuccessResponse(res, httpRes, err) }) t.Run("Retrieve3ds2Result", func(t *testing.T) { t.Skip("skipping since this returns auth result after a 3d auth") - req := service.GeneralApi.Retrieve3ds2ResultInput() - res, httpRes, err := service.GeneralApi.Retrieve3ds2Result(context.Background(), req) + req := service.PaymentsApi.Retrieve3ds2ResultInput() + res, httpRes, err := service.PaymentsApi.Retrieve3ds2Result(context.Background(), req) assertForSuccessResponse(res, httpRes, err) }) }) From ca507c70547877fe54f91d561d208b4a3e5ec4ba Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Mon, 6 Nov 2023 13:17:49 +0100 Subject: [PATCH 5/9] Upgrade Checkout to v71 (#263) --- Makefile | 2 +- Readme.md | 2 +- src/adyen/api.go | 2 +- src/checkout/api_classic_checkout_sdk.go | 2 +- src/checkout/api_modifications.go | 2 +- src/checkout/api_orders.go | 2 +- src/checkout/api_payment_links.go | 2 +- src/checkout/api_payments.go | 2 +- src/checkout/api_recurring.go | 2 +- src/checkout/api_utility.go | 2 +- src/checkout/client.go | 4 +- src/checkout/model_account_info.go | 2 +- src/checkout/model_acct_info.go | 2 +- src/checkout/model_ach_details.go | 2 +- .../model_additional_data3_d_secure.go | 2 +- src/checkout/model_additional_data_airline.go | 2 +- .../model_additional_data_car_rental.go | 2 +- src/checkout/model_additional_data_common.go | 2 +- src/checkout/model_additional_data_level23.go | 2 +- src/checkout/model_additional_data_lodging.go | 2 +- .../model_additional_data_open_invoice.go | 2 +- src/checkout/model_additional_data_opi.go | 2 +- src/checkout/model_additional_data_ratepay.go | 2 +- src/checkout/model_additional_data_retry.go | 2 +- src/checkout/model_additional_data_risk.go | 2 +- .../model_additional_data_risk_standalone.go | 2 +- .../model_additional_data_sub_merchant.go | 2 +- ...odel_additional_data_temporary_services.go | 2 +- src/checkout/model_additional_data_wallets.go | 2 +- src/checkout/model_address.go | 2 +- src/checkout/model_afterpay_details.go | 2 +- src/checkout/model_amazon_pay_details.go | 2 +- src/checkout/model_amount.go | 2 +- src/checkout/model_android_pay_details.go | 2 +- src/checkout/model_apple_pay_details.go | 2 +- .../model_apple_pay_session_request.go | 2 +- .../model_apple_pay_session_response.go | 2 +- src/checkout/model_application_info.go | 2 +- src/checkout/model_authentication_data.go | 2 +- src/checkout/model_avs.go | 2 +- .../model_bacs_direct_debit_details.go | 2 +- src/checkout/model_balance_check_request.go | 2 +- src/checkout/model_balance_check_response.go | 2 +- src/checkout/model_bank_account.go | 2 +- src/checkout/model_bill_desk_details.go | 2 +- src/checkout/model_billing_address.go | 2 +- src/checkout/model_blik_details.go | 2 +- src/checkout/model_browser_info.go | 2 +- src/checkout/model_cancel_order_request.go | 2 +- src/checkout/model_cancel_order_response.go | 2 +- src/checkout/model_card.go | 2 +- src/checkout/model_card_brand_details.go | 2 +- src/checkout/model_card_details.go | 2 +- src/checkout/model_card_details_request.go | 2 +- src/checkout/model_card_details_response.go | 2 +- src/checkout/model_cellulant_details.go | 2 +- src/checkout/model_checkout_await_action.go | 2 +- ...heckout_delegated_authentication_action.go | 2 +- .../model_checkout_native_redirect_action.go | 2 +- src/checkout/model_checkout_order_response.go | 2 +- src/checkout/model_checkout_payment_method.go | 2 +- src/checkout/model_checkout_qr_code_action.go | 2 +- .../model_checkout_redirect_action.go | 2 +- src/checkout/model_checkout_sdk_action.go | 2 +- ...del_checkout_session_installment_option.go | 2 +- .../model_checkout_three_ds2_action.go | 2 +- src/checkout/model_checkout_voucher_action.go | 2 +- src/checkout/model_common_field.go | 2 +- src/checkout/model_company.go | 2 +- src/checkout/model_configuration.go | 2 +- .../model_create_checkout_session_request.go | 54 +- .../model_create_checkout_session_response.go | 2 +- src/checkout/model_create_order_request.go | 2 +- src/checkout/model_create_order_response.go | 2 +- src/checkout/model_delivery_address.go | 2 +- ...del_details_request_authentication_data.go | 2 +- src/checkout/model_device_render_options.go | 2 +- src/checkout/model_doku_details.go | 2 +- src/checkout/model_donation_payment_method.go | 2 +- .../model_donation_payment_request.go | 1522 ++--------------- .../model_donation_payment_response.go | 2 +- src/checkout/model_dotpay_details.go | 2 +- src/checkout/model_dragonpay_details.go | 2 +- .../model_econtext_voucher_details.go | 2 +- src/checkout/model_encrypted_order_data.go | 2 +- src/checkout/model_external_platform.go | 2 +- src/checkout/model_forex_quote.go | 2 +- src/checkout/model_fraud_check_result.go | 2 +- src/checkout/model_fraud_result.go | 2 +- src/checkout/model_fund_origin.go | 2 +- src/checkout/model_fund_recipient.go | 2 +- ...l_generic_issuer_payment_method_details.go | 2 +- src/checkout/model_giropay_details.go | 2 +- src/checkout/model_google_pay_details.go | 2 +- src/checkout/model_ideal_details.go | 2 +- src/checkout/model_input_detail.go | 2 +- src/checkout/model_installment_option.go | 2 +- src/checkout/model_installments.go | 2 +- src/checkout/model_installments_number.go | 2 +- src/checkout/model_item.go | 2 +- src/checkout/model_klarna_details.go | 2 +- src/checkout/model_line_item.go | 2 +- ...el_list_stored_payment_methods_response.go | 2 +- src/checkout/model_mandate.go | 2 +- src/checkout/model_masterpass_details.go | 2 +- src/checkout/model_mbway_details.go | 2 +- src/checkout/model_merchant_device.go | 2 +- src/checkout/model_merchant_risk_indicator.go | 2 +- src/checkout/model_mobile_pay_details.go | 2 +- src/checkout/model_mol_pay_details.go | 2 +- src/checkout/model_name.go | 2 +- src/checkout/model_open_invoice_details.go | 2 +- src/checkout/model_pay_pal_details.go | 2 +- src/checkout/model_pay_u_upi_details.go | 2 +- src/checkout/model_pay_with_google_details.go | 2 +- .../model_payment_amount_update_request.go | 2 +- .../model_payment_amount_update_response.go | 39 +- src/checkout/model_payment_cancel_request.go | 2 +- src/checkout/model_payment_cancel_response.go | 2 +- src/checkout/model_payment_capture_request.go | 2 +- .../model_payment_capture_response.go | 2 +- .../model_payment_completion_details.go | 2 +- src/checkout/model_payment_details.go | 2 +- src/checkout/model_payment_details_request.go | 2 +- .../model_payment_details_response.go | 2 +- src/checkout/model_payment_link_request.go | 16 +- src/checkout/model_payment_link_response.go | 16 +- src/checkout/model_payment_method.go | 2 +- src/checkout/model_payment_method_group.go | 2 +- src/checkout/model_payment_method_issuer.go | 2 +- src/checkout/model_payment_methods_request.go | 2 +- .../model_payment_methods_response.go | 2 +- src/checkout/model_payment_refund_request.go | 2 +- src/checkout/model_payment_refund_response.go | 2 +- src/checkout/model_payment_request.go | 16 +- src/checkout/model_payment_response.go | 2 +- src/checkout/model_payment_response_action.go | 2 +- .../model_payment_reversal_request.go | 2 +- .../model_payment_reversal_response.go | 2 +- src/checkout/model_payment_setup_request.go | 2 +- src/checkout/model_payment_setup_response.go | 2 +- .../model_payment_verification_request.go | 2 +- .../model_payment_verification_response.go | 16 +- src/checkout/model_phone.go | 2 +- .../model_platform_chargeback_logic.go | 2 +- src/checkout/model_ratepay_details.go | 2 +- src/checkout/model_recurring.go | 4 +- src/checkout/model_recurring_detail.go | 2 +- ...odel_response_additional_data3_d_secure.go | 2 +- ...esponse_additional_data_billing_address.go | 2 +- .../model_response_additional_data_card.go | 2 +- .../model_response_additional_data_common.go | 2 +- ...l_response_additional_data_installments.go | 2 +- ...response_additional_data_network_tokens.go | 2 +- .../model_response_additional_data_opi.go | 2 +- .../model_response_additional_data_sepa.go | 2 +- src/checkout/model_response_payment_method.go | 2 +- src/checkout/model_risk_data.go | 2 +- src/checkout/model_samsung_pay_details.go | 2 +- src/checkout/model_sdk_ephem_pub_key.go | 2 +- .../model_sepa_direct_debit_details.go | 2 +- src/checkout/model_service_error.go | 2 +- ...or_2.go => model_service_error_details.go} | 78 +- src/checkout/model_session_result_response.go | 2 +- src/checkout/model_shopper_input.go | 2 +- .../model_shopper_interaction_device.go | 2 +- src/checkout/model_split.go | 2 +- src/checkout/model_split_amount.go | 2 +- ...model_standalone_payment_cancel_request.go | 2 +- ...odel_standalone_payment_cancel_response.go | 2 +- src/checkout/model_stored_details.go | 2 +- src/checkout/model_stored_payment_method.go | 2 +- .../model_stored_payment_method_details.go | 2 +- .../model_stored_payment_method_resource.go | 2 +- src/checkout/model_sub_input_detail.go | 2 +- src/checkout/model_sub_merchant.go | 2 +- src/checkout/model_sub_merchant_info.go | 2 +- src/checkout/model_three_d_secure_data.go | 2 +- src/checkout/model_three_ds2_request_data.go | 2 +- ...2.go => model_three_ds2_request_fields.go} | 346 ++-- src/checkout/model_three_ds2_response_data.go | 2 +- src/checkout/model_three_ds2_result.go | 2 +- src/checkout/model_three_ds_request_data.go | 2 +- ..._three_ds_requestor_authentication_info.go | 2 +- ..._ds_requestor_prior_authentication_info.go | 2 +- .../model_update_payment_link_request.go | 2 +- src/checkout/model_upi_collect_details.go | 2 +- src/checkout/model_upi_intent_details.go | 2 +- src/checkout/model_utility_request.go | 2 +- src/checkout/model_utility_response.go | 2 +- src/checkout/model_vipps_details.go | 2 +- src/checkout/model_visa_checkout_details.go | 2 +- src/checkout/model_we_chat_pay_details.go | 2 +- .../model_we_chat_pay_mini_program_details.go | 2 +- src/checkout/model_zip_details.go | 2 +- src/common/utils.go | 11 - tests/checkout/integration_test.go | 5 +- tests/readme_test.go | 2 +- 198 files changed, 668 insertions(+), 1829 deletions(-) rename src/checkout/{model_service_error_2.go => model_service_error_details.go} (65%) rename src/checkout/{model_three_ds2_request_data_2.go => model_three_ds2_request_fields.go} (78%) diff --git a/Makefile b/Makefile index b29149b96..3502f0ce6 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ configurationwebhook: spec=BalancePlatformConfigurationNotification-v1 reportwebhook: spec=BalancePlatformReportNotification-v1 transferwebhook: spec=BalancePlatformTransferNotification-v4 binlookup: spec=BinLookupService-v54 -checkout: spec=CheckoutService-v70 +checkout: spec=CheckoutService-v71 checkout: serviceName=Checkout legalentity: spec=LegalEntityService-v3 legalentity: serviceName=LegalEntity diff --git a/Readme.md b/Readme.md index 5d0014ccf..b63bc23df 100644 --- a/Readme.md +++ b/Readme.md @@ -12,7 +12,7 @@ The Library supports all APIs under the following services: | API | Description | Service constructor | Supported version | |------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|-------------------| -| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Our latest integration for accepting online payments. | client.Checkout() | **v70** | +| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Our latest integration for accepting online payments. | client.Checkout() | **v71** | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | Endpoints for sending funds to your customers. | client.Payout() | **v68** | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | Endpoints for managing saved payment details. | client.Recurring() | **v68** | | [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | client.BinLookup() | **v54** | diff --git a/src/adyen/api.go b/src/adyen/api.go index 4e0c633c2..2760972d3 100644 --- a/src/adyen/api.go +++ b/src/adyen/api.go @@ -66,7 +66,7 @@ const ( MarketpayHopAPIVersion = "v6" PaymentAPIVersion = "v68" RecurringAPIVersion = "v68" - CheckoutAPIVersion = "v70" + CheckoutAPIVersion = "v71" BinLookupAPIVersion = "v54" BalanceControlAPIVersion = "v1" EndpointProtocol = "https://" diff --git a/src/checkout/api_classic_checkout_sdk.go b/src/checkout/api_classic_checkout_sdk.go index 25df0fff1..2121d5974 100644 --- a/src/checkout/api_classic_checkout_sdk.go +++ b/src/checkout/api_classic_checkout_sdk.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_modifications.go b/src/checkout/api_modifications.go index 6782d7ba0..0ba8623b1 100644 --- a/src/checkout/api_modifications.go +++ b/src/checkout/api_modifications.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index adb16656c..5c2cf9ead 100644 --- a/src/checkout/api_orders.go +++ b/src/checkout/api_orders.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index 3c74f91fb..e3a75537b 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index 180745258..52a0ece58 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index 3344a221e..56df4ec1c 100644 --- a/src/checkout/api_recurring.go +++ b/src/checkout/api_recurring.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index ca8f91d74..4cd036b82 100644 --- a/src/checkout/api_utility.go +++ b/src/checkout/api_utility.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/client.go b/src/checkout/client.go index 55902f2ea..5b272cc1b 100644 --- a/src/checkout/client.go +++ b/src/checkout/client.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -12,7 +12,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/common" ) -// APIClient manages communication with the Adyen Checkout API API v70 +// APIClient manages communication with the Adyen Checkout API API v71 // In most cases there should be only one, shared, APIClient. type APIClient struct { common common.Service // Reuse a single struct instead of allocating one for each service on the heap. diff --git a/src/checkout/model_account_info.go b/src/checkout/model_account_info.go index 1754eaf6e..bb6a6052a 100644 --- a/src/checkout/model_account_info.go +++ b/src/checkout/model_account_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_acct_info.go b/src/checkout/model_acct_info.go index b8b7c2577..f46063160 100644 --- a/src/checkout/model_acct_info.go +++ b/src/checkout/model_acct_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_ach_details.go b/src/checkout/model_ach_details.go index 322f8cf2a..975102435 100644 --- a/src/checkout/model_ach_details.go +++ b/src/checkout/model_ach_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data3_d_secure.go b/src/checkout/model_additional_data3_d_secure.go index 845a18abd..f8bce927b 100644 --- a/src/checkout/model_additional_data3_d_secure.go +++ b/src/checkout/model_additional_data3_d_secure.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_airline.go b/src/checkout/model_additional_data_airline.go index 8d6fde8d8..924ae2619 100644 --- a/src/checkout/model_additional_data_airline.go +++ b/src/checkout/model_additional_data_airline.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_car_rental.go b/src/checkout/model_additional_data_car_rental.go index 6437ed896..373067011 100644 --- a/src/checkout/model_additional_data_car_rental.go +++ b/src/checkout/model_additional_data_car_rental.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_common.go b/src/checkout/model_additional_data_common.go index 5e866926b..5394abc2d 100644 --- a/src/checkout/model_additional_data_common.go +++ b/src/checkout/model_additional_data_common.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_level23.go b/src/checkout/model_additional_data_level23.go index b6ebf9f9a..c1e7a7883 100644 --- a/src/checkout/model_additional_data_level23.go +++ b/src/checkout/model_additional_data_level23.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_lodging.go b/src/checkout/model_additional_data_lodging.go index 3fa00957f..1f55813d2 100644 --- a/src/checkout/model_additional_data_lodging.go +++ b/src/checkout/model_additional_data_lodging.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_open_invoice.go b/src/checkout/model_additional_data_open_invoice.go index d19c843d4..0969e35a2 100644 --- a/src/checkout/model_additional_data_open_invoice.go +++ b/src/checkout/model_additional_data_open_invoice.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_opi.go b/src/checkout/model_additional_data_opi.go index 06d9f4211..7c4575ce6 100644 --- a/src/checkout/model_additional_data_opi.go +++ b/src/checkout/model_additional_data_opi.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_ratepay.go b/src/checkout/model_additional_data_ratepay.go index b18f120f5..22017a538 100644 --- a/src/checkout/model_additional_data_ratepay.go +++ b/src/checkout/model_additional_data_ratepay.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_retry.go b/src/checkout/model_additional_data_retry.go index 8a16fe456..123f549e2 100644 --- a/src/checkout/model_additional_data_retry.go +++ b/src/checkout/model_additional_data_retry.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_risk.go b/src/checkout/model_additional_data_risk.go index 86566187f..05a7c7315 100644 --- a/src/checkout/model_additional_data_risk.go +++ b/src/checkout/model_additional_data_risk.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_risk_standalone.go b/src/checkout/model_additional_data_risk_standalone.go index c0de15442..a7ef7a042 100644 --- a/src/checkout/model_additional_data_risk_standalone.go +++ b/src/checkout/model_additional_data_risk_standalone.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_sub_merchant.go b/src/checkout/model_additional_data_sub_merchant.go index d6583300c..059bece54 100644 --- a/src/checkout/model_additional_data_sub_merchant.go +++ b/src/checkout/model_additional_data_sub_merchant.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_temporary_services.go b/src/checkout/model_additional_data_temporary_services.go index 8760d41c2..bb80d7255 100644 --- a/src/checkout/model_additional_data_temporary_services.go +++ b/src/checkout/model_additional_data_temporary_services.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_additional_data_wallets.go b/src/checkout/model_additional_data_wallets.go index 885cc4d16..b7d4a79f4 100644 --- a/src/checkout/model_additional_data_wallets.go +++ b/src/checkout/model_additional_data_wallets.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_address.go b/src/checkout/model_address.go index f7e879f7f..33d8e7c42 100644 --- a/src/checkout/model_address.go +++ b/src/checkout/model_address.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_afterpay_details.go b/src/checkout/model_afterpay_details.go index c8ad19ce5..d07076182 100644 --- a/src/checkout/model_afterpay_details.go +++ b/src/checkout/model_afterpay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_amazon_pay_details.go b/src/checkout/model_amazon_pay_details.go index 27381828e..35c24c009 100644 --- a/src/checkout/model_amazon_pay_details.go +++ b/src/checkout/model_amazon_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_amount.go b/src/checkout/model_amount.go index cf71dc406..14259071d 100644 --- a/src/checkout/model_amount.go +++ b/src/checkout/model_amount.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_android_pay_details.go b/src/checkout/model_android_pay_details.go index 64da29ba4..6a984cae4 100644 --- a/src/checkout/model_android_pay_details.go +++ b/src/checkout/model_android_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_apple_pay_details.go b/src/checkout/model_apple_pay_details.go index dcbc19fd0..2ae73e72b 100644 --- a/src/checkout/model_apple_pay_details.go +++ b/src/checkout/model_apple_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_apple_pay_session_request.go b/src/checkout/model_apple_pay_session_request.go index f44049451..5ba08d959 100644 --- a/src/checkout/model_apple_pay_session_request.go +++ b/src/checkout/model_apple_pay_session_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_apple_pay_session_response.go b/src/checkout/model_apple_pay_session_response.go index c585823b4..5e7e07f7b 100644 --- a/src/checkout/model_apple_pay_session_response.go +++ b/src/checkout/model_apple_pay_session_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_application_info.go b/src/checkout/model_application_info.go index 6ed3d8edc..f02577148 100644 --- a/src/checkout/model_application_info.go +++ b/src/checkout/model_application_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_authentication_data.go b/src/checkout/model_authentication_data.go index 37eeab0b7..b893f3d09 100644 --- a/src/checkout/model_authentication_data.go +++ b/src/checkout/model_authentication_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_avs.go b/src/checkout/model_avs.go index 9e89544df..7e9c093b8 100644 --- a/src/checkout/model_avs.go +++ b/src/checkout/model_avs.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_bacs_direct_debit_details.go b/src/checkout/model_bacs_direct_debit_details.go index e58329fb2..b6b5f0bee 100644 --- a/src/checkout/model_bacs_direct_debit_details.go +++ b/src/checkout/model_bacs_direct_debit_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_balance_check_request.go b/src/checkout/model_balance_check_request.go index 34308994d..8d9ce060d 100644 --- a/src/checkout/model_balance_check_request.go +++ b/src/checkout/model_balance_check_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_balance_check_response.go b/src/checkout/model_balance_check_response.go index 5bedc73af..bba0709b7 100644 --- a/src/checkout/model_balance_check_response.go +++ b/src/checkout/model_balance_check_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_bank_account.go b/src/checkout/model_bank_account.go index 20afc8c7c..166e1a548 100644 --- a/src/checkout/model_bank_account.go +++ b/src/checkout/model_bank_account.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_bill_desk_details.go b/src/checkout/model_bill_desk_details.go index d07cdaa5d..4f3ebd7ea 100644 --- a/src/checkout/model_bill_desk_details.go +++ b/src/checkout/model_bill_desk_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_billing_address.go b/src/checkout/model_billing_address.go index 31bcd8e98..a811cb698 100644 --- a/src/checkout/model_billing_address.go +++ b/src/checkout/model_billing_address.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_blik_details.go b/src/checkout/model_blik_details.go index ac055b9e4..24aac3515 100644 --- a/src/checkout/model_blik_details.go +++ b/src/checkout/model_blik_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_browser_info.go b/src/checkout/model_browser_info.go index 36b569c78..ec9e0298e 100644 --- a/src/checkout/model_browser_info.go +++ b/src/checkout/model_browser_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_cancel_order_request.go b/src/checkout/model_cancel_order_request.go index c1b0ac61d..54df21c08 100644 --- a/src/checkout/model_cancel_order_request.go +++ b/src/checkout/model_cancel_order_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_cancel_order_response.go b/src/checkout/model_cancel_order_response.go index 60c014191..f11071626 100644 --- a/src/checkout/model_cancel_order_response.go +++ b/src/checkout/model_cancel_order_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_card.go b/src/checkout/model_card.go index 5de656762..f1745867a 100644 --- a/src/checkout/model_card.go +++ b/src/checkout/model_card.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_card_brand_details.go b/src/checkout/model_card_brand_details.go index 538e14782..560575e6d 100644 --- a/src/checkout/model_card_brand_details.go +++ b/src/checkout/model_card_brand_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index 7e1e8b667..c8e076295 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_card_details_request.go b/src/checkout/model_card_details_request.go index 728be92ff..90ddf4061 100644 --- a/src/checkout/model_card_details_request.go +++ b/src/checkout/model_card_details_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_card_details_response.go b/src/checkout/model_card_details_response.go index 457cde674..54f8636d3 100644 --- a/src/checkout/model_card_details_response.go +++ b/src/checkout/model_card_details_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_cellulant_details.go b/src/checkout/model_cellulant_details.go index a492a302f..144a9af98 100644 --- a/src/checkout/model_cellulant_details.go +++ b/src/checkout/model_cellulant_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_await_action.go b/src/checkout/model_checkout_await_action.go index 2abdc5b52..07ffbd0de 100644 --- a/src/checkout/model_checkout_await_action.go +++ b/src/checkout/model_checkout_await_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_delegated_authentication_action.go b/src/checkout/model_checkout_delegated_authentication_action.go index 5e3ba3126..7d3886f9a 100644 --- a/src/checkout/model_checkout_delegated_authentication_action.go +++ b/src/checkout/model_checkout_delegated_authentication_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_native_redirect_action.go b/src/checkout/model_checkout_native_redirect_action.go index abd9218c3..eed84a01b 100644 --- a/src/checkout/model_checkout_native_redirect_action.go +++ b/src/checkout/model_checkout_native_redirect_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_order_response.go b/src/checkout/model_checkout_order_response.go index c5e09daae..a46d4648a 100644 --- a/src/checkout/model_checkout_order_response.go +++ b/src/checkout/model_checkout_order_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_payment_method.go b/src/checkout/model_checkout_payment_method.go index 87d0369a6..43f3abb1a 100644 --- a/src/checkout/model_checkout_payment_method.go +++ b/src/checkout/model_checkout_payment_method.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_qr_code_action.go b/src/checkout/model_checkout_qr_code_action.go index ea118a891..a6d2e7888 100644 --- a/src/checkout/model_checkout_qr_code_action.go +++ b/src/checkout/model_checkout_qr_code_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_redirect_action.go b/src/checkout/model_checkout_redirect_action.go index 01354c0ba..eabc44dbf 100644 --- a/src/checkout/model_checkout_redirect_action.go +++ b/src/checkout/model_checkout_redirect_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_sdk_action.go b/src/checkout/model_checkout_sdk_action.go index b59bec072..46bdb4fcd 100644 --- a/src/checkout/model_checkout_sdk_action.go +++ b/src/checkout/model_checkout_sdk_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_session_installment_option.go b/src/checkout/model_checkout_session_installment_option.go index 0001ebc48..839399721 100644 --- a/src/checkout/model_checkout_session_installment_option.go +++ b/src/checkout/model_checkout_session_installment_option.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_three_ds2_action.go b/src/checkout/model_checkout_three_ds2_action.go index 4230942f5..8f585e6d5 100644 --- a/src/checkout/model_checkout_three_ds2_action.go +++ b/src/checkout/model_checkout_three_ds2_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_checkout_voucher_action.go b/src/checkout/model_checkout_voucher_action.go index 2820d6837..b5c07b3aa 100644 --- a/src/checkout/model_checkout_voucher_action.go +++ b/src/checkout/model_checkout_voucher_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_common_field.go b/src/checkout/model_common_field.go index 4beee919f..43480e54d 100644 --- a/src/checkout/model_common_field.go +++ b/src/checkout/model_common_field.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_company.go b/src/checkout/model_company.go index 6ac17d0a1..3e1f6691b 100644 --- a/src/checkout/model_company.go +++ b/src/checkout/model_company.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_configuration.go b/src/checkout/model_configuration.go index f530ddff3..5490bc72c 100644 --- a/src/checkout/model_configuration.go +++ b/src/checkout/model_configuration.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index 4d05a9b9d..c71a4e6c1 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -66,7 +66,9 @@ type CreateCheckoutSessionRequest struct { // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + // Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration + Mode *string `json:"mode,omitempty"` MpiData *ThreeDSecureData `json:"mpiData,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. @@ -128,6 +130,8 @@ func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, refe this := CreateCheckoutSessionRequest{} this.Amount = amount this.MerchantAccount = merchantAccount + var mode string = "embedded" + this.Mode = &mode this.Reference = reference this.ReturnUrl = returnUrl var splitCardFundingSources bool = false @@ -142,6 +146,8 @@ func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, refe // but it doesn't guarantee that properties required by API are set func NewCreateCheckoutSessionRequestWithDefaults() *CreateCheckoutSessionRequest { this := CreateCheckoutSessionRequest{} + var mode string = "embedded" + this.Mode = &mode var splitCardFundingSources bool = false this.SplitCardFundingSources = &splitCardFundingSources var threeDSAuthenticationOnly bool = false @@ -1061,6 +1067,38 @@ func (o *CreateCheckoutSessionRequest) SetMetadata(v map[string]string) { o.Metadata = &v } +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetMode() string { + if o == nil || common.IsNil(o.Mode) { + var ret string + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetModeOk() (*string, bool) { + if o == nil || common.IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasMode() bool { + if o != nil && !common.IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given string and assigns it to the Mode field. +func (o *CreateCheckoutSessionRequest) SetMode(v string) { + o.Mode = &v +} + // GetMpiData returns the MpiData field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetMpiData() ThreeDSecureData { if o == nil || common.IsNil(o.MpiData) { @@ -2005,6 +2043,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } + if !common.IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } @@ -2130,6 +2171,15 @@ func (o *CreateCheckoutSessionRequest) isValidChannel() bool { } return false } +func (o *CreateCheckoutSessionRequest) isValidMode() bool { + var allowedEnumValues = []string{"embedded", "hosted"} + for _, allowed := range allowedEnumValues { + if o.GetMode() == allowed { + return true + } + } + return false +} func (o *CreateCheckoutSessionRequest) isValidRecurringProcessingModel() bool { var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index 87566c2f8..1b32daa1d 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_create_order_request.go b/src/checkout/model_create_order_request.go index 50e648755..4c80d262a 100644 --- a/src/checkout/model_create_order_request.go +++ b/src/checkout/model_create_order_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_create_order_response.go b/src/checkout/model_create_order_response.go index 66829efed..23db715b2 100644 --- a/src/checkout/model_create_order_response.go +++ b/src/checkout/model_create_order_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_delivery_address.go b/src/checkout/model_delivery_address.go index d62f616dd..9135eeb77 100644 --- a/src/checkout/model_delivery_address.go +++ b/src/checkout/model_delivery_address.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_details_request_authentication_data.go b/src/checkout/model_details_request_authentication_data.go index 34558b2e0..96f8327ba 100644 --- a/src/checkout/model_details_request_authentication_data.go +++ b/src/checkout/model_details_request_authentication_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_device_render_options.go b/src/checkout/model_device_render_options.go index a1cd9fced..cb376b7c6 100644 --- a/src/checkout/model_device_render_options.go +++ b/src/checkout/model_device_render_options.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_doku_details.go b/src/checkout/model_doku_details.go index 3e13a484e..db91456f6 100644 --- a/src/checkout/model_doku_details.go +++ b/src/checkout/model_doku_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_donation_payment_method.go b/src/checkout/model_donation_payment_method.go index 1924132aa..7d1f97c2b 100644 --- a/src/checkout/model_donation_payment_method.go +++ b/src/checkout/model_donation_payment_method.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index d6e27b80c..c3855bbc1 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,39 +20,28 @@ var _ common.MappedNullable = &DonationPaymentRequest{} // DonationPaymentRequest struct for DonationPaymentRequest type DonationPaymentRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *BillingAddress `json:"billingAddress,omitempty"` - // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` - BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` - // The delay between the authorisation and scheduled auto-capture, specified in hours. - CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web Channel *string `json:"channel,omitempty"` // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Company *Company `json:"company,omitempty"` + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. // Deprecated ConversionId *string `json:"conversionId,omitempty"` // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliverAt *time.Time `json:"deliverAt,omitempty"` DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` - // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // Donation account to which the transaction is credited. @@ -61,49 +50,17 @@ type DonationPaymentRequest struct { DonationOriginalPspReference *string `json:"donationOriginalPspReference,omitempty"` // Donation token received in the `/payments` call. DonationToken *string `json:"donationToken,omitempty"` - // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. - EnableOneClick *bool `json:"enableOneClick,omitempty"` - // When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - EnablePayOut *bool `json:"enablePayOut,omitempty"` - // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. - EnableRecurring *bool `json:"enableRecurring,omitempty"` - // The type of the entity the payment is processed for. - EntityType *string `json:"entityType,omitempty"` - // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` - FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` - // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - FundingSource *string `json:"fundingSource,omitempty"` - // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - IndustryUsage *string `json:"industryUsage,omitempty"` - Installments *Installments `json:"installments,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` - // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + MerchantAccount string `json:"merchantAccount"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` - Order *EncryptedOrderData `json:"order,omitempty"` - // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - Origin *string `json:"origin,omitempty"` - PaymentMethod DonationPaymentMethod `json:"paymentMethod"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` - // Date after which no further authorisations shall be performed. Only for 3D Secure 2. - RecurringExpiry *string `json:"recurringExpiry,omitempty"` - // Minimum number of days between authorisations. Only for 3D Secure 2. - RecurringFrequency *string `json:"recurringFrequency,omitempty"` + Origin *string `json:"origin,omitempty"` + PaymentMethod DonationPaymentMethod `json:"paymentMethod"` // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. @@ -113,10 +70,7 @@ type DonationPaymentRequest struct { // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` - // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` + ReturnUrl string `json:"returnUrl"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 SessionValidity *string `json:"sessionValidity,omitempty"` // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. @@ -130,24 +84,14 @@ type DonationPaymentRequest struct { ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` - // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - ShopperStatement *string `json:"shopperStatement,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - // An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - Splits []Split `json:"splits,omitempty"` - // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). - Store *string `json:"store,omitempty"` - // When true and `shopperReference` is provided, the payment details will be stored. - StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + ThreeDS2RequestData *ThreeDS2RequestFields `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` - // Set to true if the payment should be routed to a trusted MID. - TrustedShopper *bool `json:"trustedShopper,omitempty"` } // NewDonationPaymentRequest instantiates a new DonationPaymentRequest object @@ -209,38 +153,6 @@ func (o *DonationPaymentRequest) SetAccountInfo(v AccountInfo) { o.AccountInfo = &v } -// GetAdditionalAmount returns the AdditionalAmount field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetAdditionalAmount() Amount { - if o == nil || common.IsNil(o.AdditionalAmount) { - var ret Amount - return ret - } - return *o.AdditionalAmount -} - -// GetAdditionalAmountOk returns a tuple with the AdditionalAmount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetAdditionalAmountOk() (*Amount, bool) { - if o == nil || common.IsNil(o.AdditionalAmount) { - return nil, false - } - return o.AdditionalAmount, true -} - -// HasAdditionalAmount returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasAdditionalAmount() bool { - if o != nil && !common.IsNil(o.AdditionalAmount) { - return true - } - - return false -} - -// SetAdditionalAmount gets a reference to the given Amount and assigns it to the AdditionalAmount field. -func (o *DonationPaymentRequest) SetAdditionalAmount(v Amount) { - o.AdditionalAmount = &v -} - // GetAdditionalData returns the AdditionalData field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetAdditionalData() map[string]string { if o == nil || common.IsNil(o.AdditionalData) { @@ -273,38 +185,6 @@ func (o *DonationPaymentRequest) SetAdditionalData(v map[string]string) { o.AdditionalData = &v } -// GetAllowedPaymentMethods returns the AllowedPaymentMethods field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetAllowedPaymentMethods() []string { - if o == nil || common.IsNil(o.AllowedPaymentMethods) { - var ret []string - return ret - } - return o.AllowedPaymentMethods -} - -// GetAllowedPaymentMethodsOk returns a tuple with the AllowedPaymentMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetAllowedPaymentMethodsOk() ([]string, bool) { - if o == nil || common.IsNil(o.AllowedPaymentMethods) { - return nil, false - } - return o.AllowedPaymentMethods, true -} - -// HasAllowedPaymentMethods returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasAllowedPaymentMethods() bool { - if o != nil && !common.IsNil(o.AllowedPaymentMethods) { - return true - } - - return false -} - -// SetAllowedPaymentMethods gets a reference to the given []string and assigns it to the AllowedPaymentMethods field. -func (o *DonationPaymentRequest) SetAllowedPaymentMethods(v []string) { - o.AllowedPaymentMethods = v -} - // GetAmount returns the Amount field value func (o *DonationPaymentRequest) GetAmount() Amount { if o == nil { @@ -425,38 +305,6 @@ func (o *DonationPaymentRequest) SetBillingAddress(v BillingAddress) { o.BillingAddress = &v } -// GetBlockedPaymentMethods returns the BlockedPaymentMethods field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetBlockedPaymentMethods() []string { - if o == nil || common.IsNil(o.BlockedPaymentMethods) { - var ret []string - return ret - } - return o.BlockedPaymentMethods -} - -// GetBlockedPaymentMethodsOk returns a tuple with the BlockedPaymentMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetBlockedPaymentMethodsOk() ([]string, bool) { - if o == nil || common.IsNil(o.BlockedPaymentMethods) { - return nil, false - } - return o.BlockedPaymentMethods, true -} - -// HasBlockedPaymentMethods returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasBlockedPaymentMethods() bool { - if o != nil && !common.IsNil(o.BlockedPaymentMethods) { - return true - } - - return false -} - -// SetBlockedPaymentMethods gets a reference to the given []string and assigns it to the BlockedPaymentMethods field. -func (o *DonationPaymentRequest) SetBlockedPaymentMethods(v []string) { - o.BlockedPaymentMethods = v -} - // GetBrowserInfo returns the BrowserInfo field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetBrowserInfo() BrowserInfo { if o == nil || common.IsNil(o.BrowserInfo) { @@ -489,38 +337,6 @@ func (o *DonationPaymentRequest) SetBrowserInfo(v BrowserInfo) { o.BrowserInfo = &v } -// GetCaptureDelayHours returns the CaptureDelayHours field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetCaptureDelayHours() int32 { - if o == nil || common.IsNil(o.CaptureDelayHours) { - var ret int32 - return ret - } - return *o.CaptureDelayHours -} - -// GetCaptureDelayHoursOk returns a tuple with the CaptureDelayHours field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetCaptureDelayHoursOk() (*int32, bool) { - if o == nil || common.IsNil(o.CaptureDelayHours) { - return nil, false - } - return o.CaptureDelayHours, true -} - -// HasCaptureDelayHours returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasCaptureDelayHours() bool { - if o != nil && !common.IsNil(o.CaptureDelayHours) { - return true - } - - return false -} - -// SetCaptureDelayHours gets a reference to the given int32 and assigns it to the CaptureDelayHours field. -func (o *DonationPaymentRequest) SetCaptureDelayHours(v int32) { - o.CaptureDelayHours = &v -} - // GetChannel returns the Channel field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetChannel() string { if o == nil || common.IsNil(o.Channel) { @@ -585,38 +401,6 @@ func (o *DonationPaymentRequest) SetCheckoutAttemptId(v string) { o.CheckoutAttemptId = &v } -// GetCompany returns the Company field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetCompany() Company { - if o == nil || common.IsNil(o.Company) { - var ret Company - return ret - } - return *o.Company -} - -// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetCompanyOk() (*Company, bool) { - if o == nil || common.IsNil(o.Company) { - return nil, false - } - return o.Company, true -} - -// HasCompany returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasCompany() bool { - if o != nil && !common.IsNil(o.Company) { - return true - } - - return false -} - -// SetCompany gets a reference to the given Company and assigns it to the Company field. -func (o *DonationPaymentRequest) SetCompany(v Company) { - o.Company = &v -} - // GetConversionId returns the ConversionId field value if set, zero value otherwise. // Deprecated func (o *DonationPaymentRequest) GetConversionId() string { @@ -716,38 +500,6 @@ func (o *DonationPaymentRequest) SetDateOfBirth(v time.Time) { o.DateOfBirth = &v } -// GetDccQuote returns the DccQuote field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetDccQuote() ForexQuote { - if o == nil || common.IsNil(o.DccQuote) { - var ret ForexQuote - return ret - } - return *o.DccQuote -} - -// GetDccQuoteOk returns a tuple with the DccQuote field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetDccQuoteOk() (*ForexQuote, bool) { - if o == nil || common.IsNil(o.DccQuote) { - return nil, false - } - return o.DccQuote, true -} - -// HasDccQuote returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasDccQuote() bool { - if o != nil && !common.IsNil(o.DccQuote) { - return true - } - - return false -} - -// SetDccQuote gets a reference to the given ForexQuote and assigns it to the DccQuote field. -func (o *DonationPaymentRequest) SetDccQuote(v ForexQuote) { - o.DccQuote = &v -} - // GetDeliverAt returns the DeliverAt field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetDeliverAt() time.Time { if o == nil || common.IsNil(o.DeliverAt) { @@ -812,38 +564,6 @@ func (o *DonationPaymentRequest) SetDeliveryAddress(v DeliveryAddress) { o.DeliveryAddress = &v } -// GetDeliveryDate returns the DeliveryDate field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetDeliveryDate() time.Time { - if o == nil || common.IsNil(o.DeliveryDate) { - var ret time.Time - return ret - } - return *o.DeliveryDate -} - -// GetDeliveryDateOk returns a tuple with the DeliveryDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetDeliveryDateOk() (*time.Time, bool) { - if o == nil || common.IsNil(o.DeliveryDate) { - return nil, false - } - return o.DeliveryDate, true -} - -// HasDeliveryDate returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasDeliveryDate() bool { - if o != nil && !common.IsNil(o.DeliveryDate) { - return true - } - - return false -} - -// SetDeliveryDate gets a reference to the given time.Time and assigns it to the DeliveryDate field. -func (o *DonationPaymentRequest) SetDeliveryDate(v time.Time) { - o.DeliveryDate = &v -} - // GetDeviceFingerprint returns the DeviceFingerprint field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetDeviceFingerprint() string { if o == nil || common.IsNil(o.DeviceFingerprint) { @@ -964,857 +684,249 @@ func (o *DonationPaymentRequest) SetDonationToken(v string) { o.DonationToken = &v } -// GetEnableOneClick returns the EnableOneClick field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetEnableOneClick() bool { - if o == nil || common.IsNil(o.EnableOneClick) { - var ret bool +// GetLineItems returns the LineItems field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetLineItems() []LineItem { + if o == nil || common.IsNil(o.LineItems) { + var ret []LineItem return ret } - return *o.EnableOneClick + return o.LineItems } -// GetEnableOneClickOk returns a tuple with the EnableOneClick field value if set, nil otherwise +// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetEnableOneClickOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnableOneClick) { +func (o *DonationPaymentRequest) GetLineItemsOk() ([]LineItem, bool) { + if o == nil || common.IsNil(o.LineItems) { return nil, false } - return o.EnableOneClick, true + return o.LineItems, true } -// HasEnableOneClick returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasEnableOneClick() bool { - if o != nil && !common.IsNil(o.EnableOneClick) { +// HasLineItems returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasLineItems() bool { + if o != nil && !common.IsNil(o.LineItems) { return true } return false } -// SetEnableOneClick gets a reference to the given bool and assigns it to the EnableOneClick field. -func (o *DonationPaymentRequest) SetEnableOneClick(v bool) { - o.EnableOneClick = &v +// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. +func (o *DonationPaymentRequest) SetLineItems(v []LineItem) { + o.LineItems = v } -// GetEnablePayOut returns the EnablePayOut field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetEnablePayOut() bool { - if o == nil || common.IsNil(o.EnablePayOut) { - var ret bool +// GetMerchantAccount returns the MerchantAccount field value +func (o *DonationPaymentRequest) GetMerchantAccount() string { + if o == nil { + var ret string return ret } - return *o.EnablePayOut + + return o.MerchantAccount } -// GetEnablePayOutOk returns a tuple with the EnablePayOut field value if set, nil otherwise +// GetMerchantAccountOk returns a tuple with the MerchantAccount field value // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetEnablePayOutOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnablePayOut) { +func (o *DonationPaymentRequest) GetMerchantAccountOk() (*string, bool) { + if o == nil { return nil, false } - return o.EnablePayOut, true -} - -// HasEnablePayOut returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasEnablePayOut() bool { - if o != nil && !common.IsNil(o.EnablePayOut) { - return true - } - - return false + return &o.MerchantAccount, true } -// SetEnablePayOut gets a reference to the given bool and assigns it to the EnablePayOut field. -func (o *DonationPaymentRequest) SetEnablePayOut(v bool) { - o.EnablePayOut = &v +// SetMerchantAccount sets field value +func (o *DonationPaymentRequest) SetMerchantAccount(v string) { + o.MerchantAccount = v } -// GetEnableRecurring returns the EnableRecurring field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetEnableRecurring() bool { - if o == nil || common.IsNil(o.EnableRecurring) { - var ret bool +// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { + var ret MerchantRiskIndicator return ret } - return *o.EnableRecurring + return *o.MerchantRiskIndicator } -// GetEnableRecurringOk returns a tuple with the EnableRecurring field value if set, nil otherwise +// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetEnableRecurringOk() (*bool, bool) { - if o == nil || common.IsNil(o.EnableRecurring) { +func (o *DonationPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator, bool) { + if o == nil || common.IsNil(o.MerchantRiskIndicator) { return nil, false } - return o.EnableRecurring, true + return o.MerchantRiskIndicator, true } -// HasEnableRecurring returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasEnableRecurring() bool { - if o != nil && !common.IsNil(o.EnableRecurring) { +// HasMerchantRiskIndicator returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasMerchantRiskIndicator() bool { + if o != nil && !common.IsNil(o.MerchantRiskIndicator) { return true } return false } -// SetEnableRecurring gets a reference to the given bool and assigns it to the EnableRecurring field. -func (o *DonationPaymentRequest) SetEnableRecurring(v bool) { - o.EnableRecurring = &v +// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator and assigns it to the MerchantRiskIndicator field. +func (o *DonationPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator) { + o.MerchantRiskIndicator = &v } -// GetEntityType returns the EntityType field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetEntityType() string { - if o == nil || common.IsNil(o.EntityType) { - var ret string +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string return ret } - return *o.EntityType + return *o.Metadata } -// GetEntityTypeOk returns a tuple with the EntityType field value if set, nil otherwise +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetEntityTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.EntityType) { +func (o *DonationPaymentRequest) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { return nil, false } - return o.EntityType, true + return o.Metadata, true } -// HasEntityType returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasEntityType() bool { - if o != nil && !common.IsNil(o.EntityType) { +// HasMetadata returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { return true } return false } -// SetEntityType gets a reference to the given string and assigns it to the EntityType field. -func (o *DonationPaymentRequest) SetEntityType(v string) { - o.EntityType = &v +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *DonationPaymentRequest) SetMetadata(v map[string]string) { + o.Metadata = &v } -// GetFraudOffset returns the FraudOffset field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetFraudOffset() int32 { - if o == nil || common.IsNil(o.FraudOffset) { - var ret int32 +// GetMpiData returns the MpiData field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetMpiData() ThreeDSecureData { + if o == nil || common.IsNil(o.MpiData) { + var ret ThreeDSecureData return ret } - return *o.FraudOffset + return *o.MpiData } -// GetFraudOffsetOk returns a tuple with the FraudOffset field value if set, nil otherwise +// GetMpiDataOk returns a tuple with the MpiData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetFraudOffsetOk() (*int32, bool) { - if o == nil || common.IsNil(o.FraudOffset) { +func (o *DonationPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool) { + if o == nil || common.IsNil(o.MpiData) { return nil, false } - return o.FraudOffset, true + return o.MpiData, true } -// HasFraudOffset returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasFraudOffset() bool { - if o != nil && !common.IsNil(o.FraudOffset) { +// HasMpiData returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasMpiData() bool { + if o != nil && !common.IsNil(o.MpiData) { return true } return false } -// SetFraudOffset gets a reference to the given int32 and assigns it to the FraudOffset field. -func (o *DonationPaymentRequest) SetFraudOffset(v int32) { - o.FraudOffset = &v +// SetMpiData gets a reference to the given ThreeDSecureData and assigns it to the MpiData field. +func (o *DonationPaymentRequest) SetMpiData(v ThreeDSecureData) { + o.MpiData = &v } -// GetFundOrigin returns the FundOrigin field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetFundOrigin() FundOrigin { - if o == nil || common.IsNil(o.FundOrigin) { - var ret FundOrigin +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetOrigin() string { + if o == nil || common.IsNil(o.Origin) { + var ret string return ret } - return *o.FundOrigin + return *o.Origin } -// GetFundOriginOk returns a tuple with the FundOrigin field value if set, nil otherwise +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetFundOriginOk() (*FundOrigin, bool) { - if o == nil || common.IsNil(o.FundOrigin) { +func (o *DonationPaymentRequest) GetOriginOk() (*string, bool) { + if o == nil || common.IsNil(o.Origin) { return nil, false } - return o.FundOrigin, true + return o.Origin, true } -// HasFundOrigin returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasFundOrigin() bool { - if o != nil && !common.IsNil(o.FundOrigin) { +// HasOrigin returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasOrigin() bool { + if o != nil && !common.IsNil(o.Origin) { return true } return false } -// SetFundOrigin gets a reference to the given FundOrigin and assigns it to the FundOrigin field. -func (o *DonationPaymentRequest) SetFundOrigin(v FundOrigin) { - o.FundOrigin = &v +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *DonationPaymentRequest) SetOrigin(v string) { + o.Origin = &v } -// GetFundRecipient returns the FundRecipient field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetFundRecipient() FundRecipient { - if o == nil || common.IsNil(o.FundRecipient) { - var ret FundRecipient +// GetPaymentMethod returns the PaymentMethod field value +func (o *DonationPaymentRequest) GetPaymentMethod() DonationPaymentMethod { + if o == nil { + var ret DonationPaymentMethod return ret } - return *o.FundRecipient + + return o.PaymentMethod } -// GetFundRecipientOk returns a tuple with the FundRecipient field value if set, nil otherwise +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetFundRecipientOk() (*FundRecipient, bool) { - if o == nil || common.IsNil(o.FundRecipient) { +func (o *DonationPaymentRequest) GetPaymentMethodOk() (*DonationPaymentMethod, bool) { + if o == nil { return nil, false } - return o.FundRecipient, true -} - -// HasFundRecipient returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasFundRecipient() bool { - if o != nil && !common.IsNil(o.FundRecipient) { - return true - } - - return false + return &o.PaymentMethod, true } -// SetFundRecipient gets a reference to the given FundRecipient and assigns it to the FundRecipient field. -func (o *DonationPaymentRequest) SetFundRecipient(v FundRecipient) { - o.FundRecipient = &v +// SetPaymentMethod sets field value +func (o *DonationPaymentRequest) SetPaymentMethod(v DonationPaymentMethod) { + o.PaymentMethod = v } -// GetFundingSource returns the FundingSource field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetFundingSource() string { - if o == nil || common.IsNil(o.FundingSource) { +// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetRecurringProcessingModel() string { + if o == nil || common.IsNil(o.RecurringProcessingModel) { var ret string return ret } - return *o.FundingSource + return *o.RecurringProcessingModel } -// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetFundingSourceOk() (*string, bool) { - if o == nil || common.IsNil(o.FundingSource) { +func (o *DonationPaymentRequest) GetRecurringProcessingModelOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringProcessingModel) { return nil, false } - return o.FundingSource, true + return o.RecurringProcessingModel, true } -// HasFundingSource returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasFundingSource() bool { - if o != nil && !common.IsNil(o.FundingSource) { +// HasRecurringProcessingModel returns a boolean if a field has been set. +func (o *DonationPaymentRequest) HasRecurringProcessingModel() bool { + if o != nil && !common.IsNil(o.RecurringProcessingModel) { return true } return false } -// SetFundingSource gets a reference to the given string and assigns it to the FundingSource field. -func (o *DonationPaymentRequest) SetFundingSource(v string) { - o.FundingSource = &v +// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. +func (o *DonationPaymentRequest) SetRecurringProcessingModel(v string) { + o.RecurringProcessingModel = &v } -// GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetIndustryUsage() string { - if o == nil || common.IsNil(o.IndustryUsage) { - var ret string - return ret - } - return *o.IndustryUsage -} - -// GetIndustryUsageOk returns a tuple with the IndustryUsage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetIndustryUsageOk() (*string, bool) { - if o == nil || common.IsNil(o.IndustryUsage) { - return nil, false - } - return o.IndustryUsage, true -} - -// HasIndustryUsage returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasIndustryUsage() bool { - if o != nil && !common.IsNil(o.IndustryUsage) { - return true - } - - return false -} - -// SetIndustryUsage gets a reference to the given string and assigns it to the IndustryUsage field. -func (o *DonationPaymentRequest) SetIndustryUsage(v string) { - o.IndustryUsage = &v -} - -// GetInstallments returns the Installments field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetInstallments() Installments { - if o == nil || common.IsNil(o.Installments) { - var ret Installments - return ret - } - return *o.Installments -} - -// GetInstallmentsOk returns a tuple with the Installments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetInstallmentsOk() (*Installments, bool) { - if o == nil || common.IsNil(o.Installments) { - return nil, false - } - return o.Installments, true -} - -// HasInstallments returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasInstallments() bool { - if o != nil && !common.IsNil(o.Installments) { - return true - } - - return false -} - -// SetInstallments gets a reference to the given Installments and assigns it to the Installments field. -func (o *DonationPaymentRequest) SetInstallments(v Installments) { - o.Installments = &v -} - -// GetLineItems returns the LineItems field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetLineItems() []LineItem { - if o == nil || common.IsNil(o.LineItems) { - var ret []LineItem - return ret - } - return o.LineItems -} - -// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetLineItemsOk() ([]LineItem, bool) { - if o == nil || common.IsNil(o.LineItems) { - return nil, false - } - return o.LineItems, true -} - -// HasLineItems returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasLineItems() bool { - if o != nil && !common.IsNil(o.LineItems) { - return true - } - - return false -} - -// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. -func (o *DonationPaymentRequest) SetLineItems(v []LineItem) { - o.LineItems = v -} - -// GetLocalizedShopperStatement returns the LocalizedShopperStatement field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetLocalizedShopperStatement() map[string]string { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - var ret map[string]string - return ret - } - return *o.LocalizedShopperStatement -} - -// GetLocalizedShopperStatementOk returns a tuple with the LocalizedShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetLocalizedShopperStatementOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.LocalizedShopperStatement) { - return nil, false - } - return o.LocalizedShopperStatement, true -} - -// HasLocalizedShopperStatement returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasLocalizedShopperStatement() bool { - if o != nil && !common.IsNil(o.LocalizedShopperStatement) { - return true - } - - return false -} - -// SetLocalizedShopperStatement gets a reference to the given map[string]string and assigns it to the LocalizedShopperStatement field. -func (o *DonationPaymentRequest) SetLocalizedShopperStatement(v map[string]string) { - o.LocalizedShopperStatement = &v -} - -// GetMandate returns the Mandate field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetMandate() Mandate { - if o == nil || common.IsNil(o.Mandate) { - var ret Mandate - return ret - } - return *o.Mandate -} - -// GetMandateOk returns a tuple with the Mandate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMandateOk() (*Mandate, bool) { - if o == nil || common.IsNil(o.Mandate) { - return nil, false - } - return o.Mandate, true -} - -// HasMandate returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasMandate() bool { - if o != nil && !common.IsNil(o.Mandate) { - return true - } - - return false -} - -// SetMandate gets a reference to the given Mandate and assigns it to the Mandate field. -func (o *DonationPaymentRequest) SetMandate(v Mandate) { - o.Mandate = &v -} - -// GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *DonationPaymentRequest) 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 *DonationPaymentRequest) 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 *DonationPaymentRequest) 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 *DonationPaymentRequest) SetMcc(v string) { - o.Mcc = &v -} - -// GetMerchantAccount returns the MerchantAccount field value -func (o *DonationPaymentRequest) GetMerchantAccount() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccount -} - -// GetMerchantAccountOk returns a tuple with the MerchantAccount field value -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMerchantAccountOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccount, true -} - -// SetMerchantAccount sets field value -func (o *DonationPaymentRequest) SetMerchantAccount(v string) { - o.MerchantAccount = v -} - -// GetMerchantOrderReference returns the MerchantOrderReference field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetMerchantOrderReference() string { - if o == nil || common.IsNil(o.MerchantOrderReference) { - var ret string - return ret - } - return *o.MerchantOrderReference -} - -// GetMerchantOrderReferenceOk returns a tuple with the MerchantOrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMerchantOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.MerchantOrderReference) { - return nil, false - } - return o.MerchantOrderReference, true -} - -// HasMerchantOrderReference returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasMerchantOrderReference() bool { - if o != nil && !common.IsNil(o.MerchantOrderReference) { - return true - } - - return false -} - -// SetMerchantOrderReference gets a reference to the given string and assigns it to the MerchantOrderReference field. -func (o *DonationPaymentRequest) SetMerchantOrderReference(v string) { - o.MerchantOrderReference = &v -} - -// GetMerchantRiskIndicator returns the MerchantRiskIndicator field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetMerchantRiskIndicator() MerchantRiskIndicator { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - var ret MerchantRiskIndicator - return ret - } - return *o.MerchantRiskIndicator -} - -// GetMerchantRiskIndicatorOk returns a tuple with the MerchantRiskIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMerchantRiskIndicatorOk() (*MerchantRiskIndicator, bool) { - if o == nil || common.IsNil(o.MerchantRiskIndicator) { - return nil, false - } - return o.MerchantRiskIndicator, true -} - -// HasMerchantRiskIndicator returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasMerchantRiskIndicator() bool { - if o != nil && !common.IsNil(o.MerchantRiskIndicator) { - return true - } - - return false -} - -// SetMerchantRiskIndicator gets a reference to the given MerchantRiskIndicator and assigns it to the MerchantRiskIndicator field. -func (o *DonationPaymentRequest) SetMerchantRiskIndicator(v MerchantRiskIndicator) { - o.MerchantRiskIndicator = &v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetMetadata() map[string]string { - if o == nil || common.IsNil(o.Metadata) { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMetadataOk() (*map[string]string, bool) { - if o == nil || common.IsNil(o.Metadata) { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasMetadata() bool { - if o != nil && !common.IsNil(o.Metadata) { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *DonationPaymentRequest) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetMpiData returns the MpiData field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetMpiData() ThreeDSecureData { - if o == nil || common.IsNil(o.MpiData) { - var ret ThreeDSecureData - return ret - } - return *o.MpiData -} - -// GetMpiDataOk returns a tuple with the MpiData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetMpiDataOk() (*ThreeDSecureData, bool) { - if o == nil || common.IsNil(o.MpiData) { - return nil, false - } - return o.MpiData, true -} - -// HasMpiData returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasMpiData() bool { - if o != nil && !common.IsNil(o.MpiData) { - return true - } - - return false -} - -// SetMpiData gets a reference to the given ThreeDSecureData and assigns it to the MpiData field. -func (o *DonationPaymentRequest) SetMpiData(v ThreeDSecureData) { - o.MpiData = &v -} - -// GetOrder returns the Order field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetOrder() EncryptedOrderData { - if o == nil || common.IsNil(o.Order) { - var ret EncryptedOrderData - return ret - } - return *o.Order -} - -// GetOrderOk returns a tuple with the Order field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetOrderOk() (*EncryptedOrderData, bool) { - if o == nil || common.IsNil(o.Order) { - return nil, false - } - return o.Order, true -} - -// HasOrder returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasOrder() bool { - if o != nil && !common.IsNil(o.Order) { - return true - } - - return false -} - -// SetOrder gets a reference to the given EncryptedOrderData and assigns it to the Order field. -func (o *DonationPaymentRequest) SetOrder(v EncryptedOrderData) { - o.Order = &v -} - -// GetOrderReference returns the OrderReference field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetOrderReference() string { - if o == nil || common.IsNil(o.OrderReference) { - var ret string - return ret - } - return *o.OrderReference -} - -// GetOrderReferenceOk returns a tuple with the OrderReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetOrderReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.OrderReference) { - return nil, false - } - return o.OrderReference, true -} - -// HasOrderReference returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasOrderReference() bool { - if o != nil && !common.IsNil(o.OrderReference) { - return true - } - - return false -} - -// SetOrderReference gets a reference to the given string and assigns it to the OrderReference field. -func (o *DonationPaymentRequest) SetOrderReference(v string) { - o.OrderReference = &v -} - -// GetOrigin returns the Origin field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetOrigin() string { - if o == nil || common.IsNil(o.Origin) { - var ret string - return ret - } - return *o.Origin -} - -// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetOriginOk() (*string, bool) { - if o == nil || common.IsNil(o.Origin) { - return nil, false - } - return o.Origin, true -} - -// HasOrigin returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasOrigin() bool { - if o != nil && !common.IsNil(o.Origin) { - return true - } - - return false -} - -// SetOrigin gets a reference to the given string and assigns it to the Origin field. -func (o *DonationPaymentRequest) SetOrigin(v string) { - o.Origin = &v -} - -// GetPaymentMethod returns the PaymentMethod field value -func (o *DonationPaymentRequest) GetPaymentMethod() DonationPaymentMethod { - if o == nil { - var ret DonationPaymentMethod - return ret - } - - return o.PaymentMethod -} - -// GetPaymentMethodOk returns a tuple with the PaymentMethod field value -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetPaymentMethodOk() (*DonationPaymentMethod, bool) { - if o == nil { - return nil, false - } - return &o.PaymentMethod, true -} - -// SetPaymentMethod sets field value -func (o *DonationPaymentRequest) SetPaymentMethod(v DonationPaymentMethod) { - o.PaymentMethod = v -} - -// GetPlatformChargebackLogic returns the PlatformChargebackLogic field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetPlatformChargebackLogic() PlatformChargebackLogic { - if o == nil || common.IsNil(o.PlatformChargebackLogic) { - var ret PlatformChargebackLogic - return ret - } - return *o.PlatformChargebackLogic -} - -// GetPlatformChargebackLogicOk returns a tuple with the PlatformChargebackLogic field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetPlatformChargebackLogicOk() (*PlatformChargebackLogic, bool) { - if o == nil || common.IsNil(o.PlatformChargebackLogic) { - return nil, false - } - return o.PlatformChargebackLogic, true -} - -// HasPlatformChargebackLogic returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasPlatformChargebackLogic() bool { - if o != nil && !common.IsNil(o.PlatformChargebackLogic) { - return true - } - - return false -} - -// SetPlatformChargebackLogic gets a reference to the given PlatformChargebackLogic and assigns it to the PlatformChargebackLogic field. -func (o *DonationPaymentRequest) SetPlatformChargebackLogic(v PlatformChargebackLogic) { - o.PlatformChargebackLogic = &v -} - -// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetRecurringExpiry() string { - if o == nil || common.IsNil(o.RecurringExpiry) { - var ret string - return ret - } - return *o.RecurringExpiry -} - -// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetRecurringExpiryOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringExpiry) { - return nil, false - } - return o.RecurringExpiry, true -} - -// HasRecurringExpiry returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasRecurringExpiry() bool { - if o != nil && !common.IsNil(o.RecurringExpiry) { - return true - } - - return false -} - -// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. -func (o *DonationPaymentRequest) SetRecurringExpiry(v string) { - o.RecurringExpiry = &v -} - -// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetRecurringFrequency() string { - if o == nil || common.IsNil(o.RecurringFrequency) { - var ret string - return ret - } - return *o.RecurringFrequency -} - -// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetRecurringFrequencyOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringFrequency) { - return nil, false - } - return o.RecurringFrequency, true -} - -// HasRecurringFrequency returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasRecurringFrequency() bool { - if o != nil && !common.IsNil(o.RecurringFrequency) { - return true - } - - return false -} - -// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. -func (o *DonationPaymentRequest) SetRecurringFrequency(v string) { - o.RecurringFrequency = &v -} - -// GetRecurringProcessingModel returns the RecurringProcessingModel field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetRecurringProcessingModel() string { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - var ret string - return ret - } - return *o.RecurringProcessingModel -} - -// GetRecurringProcessingModelOk returns a tuple with the RecurringProcessingModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetRecurringProcessingModelOk() (*string, bool) { - if o == nil || common.IsNil(o.RecurringProcessingModel) { - return nil, false - } - return o.RecurringProcessingModel, true -} - -// HasRecurringProcessingModel returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasRecurringProcessingModel() bool { - if o != nil && !common.IsNil(o.RecurringProcessingModel) { - return true - } - - return false -} - -// SetRecurringProcessingModel gets a reference to the given string and assigns it to the RecurringProcessingModel field. -func (o *DonationPaymentRequest) SetRecurringProcessingModel(v string) { - o.RecurringProcessingModel = &v -} - -// GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetRedirectFromIssuerMethod() string { - if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { +// GetRedirectFromIssuerMethod returns the RedirectFromIssuerMethod field value if set, zero value otherwise. +func (o *DonationPaymentRequest) GetRedirectFromIssuerMethod() string { + if o == nil || common.IsNil(o.RedirectFromIssuerMethod) { var ret string return ret } @@ -1924,70 +1036,6 @@ func (o *DonationPaymentRequest) SetReturnUrl(v string) { o.ReturnUrl = v } -// GetRiskData returns the RiskData field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetRiskData() RiskData { - if o == nil || common.IsNil(o.RiskData) { - var ret RiskData - return ret - } - return *o.RiskData -} - -// GetRiskDataOk returns a tuple with the RiskData field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetRiskDataOk() (*RiskData, bool) { - if o == nil || common.IsNil(o.RiskData) { - return nil, false - } - return o.RiskData, true -} - -// HasRiskData returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasRiskData() bool { - if o != nil && !common.IsNil(o.RiskData) { - return true - } - - return false -} - -// SetRiskData gets a reference to the given RiskData and assigns it to the RiskData field. -func (o *DonationPaymentRequest) SetRiskData(v RiskData) { - o.RiskData = &v -} - -// GetSelectedRecurringDetailReference returns the SelectedRecurringDetailReference field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetSelectedRecurringDetailReference() string { - if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { - var ret string - return ret - } - return *o.SelectedRecurringDetailReference -} - -// GetSelectedRecurringDetailReferenceOk returns a tuple with the SelectedRecurringDetailReference field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetSelectedRecurringDetailReferenceOk() (*string, bool) { - if o == nil || common.IsNil(o.SelectedRecurringDetailReference) { - return nil, false - } - return o.SelectedRecurringDetailReference, true -} - -// HasSelectedRecurringDetailReference returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasSelectedRecurringDetailReference() bool { - if o != nil && !common.IsNil(o.SelectedRecurringDetailReference) { - return true - } - - return false -} - -// SetSelectedRecurringDetailReference gets a reference to the given string and assigns it to the SelectedRecurringDetailReference field. -func (o *DonationPaymentRequest) SetSelectedRecurringDetailReference(v string) { - o.SelectedRecurringDetailReference = &v -} - // GetSessionValidity returns the SessionValidity field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetSessionValidity() string { if o == nil || common.IsNil(o.SessionValidity) { @@ -2212,38 +1260,6 @@ func (o *DonationPaymentRequest) SetShopperReference(v string) { o.ShopperReference = &v } -// GetShopperStatement returns the ShopperStatement field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetShopperStatement() string { - if o == nil || common.IsNil(o.ShopperStatement) { - var ret string - return ret - } - return *o.ShopperStatement -} - -// GetShopperStatementOk returns a tuple with the ShopperStatement field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetShopperStatementOk() (*string, bool) { - if o == nil || common.IsNil(o.ShopperStatement) { - return nil, false - } - return o.ShopperStatement, true -} - -// HasShopperStatement returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasShopperStatement() bool { - if o != nil && !common.IsNil(o.ShopperStatement) { - return true - } - - return false -} - -// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field. -func (o *DonationPaymentRequest) SetShopperStatement(v string) { - o.ShopperStatement = &v -} - // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2276,102 +1292,6 @@ func (o *DonationPaymentRequest) SetSocialSecurityNumber(v string) { o.SocialSecurityNumber = &v } -// GetSplits returns the Splits field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetSplits() []Split { - if o == nil || common.IsNil(o.Splits) { - var ret []Split - return ret - } - return o.Splits -} - -// GetSplitsOk returns a tuple with the Splits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetSplitsOk() ([]Split, bool) { - if o == nil || common.IsNil(o.Splits) { - return nil, false - } - return o.Splits, true -} - -// HasSplits returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasSplits() bool { - if o != nil && !common.IsNil(o.Splits) { - return true - } - - return false -} - -// SetSplits gets a reference to the given []Split and assigns it to the Splits field. -func (o *DonationPaymentRequest) SetSplits(v []Split) { - o.Splits = v -} - -// GetStore returns the Store field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetStore() string { - if o == nil || common.IsNil(o.Store) { - var ret string - return ret - } - return *o.Store -} - -// GetStoreOk returns a tuple with the Store field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetStoreOk() (*string, bool) { - if o == nil || common.IsNil(o.Store) { - return nil, false - } - return o.Store, true -} - -// HasStore returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasStore() bool { - if o != nil && !common.IsNil(o.Store) { - return true - } - - return false -} - -// SetStore gets a reference to the given string and assigns it to the Store field. -func (o *DonationPaymentRequest) SetStore(v string) { - o.Store = &v -} - -// GetStorePaymentMethod returns the StorePaymentMethod field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetStorePaymentMethod() bool { - if o == nil || common.IsNil(o.StorePaymentMethod) { - var ret bool - return ret - } - return *o.StorePaymentMethod -} - -// GetStorePaymentMethodOk returns a tuple with the StorePaymentMethod field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetStorePaymentMethodOk() (*bool, bool) { - if o == nil || common.IsNil(o.StorePaymentMethod) { - return nil, false - } - return o.StorePaymentMethod, true -} - -// HasStorePaymentMethod returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasStorePaymentMethod() bool { - if o != nil && !common.IsNil(o.StorePaymentMethod) { - return true - } - - return false -} - -// SetStorePaymentMethod gets a reference to the given bool and assigns it to the StorePaymentMethod field. -func (o *DonationPaymentRequest) SetStorePaymentMethod(v bool) { - o.StorePaymentMethod = &v -} - // GetTelephoneNumber returns the TelephoneNumber field value if set, zero value otherwise. func (o *DonationPaymentRequest) GetTelephoneNumber() string { if o == nil || common.IsNil(o.TelephoneNumber) { @@ -2405,9 +1325,9 @@ func (o *DonationPaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { +func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestFields { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData2 + var ret ThreeDS2RequestFields return ret } return *o.ThreeDS2RequestData @@ -2415,7 +1335,7 @@ func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { // GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { +func (o *DonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestFields, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2431,8 +1351,8 @@ func (o *DonationPaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. -func (o *DonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestFields and assigns it to the ThreeDS2RequestData field. +func (o *DonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestFields) { o.ThreeDS2RequestData = &v } @@ -2471,38 +1391,6 @@ func (o *DonationPaymentRequest) SetThreeDSAuthenticationOnly(v bool) { o.ThreeDSAuthenticationOnly = &v } -// GetTrustedShopper returns the TrustedShopper field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetTrustedShopper() bool { - if o == nil || common.IsNil(o.TrustedShopper) { - var ret bool - return ret - } - return *o.TrustedShopper -} - -// GetTrustedShopperOk returns a tuple with the TrustedShopper field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetTrustedShopperOk() (*bool, bool) { - if o == nil || common.IsNil(o.TrustedShopper) { - return nil, false - } - return o.TrustedShopper, true -} - -// HasTrustedShopper returns a boolean if a field has been set. -func (o *DonationPaymentRequest) HasTrustedShopper() bool { - if o != nil && !common.IsNil(o.TrustedShopper) { - return true - } - - return false -} - -// SetTrustedShopper gets a reference to the given bool and assigns it to the TrustedShopper field. -func (o *DonationPaymentRequest) SetTrustedShopper(v bool) { - o.TrustedShopper = &v -} - func (o DonationPaymentRequest) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -2516,15 +1404,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountInfo) { toSerialize["accountInfo"] = o.AccountInfo } - if !common.IsNil(o.AdditionalAmount) { - toSerialize["additionalAmount"] = o.AdditionalAmount - } if !common.IsNil(o.AdditionalData) { toSerialize["additionalData"] = o.AdditionalData } - if !common.IsNil(o.AllowedPaymentMethods) { - toSerialize["allowedPaymentMethods"] = o.AllowedPaymentMethods - } toSerialize["amount"] = o.Amount if !common.IsNil(o.ApplicationInfo) { toSerialize["applicationInfo"] = o.ApplicationInfo @@ -2535,24 +1417,15 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BillingAddress) { toSerialize["billingAddress"] = o.BillingAddress } - if !common.IsNil(o.BlockedPaymentMethods) { - toSerialize["blockedPaymentMethods"] = o.BlockedPaymentMethods - } if !common.IsNil(o.BrowserInfo) { toSerialize["browserInfo"] = o.BrowserInfo } - if !common.IsNil(o.CaptureDelayHours) { - toSerialize["captureDelayHours"] = o.CaptureDelayHours - } if !common.IsNil(o.Channel) { toSerialize["channel"] = o.Channel } if !common.IsNil(o.CheckoutAttemptId) { toSerialize["checkoutAttemptId"] = o.CheckoutAttemptId } - if !common.IsNil(o.Company) { - toSerialize["company"] = o.Company - } if !common.IsNil(o.ConversionId) { toSerialize["conversionId"] = o.ConversionId } @@ -2562,18 +1435,12 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DateOfBirth) { toSerialize["dateOfBirth"] = o.DateOfBirth } - if !common.IsNil(o.DccQuote) { - toSerialize["dccQuote"] = o.DccQuote - } if !common.IsNil(o.DeliverAt) { toSerialize["deliverAt"] = o.DeliverAt } if !common.IsNil(o.DeliveryAddress) { toSerialize["deliveryAddress"] = o.DeliveryAddress } - if !common.IsNil(o.DeliveryDate) { - toSerialize["deliveryDate"] = o.DeliveryDate - } if !common.IsNil(o.DeviceFingerprint) { toSerialize["deviceFingerprint"] = o.DeviceFingerprint } @@ -2584,52 +1451,10 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DonationToken) { toSerialize["donationToken"] = o.DonationToken } - if !common.IsNil(o.EnableOneClick) { - toSerialize["enableOneClick"] = o.EnableOneClick - } - if !common.IsNil(o.EnablePayOut) { - toSerialize["enablePayOut"] = o.EnablePayOut - } - if !common.IsNil(o.EnableRecurring) { - toSerialize["enableRecurring"] = o.EnableRecurring - } - if !common.IsNil(o.EntityType) { - toSerialize["entityType"] = o.EntityType - } - if !common.IsNil(o.FraudOffset) { - toSerialize["fraudOffset"] = o.FraudOffset - } - if !common.IsNil(o.FundOrigin) { - toSerialize["fundOrigin"] = o.FundOrigin - } - if !common.IsNil(o.FundRecipient) { - toSerialize["fundRecipient"] = o.FundRecipient - } - if !common.IsNil(o.FundingSource) { - toSerialize["fundingSource"] = o.FundingSource - } - if !common.IsNil(o.IndustryUsage) { - toSerialize["industryUsage"] = o.IndustryUsage - } - if !common.IsNil(o.Installments) { - toSerialize["installments"] = o.Installments - } if !common.IsNil(o.LineItems) { toSerialize["lineItems"] = o.LineItems } - if !common.IsNil(o.LocalizedShopperStatement) { - toSerialize["localizedShopperStatement"] = o.LocalizedShopperStatement - } - if !common.IsNil(o.Mandate) { - toSerialize["mandate"] = o.Mandate - } - if !common.IsNil(o.Mcc) { - toSerialize["mcc"] = o.Mcc - } toSerialize["merchantAccount"] = o.MerchantAccount - if !common.IsNil(o.MerchantOrderReference) { - toSerialize["merchantOrderReference"] = o.MerchantOrderReference - } if !common.IsNil(o.MerchantRiskIndicator) { toSerialize["merchantRiskIndicator"] = o.MerchantRiskIndicator } @@ -2639,25 +1464,10 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } - if !common.IsNil(o.Order) { - toSerialize["order"] = o.Order - } - if !common.IsNil(o.OrderReference) { - toSerialize["orderReference"] = o.OrderReference - } if !common.IsNil(o.Origin) { toSerialize["origin"] = o.Origin } toSerialize["paymentMethod"] = o.PaymentMethod - if !common.IsNil(o.PlatformChargebackLogic) { - toSerialize["platformChargebackLogic"] = o.PlatformChargebackLogic - } - if !common.IsNil(o.RecurringExpiry) { - toSerialize["recurringExpiry"] = o.RecurringExpiry - } - if !common.IsNil(o.RecurringFrequency) { - toSerialize["recurringFrequency"] = o.RecurringFrequency - } if !common.IsNil(o.RecurringProcessingModel) { toSerialize["recurringProcessingModel"] = o.RecurringProcessingModel } @@ -2669,12 +1479,6 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { } toSerialize["reference"] = o.Reference toSerialize["returnUrl"] = o.ReturnUrl - if !common.IsNil(o.RiskData) { - toSerialize["riskData"] = o.RiskData - } - if !common.IsNil(o.SelectedRecurringDetailReference) { - toSerialize["selectedRecurringDetailReference"] = o.SelectedRecurringDetailReference - } if !common.IsNil(o.SessionValidity) { toSerialize["sessionValidity"] = o.SessionValidity } @@ -2696,21 +1500,9 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShopperReference) { toSerialize["shopperReference"] = o.ShopperReference } - if !common.IsNil(o.ShopperStatement) { - toSerialize["shopperStatement"] = o.ShopperStatement - } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } - if !common.IsNil(o.Splits) { - toSerialize["splits"] = o.Splits - } - if !common.IsNil(o.Store) { - toSerialize["store"] = o.Store - } - if !common.IsNil(o.StorePaymentMethod) { - toSerialize["storePaymentMethod"] = o.StorePaymentMethod - } if !common.IsNil(o.TelephoneNumber) { toSerialize["telephoneNumber"] = o.TelephoneNumber } @@ -2720,9 +1512,6 @@ func (o DonationPaymentRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ThreeDSAuthenticationOnly) { toSerialize["threeDSAuthenticationOnly"] = o.ThreeDSAuthenticationOnly } - if !common.IsNil(o.TrustedShopper) { - toSerialize["trustedShopper"] = o.TrustedShopper - } return toSerialize, nil } @@ -2771,33 +1560,6 @@ func (o *DonationPaymentRequest) isValidChannel() bool { } return false } -func (o *DonationPaymentRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false -} -func (o *DonationPaymentRequest) isValidFundingSource() bool { - var allowedEnumValues = []string{"debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false -} -func (o *DonationPaymentRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false -} func (o *DonationPaymentRequest) isValidRecurringProcessingModel() bool { var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} for _, allowed := range allowedEnumValues { diff --git a/src/checkout/model_donation_payment_response.go b/src/checkout/model_donation_payment_response.go index d8db82794..228939931 100644 --- a/src/checkout/model_donation_payment_response.go +++ b/src/checkout/model_donation_payment_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_dotpay_details.go b/src/checkout/model_dotpay_details.go index d3d9d8794..f5b7f64fc 100644 --- a/src/checkout/model_dotpay_details.go +++ b/src/checkout/model_dotpay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_dragonpay_details.go b/src/checkout/model_dragonpay_details.go index f36ce0f1c..4defe9c83 100644 --- a/src/checkout/model_dragonpay_details.go +++ b/src/checkout/model_dragonpay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_econtext_voucher_details.go b/src/checkout/model_econtext_voucher_details.go index a4e4c8bde..da8f5a216 100644 --- a/src/checkout/model_econtext_voucher_details.go +++ b/src/checkout/model_econtext_voucher_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_encrypted_order_data.go b/src/checkout/model_encrypted_order_data.go index 7f8365e7d..c36e39532 100644 --- a/src/checkout/model_encrypted_order_data.go +++ b/src/checkout/model_encrypted_order_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_external_platform.go b/src/checkout/model_external_platform.go index 69d3f9f12..058744ed9 100644 --- a/src/checkout/model_external_platform.go +++ b/src/checkout/model_external_platform.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_forex_quote.go b/src/checkout/model_forex_quote.go index 86efca81b..8173e315d 100644 --- a/src/checkout/model_forex_quote.go +++ b/src/checkout/model_forex_quote.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_fraud_check_result.go b/src/checkout/model_fraud_check_result.go index c30a49676..a4dc632f1 100644 --- a/src/checkout/model_fraud_check_result.go +++ b/src/checkout/model_fraud_check_result.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_fraud_result.go b/src/checkout/model_fraud_result.go index 5b7fb8b8e..68c5a7dad 100644 --- a/src/checkout/model_fraud_result.go +++ b/src/checkout/model_fraud_result.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_fund_origin.go b/src/checkout/model_fund_origin.go index 1ca6098af..bf99fba24 100644 --- a/src/checkout/model_fund_origin.go +++ b/src/checkout/model_fund_origin.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_fund_recipient.go b/src/checkout/model_fund_recipient.go index 7ef62fd0c..99223f756 100644 --- a/src/checkout/model_fund_recipient.go +++ b/src/checkout/model_fund_recipient.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_generic_issuer_payment_method_details.go b/src/checkout/model_generic_issuer_payment_method_details.go index 543cece84..666451d09 100644 --- a/src/checkout/model_generic_issuer_payment_method_details.go +++ b/src/checkout/model_generic_issuer_payment_method_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_giropay_details.go b/src/checkout/model_giropay_details.go index 44c7fc96b..e1fd55973 100644 --- a/src/checkout/model_giropay_details.go +++ b/src/checkout/model_giropay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_google_pay_details.go b/src/checkout/model_google_pay_details.go index 0a7e43e80..3cf6fdd51 100644 --- a/src/checkout/model_google_pay_details.go +++ b/src/checkout/model_google_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_ideal_details.go b/src/checkout/model_ideal_details.go index 3ef0356ff..42f9937d6 100644 --- a/src/checkout/model_ideal_details.go +++ b/src/checkout/model_ideal_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_input_detail.go b/src/checkout/model_input_detail.go index be0c0763a..203b917a3 100644 --- a/src/checkout/model_input_detail.go +++ b/src/checkout/model_input_detail.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_installment_option.go b/src/checkout/model_installment_option.go index 3d145071d..bc5b26fd3 100644 --- a/src/checkout/model_installment_option.go +++ b/src/checkout/model_installment_option.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_installments.go b/src/checkout/model_installments.go index 77c16860d..f59190a17 100644 --- a/src/checkout/model_installments.go +++ b/src/checkout/model_installments.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_installments_number.go b/src/checkout/model_installments_number.go index eb22b09a9..8ad933a9e 100644 --- a/src/checkout/model_installments_number.go +++ b/src/checkout/model_installments_number.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_item.go b/src/checkout/model_item.go index 384b7a5d8..2eca14354 100644 --- a/src/checkout/model_item.go +++ b/src/checkout/model_item.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_klarna_details.go b/src/checkout/model_klarna_details.go index 9195e2ae1..ab8a26ac7 100644 --- a/src/checkout/model_klarna_details.go +++ b/src/checkout/model_klarna_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_line_item.go b/src/checkout/model_line_item.go index a4fcb0dd5..9fc680a1e 100644 --- a/src/checkout/model_line_item.go +++ b/src/checkout/model_line_item.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_list_stored_payment_methods_response.go b/src/checkout/model_list_stored_payment_methods_response.go index 53803d7c1..d9e14e9e4 100644 --- a/src/checkout/model_list_stored_payment_methods_response.go +++ b/src/checkout/model_list_stored_payment_methods_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_mandate.go b/src/checkout/model_mandate.go index c49d6b509..28b1335bf 100644 --- a/src/checkout/model_mandate.go +++ b/src/checkout/model_mandate.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_masterpass_details.go b/src/checkout/model_masterpass_details.go index 9ca5c0aca..d11041abe 100644 --- a/src/checkout/model_masterpass_details.go +++ b/src/checkout/model_masterpass_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_mbway_details.go b/src/checkout/model_mbway_details.go index a302b647d..bbdf301ce 100644 --- a/src/checkout/model_mbway_details.go +++ b/src/checkout/model_mbway_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_merchant_device.go b/src/checkout/model_merchant_device.go index f05d27f0d..87a75fa82 100644 --- a/src/checkout/model_merchant_device.go +++ b/src/checkout/model_merchant_device.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_merchant_risk_indicator.go b/src/checkout/model_merchant_risk_indicator.go index 3bafc3232..6bb10743e 100644 --- a/src/checkout/model_merchant_risk_indicator.go +++ b/src/checkout/model_merchant_risk_indicator.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_mobile_pay_details.go b/src/checkout/model_mobile_pay_details.go index 823a3cbe1..d168dd2b7 100644 --- a/src/checkout/model_mobile_pay_details.go +++ b/src/checkout/model_mobile_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_mol_pay_details.go b/src/checkout/model_mol_pay_details.go index 74c6df331..a21ad59ba 100644 --- a/src/checkout/model_mol_pay_details.go +++ b/src/checkout/model_mol_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_name.go b/src/checkout/model_name.go index b83ef11e0..1dc9c1791 100644 --- a/src/checkout/model_name.go +++ b/src/checkout/model_name.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_open_invoice_details.go b/src/checkout/model_open_invoice_details.go index 8a80ce7a5..8381fb7d8 100644 --- a/src/checkout/model_open_invoice_details.go +++ b/src/checkout/model_open_invoice_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_pay_pal_details.go b/src/checkout/model_pay_pal_details.go index e8e6b0f66..5b6de3eba 100644 --- a/src/checkout/model_pay_pal_details.go +++ b/src/checkout/model_pay_pal_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_pay_u_upi_details.go b/src/checkout/model_pay_u_upi_details.go index 57cf69351..5e749a879 100644 --- a/src/checkout/model_pay_u_upi_details.go +++ b/src/checkout/model_pay_u_upi_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_pay_with_google_details.go b/src/checkout/model_pay_with_google_details.go index 31e83b992..1d71c37cc 100644 --- a/src/checkout/model_pay_with_google_details.go +++ b/src/checkout/model_pay_with_google_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_amount_update_request.go b/src/checkout/model_payment_amount_update_request.go index 620310600..008efec4b 100644 --- a/src/checkout/model_payment_amount_update_request.go +++ b/src/checkout/model_payment_amount_update_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_amount_update_response.go b/src/checkout/model_payment_amount_update_response.go index 03ddc2600..8806a2dd7 100644 --- a/src/checkout/model_payment_amount_update_response.go +++ b/src/checkout/model_payment_amount_update_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,6 +22,8 @@ type PaymentAmountUpdateResponse struct { Amount Amount `json:"amount"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` + // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. @@ -115,6 +117,38 @@ func (o *PaymentAmountUpdateResponse) SetIndustryUsage(v string) { o.IndustryUsage = &v } +// GetLineItems returns the LineItems field value if set, zero value otherwise. +func (o *PaymentAmountUpdateResponse) GetLineItems() []LineItem { + if o == nil || common.IsNil(o.LineItems) { + var ret []LineItem + return ret + } + return o.LineItems +} + +// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentAmountUpdateResponse) GetLineItemsOk() ([]LineItem, bool) { + if o == nil || common.IsNil(o.LineItems) { + return nil, false + } + return o.LineItems, true +} + +// HasLineItems returns a boolean if a field has been set. +func (o *PaymentAmountUpdateResponse) HasLineItems() bool { + if o != nil && !common.IsNil(o.LineItems) { + return true + } + + return false +} + +// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field. +func (o *PaymentAmountUpdateResponse) SetLineItems(v []LineItem) { + o.LineItems = v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *PaymentAmountUpdateResponse) GetMerchantAccount() string { if o == nil { @@ -281,6 +315,9 @@ func (o PaymentAmountUpdateResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } + if !common.IsNil(o.LineItems) { + toSerialize["lineItems"] = o.LineItems + } toSerialize["merchantAccount"] = o.MerchantAccount toSerialize["paymentPspReference"] = o.PaymentPspReference toSerialize["pspReference"] = o.PspReference diff --git a/src/checkout/model_payment_cancel_request.go b/src/checkout/model_payment_cancel_request.go index 42aa856c7..97f7579e0 100644 --- a/src/checkout/model_payment_cancel_request.go +++ b/src/checkout/model_payment_cancel_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_cancel_response.go b/src/checkout/model_payment_cancel_response.go index b67e08f2c..5f4e1d121 100644 --- a/src/checkout/model_payment_cancel_response.go +++ b/src/checkout/model_payment_cancel_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 0b1be6715..56e017e33 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_capture_response.go b/src/checkout/model_payment_capture_response.go index 9fd22ca2c..b6809bdba 100644 --- a/src/checkout/model_payment_capture_response.go +++ b/src/checkout/model_payment_capture_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_completion_details.go b/src/checkout/model_payment_completion_details.go index 3b411e676..b8d0f5b0c 100644 --- a/src/checkout/model_payment_completion_details.go +++ b/src/checkout/model_payment_completion_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 1d8f0c25f..61cb5f947 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_details_request.go b/src/checkout/model_payment_details_request.go index 5611b4b8d..77cb1205c 100644 --- a/src/checkout/model_payment_details_request.go +++ b/src/checkout/model_payment_details_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_details_response.go b/src/checkout/model_payment_details_response.go index dc8c4ae87..bdb91f6cd 100644 --- a/src/checkout/model_payment_details_response.go +++ b/src/checkout/model_payment_details_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_link_request.go b/src/checkout/model_payment_link_request.go index a8df68948..fc570e9c0 100644 --- a/src/checkout/model_payment_link_request.go +++ b/src/checkout/model_payment_link_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -38,8 +38,8 @@ type PaymentLinkRequest struct { DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - ExpiresAt *string `json:"expiresAt,omitempty"` + // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. InstallmentOptions *map[string]InstallmentOption `json:"installmentOptions,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. @@ -465,9 +465,9 @@ func (o *PaymentLinkRequest) SetDescription(v string) { } // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *PaymentLinkRequest) GetExpiresAt() string { +func (o *PaymentLinkRequest) GetExpiresAt() time.Time { if o == nil || common.IsNil(o.ExpiresAt) { - var ret string + var ret time.Time return ret } return *o.ExpiresAt @@ -475,7 +475,7 @@ func (o *PaymentLinkRequest) GetExpiresAt() string { // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentLinkRequest) GetExpiresAtOk() (*string, bool) { +func (o *PaymentLinkRequest) GetExpiresAtOk() (*time.Time, bool) { if o == nil || common.IsNil(o.ExpiresAt) { return nil, false } @@ -491,8 +491,8 @@ func (o *PaymentLinkRequest) HasExpiresAt() bool { return false } -// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. -func (o *PaymentLinkRequest) SetExpiresAt(v string) { +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *PaymentLinkRequest) SetExpiresAt(v time.Time) { o.ExpiresAt = &v } diff --git a/src/checkout/model_payment_link_response.go b/src/checkout/model_payment_link_response.go index f947f87b9..8264cbfc7 100644 --- a/src/checkout/model_payment_link_response.go +++ b/src/checkout/model_payment_link_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -38,8 +38,8 @@ type PaymentLinkResponse struct { DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` - // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone designator **Z**: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30Z**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - ExpiresAt *string `json:"expiresAt,omitempty"` + // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` // A unique identifier of the payment link. Id string `json:"id"` // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. @@ -476,9 +476,9 @@ func (o *PaymentLinkResponse) SetDescription(v string) { } // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *PaymentLinkResponse) GetExpiresAt() string { +func (o *PaymentLinkResponse) GetExpiresAt() time.Time { if o == nil || common.IsNil(o.ExpiresAt) { - var ret string + var ret time.Time return ret } return *o.ExpiresAt @@ -486,7 +486,7 @@ func (o *PaymentLinkResponse) GetExpiresAt() string { // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentLinkResponse) GetExpiresAtOk() (*string, bool) { +func (o *PaymentLinkResponse) GetExpiresAtOk() (*time.Time, bool) { if o == nil || common.IsNil(o.ExpiresAt) { return nil, false } @@ -502,8 +502,8 @@ func (o *PaymentLinkResponse) HasExpiresAt() bool { return false } -// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. -func (o *PaymentLinkResponse) SetExpiresAt(v string) { +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *PaymentLinkResponse) SetExpiresAt(v time.Time) { o.ExpiresAt = &v } diff --git a/src/checkout/model_payment_method.go b/src/checkout/model_payment_method.go index e4da2a998..dec5bb9e9 100644 --- a/src/checkout/model_payment_method.go +++ b/src/checkout/model_payment_method.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_method_group.go b/src/checkout/model_payment_method_group.go index d63032468..af7eb66b7 100644 --- a/src/checkout/model_payment_method_group.go +++ b/src/checkout/model_payment_method_group.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_method_issuer.go b/src/checkout/model_payment_method_issuer.go index e698b0da3..52477c3be 100644 --- a/src/checkout/model_payment_method_issuer.go +++ b/src/checkout/model_payment_method_issuer.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_methods_request.go b/src/checkout/model_payment_methods_request.go index 0a9db2091..07ff9d824 100644 --- a/src/checkout/model_payment_methods_request.go +++ b/src/checkout/model_payment_methods_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_methods_response.go b/src/checkout/model_payment_methods_response.go index 60346fd0a..03703b634 100644 --- a/src/checkout/model_payment_methods_response.go +++ b/src/checkout/model_payment_methods_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_refund_request.go b/src/checkout/model_payment_refund_request.go index 824bf95f1..b46c07486 100644 --- a/src/checkout/model_payment_refund_request.go +++ b/src/checkout/model_payment_refund_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_refund_response.go b/src/checkout/model_payment_refund_response.go index ab108eade..d9fac716d 100644 --- a/src/checkout/model_payment_refund_response.go +++ b/src/checkout/model_payment_refund_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index 12d4b4426..dbbf383a6 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -128,8 +128,8 @@ type PaymentRequest struct { // When true and `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` - ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` + ThreeDS2RequestData *ThreeDS2RequestFields `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -2178,9 +2178,9 @@ func (o *PaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { +func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestFields { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData2 + var ret ThreeDS2RequestFields return ret } return *o.ThreeDS2RequestData @@ -2188,7 +2188,7 @@ func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { // GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { +func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestFields, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2204,8 +2204,8 @@ func (o *PaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. -func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestFields and assigns it to the ThreeDS2RequestData field. +func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestFields) { o.ThreeDS2RequestData = &v } diff --git a/src/checkout/model_payment_response.go b/src/checkout/model_payment_response.go index a17eec40a..445269d07 100644 --- a/src/checkout/model_payment_response.go +++ b/src/checkout/model_payment_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_response_action.go b/src/checkout/model_payment_response_action.go index be125e42c..01fd48b0a 100644 --- a/src/checkout/model_payment_response_action.go +++ b/src/checkout/model_payment_response_action.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_reversal_request.go b/src/checkout/model_payment_reversal_request.go index 8aed58819..a2a3c1acf 100644 --- a/src/checkout/model_payment_reversal_request.go +++ b/src/checkout/model_payment_reversal_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_reversal_response.go b/src/checkout/model_payment_reversal_response.go index 16f33f6aa..6ac1db3ed 100644 --- a/src/checkout/model_payment_reversal_response.go +++ b/src/checkout/model_payment_reversal_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_setup_request.go b/src/checkout/model_payment_setup_request.go index b1cdb784d..4b3f9aca2 100644 --- a/src/checkout/model_payment_setup_request.go +++ b/src/checkout/model_payment_setup_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_setup_response.go b/src/checkout/model_payment_setup_response.go index c2bbd2297..9f54aabb0 100644 --- a/src/checkout/model_payment_setup_response.go +++ b/src/checkout/model_payment_setup_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_verification_request.go b/src/checkout/model_payment_verification_request.go index b9e55e429..541bb59f2 100644 --- a/src/checkout/model_payment_verification_request.go +++ b/src/checkout/model_payment_verification_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 5e39e03d2..92163443a 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -32,8 +32,8 @@ type PaymentVerificationResponse struct { // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - ResultCode *string `json:"resultCode,omitempty"` - ServiceError *ServiceError2 `json:"serviceError,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` + ServiceError *ServiceErrorDetails `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. ShopperLocale string `json:"shopperLocale"` } @@ -306,9 +306,9 @@ func (o *PaymentVerificationResponse) SetResultCode(v string) { } // GetServiceError returns the ServiceError field value if set, zero value otherwise. -func (o *PaymentVerificationResponse) GetServiceError() ServiceError2 { +func (o *PaymentVerificationResponse) GetServiceError() ServiceErrorDetails { if o == nil || common.IsNil(o.ServiceError) { - var ret ServiceError2 + var ret ServiceErrorDetails return ret } return *o.ServiceError @@ -316,7 +316,7 @@ func (o *PaymentVerificationResponse) GetServiceError() ServiceError2 { // GetServiceErrorOk returns a tuple with the ServiceError field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentVerificationResponse) GetServiceErrorOk() (*ServiceError2, bool) { +func (o *PaymentVerificationResponse) GetServiceErrorOk() (*ServiceErrorDetails, bool) { if o == nil || common.IsNil(o.ServiceError) { return nil, false } @@ -332,8 +332,8 @@ func (o *PaymentVerificationResponse) HasServiceError() bool { return false } -// SetServiceError gets a reference to the given ServiceError2 and assigns it to the ServiceError field. -func (o *PaymentVerificationResponse) SetServiceError(v ServiceError2) { +// SetServiceError gets a reference to the given ServiceErrorDetails and assigns it to the ServiceError field. +func (o *PaymentVerificationResponse) SetServiceError(v ServiceErrorDetails) { o.ServiceError = &v } diff --git a/src/checkout/model_phone.go b/src/checkout/model_phone.go index 506298265..e4c6782a6 100644 --- a/src/checkout/model_phone.go +++ b/src/checkout/model_phone.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_platform_chargeback_logic.go b/src/checkout/model_platform_chargeback_logic.go index d1d848dd7..0ce5ec062 100644 --- a/src/checkout/model_platform_chargeback_logic.go +++ b/src/checkout/model_platform_chargeback_logic.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_ratepay_details.go b/src/checkout/model_ratepay_details.go index 7ea48485b..8c9e5e8c7 100644 --- a/src/checkout/model_ratepay_details.go +++ b/src/checkout/model_ratepay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_recurring.go b/src/checkout/model_recurring.go index ac3c31d9f..69f39fbc5 100644 --- a/src/checkout/model_recurring.go +++ b/src/checkout/model_recurring.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/checkout/model_recurring_detail.go b/src/checkout/model_recurring_detail.go index 68cce8c0e..7298af584 100644 --- a/src/checkout/model_recurring_detail.go +++ b/src/checkout/model_recurring_detail.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data3_d_secure.go b/src/checkout/model_response_additional_data3_d_secure.go index a080bfb70..bacbd5342 100644 --- a/src/checkout/model_response_additional_data3_d_secure.go +++ b/src/checkout/model_response_additional_data3_d_secure.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_billing_address.go b/src/checkout/model_response_additional_data_billing_address.go index 8eb734b8a..bd146627c 100644 --- a/src/checkout/model_response_additional_data_billing_address.go +++ b/src/checkout/model_response_additional_data_billing_address.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_card.go b/src/checkout/model_response_additional_data_card.go index 08dd30926..5c3746eed 100644 --- a/src/checkout/model_response_additional_data_card.go +++ b/src/checkout/model_response_additional_data_card.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_common.go b/src/checkout/model_response_additional_data_common.go index 056b1d287..62215a14e 100644 --- a/src/checkout/model_response_additional_data_common.go +++ b/src/checkout/model_response_additional_data_common.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_installments.go b/src/checkout/model_response_additional_data_installments.go index 0df330641..a75ae1701 100644 --- a/src/checkout/model_response_additional_data_installments.go +++ b/src/checkout/model_response_additional_data_installments.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_network_tokens.go b/src/checkout/model_response_additional_data_network_tokens.go index c3ecac83f..aac040f99 100644 --- a/src/checkout/model_response_additional_data_network_tokens.go +++ b/src/checkout/model_response_additional_data_network_tokens.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_opi.go b/src/checkout/model_response_additional_data_opi.go index a508fb410..aede45fa8 100644 --- a/src/checkout/model_response_additional_data_opi.go +++ b/src/checkout/model_response_additional_data_opi.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_additional_data_sepa.go b/src/checkout/model_response_additional_data_sepa.go index ddf97cdc2..fb44dfb92 100644 --- a/src/checkout/model_response_additional_data_sepa.go +++ b/src/checkout/model_response_additional_data_sepa.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_response_payment_method.go b/src/checkout/model_response_payment_method.go index 940d023c5..61c1cc867 100644 --- a/src/checkout/model_response_payment_method.go +++ b/src/checkout/model_response_payment_method.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_risk_data.go b/src/checkout/model_risk_data.go index faa9b8cdd..c754d1987 100644 --- a/src/checkout/model_risk_data.go +++ b/src/checkout/model_risk_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_samsung_pay_details.go b/src/checkout/model_samsung_pay_details.go index 61056f9ac..685e7fc9b 100644 --- a/src/checkout/model_samsung_pay_details.go +++ b/src/checkout/model_samsung_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_sdk_ephem_pub_key.go b/src/checkout/model_sdk_ephem_pub_key.go index 9392ec140..0e53e9a62 100644 --- a/src/checkout/model_sdk_ephem_pub_key.go +++ b/src/checkout/model_sdk_ephem_pub_key.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_sepa_direct_debit_details.go b/src/checkout/model_sepa_direct_debit_details.go index c05935083..e6ca475e0 100644 --- a/src/checkout/model_sepa_direct_debit_details.go +++ b/src/checkout/model_sepa_direct_debit_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_service_error.go b/src/checkout/model_service_error.go index eaa0fd3e9..81e78e0ee 100644 --- a/src/checkout/model_service_error.go +++ b/src/checkout/model_service_error.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_service_error_2.go b/src/checkout/model_service_error_details.go similarity index 65% rename from src/checkout/model_service_error_2.go rename to src/checkout/model_service_error_details.go index faceec59e..95fb00855 100644 --- a/src/checkout/model_service_error_2.go +++ b/src/checkout/model_service_error_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -14,36 +14,36 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/common" ) -// checks if the ServiceError2 type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &ServiceError2{} +// checks if the ServiceErrorDetails type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ServiceErrorDetails{} -// ServiceError2 struct for ServiceError2 -type ServiceError2 struct { +// ServiceErrorDetails struct for ServiceErrorDetails +type ServiceErrorDetails struct { ErrorCode *string `json:"errorCode,omitempty"` ErrorType *string `json:"errorType,omitempty"` Message *string `json:"message,omitempty"` PspReference *string `json:"pspReference,omitempty"` } -// NewServiceError2 instantiates a new ServiceError2 object +// NewServiceErrorDetails instantiates a new ServiceErrorDetails 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 NewServiceError2() *ServiceError2 { - this := ServiceError2{} +func NewServiceErrorDetails() *ServiceErrorDetails { + this := ServiceErrorDetails{} return &this } -// NewServiceError2WithDefaults instantiates a new ServiceError2 object +// NewServiceErrorDetailsWithDefaults instantiates a new ServiceErrorDetails 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 NewServiceError2WithDefaults() *ServiceError2 { - this := ServiceError2{} +func NewServiceErrorDetailsWithDefaults() *ServiceErrorDetails { + this := ServiceErrorDetails{} return &this } // GetErrorCode returns the ErrorCode field value if set, zero value otherwise. -func (o *ServiceError2) GetErrorCode() string { +func (o *ServiceErrorDetails) GetErrorCode() string { if o == nil || common.IsNil(o.ErrorCode) { var ret string return ret @@ -53,7 +53,7 @@ func (o *ServiceError2) GetErrorCode() string { // GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceError2) GetErrorCodeOk() (*string, bool) { +func (o *ServiceErrorDetails) GetErrorCodeOk() (*string, bool) { if o == nil || common.IsNil(o.ErrorCode) { return nil, false } @@ -61,7 +61,7 @@ func (o *ServiceError2) GetErrorCodeOk() (*string, bool) { } // HasErrorCode returns a boolean if a field has been set. -func (o *ServiceError2) HasErrorCode() bool { +func (o *ServiceErrorDetails) HasErrorCode() bool { if o != nil && !common.IsNil(o.ErrorCode) { return true } @@ -70,12 +70,12 @@ func (o *ServiceError2) HasErrorCode() bool { } // SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. -func (o *ServiceError2) SetErrorCode(v string) { +func (o *ServiceErrorDetails) SetErrorCode(v string) { o.ErrorCode = &v } // GetErrorType returns the ErrorType field value if set, zero value otherwise. -func (o *ServiceError2) GetErrorType() string { +func (o *ServiceErrorDetails) GetErrorType() string { if o == nil || common.IsNil(o.ErrorType) { var ret string return ret @@ -85,7 +85,7 @@ func (o *ServiceError2) GetErrorType() string { // GetErrorTypeOk returns a tuple with the ErrorType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceError2) GetErrorTypeOk() (*string, bool) { +func (o *ServiceErrorDetails) GetErrorTypeOk() (*string, bool) { if o == nil || common.IsNil(o.ErrorType) { return nil, false } @@ -93,7 +93,7 @@ func (o *ServiceError2) GetErrorTypeOk() (*string, bool) { } // HasErrorType returns a boolean if a field has been set. -func (o *ServiceError2) HasErrorType() bool { +func (o *ServiceErrorDetails) HasErrorType() bool { if o != nil && !common.IsNil(o.ErrorType) { return true } @@ -102,12 +102,12 @@ func (o *ServiceError2) HasErrorType() bool { } // SetErrorType gets a reference to the given string and assigns it to the ErrorType field. -func (o *ServiceError2) SetErrorType(v string) { +func (o *ServiceErrorDetails) SetErrorType(v string) { o.ErrorType = &v } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *ServiceError2) GetMessage() string { +func (o *ServiceErrorDetails) GetMessage() string { if o == nil || common.IsNil(o.Message) { var ret string return ret @@ -117,7 +117,7 @@ func (o *ServiceError2) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceError2) GetMessageOk() (*string, bool) { +func (o *ServiceErrorDetails) GetMessageOk() (*string, bool) { if o == nil || common.IsNil(o.Message) { return nil, false } @@ -125,7 +125,7 @@ func (o *ServiceError2) GetMessageOk() (*string, bool) { } // HasMessage returns a boolean if a field has been set. -func (o *ServiceError2) HasMessage() bool { +func (o *ServiceErrorDetails) HasMessage() bool { if o != nil && !common.IsNil(o.Message) { return true } @@ -134,12 +134,12 @@ func (o *ServiceError2) HasMessage() bool { } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ServiceError2) SetMessage(v string) { +func (o *ServiceErrorDetails) SetMessage(v string) { o.Message = &v } // GetPspReference returns the PspReference field value if set, zero value otherwise. -func (o *ServiceError2) GetPspReference() string { +func (o *ServiceErrorDetails) GetPspReference() string { if o == nil || common.IsNil(o.PspReference) { var ret string return ret @@ -149,7 +149,7 @@ func (o *ServiceError2) GetPspReference() string { // GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceError2) GetPspReferenceOk() (*string, bool) { +func (o *ServiceErrorDetails) GetPspReferenceOk() (*string, bool) { if o == nil || common.IsNil(o.PspReference) { return nil, false } @@ -157,7 +157,7 @@ func (o *ServiceError2) GetPspReferenceOk() (*string, bool) { } // HasPspReference returns a boolean if a field has been set. -func (o *ServiceError2) HasPspReference() bool { +func (o *ServiceErrorDetails) HasPspReference() bool { if o != nil && !common.IsNil(o.PspReference) { return true } @@ -166,11 +166,11 @@ func (o *ServiceError2) HasPspReference() bool { } // SetPspReference gets a reference to the given string and assigns it to the PspReference field. -func (o *ServiceError2) SetPspReference(v string) { +func (o *ServiceErrorDetails) SetPspReference(v string) { o.PspReference = &v } -func (o ServiceError2) MarshalJSON() ([]byte, error) { +func (o ServiceErrorDetails) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -178,7 +178,7 @@ func (o ServiceError2) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ServiceError2) ToMap() (map[string]interface{}, error) { +func (o ServiceErrorDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !common.IsNil(o.ErrorCode) { toSerialize["errorCode"] = o.ErrorCode @@ -195,38 +195,38 @@ func (o ServiceError2) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -type NullableServiceError2 struct { - value *ServiceError2 +type NullableServiceErrorDetails struct { + value *ServiceErrorDetails isSet bool } -func (v NullableServiceError2) Get() *ServiceError2 { +func (v NullableServiceErrorDetails) Get() *ServiceErrorDetails { return v.value } -func (v *NullableServiceError2) Set(val *ServiceError2) { +func (v *NullableServiceErrorDetails) Set(val *ServiceErrorDetails) { v.value = val v.isSet = true } -func (v NullableServiceError2) IsSet() bool { +func (v NullableServiceErrorDetails) IsSet() bool { return v.isSet } -func (v *NullableServiceError2) Unset() { +func (v *NullableServiceErrorDetails) Unset() { v.value = nil v.isSet = false } -func NewNullableServiceError2(val *ServiceError2) *NullableServiceError2 { - return &NullableServiceError2{value: val, isSet: true} +func NewNullableServiceErrorDetails(val *ServiceErrorDetails) *NullableServiceErrorDetails { + return &NullableServiceErrorDetails{value: val, isSet: true} } -func (v NullableServiceError2) MarshalJSON() ([]byte, error) { +func (v NullableServiceErrorDetails) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableServiceError2) UnmarshalJSON(src []byte) error { +func (v *NullableServiceErrorDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/src/checkout/model_session_result_response.go b/src/checkout/model_session_result_response.go index 1ac243fca..e5eae54f8 100644 --- a/src/checkout/model_session_result_response.go +++ b/src/checkout/model_session_result_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_shopper_input.go b/src/checkout/model_shopper_input.go index 802ba47c2..8bba71d5f 100644 --- a/src/checkout/model_shopper_input.go +++ b/src/checkout/model_shopper_input.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_shopper_interaction_device.go b/src/checkout/model_shopper_interaction_device.go index b9cb33650..c5eac1b8e 100644 --- a/src/checkout/model_shopper_interaction_device.go +++ b/src/checkout/model_shopper_interaction_device.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index 513463d4f..33a8b594c 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_split_amount.go b/src/checkout/model_split_amount.go index d413fd197..e1dbba771 100644 --- a/src/checkout/model_split_amount.go +++ b/src/checkout/model_split_amount.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_standalone_payment_cancel_request.go b/src/checkout/model_standalone_payment_cancel_request.go index 22d47d117..6e69a66b7 100644 --- a/src/checkout/model_standalone_payment_cancel_request.go +++ b/src/checkout/model_standalone_payment_cancel_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_standalone_payment_cancel_response.go b/src/checkout/model_standalone_payment_cancel_response.go index c6e3a9950..6f2931a78 100644 --- a/src/checkout/model_standalone_payment_cancel_response.go +++ b/src/checkout/model_standalone_payment_cancel_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_stored_details.go b/src/checkout/model_stored_details.go index 9c62555b6..ed45cb4c6 100644 --- a/src/checkout/model_stored_details.go +++ b/src/checkout/model_stored_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_stored_payment_method.go b/src/checkout/model_stored_payment_method.go index 1ea08e3d4..1b99dd393 100644 --- a/src/checkout/model_stored_payment_method.go +++ b/src/checkout/model_stored_payment_method.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_stored_payment_method_details.go b/src/checkout/model_stored_payment_method_details.go index ddbc4a426..035c87a80 100644 --- a/src/checkout/model_stored_payment_method_details.go +++ b/src/checkout/model_stored_payment_method_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_stored_payment_method_resource.go b/src/checkout/model_stored_payment_method_resource.go index 19c53c52b..12a05ebe3 100644 --- a/src/checkout/model_stored_payment_method_resource.go +++ b/src/checkout/model_stored_payment_method_resource.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_sub_input_detail.go b/src/checkout/model_sub_input_detail.go index cd004b1ca..af87aac9b 100644 --- a/src/checkout/model_sub_input_detail.go +++ b/src/checkout/model_sub_input_detail.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_sub_merchant.go b/src/checkout/model_sub_merchant.go index 22509c947..ce4447589 100644 --- a/src/checkout/model_sub_merchant.go +++ b/src/checkout/model_sub_merchant.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_sub_merchant_info.go b/src/checkout/model_sub_merchant_info.go index 91b80c990..4caff73d8 100644 --- a/src/checkout/model_sub_merchant_info.go +++ b/src/checkout/model_sub_merchant_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_d_secure_data.go b/src/checkout/model_three_d_secure_data.go index ead4a721a..5deb62498 100644 --- a/src/checkout/model_three_d_secure_data.go +++ b/src/checkout/model_three_d_secure_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds2_request_data.go b/src/checkout/model_three_ds2_request_data.go index 82eac06c7..3e7e8b536 100644 --- a/src/checkout/model_three_ds2_request_data.go +++ b/src/checkout/model_three_ds2_request_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds2_request_data_2.go b/src/checkout/model_three_ds2_request_fields.go similarity index 78% rename from src/checkout/model_three_ds2_request_data_2.go rename to src/checkout/model_three_ds2_request_fields.go index 7f355eefb..4bb6a1af0 100644 --- a/src/checkout/model_three_ds2_request_data_2.go +++ b/src/checkout/model_three_ds2_request_fields.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -14,11 +14,11 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/common" ) -// checks if the ThreeDS2RequestData2 type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &ThreeDS2RequestData2{} +// checks if the ThreeDS2RequestFields type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ThreeDS2RequestFields{} -// ThreeDS2RequestData2 struct for ThreeDS2RequestData2 -type ThreeDS2RequestData2 struct { +// ThreeDS2RequestFields struct for ThreeDS2RequestFields +type ThreeDS2RequestFields struct { AcctInfo *AcctInfo `json:"acctInfo,omitempty"` // Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit AcctType *string `json:"acctType,omitempty"` @@ -87,12 +87,12 @@ type ThreeDS2RequestData2 struct { WorkPhone *Phone `json:"workPhone,omitempty"` } -// NewThreeDS2RequestData2 instantiates a new ThreeDS2RequestData2 object +// NewThreeDS2RequestFields instantiates a new ThreeDS2RequestFields 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 NewThreeDS2RequestData2() *ThreeDS2RequestData2 { - this := ThreeDS2RequestData2{} +func NewThreeDS2RequestFields() *ThreeDS2RequestFields { + this := ThreeDS2RequestFields{} var authenticationOnly bool = false this.AuthenticationOnly = &authenticationOnly var sdkMaxTimeout int32 = 60 @@ -100,11 +100,11 @@ func NewThreeDS2RequestData2() *ThreeDS2RequestData2 { return &this } -// NewThreeDS2RequestData2WithDefaults instantiates a new ThreeDS2RequestData2 object +// NewThreeDS2RequestFieldsWithDefaults instantiates a new ThreeDS2RequestFields 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 NewThreeDS2RequestData2WithDefaults() *ThreeDS2RequestData2 { - this := ThreeDS2RequestData2{} +func NewThreeDS2RequestFieldsWithDefaults() *ThreeDS2RequestFields { + this := ThreeDS2RequestFields{} var authenticationOnly bool = false this.AuthenticationOnly = &authenticationOnly var sdkMaxTimeout int32 = 60 @@ -113,7 +113,7 @@ func NewThreeDS2RequestData2WithDefaults() *ThreeDS2RequestData2 { } // GetAcctInfo returns the AcctInfo field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetAcctInfo() AcctInfo { +func (o *ThreeDS2RequestFields) GetAcctInfo() AcctInfo { if o == nil || common.IsNil(o.AcctInfo) { var ret AcctInfo return ret @@ -123,7 +123,7 @@ func (o *ThreeDS2RequestData2) GetAcctInfo() AcctInfo { // GetAcctInfoOk returns a tuple with the AcctInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetAcctInfoOk() (*AcctInfo, bool) { +func (o *ThreeDS2RequestFields) GetAcctInfoOk() (*AcctInfo, bool) { if o == nil || common.IsNil(o.AcctInfo) { return nil, false } @@ -131,7 +131,7 @@ func (o *ThreeDS2RequestData2) GetAcctInfoOk() (*AcctInfo, bool) { } // HasAcctInfo returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAcctInfo() bool { +func (o *ThreeDS2RequestFields) HasAcctInfo() bool { if o != nil && !common.IsNil(o.AcctInfo) { return true } @@ -140,12 +140,12 @@ func (o *ThreeDS2RequestData2) HasAcctInfo() bool { } // SetAcctInfo gets a reference to the given AcctInfo and assigns it to the AcctInfo field. -func (o *ThreeDS2RequestData2) SetAcctInfo(v AcctInfo) { +func (o *ThreeDS2RequestFields) SetAcctInfo(v AcctInfo) { o.AcctInfo = &v } // GetAcctType returns the AcctType field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetAcctType() string { +func (o *ThreeDS2RequestFields) GetAcctType() string { if o == nil || common.IsNil(o.AcctType) { var ret string return ret @@ -155,7 +155,7 @@ func (o *ThreeDS2RequestData2) GetAcctType() string { // GetAcctTypeOk returns a tuple with the AcctType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetAcctTypeOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetAcctTypeOk() (*string, bool) { if o == nil || common.IsNil(o.AcctType) { return nil, false } @@ -163,7 +163,7 @@ func (o *ThreeDS2RequestData2) GetAcctTypeOk() (*string, bool) { } // HasAcctType returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAcctType() bool { +func (o *ThreeDS2RequestFields) HasAcctType() bool { if o != nil && !common.IsNil(o.AcctType) { return true } @@ -172,12 +172,12 @@ func (o *ThreeDS2RequestData2) HasAcctType() bool { } // SetAcctType gets a reference to the given string and assigns it to the AcctType field. -func (o *ThreeDS2RequestData2) SetAcctType(v string) { +func (o *ThreeDS2RequestFields) SetAcctType(v string) { o.AcctType = &v } // GetAcquirerBIN returns the AcquirerBIN field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetAcquirerBIN() string { +func (o *ThreeDS2RequestFields) GetAcquirerBIN() string { if o == nil || common.IsNil(o.AcquirerBIN) { var ret string return ret @@ -187,7 +187,7 @@ func (o *ThreeDS2RequestData2) GetAcquirerBIN() string { // GetAcquirerBINOk returns a tuple with the AcquirerBIN field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetAcquirerBINOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetAcquirerBINOk() (*string, bool) { if o == nil || common.IsNil(o.AcquirerBIN) { return nil, false } @@ -195,7 +195,7 @@ func (o *ThreeDS2RequestData2) GetAcquirerBINOk() (*string, bool) { } // HasAcquirerBIN returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAcquirerBIN() bool { +func (o *ThreeDS2RequestFields) HasAcquirerBIN() bool { if o != nil && !common.IsNil(o.AcquirerBIN) { return true } @@ -204,12 +204,12 @@ func (o *ThreeDS2RequestData2) HasAcquirerBIN() bool { } // SetAcquirerBIN gets a reference to the given string and assigns it to the AcquirerBIN field. -func (o *ThreeDS2RequestData2) SetAcquirerBIN(v string) { +func (o *ThreeDS2RequestFields) SetAcquirerBIN(v string) { o.AcquirerBIN = &v } // GetAcquirerMerchantID returns the AcquirerMerchantID field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetAcquirerMerchantID() string { +func (o *ThreeDS2RequestFields) GetAcquirerMerchantID() string { if o == nil || common.IsNil(o.AcquirerMerchantID) { var ret string return ret @@ -219,7 +219,7 @@ func (o *ThreeDS2RequestData2) GetAcquirerMerchantID() string { // GetAcquirerMerchantIDOk returns a tuple with the AcquirerMerchantID field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetAcquirerMerchantIDOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetAcquirerMerchantIDOk() (*string, bool) { if o == nil || common.IsNil(o.AcquirerMerchantID) { return nil, false } @@ -227,7 +227,7 @@ func (o *ThreeDS2RequestData2) GetAcquirerMerchantIDOk() (*string, bool) { } // HasAcquirerMerchantID returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAcquirerMerchantID() bool { +func (o *ThreeDS2RequestFields) HasAcquirerMerchantID() bool { if o != nil && !common.IsNil(o.AcquirerMerchantID) { return true } @@ -236,12 +236,12 @@ func (o *ThreeDS2RequestData2) HasAcquirerMerchantID() bool { } // SetAcquirerMerchantID gets a reference to the given string and assigns it to the AcquirerMerchantID field. -func (o *ThreeDS2RequestData2) SetAcquirerMerchantID(v string) { +func (o *ThreeDS2RequestFields) SetAcquirerMerchantID(v string) { o.AcquirerMerchantID = &v } // GetAddrMatch returns the AddrMatch field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetAddrMatch() string { +func (o *ThreeDS2RequestFields) GetAddrMatch() string { if o == nil || common.IsNil(o.AddrMatch) { var ret string return ret @@ -251,7 +251,7 @@ func (o *ThreeDS2RequestData2) GetAddrMatch() string { // GetAddrMatchOk returns a tuple with the AddrMatch field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetAddrMatchOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetAddrMatchOk() (*string, bool) { if o == nil || common.IsNil(o.AddrMatch) { return nil, false } @@ -259,7 +259,7 @@ func (o *ThreeDS2RequestData2) GetAddrMatchOk() (*string, bool) { } // HasAddrMatch returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAddrMatch() bool { +func (o *ThreeDS2RequestFields) HasAddrMatch() bool { if o != nil && !common.IsNil(o.AddrMatch) { return true } @@ -268,13 +268,13 @@ func (o *ThreeDS2RequestData2) HasAddrMatch() bool { } // SetAddrMatch gets a reference to the given string and assigns it to the AddrMatch field. -func (o *ThreeDS2RequestData2) SetAddrMatch(v string) { +func (o *ThreeDS2RequestFields) SetAddrMatch(v string) { o.AddrMatch = &v } // GetAuthenticationOnly returns the AuthenticationOnly field value if set, zero value otherwise. // Deprecated -func (o *ThreeDS2RequestData2) GetAuthenticationOnly() bool { +func (o *ThreeDS2RequestFields) GetAuthenticationOnly() bool { if o == nil || common.IsNil(o.AuthenticationOnly) { var ret bool return ret @@ -285,7 +285,7 @@ func (o *ThreeDS2RequestData2) GetAuthenticationOnly() bool { // GetAuthenticationOnlyOk returns a tuple with the AuthenticationOnly field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated -func (o *ThreeDS2RequestData2) GetAuthenticationOnlyOk() (*bool, bool) { +func (o *ThreeDS2RequestFields) GetAuthenticationOnlyOk() (*bool, bool) { if o == nil || common.IsNil(o.AuthenticationOnly) { return nil, false } @@ -293,7 +293,7 @@ func (o *ThreeDS2RequestData2) GetAuthenticationOnlyOk() (*bool, bool) { } // HasAuthenticationOnly returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasAuthenticationOnly() bool { +func (o *ThreeDS2RequestFields) HasAuthenticationOnly() bool { if o != nil && !common.IsNil(o.AuthenticationOnly) { return true } @@ -303,13 +303,13 @@ func (o *ThreeDS2RequestData2) HasAuthenticationOnly() bool { // SetAuthenticationOnly gets a reference to the given bool and assigns it to the AuthenticationOnly field. // Deprecated -func (o *ThreeDS2RequestData2) SetAuthenticationOnly(v bool) { +func (o *ThreeDS2RequestFields) SetAuthenticationOnly(v bool) { o.AuthenticationOnly = &v } // GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. // Deprecated -func (o *ThreeDS2RequestData2) GetChallengeIndicator() string { +func (o *ThreeDS2RequestFields) GetChallengeIndicator() string { if o == nil || common.IsNil(o.ChallengeIndicator) { var ret string return ret @@ -320,7 +320,7 @@ func (o *ThreeDS2RequestData2) GetChallengeIndicator() string { // GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated -func (o *ThreeDS2RequestData2) GetChallengeIndicatorOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetChallengeIndicatorOk() (*string, bool) { if o == nil || common.IsNil(o.ChallengeIndicator) { return nil, false } @@ -328,7 +328,7 @@ func (o *ThreeDS2RequestData2) GetChallengeIndicatorOk() (*string, bool) { } // HasChallengeIndicator returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasChallengeIndicator() bool { +func (o *ThreeDS2RequestFields) HasChallengeIndicator() bool { if o != nil && !common.IsNil(o.ChallengeIndicator) { return true } @@ -338,12 +338,12 @@ func (o *ThreeDS2RequestData2) HasChallengeIndicator() bool { // SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. // Deprecated -func (o *ThreeDS2RequestData2) SetChallengeIndicator(v string) { +func (o *ThreeDS2RequestFields) SetChallengeIndicator(v string) { o.ChallengeIndicator = &v } // GetDeviceRenderOptions returns the DeviceRenderOptions field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetDeviceRenderOptions() DeviceRenderOptions { +func (o *ThreeDS2RequestFields) GetDeviceRenderOptions() DeviceRenderOptions { if o == nil || common.IsNil(o.DeviceRenderOptions) { var ret DeviceRenderOptions return ret @@ -353,7 +353,7 @@ func (o *ThreeDS2RequestData2) GetDeviceRenderOptions() DeviceRenderOptions { // GetDeviceRenderOptionsOk returns a tuple with the DeviceRenderOptions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, bool) { +func (o *ThreeDS2RequestFields) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, bool) { if o == nil || common.IsNil(o.DeviceRenderOptions) { return nil, false } @@ -361,7 +361,7 @@ func (o *ThreeDS2RequestData2) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, } // HasDeviceRenderOptions returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasDeviceRenderOptions() bool { +func (o *ThreeDS2RequestFields) HasDeviceRenderOptions() bool { if o != nil && !common.IsNil(o.DeviceRenderOptions) { return true } @@ -370,12 +370,12 @@ func (o *ThreeDS2RequestData2) HasDeviceRenderOptions() bool { } // SetDeviceRenderOptions gets a reference to the given DeviceRenderOptions and assigns it to the DeviceRenderOptions field. -func (o *ThreeDS2RequestData2) SetDeviceRenderOptions(v DeviceRenderOptions) { +func (o *ThreeDS2RequestFields) SetDeviceRenderOptions(v DeviceRenderOptions) { o.DeviceRenderOptions = &v } // GetHomePhone returns the HomePhone field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetHomePhone() Phone { +func (o *ThreeDS2RequestFields) GetHomePhone() Phone { if o == nil || common.IsNil(o.HomePhone) { var ret Phone return ret @@ -385,7 +385,7 @@ func (o *ThreeDS2RequestData2) GetHomePhone() Phone { // GetHomePhoneOk returns a tuple with the HomePhone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetHomePhoneOk() (*Phone, bool) { +func (o *ThreeDS2RequestFields) GetHomePhoneOk() (*Phone, bool) { if o == nil || common.IsNil(o.HomePhone) { return nil, false } @@ -393,7 +393,7 @@ func (o *ThreeDS2RequestData2) GetHomePhoneOk() (*Phone, bool) { } // HasHomePhone returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasHomePhone() bool { +func (o *ThreeDS2RequestFields) HasHomePhone() bool { if o != nil && !common.IsNil(o.HomePhone) { return true } @@ -402,12 +402,12 @@ func (o *ThreeDS2RequestData2) HasHomePhone() bool { } // SetHomePhone gets a reference to the given Phone and assigns it to the HomePhone field. -func (o *ThreeDS2RequestData2) SetHomePhone(v Phone) { +func (o *ThreeDS2RequestFields) SetHomePhone(v Phone) { o.HomePhone = &v } // GetMcc returns the Mcc field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetMcc() string { +func (o *ThreeDS2RequestFields) GetMcc() string { if o == nil || common.IsNil(o.Mcc) { var ret string return ret @@ -417,7 +417,7 @@ func (o *ThreeDS2RequestData2) GetMcc() string { // 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 *ThreeDS2RequestData2) GetMccOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetMccOk() (*string, bool) { if o == nil || common.IsNil(o.Mcc) { return nil, false } @@ -425,7 +425,7 @@ func (o *ThreeDS2RequestData2) GetMccOk() (*string, bool) { } // HasMcc returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasMcc() bool { +func (o *ThreeDS2RequestFields) HasMcc() bool { if o != nil && !common.IsNil(o.Mcc) { return true } @@ -434,12 +434,12 @@ func (o *ThreeDS2RequestData2) HasMcc() bool { } // SetMcc gets a reference to the given string and assigns it to the Mcc field. -func (o *ThreeDS2RequestData2) SetMcc(v string) { +func (o *ThreeDS2RequestFields) SetMcc(v string) { o.Mcc = &v } // GetMerchantName returns the MerchantName field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetMerchantName() string { +func (o *ThreeDS2RequestFields) GetMerchantName() string { if o == nil || common.IsNil(o.MerchantName) { var ret string return ret @@ -449,7 +449,7 @@ func (o *ThreeDS2RequestData2) GetMerchantName() string { // GetMerchantNameOk returns a tuple with the MerchantName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetMerchantNameOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetMerchantNameOk() (*string, bool) { if o == nil || common.IsNil(o.MerchantName) { return nil, false } @@ -457,7 +457,7 @@ func (o *ThreeDS2RequestData2) GetMerchantNameOk() (*string, bool) { } // HasMerchantName returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasMerchantName() bool { +func (o *ThreeDS2RequestFields) HasMerchantName() bool { if o != nil && !common.IsNil(o.MerchantName) { return true } @@ -466,12 +466,12 @@ func (o *ThreeDS2RequestData2) HasMerchantName() bool { } // SetMerchantName gets a reference to the given string and assigns it to the MerchantName field. -func (o *ThreeDS2RequestData2) SetMerchantName(v string) { +func (o *ThreeDS2RequestFields) SetMerchantName(v string) { o.MerchantName = &v } // GetMessageVersion returns the MessageVersion field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetMessageVersion() string { +func (o *ThreeDS2RequestFields) GetMessageVersion() string { if o == nil || common.IsNil(o.MessageVersion) { var ret string return ret @@ -481,7 +481,7 @@ func (o *ThreeDS2RequestData2) GetMessageVersion() string { // GetMessageVersionOk returns a tuple with the MessageVersion field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetMessageVersionOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetMessageVersionOk() (*string, bool) { if o == nil || common.IsNil(o.MessageVersion) { return nil, false } @@ -489,7 +489,7 @@ func (o *ThreeDS2RequestData2) GetMessageVersionOk() (*string, bool) { } // HasMessageVersion returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasMessageVersion() bool { +func (o *ThreeDS2RequestFields) HasMessageVersion() bool { if o != nil && !common.IsNil(o.MessageVersion) { return true } @@ -498,12 +498,12 @@ func (o *ThreeDS2RequestData2) HasMessageVersion() bool { } // SetMessageVersion gets a reference to the given string and assigns it to the MessageVersion field. -func (o *ThreeDS2RequestData2) SetMessageVersion(v string) { +func (o *ThreeDS2RequestFields) SetMessageVersion(v string) { o.MessageVersion = &v } // GetMobilePhone returns the MobilePhone field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetMobilePhone() Phone { +func (o *ThreeDS2RequestFields) GetMobilePhone() Phone { if o == nil || common.IsNil(o.MobilePhone) { var ret Phone return ret @@ -513,7 +513,7 @@ func (o *ThreeDS2RequestData2) GetMobilePhone() Phone { // GetMobilePhoneOk returns a tuple with the MobilePhone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetMobilePhoneOk() (*Phone, bool) { +func (o *ThreeDS2RequestFields) GetMobilePhoneOk() (*Phone, bool) { if o == nil || common.IsNil(o.MobilePhone) { return nil, false } @@ -521,7 +521,7 @@ func (o *ThreeDS2RequestData2) GetMobilePhoneOk() (*Phone, bool) { } // HasMobilePhone returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasMobilePhone() bool { +func (o *ThreeDS2RequestFields) HasMobilePhone() bool { if o != nil && !common.IsNil(o.MobilePhone) { return true } @@ -530,12 +530,12 @@ func (o *ThreeDS2RequestData2) HasMobilePhone() bool { } // SetMobilePhone gets a reference to the given Phone and assigns it to the MobilePhone field. -func (o *ThreeDS2RequestData2) SetMobilePhone(v Phone) { +func (o *ThreeDS2RequestFields) SetMobilePhone(v Phone) { o.MobilePhone = &v } // GetNotificationURL returns the NotificationURL field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetNotificationURL() string { +func (o *ThreeDS2RequestFields) GetNotificationURL() string { if o == nil || common.IsNil(o.NotificationURL) { var ret string return ret @@ -545,7 +545,7 @@ func (o *ThreeDS2RequestData2) GetNotificationURL() string { // GetNotificationURLOk returns a tuple with the NotificationURL field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetNotificationURLOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetNotificationURLOk() (*string, bool) { if o == nil || common.IsNil(o.NotificationURL) { return nil, false } @@ -553,7 +553,7 @@ func (o *ThreeDS2RequestData2) GetNotificationURLOk() (*string, bool) { } // HasNotificationURL returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasNotificationURL() bool { +func (o *ThreeDS2RequestFields) HasNotificationURL() bool { if o != nil && !common.IsNil(o.NotificationURL) { return true } @@ -562,12 +562,12 @@ func (o *ThreeDS2RequestData2) HasNotificationURL() bool { } // SetNotificationURL gets a reference to the given string and assigns it to the NotificationURL field. -func (o *ThreeDS2RequestData2) SetNotificationURL(v string) { +func (o *ThreeDS2RequestFields) SetNotificationURL(v string) { o.NotificationURL = &v } // GetPayTokenInd returns the PayTokenInd field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetPayTokenInd() bool { +func (o *ThreeDS2RequestFields) GetPayTokenInd() bool { if o == nil || common.IsNil(o.PayTokenInd) { var ret bool return ret @@ -577,7 +577,7 @@ func (o *ThreeDS2RequestData2) GetPayTokenInd() bool { // GetPayTokenIndOk returns a tuple with the PayTokenInd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetPayTokenIndOk() (*bool, bool) { +func (o *ThreeDS2RequestFields) GetPayTokenIndOk() (*bool, bool) { if o == nil || common.IsNil(o.PayTokenInd) { return nil, false } @@ -585,7 +585,7 @@ func (o *ThreeDS2RequestData2) GetPayTokenIndOk() (*bool, bool) { } // HasPayTokenInd returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasPayTokenInd() bool { +func (o *ThreeDS2RequestFields) HasPayTokenInd() bool { if o != nil && !common.IsNil(o.PayTokenInd) { return true } @@ -594,12 +594,12 @@ func (o *ThreeDS2RequestData2) HasPayTokenInd() bool { } // SetPayTokenInd gets a reference to the given bool and assigns it to the PayTokenInd field. -func (o *ThreeDS2RequestData2) SetPayTokenInd(v bool) { +func (o *ThreeDS2RequestFields) SetPayTokenInd(v bool) { o.PayTokenInd = &v } // GetPaymentAuthenticationUseCase returns the PaymentAuthenticationUseCase field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCase() string { +func (o *ThreeDS2RequestFields) GetPaymentAuthenticationUseCase() string { if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { var ret string return ret @@ -609,7 +609,7 @@ func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCase() string { // GetPaymentAuthenticationUseCaseOk returns a tuple with the PaymentAuthenticationUseCase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCaseOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetPaymentAuthenticationUseCaseOk() (*string, bool) { if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { return nil, false } @@ -617,7 +617,7 @@ func (o *ThreeDS2RequestData2) GetPaymentAuthenticationUseCaseOk() (*string, boo } // HasPaymentAuthenticationUseCase returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasPaymentAuthenticationUseCase() bool { +func (o *ThreeDS2RequestFields) HasPaymentAuthenticationUseCase() bool { if o != nil && !common.IsNil(o.PaymentAuthenticationUseCase) { return true } @@ -626,12 +626,12 @@ func (o *ThreeDS2RequestData2) HasPaymentAuthenticationUseCase() bool { } // SetPaymentAuthenticationUseCase gets a reference to the given string and assigns it to the PaymentAuthenticationUseCase field. -func (o *ThreeDS2RequestData2) SetPaymentAuthenticationUseCase(v string) { +func (o *ThreeDS2RequestFields) SetPaymentAuthenticationUseCase(v string) { o.PaymentAuthenticationUseCase = &v } // GetPurchaseInstalData returns the PurchaseInstalData field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetPurchaseInstalData() string { +func (o *ThreeDS2RequestFields) GetPurchaseInstalData() string { if o == nil || common.IsNil(o.PurchaseInstalData) { var ret string return ret @@ -641,7 +641,7 @@ func (o *ThreeDS2RequestData2) GetPurchaseInstalData() string { // GetPurchaseInstalDataOk returns a tuple with the PurchaseInstalData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetPurchaseInstalDataOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetPurchaseInstalDataOk() (*string, bool) { if o == nil || common.IsNil(o.PurchaseInstalData) { return nil, false } @@ -649,7 +649,7 @@ func (o *ThreeDS2RequestData2) GetPurchaseInstalDataOk() (*string, bool) { } // HasPurchaseInstalData returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasPurchaseInstalData() bool { +func (o *ThreeDS2RequestFields) HasPurchaseInstalData() bool { if o != nil && !common.IsNil(o.PurchaseInstalData) { return true } @@ -658,12 +658,12 @@ func (o *ThreeDS2RequestData2) HasPurchaseInstalData() bool { } // SetPurchaseInstalData gets a reference to the given string and assigns it to the PurchaseInstalData field. -func (o *ThreeDS2RequestData2) SetPurchaseInstalData(v string) { +func (o *ThreeDS2RequestFields) SetPurchaseInstalData(v string) { o.PurchaseInstalData = &v } // GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetRecurringExpiry() string { +func (o *ThreeDS2RequestFields) GetRecurringExpiry() string { if o == nil || common.IsNil(o.RecurringExpiry) { var ret string return ret @@ -673,7 +673,7 @@ func (o *ThreeDS2RequestData2) GetRecurringExpiry() string { // GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetRecurringExpiryOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetRecurringExpiryOk() (*string, bool) { if o == nil || common.IsNil(o.RecurringExpiry) { return nil, false } @@ -681,7 +681,7 @@ func (o *ThreeDS2RequestData2) GetRecurringExpiryOk() (*string, bool) { } // HasRecurringExpiry returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasRecurringExpiry() bool { +func (o *ThreeDS2RequestFields) HasRecurringExpiry() bool { if o != nil && !common.IsNil(o.RecurringExpiry) { return true } @@ -690,12 +690,12 @@ func (o *ThreeDS2RequestData2) HasRecurringExpiry() bool { } // SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. -func (o *ThreeDS2RequestData2) SetRecurringExpiry(v string) { +func (o *ThreeDS2RequestFields) SetRecurringExpiry(v string) { o.RecurringExpiry = &v } // GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetRecurringFrequency() string { +func (o *ThreeDS2RequestFields) GetRecurringFrequency() string { if o == nil || common.IsNil(o.RecurringFrequency) { var ret string return ret @@ -705,7 +705,7 @@ func (o *ThreeDS2RequestData2) GetRecurringFrequency() string { // GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetRecurringFrequencyOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetRecurringFrequencyOk() (*string, bool) { if o == nil || common.IsNil(o.RecurringFrequency) { return nil, false } @@ -713,7 +713,7 @@ func (o *ThreeDS2RequestData2) GetRecurringFrequencyOk() (*string, bool) { } // HasRecurringFrequency returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasRecurringFrequency() bool { +func (o *ThreeDS2RequestFields) HasRecurringFrequency() bool { if o != nil && !common.IsNil(o.RecurringFrequency) { return true } @@ -722,12 +722,12 @@ func (o *ThreeDS2RequestData2) HasRecurringFrequency() bool { } // SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. -func (o *ThreeDS2RequestData2) SetRecurringFrequency(v string) { +func (o *ThreeDS2RequestFields) SetRecurringFrequency(v string) { o.RecurringFrequency = &v } // GetSdkAppID returns the SdkAppID field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetSdkAppID() string { +func (o *ThreeDS2RequestFields) GetSdkAppID() string { if o == nil || common.IsNil(o.SdkAppID) { var ret string return ret @@ -737,7 +737,7 @@ func (o *ThreeDS2RequestData2) GetSdkAppID() string { // GetSdkAppIDOk returns a tuple with the SdkAppID field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetSdkAppIDOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetSdkAppIDOk() (*string, bool) { if o == nil || common.IsNil(o.SdkAppID) { return nil, false } @@ -745,7 +745,7 @@ func (o *ThreeDS2RequestData2) GetSdkAppIDOk() (*string, bool) { } // HasSdkAppID returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasSdkAppID() bool { +func (o *ThreeDS2RequestFields) HasSdkAppID() bool { if o != nil && !common.IsNil(o.SdkAppID) { return true } @@ -754,12 +754,12 @@ func (o *ThreeDS2RequestData2) HasSdkAppID() bool { } // SetSdkAppID gets a reference to the given string and assigns it to the SdkAppID field. -func (o *ThreeDS2RequestData2) SetSdkAppID(v string) { +func (o *ThreeDS2RequestFields) SetSdkAppID(v string) { o.SdkAppID = &v } // GetSdkEphemPubKey returns the SdkEphemPubKey field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetSdkEphemPubKey() SDKEphemPubKey { +func (o *ThreeDS2RequestFields) GetSdkEphemPubKey() SDKEphemPubKey { if o == nil || common.IsNil(o.SdkEphemPubKey) { var ret SDKEphemPubKey return ret @@ -769,7 +769,7 @@ func (o *ThreeDS2RequestData2) GetSdkEphemPubKey() SDKEphemPubKey { // GetSdkEphemPubKeyOk returns a tuple with the SdkEphemPubKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool) { +func (o *ThreeDS2RequestFields) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool) { if o == nil || common.IsNil(o.SdkEphemPubKey) { return nil, false } @@ -777,7 +777,7 @@ func (o *ThreeDS2RequestData2) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool) { } // HasSdkEphemPubKey returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasSdkEphemPubKey() bool { +func (o *ThreeDS2RequestFields) HasSdkEphemPubKey() bool { if o != nil && !common.IsNil(o.SdkEphemPubKey) { return true } @@ -786,12 +786,12 @@ func (o *ThreeDS2RequestData2) HasSdkEphemPubKey() bool { } // SetSdkEphemPubKey gets a reference to the given SDKEphemPubKey and assigns it to the SdkEphemPubKey field. -func (o *ThreeDS2RequestData2) SetSdkEphemPubKey(v SDKEphemPubKey) { +func (o *ThreeDS2RequestFields) SetSdkEphemPubKey(v SDKEphemPubKey) { o.SdkEphemPubKey = &v } // GetSdkMaxTimeout returns the SdkMaxTimeout field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetSdkMaxTimeout() int32 { +func (o *ThreeDS2RequestFields) GetSdkMaxTimeout() int32 { if o == nil || common.IsNil(o.SdkMaxTimeout) { var ret int32 return ret @@ -801,7 +801,7 @@ func (o *ThreeDS2RequestData2) GetSdkMaxTimeout() int32 { // GetSdkMaxTimeoutOk returns a tuple with the SdkMaxTimeout field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetSdkMaxTimeoutOk() (*int32, bool) { +func (o *ThreeDS2RequestFields) GetSdkMaxTimeoutOk() (*int32, bool) { if o == nil || common.IsNil(o.SdkMaxTimeout) { return nil, false } @@ -809,7 +809,7 @@ func (o *ThreeDS2RequestData2) GetSdkMaxTimeoutOk() (*int32, bool) { } // HasSdkMaxTimeout returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasSdkMaxTimeout() bool { +func (o *ThreeDS2RequestFields) HasSdkMaxTimeout() bool { if o != nil && !common.IsNil(o.SdkMaxTimeout) { return true } @@ -818,12 +818,12 @@ func (o *ThreeDS2RequestData2) HasSdkMaxTimeout() bool { } // SetSdkMaxTimeout gets a reference to the given int32 and assigns it to the SdkMaxTimeout field. -func (o *ThreeDS2RequestData2) SetSdkMaxTimeout(v int32) { +func (o *ThreeDS2RequestFields) SetSdkMaxTimeout(v int32) { o.SdkMaxTimeout = &v } // GetSdkReferenceNumber returns the SdkReferenceNumber field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetSdkReferenceNumber() string { +func (o *ThreeDS2RequestFields) GetSdkReferenceNumber() string { if o == nil || common.IsNil(o.SdkReferenceNumber) { var ret string return ret @@ -833,7 +833,7 @@ func (o *ThreeDS2RequestData2) GetSdkReferenceNumber() string { // GetSdkReferenceNumberOk returns a tuple with the SdkReferenceNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetSdkReferenceNumberOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetSdkReferenceNumberOk() (*string, bool) { if o == nil || common.IsNil(o.SdkReferenceNumber) { return nil, false } @@ -841,7 +841,7 @@ func (o *ThreeDS2RequestData2) GetSdkReferenceNumberOk() (*string, bool) { } // HasSdkReferenceNumber returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasSdkReferenceNumber() bool { +func (o *ThreeDS2RequestFields) HasSdkReferenceNumber() bool { if o != nil && !common.IsNil(o.SdkReferenceNumber) { return true } @@ -850,12 +850,12 @@ func (o *ThreeDS2RequestData2) HasSdkReferenceNumber() bool { } // SetSdkReferenceNumber gets a reference to the given string and assigns it to the SdkReferenceNumber field. -func (o *ThreeDS2RequestData2) SetSdkReferenceNumber(v string) { +func (o *ThreeDS2RequestFields) SetSdkReferenceNumber(v string) { o.SdkReferenceNumber = &v } // GetSdkTransID returns the SdkTransID field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetSdkTransID() string { +func (o *ThreeDS2RequestFields) GetSdkTransID() string { if o == nil || common.IsNil(o.SdkTransID) { var ret string return ret @@ -865,7 +865,7 @@ func (o *ThreeDS2RequestData2) GetSdkTransID() string { // GetSdkTransIDOk returns a tuple with the SdkTransID field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetSdkTransIDOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetSdkTransIDOk() (*string, bool) { if o == nil || common.IsNil(o.SdkTransID) { return nil, false } @@ -873,7 +873,7 @@ func (o *ThreeDS2RequestData2) GetSdkTransIDOk() (*string, bool) { } // HasSdkTransID returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasSdkTransID() bool { +func (o *ThreeDS2RequestFields) HasSdkTransID() bool { if o != nil && !common.IsNil(o.SdkTransID) { return true } @@ -882,12 +882,12 @@ func (o *ThreeDS2RequestData2) HasSdkTransID() bool { } // SetSdkTransID gets a reference to the given string and assigns it to the SdkTransID field. -func (o *ThreeDS2RequestData2) SetSdkTransID(v string) { +func (o *ThreeDS2RequestFields) SetSdkTransID(v string) { o.SdkTransID = &v } // GetThreeDSCompInd returns the ThreeDSCompInd field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSCompInd() string { +func (o *ThreeDS2RequestFields) GetThreeDSCompInd() string { if o == nil || common.IsNil(o.ThreeDSCompInd) { var ret string return ret @@ -897,7 +897,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSCompInd() string { // GetThreeDSCompIndOk returns a tuple with the ThreeDSCompInd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSCompIndOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSCompIndOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSCompInd) { return nil, false } @@ -905,7 +905,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSCompIndOk() (*string, bool) { } // HasThreeDSCompInd returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSCompInd() bool { +func (o *ThreeDS2RequestFields) HasThreeDSCompInd() bool { if o != nil && !common.IsNil(o.ThreeDSCompInd) { return true } @@ -914,12 +914,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSCompInd() bool { } // SetThreeDSCompInd gets a reference to the given string and assigns it to the ThreeDSCompInd field. -func (o *ThreeDS2RequestData2) SetThreeDSCompInd(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSCompInd(v string) { o.ThreeDSCompInd = &v } // GetThreeDSRequestorAuthenticationInd returns the ThreeDSRequestorAuthenticationInd field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInd() string { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInd() string { if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { var ret string return ret @@ -929,7 +929,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInd() string { // GetThreeDSRequestorAuthenticationIndOk returns a tuple with the ThreeDSRequestorAuthenticationInd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationIndOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationIndOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { return nil, false } @@ -937,7 +937,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationIndOk() (*string } // HasThreeDSRequestorAuthenticationInd returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInd() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorAuthenticationInd() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInd) { return true } @@ -946,12 +946,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInd() bool { } // SetThreeDSRequestorAuthenticationInd gets a reference to the given string and assigns it to the ThreeDSRequestorAuthenticationInd field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInd(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorAuthenticationInd(v string) { o.ThreeDSRequestorAuthenticationInd = &v } // GetThreeDSRequestorAuthenticationInfo returns the ThreeDSRequestorAuthenticationInfo field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfo() ThreeDSRequestorAuthenticationInfo { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInfo() ThreeDSRequestorAuthenticationInfo { if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { var ret ThreeDSRequestorAuthenticationInfo return ret @@ -961,7 +961,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfo() ThreeDSRe // GetThreeDSRequestorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorAuthenticationInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfoOk() (*ThreeDSRequestorAuthenticationInfo, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInfoOk() (*ThreeDSRequestorAuthenticationInfo, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { return nil, false } @@ -969,7 +969,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorAuthenticationInfoOk() (*Three } // HasThreeDSRequestorAuthenticationInfo returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInfo() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorAuthenticationInfo() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { return true } @@ -978,12 +978,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorAuthenticationInfo() bool { } // SetThreeDSRequestorAuthenticationInfo gets a reference to the given ThreeDSRequestorAuthenticationInfo and assigns it to the ThreeDSRequestorAuthenticationInfo field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorAuthenticationInfo(v ThreeDSRequestorAuthenticationInfo) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorAuthenticationInfo(v ThreeDSRequestorAuthenticationInfo) { o.ThreeDSRequestorAuthenticationInfo = &v } // GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeInd() string { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorChallengeInd() string { if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { var ret string return ret @@ -993,7 +993,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeInd() string { // GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeIndOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorChallengeIndOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { return nil, false } @@ -1001,7 +1001,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorChallengeIndOk() (*string, boo } // HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorChallengeInd() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorChallengeInd() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { return true } @@ -1010,12 +1010,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorChallengeInd() bool { } // SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorChallengeInd(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorChallengeInd(v string) { o.ThreeDSRequestorChallengeInd = &v } // GetThreeDSRequestorID returns the ThreeDSRequestorID field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorID() string { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorID() string { if o == nil || common.IsNil(o.ThreeDSRequestorID) { var ret string return ret @@ -1025,7 +1025,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorID() string { // GetThreeDSRequestorIDOk returns a tuple with the ThreeDSRequestorID field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorIDOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorIDOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorID) { return nil, false } @@ -1033,7 +1033,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorIDOk() (*string, bool) { } // HasThreeDSRequestorID returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorID() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorID() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorID) { return true } @@ -1042,12 +1042,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorID() bool { } // SetThreeDSRequestorID gets a reference to the given string and assigns it to the ThreeDSRequestorID field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorID(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorID(v string) { o.ThreeDSRequestorID = &v } // GetThreeDSRequestorName returns the ThreeDSRequestorName field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorName() string { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorName() string { if o == nil || common.IsNil(o.ThreeDSRequestorName) { var ret string return ret @@ -1057,7 +1057,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorName() string { // GetThreeDSRequestorNameOk returns a tuple with the ThreeDSRequestorName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorNameOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorNameOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorName) { return nil, false } @@ -1065,7 +1065,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorNameOk() (*string, bool) { } // HasThreeDSRequestorName returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorName() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorName() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorName) { return true } @@ -1074,12 +1074,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorName() bool { } // SetThreeDSRequestorName gets a reference to the given string and assigns it to the ThreeDSRequestorName field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorName(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorName(v string) { o.ThreeDSRequestorName = &v } // GetThreeDSRequestorPriorAuthenticationInfo returns the ThreeDSRequestorPriorAuthenticationInfo field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfo() ThreeDSRequestorPriorAuthenticationInfo { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorPriorAuthenticationInfo() ThreeDSRequestorPriorAuthenticationInfo { if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { var ret ThreeDSRequestorPriorAuthenticationInfo return ret @@ -1089,7 +1089,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfo() Thre // GetThreeDSRequestorPriorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorPriorAuthenticationInfo field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfoOk() (*ThreeDSRequestorPriorAuthenticationInfo, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorPriorAuthenticationInfoOk() (*ThreeDSRequestorPriorAuthenticationInfo, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { return nil, false } @@ -1097,7 +1097,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorPriorAuthenticationInfoOk() (* } // HasThreeDSRequestorPriorAuthenticationInfo returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorPriorAuthenticationInfo() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorPriorAuthenticationInfo() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { return true } @@ -1106,12 +1106,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorPriorAuthenticationInfo() bool } // SetThreeDSRequestorPriorAuthenticationInfo gets a reference to the given ThreeDSRequestorPriorAuthenticationInfo and assigns it to the ThreeDSRequestorPriorAuthenticationInfo field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorPriorAuthenticationInfo(v ThreeDSRequestorPriorAuthenticationInfo) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorPriorAuthenticationInfo(v ThreeDSRequestorPriorAuthenticationInfo) { o.ThreeDSRequestorPriorAuthenticationInfo = &v } // GetThreeDSRequestorURL returns the ThreeDSRequestorURL field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorURL() string { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorURL() string { if o == nil || common.IsNil(o.ThreeDSRequestorURL) { var ret string return ret @@ -1121,7 +1121,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorURL() string { // GetThreeDSRequestorURLOk returns a tuple with the ThreeDSRequestorURL field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetThreeDSRequestorURLOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetThreeDSRequestorURLOk() (*string, bool) { if o == nil || common.IsNil(o.ThreeDSRequestorURL) { return nil, false } @@ -1129,7 +1129,7 @@ func (o *ThreeDS2RequestData2) GetThreeDSRequestorURLOk() (*string, bool) { } // HasThreeDSRequestorURL returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasThreeDSRequestorURL() bool { +func (o *ThreeDS2RequestFields) HasThreeDSRequestorURL() bool { if o != nil && !common.IsNil(o.ThreeDSRequestorURL) { return true } @@ -1138,12 +1138,12 @@ func (o *ThreeDS2RequestData2) HasThreeDSRequestorURL() bool { } // SetThreeDSRequestorURL gets a reference to the given string and assigns it to the ThreeDSRequestorURL field. -func (o *ThreeDS2RequestData2) SetThreeDSRequestorURL(v string) { +func (o *ThreeDS2RequestFields) SetThreeDSRequestorURL(v string) { o.ThreeDSRequestorURL = &v } // GetTransType returns the TransType field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetTransType() string { +func (o *ThreeDS2RequestFields) GetTransType() string { if o == nil || common.IsNil(o.TransType) { var ret string return ret @@ -1153,7 +1153,7 @@ func (o *ThreeDS2RequestData2) GetTransType() string { // GetTransTypeOk returns a tuple with the TransType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetTransTypeOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetTransTypeOk() (*string, bool) { if o == nil || common.IsNil(o.TransType) { return nil, false } @@ -1161,7 +1161,7 @@ func (o *ThreeDS2RequestData2) GetTransTypeOk() (*string, bool) { } // HasTransType returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasTransType() bool { +func (o *ThreeDS2RequestFields) HasTransType() bool { if o != nil && !common.IsNil(o.TransType) { return true } @@ -1170,12 +1170,12 @@ func (o *ThreeDS2RequestData2) HasTransType() bool { } // SetTransType gets a reference to the given string and assigns it to the TransType field. -func (o *ThreeDS2RequestData2) SetTransType(v string) { +func (o *ThreeDS2RequestFields) SetTransType(v string) { o.TransType = &v } // GetTransactionType returns the TransactionType field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetTransactionType() string { +func (o *ThreeDS2RequestFields) GetTransactionType() string { if o == nil || common.IsNil(o.TransactionType) { var ret string return ret @@ -1185,7 +1185,7 @@ func (o *ThreeDS2RequestData2) GetTransactionType() string { // GetTransactionTypeOk returns a tuple with the TransactionType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetTransactionTypeOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetTransactionTypeOk() (*string, bool) { if o == nil || common.IsNil(o.TransactionType) { return nil, false } @@ -1193,7 +1193,7 @@ func (o *ThreeDS2RequestData2) GetTransactionTypeOk() (*string, bool) { } // HasTransactionType returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasTransactionType() bool { +func (o *ThreeDS2RequestFields) HasTransactionType() bool { if o != nil && !common.IsNil(o.TransactionType) { return true } @@ -1202,12 +1202,12 @@ func (o *ThreeDS2RequestData2) HasTransactionType() bool { } // SetTransactionType gets a reference to the given string and assigns it to the TransactionType field. -func (o *ThreeDS2RequestData2) SetTransactionType(v string) { +func (o *ThreeDS2RequestFields) SetTransactionType(v string) { o.TransactionType = &v } // GetWhiteListStatus returns the WhiteListStatus field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetWhiteListStatus() string { +func (o *ThreeDS2RequestFields) GetWhiteListStatus() string { if o == nil || common.IsNil(o.WhiteListStatus) { var ret string return ret @@ -1217,7 +1217,7 @@ func (o *ThreeDS2RequestData2) GetWhiteListStatus() string { // GetWhiteListStatusOk returns a tuple with the WhiteListStatus field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetWhiteListStatusOk() (*string, bool) { +func (o *ThreeDS2RequestFields) GetWhiteListStatusOk() (*string, bool) { if o == nil || common.IsNil(o.WhiteListStatus) { return nil, false } @@ -1225,7 +1225,7 @@ func (o *ThreeDS2RequestData2) GetWhiteListStatusOk() (*string, bool) { } // HasWhiteListStatus returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasWhiteListStatus() bool { +func (o *ThreeDS2RequestFields) HasWhiteListStatus() bool { if o != nil && !common.IsNil(o.WhiteListStatus) { return true } @@ -1234,12 +1234,12 @@ func (o *ThreeDS2RequestData2) HasWhiteListStatus() bool { } // SetWhiteListStatus gets a reference to the given string and assigns it to the WhiteListStatus field. -func (o *ThreeDS2RequestData2) SetWhiteListStatus(v string) { +func (o *ThreeDS2RequestFields) SetWhiteListStatus(v string) { o.WhiteListStatus = &v } // GetWorkPhone returns the WorkPhone field value if set, zero value otherwise. -func (o *ThreeDS2RequestData2) GetWorkPhone() Phone { +func (o *ThreeDS2RequestFields) GetWorkPhone() Phone { if o == nil || common.IsNil(o.WorkPhone) { var ret Phone return ret @@ -1249,7 +1249,7 @@ func (o *ThreeDS2RequestData2) GetWorkPhone() Phone { // GetWorkPhoneOk returns a tuple with the WorkPhone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ThreeDS2RequestData2) GetWorkPhoneOk() (*Phone, bool) { +func (o *ThreeDS2RequestFields) GetWorkPhoneOk() (*Phone, bool) { if o == nil || common.IsNil(o.WorkPhone) { return nil, false } @@ -1257,7 +1257,7 @@ func (o *ThreeDS2RequestData2) GetWorkPhoneOk() (*Phone, bool) { } // HasWorkPhone returns a boolean if a field has been set. -func (o *ThreeDS2RequestData2) HasWorkPhone() bool { +func (o *ThreeDS2RequestFields) HasWorkPhone() bool { if o != nil && !common.IsNil(o.WorkPhone) { return true } @@ -1266,11 +1266,11 @@ func (o *ThreeDS2RequestData2) HasWorkPhone() bool { } // SetWorkPhone gets a reference to the given Phone and assigns it to the WorkPhone field. -func (o *ThreeDS2RequestData2) SetWorkPhone(v Phone) { +func (o *ThreeDS2RequestFields) SetWorkPhone(v Phone) { o.WorkPhone = &v } -func (o ThreeDS2RequestData2) MarshalJSON() ([]byte, error) { +func (o ThreeDS2RequestFields) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -1278,7 +1278,7 @@ func (o ThreeDS2RequestData2) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ThreeDS2RequestData2) ToMap() (map[string]interface{}, error) { +func (o ThreeDS2RequestFields) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !common.IsNil(o.AcctInfo) { toSerialize["acctInfo"] = o.AcctInfo @@ -1391,43 +1391,43 @@ func (o ThreeDS2RequestData2) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -type NullableThreeDS2RequestData2 struct { - value *ThreeDS2RequestData2 +type NullableThreeDS2RequestFields struct { + value *ThreeDS2RequestFields isSet bool } -func (v NullableThreeDS2RequestData2) Get() *ThreeDS2RequestData2 { +func (v NullableThreeDS2RequestFields) Get() *ThreeDS2RequestFields { return v.value } -func (v *NullableThreeDS2RequestData2) Set(val *ThreeDS2RequestData2) { +func (v *NullableThreeDS2RequestFields) Set(val *ThreeDS2RequestFields) { v.value = val v.isSet = true } -func (v NullableThreeDS2RequestData2) IsSet() bool { +func (v NullableThreeDS2RequestFields) IsSet() bool { return v.isSet } -func (v *NullableThreeDS2RequestData2) Unset() { +func (v *NullableThreeDS2RequestFields) Unset() { v.value = nil v.isSet = false } -func NewNullableThreeDS2RequestData2(val *ThreeDS2RequestData2) *NullableThreeDS2RequestData2 { - return &NullableThreeDS2RequestData2{value: val, isSet: true} +func NewNullableThreeDS2RequestFields(val *ThreeDS2RequestFields) *NullableThreeDS2RequestFields { + return &NullableThreeDS2RequestFields{value: val, isSet: true} } -func (v NullableThreeDS2RequestData2) MarshalJSON() ([]byte, error) { +func (v NullableThreeDS2RequestFields) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableThreeDS2RequestData2) UnmarshalJSON(src []byte) error { +func (v *NullableThreeDS2RequestFields) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } -func (o *ThreeDS2RequestData2) isValidAcctType() bool { +func (o *ThreeDS2RequestFields) isValidAcctType() bool { var allowedEnumValues = []string{"01", "02", "03"} for _, allowed := range allowedEnumValues { if o.GetAcctType() == allowed { @@ -1436,7 +1436,7 @@ func (o *ThreeDS2RequestData2) isValidAcctType() bool { } return false } -func (o *ThreeDS2RequestData2) isValidAddrMatch() bool { +func (o *ThreeDS2RequestFields) isValidAddrMatch() bool { var allowedEnumValues = []string{"Y", "N"} for _, allowed := range allowedEnumValues { if o.GetAddrMatch() == allowed { @@ -1445,7 +1445,7 @@ func (o *ThreeDS2RequestData2) isValidAddrMatch() bool { } return false } -func (o *ThreeDS2RequestData2) isValidChallengeIndicator() bool { +func (o *ThreeDS2RequestFields) isValidChallengeIndicator() bool { var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} for _, allowed := range allowedEnumValues { if o.GetChallengeIndicator() == allowed { @@ -1454,7 +1454,7 @@ func (o *ThreeDS2RequestData2) isValidChallengeIndicator() bool { } return false } -func (o *ThreeDS2RequestData2) isValidThreeDSRequestorChallengeInd() bool { +func (o *ThreeDS2RequestFields) isValidThreeDSRequestorChallengeInd() bool { var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { if o.GetThreeDSRequestorChallengeInd() == allowed { @@ -1463,7 +1463,7 @@ func (o *ThreeDS2RequestData2) isValidThreeDSRequestorChallengeInd() bool { } return false } -func (o *ThreeDS2RequestData2) isValidTransType() bool { +func (o *ThreeDS2RequestFields) isValidTransType() bool { var allowedEnumValues = []string{"01", "03", "10", "11", "28"} for _, allowed := range allowedEnumValues { if o.GetTransType() == allowed { @@ -1472,7 +1472,7 @@ func (o *ThreeDS2RequestData2) isValidTransType() bool { } return false } -func (o *ThreeDS2RequestData2) isValidTransactionType() bool { +func (o *ThreeDS2RequestFields) isValidTransactionType() bool { var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} for _, allowed := range allowedEnumValues { if o.GetTransactionType() == allowed { diff --git a/src/checkout/model_three_ds2_response_data.go b/src/checkout/model_three_ds2_response_data.go index 604e87652..e9619bd83 100644 --- a/src/checkout/model_three_ds2_response_data.go +++ b/src/checkout/model_three_ds2_response_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds2_result.go b/src/checkout/model_three_ds2_result.go index 3d62b699b..6a50a401b 100644 --- a/src/checkout/model_three_ds2_result.go +++ b/src/checkout/model_three_ds2_result.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds_request_data.go b/src/checkout/model_three_ds_request_data.go index c1029b255..33eff0451 100644 --- a/src/checkout/model_three_ds_request_data.go +++ b/src/checkout/model_three_ds_request_data.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds_requestor_authentication_info.go b/src/checkout/model_three_ds_requestor_authentication_info.go index f6ee990f8..a677adf6c 100644 --- a/src/checkout/model_three_ds_requestor_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_authentication_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_three_ds_requestor_prior_authentication_info.go b/src/checkout/model_three_ds_requestor_prior_authentication_info.go index 38cbaf762..9a41f8466 100644 --- a/src/checkout/model_three_ds_requestor_prior_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_prior_authentication_info.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_update_payment_link_request.go b/src/checkout/model_update_payment_link_request.go index ef71ea5aa..a23828083 100644 --- a/src/checkout/model_update_payment_link_request.go +++ b/src/checkout/model_update_payment_link_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_upi_collect_details.go b/src/checkout/model_upi_collect_details.go index df25f79fe..c3d9e4090 100644 --- a/src/checkout/model_upi_collect_details.go +++ b/src/checkout/model_upi_collect_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_upi_intent_details.go b/src/checkout/model_upi_intent_details.go index 67a0a20b3..4f0cd2c65 100644 --- a/src/checkout/model_upi_intent_details.go +++ b/src/checkout/model_upi_intent_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_utility_request.go b/src/checkout/model_utility_request.go index 743d2dac1..496906050 100644 --- a/src/checkout/model_utility_request.go +++ b/src/checkout/model_utility_request.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_utility_response.go b/src/checkout/model_utility_response.go index 87bc9d52c..c042d560f 100644 --- a/src/checkout/model_utility_response.go +++ b/src/checkout/model_utility_response.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_vipps_details.go b/src/checkout/model_vipps_details.go index ad63a7f61..c5d084d7e 100644 --- a/src/checkout/model_vipps_details.go +++ b/src/checkout/model_vipps_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_visa_checkout_details.go b/src/checkout/model_visa_checkout_details.go index e2472df8e..63ee5662c 100644 --- a/src/checkout/model_visa_checkout_details.go +++ b/src/checkout/model_visa_checkout_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_we_chat_pay_details.go b/src/checkout/model_we_chat_pay_details.go index 954d7290d..c2752e88a 100644 --- a/src/checkout/model_we_chat_pay_details.go +++ b/src/checkout/model_we_chat_pay_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_we_chat_pay_mini_program_details.go b/src/checkout/model_we_chat_pay_mini_program_details.go index db7d89e9c..f59de52a4 100644 --- a/src/checkout/model_we_chat_pay_mini_program_details.go +++ b/src/checkout/model_we_chat_pay_mini_program_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/checkout/model_zip_details.go b/src/checkout/model_zip_details.go index 3f54f87d9..2b455de2e 100644 --- a/src/checkout/model_zip_details.go +++ b/src/checkout/model_zip_details.go @@ -1,7 +1,7 @@ /* Adyen Checkout API -API version: 70 +API version: 71 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/common/utils.go b/src/common/utils.go index 52817b5a6..1e83d1ae5 100644 --- a/src/common/utils.go +++ b/src/common/utils.go @@ -1,14 +1,3 @@ -/* -Adyen Checkout API - -Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v70/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v70/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! - -API version: 70 -Contact: developer-experience@adyen.com -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - package common import ( diff --git a/tests/checkout/integration_test.go b/tests/checkout/integration_test.go index f7e368935..7164f8896 100644 --- a/tests/checkout/integration_test.go +++ b/tests/checkout/integration_test.go @@ -9,6 +9,7 @@ import ( "github.com/adyen/adyen-go-api-library/v8/src/adyen" "github.com/adyen/adyen-go-api-library/v8/src/checkout" "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/google/uuid" "io/ioutil" "os" "strings" @@ -92,7 +93,7 @@ func TestCheckoutIntegration(t *testing.T) { }) t.Run("iDEAL payment", func(t *testing.T) { - idempotencyKey := "b9c3947f-b282-4059-a645-56ddbbd2fef3" + idempotencyKey := uuid.New().String() ctx := common.WithIdempotencyKey(context.Background(), idempotencyKey) ideal := checkout.NewIdealDetails("1121") paymentRequest := *checkout.NewPaymentRequest( @@ -253,7 +254,7 @@ func TestCheckoutIntegration(t *testing.T) { // verify ServiceError2 includes PspReference require.NotNil(t, err.(common.APIError).RawBody) - var serviceError checkout.ServiceError2 + var serviceError checkout.ServiceError json.Unmarshal(err.(common.APIError).RawBody, &serviceError) require.NotNil(t, serviceError) require.NotNil(t, serviceError.PspReference) diff --git a/tests/readme_test.go b/tests/readme_test.go index 27c8bfd4c..26ea11c75 100644 --- a/tests/readme_test.go +++ b/tests/readme_test.go @@ -45,7 +45,7 @@ func ExampleLiveEnv() { res, httpRes, err := service.PaymentsApi.PaymentMethods(context.Background(), req) fmt.Println(res.GetPaymentMethods(), httpRes, err.(*url.Error).URL) - // Output: [] https://1797a841fbb37ca7-AdyenDemo-checkout-live.adyenpayments.com/checkout/v70/paymentMethods + // Output: [] https://1797a841fbb37ca7-AdyenDemo-checkout-live.adyenpayments.com/checkout/v71/paymentMethods } func ExampleBasicAuth() { From a9fff9dfd026b43474d58ab3c0912600be70bdd2 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Mon, 6 Nov 2023 16:19:00 +0100 Subject: [PATCH 6/9] Delete downloadDisputeDefenseDocument (#264) --- src/disputes/api_general.go | 47 ----- ...model_download_defense_document_request.go | 172 ---------------- ...odel_download_defense_document_response.go | 189 ------------------ tests/disputes_test.go | 20 -- 4 files changed, 428 deletions(-) delete mode 100644 src/disputes/model_download_defense_document_request.go delete mode 100644 src/disputes/model_download_defense_document_response.go diff --git a/src/disputes/api_general.go b/src/disputes/api_general.go index b92caa90c..c687e30ff 100644 --- a/src/disputes/api_general.go +++ b/src/disputes/api_general.go @@ -160,53 +160,6 @@ func (a *GeneralApi) DeleteDisputeDefenseDocument(ctx context.Context, r General return *res, httpRes, err } -// All parameters accepted by GeneralApi.DownloadDisputeDefenseDocument -type GeneralApiDownloadDisputeDefenseDocumentInput struct { - downloadDefenseDocumentRequest *DownloadDefenseDocumentRequest -} - -func (r GeneralApiDownloadDisputeDefenseDocumentInput) DownloadDefenseDocumentRequest(downloadDefenseDocumentRequest DownloadDefenseDocumentRequest) GeneralApiDownloadDisputeDefenseDocumentInput { - r.downloadDefenseDocumentRequest = &downloadDefenseDocumentRequest - return r -} - -/* -Prepare a request for DownloadDisputeDefenseDocument - -@return GeneralApiDownloadDisputeDefenseDocumentInput -*/ -func (a *GeneralApi) DownloadDisputeDefenseDocumentInput() GeneralApiDownloadDisputeDefenseDocumentInput { - return GeneralApiDownloadDisputeDefenseDocumentInput{} -} - -/* -DownloadDisputeDefenseDocument Download a defense document - -Downloads a specific dispute defense document that was supplied earlier. - -@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r GeneralApiDownloadDisputeDefenseDocumentInput - Request parameters, see DownloadDisputeDefenseDocumentInput -@return DownloadDefenseDocumentResponse, *http.Response, error -*/ -func (a *GeneralApi) DownloadDisputeDefenseDocument(ctx context.Context, r GeneralApiDownloadDisputeDefenseDocumentInput) (DownloadDefenseDocumentResponse, *http.Response, error) { - res := &DownloadDefenseDocumentResponse{} - path := "/downloadDisputeDefenseDocument" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.downloadDefenseDocumentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err -} - // All parameters accepted by GeneralApi.RetrieveApplicableDefenseReasons type GeneralApiRetrieveApplicableDefenseReasonsInput struct { defenseReasonsRequest *DefenseReasonsRequest diff --git a/src/disputes/model_download_defense_document_request.go b/src/disputes/model_download_defense_document_request.go deleted file mode 100644 index 49f11add7..000000000 --- a/src/disputes/model_download_defense_document_request.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Disputes API - -API version: 30 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package disputes - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the DownloadDefenseDocumentRequest type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &DownloadDefenseDocumentRequest{} - -// DownloadDefenseDocumentRequest struct for DownloadDefenseDocumentRequest -type DownloadDefenseDocumentRequest struct { - // The document type code of the defense document. - DefenseDocumentType string `json:"defenseDocumentType"` - // The PSP reference assigned to the dispute. - DisputePspReference string `json:"disputePspReference"` - // The merchant account identifier, for which you want to process the dispute transaction. - MerchantAccountCode string `json:"merchantAccountCode"` -} - -// NewDownloadDefenseDocumentRequest instantiates a new DownloadDefenseDocumentRequest 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 NewDownloadDefenseDocumentRequest(defenseDocumentType string, disputePspReference string, merchantAccountCode string) *DownloadDefenseDocumentRequest { - this := DownloadDefenseDocumentRequest{} - this.DefenseDocumentType = defenseDocumentType - this.DisputePspReference = disputePspReference - this.MerchantAccountCode = merchantAccountCode - return &this -} - -// NewDownloadDefenseDocumentRequestWithDefaults instantiates a new DownloadDefenseDocumentRequest 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 NewDownloadDefenseDocumentRequestWithDefaults() *DownloadDefenseDocumentRequest { - this := DownloadDefenseDocumentRequest{} - return &this -} - -// GetDefenseDocumentType returns the DefenseDocumentType field value -func (o *DownloadDefenseDocumentRequest) GetDefenseDocumentType() string { - if o == nil { - var ret string - return ret - } - - return o.DefenseDocumentType -} - -// GetDefenseDocumentTypeOk returns a tuple with the DefenseDocumentType field value -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentRequest) GetDefenseDocumentTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DefenseDocumentType, true -} - -// SetDefenseDocumentType sets field value -func (o *DownloadDefenseDocumentRequest) SetDefenseDocumentType(v string) { - o.DefenseDocumentType = v -} - -// GetDisputePspReference returns the DisputePspReference field value -func (o *DownloadDefenseDocumentRequest) GetDisputePspReference() string { - if o == nil { - var ret string - return ret - } - - return o.DisputePspReference -} - -// GetDisputePspReferenceOk returns a tuple with the DisputePspReference field value -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentRequest) GetDisputePspReferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DisputePspReference, true -} - -// SetDisputePspReference sets field value -func (o *DownloadDefenseDocumentRequest) SetDisputePspReference(v string) { - o.DisputePspReference = v -} - -// GetMerchantAccountCode returns the MerchantAccountCode field value -func (o *DownloadDefenseDocumentRequest) GetMerchantAccountCode() string { - if o == nil { - var ret string - return ret - } - - return o.MerchantAccountCode -} - -// GetMerchantAccountCodeOk returns a tuple with the MerchantAccountCode field value -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentRequest) GetMerchantAccountCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.MerchantAccountCode, true -} - -// SetMerchantAccountCode sets field value -func (o *DownloadDefenseDocumentRequest) SetMerchantAccountCode(v string) { - o.MerchantAccountCode = v -} - -func (o DownloadDefenseDocumentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DownloadDefenseDocumentRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["defenseDocumentType"] = o.DefenseDocumentType - toSerialize["disputePspReference"] = o.DisputePspReference - toSerialize["merchantAccountCode"] = o.MerchantAccountCode - return toSerialize, nil -} - -type NullableDownloadDefenseDocumentRequest struct { - value *DownloadDefenseDocumentRequest - isSet bool -} - -func (v NullableDownloadDefenseDocumentRequest) Get() *DownloadDefenseDocumentRequest { - return v.value -} - -func (v *NullableDownloadDefenseDocumentRequest) Set(val *DownloadDefenseDocumentRequest) { - v.value = val - v.isSet = true -} - -func (v NullableDownloadDefenseDocumentRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableDownloadDefenseDocumentRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDownloadDefenseDocumentRequest(val *DownloadDefenseDocumentRequest) *NullableDownloadDefenseDocumentRequest { - return &NullableDownloadDefenseDocumentRequest{value: val, isSet: true} -} - -func (v NullableDownloadDefenseDocumentRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDownloadDefenseDocumentRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/src/disputes/model_download_defense_document_response.go b/src/disputes/model_download_defense_document_response.go deleted file mode 100644 index 8079b6021..000000000 --- a/src/disputes/model_download_defense_document_response.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Disputes API - -API version: 30 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package disputes - -import ( - "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" -) - -// checks if the DownloadDefenseDocumentResponse type satisfies the MappedNullable interface at compile time -var _ common.MappedNullable = &DownloadDefenseDocumentResponse{} - -// DownloadDefenseDocumentResponse struct for DownloadDefenseDocumentResponse -type DownloadDefenseDocumentResponse struct { - // The content of the defense document in Base64 binary format. Must be encoded in the format that is specified in the `contentType` field. - Content *string `json:"content,omitempty"` - // The content type of the dispute defense document. Possible values: * **image/jpg** * **image/jpeg** * **image/tiff** * **application/pdf** - ContentType *string `json:"contentType,omitempty"` - DisputeServiceResult DisputeServiceResult `json:"disputeServiceResult"` -} - -// NewDownloadDefenseDocumentResponse instantiates a new DownloadDefenseDocumentResponse 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 NewDownloadDefenseDocumentResponse(disputeServiceResult DisputeServiceResult) *DownloadDefenseDocumentResponse { - this := DownloadDefenseDocumentResponse{} - this.DisputeServiceResult = disputeServiceResult - return &this -} - -// NewDownloadDefenseDocumentResponseWithDefaults instantiates a new DownloadDefenseDocumentResponse 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 NewDownloadDefenseDocumentResponseWithDefaults() *DownloadDefenseDocumentResponse { - this := DownloadDefenseDocumentResponse{} - return &this -} - -// GetContent returns the Content field value if set, zero value otherwise. -func (o *DownloadDefenseDocumentResponse) GetContent() string { - if o == nil || common.IsNil(o.Content) { - var ret string - return ret - } - return *o.Content -} - -// GetContentOk returns a tuple with the Content field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentResponse) GetContentOk() (*string, bool) { - if o == nil || common.IsNil(o.Content) { - return nil, false - } - return o.Content, true -} - -// HasContent returns a boolean if a field has been set. -func (o *DownloadDefenseDocumentResponse) HasContent() bool { - if o != nil && !common.IsNil(o.Content) { - return true - } - - return false -} - -// SetContent gets a reference to the given string and assigns it to the Content field. -func (o *DownloadDefenseDocumentResponse) SetContent(v string) { - o.Content = &v -} - -// GetContentType returns the ContentType field value if set, zero value otherwise. -func (o *DownloadDefenseDocumentResponse) GetContentType() string { - if o == nil || common.IsNil(o.ContentType) { - var ret string - return ret - } - return *o.ContentType -} - -// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentResponse) GetContentTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.ContentType) { - return nil, false - } - return o.ContentType, true -} - -// HasContentType returns a boolean if a field has been set. -func (o *DownloadDefenseDocumentResponse) HasContentType() bool { - if o != nil && !common.IsNil(o.ContentType) { - return true - } - - return false -} - -// SetContentType gets a reference to the given string and assigns it to the ContentType field. -func (o *DownloadDefenseDocumentResponse) SetContentType(v string) { - o.ContentType = &v -} - -// GetDisputeServiceResult returns the DisputeServiceResult field value -func (o *DownloadDefenseDocumentResponse) GetDisputeServiceResult() DisputeServiceResult { - if o == nil { - var ret DisputeServiceResult - return ret - } - - return o.DisputeServiceResult -} - -// GetDisputeServiceResultOk returns a tuple with the DisputeServiceResult field value -// and a boolean to check if the value has been set. -func (o *DownloadDefenseDocumentResponse) GetDisputeServiceResultOk() (*DisputeServiceResult, bool) { - if o == nil { - return nil, false - } - return &o.DisputeServiceResult, true -} - -// SetDisputeServiceResult sets field value -func (o *DownloadDefenseDocumentResponse) SetDisputeServiceResult(v DisputeServiceResult) { - o.DisputeServiceResult = v -} - -func (o DownloadDefenseDocumentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DownloadDefenseDocumentResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !common.IsNil(o.Content) { - toSerialize["content"] = o.Content - } - if !common.IsNil(o.ContentType) { - toSerialize["contentType"] = o.ContentType - } - toSerialize["disputeServiceResult"] = o.DisputeServiceResult - return toSerialize, nil -} - -type NullableDownloadDefenseDocumentResponse struct { - value *DownloadDefenseDocumentResponse - isSet bool -} - -func (v NullableDownloadDefenseDocumentResponse) Get() *DownloadDefenseDocumentResponse { - return v.value -} - -func (v *NullableDownloadDefenseDocumentResponse) Set(val *DownloadDefenseDocumentResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDownloadDefenseDocumentResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDownloadDefenseDocumentResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDownloadDefenseDocumentResponse(val *DownloadDefenseDocumentResponse) *NullableDownloadDefenseDocumentResponse { - return &NullableDownloadDefenseDocumentResponse{value: val, isSet: true} -} - -func (v NullableDownloadDefenseDocumentResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDownloadDefenseDocumentResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/tests/disputes_test.go b/tests/disputes_test.go index bec385bbd..7abae8147 100644 --- a/tests/disputes_test.go +++ b/tests/disputes_test.go @@ -49,14 +49,6 @@ func Test_Disputes(t *testing.T) { io.WriteString(w, `{"disputeServiceResult":{"errorMessage":"Dispute not found.","success":false}}`) }) - // Error case - mux.HandleFunc("/downloadDisputeDefenseDocument", func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, "POST", r.Method) - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusForbidden) - io.WriteString(w, `{"status":403,"errorCode":"010","message":"Not allowed","errorType":"security"}`) - }) - mockServer := httptest.NewServer(mux) defer mockServer.Close() @@ -136,16 +128,4 @@ func Test_Disputes(t *testing.T) { assert.NotNil(t, res) assert.Equal(t, "Dispute not found.", res.DisputeServiceResult.GetErrorMessage()) }) - - t.Run("Download dispute defense document", func(t *testing.T) { - req := service.DownloadDisputeDefenseDocumentInput().DownloadDefenseDocumentRequest(disputes.DownloadDefenseDocumentRequest{ - DefenseDocumentType: "DefenseMaterial", - DisputePspReference: pspReference, - MerchantAccountCode: merchantAccount, - }) - _, httpRes, err := service.DownloadDisputeDefenseDocument(context.Background(), req) - - require.NotNil(t, err) - assert.Equal(t, 403, httpRes.StatusCode) - }) } From c73e8af636194efdca2965179fce920abf008716 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Mon, 6 Nov 2023 16:19:29 +0100 Subject: [PATCH 7/9] Transaction webhooks (#265) --- Makefile | 3 +- Readme.md | 19 +- .../.openapi-generator-ignore | 7 + src/transactionwebhook/model_amount.go | 144 +++++++ ..._balance_platform_notification_response.go | 125 ++++++ src/transactionwebhook/model_resource.go | 200 +++++++++ .../model_resource_reference.go | 199 +++++++++ src/transactionwebhook/model_transaction.go | 393 ++++++++++++++++++ ...del_transaction_notification_request_v4.go | 190 +++++++++ src/transactionwebhook/model_transfer_data.go | 153 +++++++ src/transactionwebhook/webhook_handler.go | 15 + 11 files changed, 1438 insertions(+), 10 deletions(-) create mode 100644 src/transactionwebhook/.openapi-generator-ignore create mode 100644 src/transactionwebhook/model_amount.go create mode 100644 src/transactionwebhook/model_balance_platform_notification_response.go create mode 100644 src/transactionwebhook/model_resource.go create mode 100644 src/transactionwebhook/model_resource_reference.go create mode 100644 src/transactionwebhook/model_transaction.go create mode 100644 src/transactionwebhook/model_transaction_notification_request_v4.go create mode 100644 src/transactionwebhook/model_transfer_data.go create mode 100644 src/transactionwebhook/webhook_handler.go diff --git a/Makefile b/Makefile index 3502f0ce6..b1180e0ed 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ goimports:=$(shell go env GOPATH)/bin/goimports generator:=go services:=balancecontrol balanceplatform acswebhook configurationwebhook reportwebhook transferwebhook binlookup checkout legalentity management managementwebhook payments payout posterminalmanagement recurring storedvalue transfers dataprotection -services+=disputes +services+=disputes transactionwebhook output:=src templates:=templates/custom @@ -55,6 +55,7 @@ management: spec=ManagementService-v3 management: serviceName=Management management: hasRestServiceError=true managementwebhook: spec=ManagementNotificationService-v3 +transactionwebhook: spec=BalancePlatformTransactionNotification-v4 posterminalmanagement: spec=TfmAPIService-v1 posterminalmanagement: serviceName=PosTerminalManagementApi dataprotection: spec=DataProtectionService-v1 diff --git a/Readme.md b/Readme.md index b63bc23df..caea01d37 100644 --- a/Readme.md +++ b/Readme.md @@ -37,15 +37,16 @@ For more information, refer to our [documentation](https://docs.adyen.com/) or t The library supports all webhooks under the following model directories: -| Webhooks | Description | Package | Supported Version | -|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------| -| [Payment Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | [webhook](src/webhook) | **v1** | -| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [acswebhook](src/acswebhook) | **v1** | -| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [configurationwebhook](src/configurationwebhook) | **v1** | -| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [transferwebhook](src/transferwebhook) | **v4** | -| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [reportwebhook](src/reportwebhook) | **v1** | -| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [managementwebhook](src/managementwebhook) | **v3** | -| [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/Notification/6/overview) | **Deprecated:** This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead. | [platformsnotificationevents](src/platformsnotificationevents) | **v6** | +| Webhooks | Description | Package | Supported Version | +|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------| +| [Payment Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | [webhook](src/webhook) | **v1** | +| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [acswebhook](src/acswebhook) | **v1** | +| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [configurationwebhook](src/configurationwebhook) | **v1** | +| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [transferwebhook](src/transferwebhook) | **v4** | +| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [reportwebhook](src/reportwebhook) | **v1** | +| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [managementwebhook](src/managementwebhook) | **v3** | +| [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [transactionwebhook](src/transactionwebhook) | **v4** | +| [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/Notification/6/overview) | **Deprecated:** This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead. | [platformsnotificationevents](src/platformsnotificationevents) | **v6** | ## Prerequisites diff --git a/src/transactionwebhook/.openapi-generator-ignore b/src/transactionwebhook/.openapi-generator-ignore new file mode 100644 index 000000000..ac5d64112 --- /dev/null +++ b/src/transactionwebhook/.openapi-generator-ignore @@ -0,0 +1,7 @@ +# OpenAPI Generator Ignore + +# Single class service does not need an "index" to group multiple tags +client.go + +# Webhook handler is not a generated file and should remain untouched +webhook_handler.go \ No newline at end of file diff --git a/src/transactionwebhook/model_amount.go b/src/transactionwebhook/model_amount.go new file mode 100644 index 000000000..444b8495c --- /dev/null +++ b/src/transactionwebhook/model_amount.go @@ -0,0 +1,144 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Amount type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Amount{} + +// Amount struct for Amount +type Amount struct { + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + Currency string `json:"currency"` + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + Value int64 `json:"value"` +} + +// NewAmount instantiates a new Amount 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 NewAmount(currency string, value int64) *Amount { + this := Amount{} + this.Currency = currency + this.Value = value + return &this +} + +// NewAmountWithDefaults instantiates a new Amount 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 NewAmountWithDefaults() *Amount { + this := Amount{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *Amount) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Amount) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Amount) SetCurrency(v string) { + o.Currency = v +} + +// GetValue returns the Value field value +func (o *Amount) GetValue() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Amount) GetValueOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Amount) SetValue(v int64) { + o.Value = v +} + +func (o Amount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Amount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableAmount struct { + value *Amount + isSet bool +} + +func (v NullableAmount) Get() *Amount { + return v.value +} + +func (v *NullableAmount) Set(val *Amount) { + v.value = val + v.isSet = true +} + +func (v NullableAmount) IsSet() bool { + return v.isSet +} + +func (v *NullableAmount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmount(val *Amount) *NullableAmount { + return &NullableAmount{value: val, isSet: true} +} + +func (v NullableAmount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transactionwebhook/model_balance_platform_notification_response.go b/src/transactionwebhook/model_balance_platform_notification_response.go new file mode 100644 index 000000000..715700c52 --- /dev/null +++ b/src/transactionwebhook/model_balance_platform_notification_response.go @@ -0,0 +1,125 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalancePlatformNotificationResponse{} + +// BalancePlatformNotificationResponse struct for BalancePlatformNotificationResponse +type BalancePlatformNotificationResponse struct { + // Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewBalancePlatformNotificationResponse instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponse() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// NewBalancePlatformNotificationResponseWithDefaults instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponseWithDefaults() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *BalancePlatformNotificationResponse) GetNotificationResponse() string { + if o == nil || common.IsNil(o.NotificationResponse) { + var ret string + return ret + } + return *o.NotificationResponse +} + +// GetNotificationResponseOk returns a tuple with the NotificationResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalancePlatformNotificationResponse) GetNotificationResponseOk() (*string, bool) { + if o == nil || common.IsNil(o.NotificationResponse) { + return nil, false + } + return o.NotificationResponse, true +} + +// HasNotificationResponse returns a boolean if a field has been set. +func (o *BalancePlatformNotificationResponse) HasNotificationResponse() bool { + if o != nil && !common.IsNil(o.NotificationResponse) { + return true + } + + return false +} + +// SetNotificationResponse gets a reference to the given string and assigns it to the NotificationResponse field. +func (o *BalancePlatformNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalancePlatformNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableBalancePlatformNotificationResponse struct { + value *BalancePlatformNotificationResponse + isSet bool +} + +func (v NullableBalancePlatformNotificationResponse) Get() *BalancePlatformNotificationResponse { + return v.value +} + +func (v *NullableBalancePlatformNotificationResponse) Set(val *BalancePlatformNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBalancePlatformNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBalancePlatformNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalancePlatformNotificationResponse(val *BalancePlatformNotificationResponse) *NullableBalancePlatformNotificationResponse { + return &NullableBalancePlatformNotificationResponse{value: val, isSet: true} +} + +func (v NullableBalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transactionwebhook/model_resource.go b/src/transactionwebhook/model_resource.go new file mode 100644 index 000000000..d4ea80c11 --- /dev/null +++ b/src/transactionwebhook/model_resource.go @@ -0,0 +1,200 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "time" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,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"` + // The ID of the resource. + Id *string `json:"id,omitempty"` +} + +// NewResource instantiates a new Resource 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 NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *Resource) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *Resource) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *Resource) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Resource) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Resource) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Resource) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Resource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Resource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Resource) SetId(v string) { + o.Id = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transactionwebhook/model_resource_reference.go b/src/transactionwebhook/model_resource_reference.go new file mode 100644 index 000000000..bcb1cc883 --- /dev/null +++ b/src/transactionwebhook/model_resource_reference.go @@ -0,0 +1,199 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ResourceReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ResourceReference{} + +// ResourceReference struct for ResourceReference +type ResourceReference struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` +} + +// NewResourceReference instantiates a new ResourceReference 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 NewResourceReference() *ResourceReference { + this := ResourceReference{} + return &this +} + +// NewResourceReferenceWithDefaults instantiates a new ResourceReference 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 NewResourceReferenceWithDefaults() *ResourceReference { + this := ResourceReference{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ResourceReference) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ResourceReference) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ResourceReference) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourceReference) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ResourceReference) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourceReference) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *ResourceReference) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *ResourceReference) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *ResourceReference) SetReference(v string) { + o.Reference = &v +} + +func (o ResourceReference) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableResourceReference struct { + value *ResourceReference + isSet bool +} + +func (v NullableResourceReference) Get() *ResourceReference { + return v.value +} + +func (v *NullableResourceReference) Set(val *ResourceReference) { + v.value = val + v.isSet = true +} + +func (v NullableResourceReference) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceReference(val *ResourceReference) *NullableResourceReference { + return &NullableResourceReference{value: val, isSet: true} +} + +func (v NullableResourceReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transactionwebhook/model_transaction.go b/src/transactionwebhook/model_transaction.go new file mode 100644 index 000000000..d901cdf50 --- /dev/null +++ b/src/transactionwebhook/model_transaction.go @@ -0,0 +1,393 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "time" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Transaction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Transaction{} + +// Transaction struct for Transaction +type Transaction struct { + AccountHolder ResourceReference `json:"accountHolder"` + Amount Amount `json:"amount"` + BalanceAccount ResourceReference `json:"balanceAccount"` + // The unique identifier of the balance platform. + BalancePlatform string `json:"balancePlatform"` + // The date the transaction was booked into the balance account. + BookingDate time.Time `json:"bookingDate"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The unique identifier of the transaction. + Id string `json:"id"` + // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. + Status string `json:"status"` + Transfer *TransferData `json:"transfer,omitempty"` + // The date the transfer amount becomes available in the balance account. + ValueDate time.Time `json:"valueDate"` +} + +// NewTransaction instantiates a new Transaction 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 NewTransaction(accountHolder ResourceReference, amount Amount, balanceAccount ResourceReference, balancePlatform string, bookingDate time.Time, id string, status string, valueDate time.Time) *Transaction { + this := Transaction{} + this.AccountHolder = accountHolder + this.Amount = amount + this.BalanceAccount = balanceAccount + this.BalancePlatform = balancePlatform + this.BookingDate = bookingDate + this.Id = id + this.Status = status + this.ValueDate = valueDate + return &this +} + +// NewTransactionWithDefaults instantiates a new Transaction 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 NewTransactionWithDefaults() *Transaction { + this := Transaction{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value +func (o *Transaction) GetAccountHolder() ResourceReference { + if o == nil { + var ret ResourceReference + return ret + } + + return o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetAccountHolderOk() (*ResourceReference, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolder, true +} + +// SetAccountHolder sets field value +func (o *Transaction) SetAccountHolder(v ResourceReference) { + o.AccountHolder = v +} + +// GetAmount returns the Amount field value +func (o *Transaction) GetAmount() Amount { + if o == nil { + var ret Amount + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetAmountOk() (*Amount, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *Transaction) SetAmount(v Amount) { + o.Amount = v +} + +// GetBalanceAccount returns the BalanceAccount field value +func (o *Transaction) GetBalanceAccount() ResourceReference { + if o == nil { + var ret ResourceReference + return ret + } + + return o.BalanceAccount +} + +// GetBalanceAccountOk returns a tuple with the BalanceAccount field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBalanceAccountOk() (*ResourceReference, bool) { + if o == nil { + return nil, false + } + return &o.BalanceAccount, true +} + +// SetBalanceAccount sets field value +func (o *Transaction) SetBalanceAccount(v ResourceReference) { + o.BalanceAccount = v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *Transaction) GetBalancePlatform() string { + if o == nil { + var ret string + return ret + } + + return o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *Transaction) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetBookingDate returns the BookingDate field value +func (o *Transaction) GetBookingDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.BookingDate +} + +// GetBookingDateOk returns a tuple with the BookingDate field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBookingDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.BookingDate, true +} + +// SetBookingDate sets field value +func (o *Transaction) SetBookingDate(v time.Time) { + o.BookingDate = v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Transaction) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Transaction) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Transaction) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Transaction) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value +func (o *Transaction) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Transaction) SetId(v string) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Transaction) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Transaction) SetStatus(v string) { + o.Status = v +} + +// GetTransfer returns the Transfer field value if set, zero value otherwise. +func (o *Transaction) GetTransfer() TransferData { + if o == nil || common.IsNil(o.Transfer) { + var ret TransferData + return ret + } + return *o.Transfer +} + +// GetTransferOk returns a tuple with the Transfer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Transaction) GetTransferOk() (*TransferData, bool) { + if o == nil || common.IsNil(o.Transfer) { + return nil, false + } + return o.Transfer, true +} + +// HasTransfer returns a boolean if a field has been set. +func (o *Transaction) HasTransfer() bool { + if o != nil && !common.IsNil(o.Transfer) { + return true + } + + return false +} + +// SetTransfer gets a reference to the given TransferData and assigns it to the Transfer field. +func (o *Transaction) SetTransfer(v TransferData) { + o.Transfer = &v +} + +// GetValueDate returns the ValueDate field value +func (o *Transaction) GetValueDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ValueDate +} + +// GetValueDateOk returns a tuple with the ValueDate field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetValueDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ValueDate, true +} + +// SetValueDate sets field value +func (o *Transaction) SetValueDate(v time.Time) { + o.ValueDate = v +} + +func (o Transaction) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountHolder"] = o.AccountHolder + toSerialize["amount"] = o.Amount + toSerialize["balanceAccount"] = o.BalanceAccount + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["bookingDate"] = o.BookingDate + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !common.IsNil(o.Transfer) { + toSerialize["transfer"] = o.Transfer + } + toSerialize["valueDate"] = o.ValueDate + return toSerialize, nil +} + +type NullableTransaction struct { + value *Transaction + isSet bool +} + +func (v NullableTransaction) Get() *Transaction { + return v.value +} + +func (v *NullableTransaction) Set(val *Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransaction(val *Transaction) *NullableTransaction { + return &NullableTransaction{value: val, isSet: true} +} + +func (v NullableTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *Transaction) isValidStatus() bool { + var allowedEnumValues = []string{"booked", "pending"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/transactionwebhook/model_transaction_notification_request_v4.go b/src/transactionwebhook/model_transaction_notification_request_v4.go new file mode 100644 index 000000000..936a2ad12 --- /dev/null +++ b/src/transactionwebhook/model_transaction_notification_request_v4.go @@ -0,0 +1,190 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransactionNotificationRequestV4 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionNotificationRequestV4{} + +// TransactionNotificationRequestV4 struct for TransactionNotificationRequestV4 +type TransactionNotificationRequestV4 struct { + Data Transaction `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of the webhook. + Type *string `json:"type,omitempty"` +} + +// NewTransactionNotificationRequestV4 instantiates a new TransactionNotificationRequestV4 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 NewTransactionNotificationRequestV4(data Transaction, environment string) *TransactionNotificationRequestV4 { + this := TransactionNotificationRequestV4{} + this.Data = data + this.Environment = environment + return &this +} + +// NewTransactionNotificationRequestV4WithDefaults instantiates a new TransactionNotificationRequestV4 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 NewTransactionNotificationRequestV4WithDefaults() *TransactionNotificationRequestV4 { + this := TransactionNotificationRequestV4{} + return &this +} + +// GetData returns the Data field value +func (o *TransactionNotificationRequestV4) GetData() Transaction { + if o == nil { + var ret Transaction + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetDataOk() (*Transaction, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *TransactionNotificationRequestV4) SetData(v Transaction) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *TransactionNotificationRequestV4) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *TransactionNotificationRequestV4) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionNotificationRequestV4) 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 *TransactionNotificationRequestV4) 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 *TransactionNotificationRequestV4) 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 *TransactionNotificationRequestV4) SetType(v string) { + o.Type = &v +} + +func (o TransactionNotificationRequestV4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionNotificationRequestV4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransactionNotificationRequestV4 struct { + value *TransactionNotificationRequestV4 + isSet bool +} + +func (v NullableTransactionNotificationRequestV4) Get() *TransactionNotificationRequestV4 { + return v.value +} + +func (v *NullableTransactionNotificationRequestV4) Set(val *TransactionNotificationRequestV4) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionNotificationRequestV4) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionNotificationRequestV4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionNotificationRequestV4(val *TransactionNotificationRequestV4) *NullableTransactionNotificationRequestV4 { + return &NullableTransactionNotificationRequestV4{value: val, isSet: true} +} + +func (v NullableTransactionNotificationRequestV4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionNotificationRequestV4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransactionNotificationRequestV4) isValidType() bool { + var allowedEnumValues = []string{"balancePlatform.transaction.created"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transactionwebhook/model_transfer_data.go b/src/transactionwebhook/model_transfer_data.go new file mode 100644 index 000000000..3efc04c45 --- /dev/null +++ b/src/transactionwebhook/model_transfer_data.go @@ -0,0 +1,153 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferData{} + +// TransferData struct for TransferData +type TransferData struct { + // The ID of the resource. + Id *string `json:"id,omitempty"` + // The [`reference`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_reference) from the `/transfers` request. If you haven't provided any, Adyen generates a unique reference. + Reference string `json:"reference"` +} + +// NewTransferData instantiates a new TransferData 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 NewTransferData(reference string) *TransferData { + this := TransferData{} + this.Reference = reference + return &this +} + +// NewTransferDataWithDefaults instantiates a new TransferData 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 NewTransferDataWithDefaults() *TransferData { + this := TransferData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransferData) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransferData) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransferData) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value +func (o *TransferData) GetReference() string { + if o == nil { + var ret string + return ret + } + + return o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value +// and a boolean to check if the value has been set. +func (o *TransferData) GetReferenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reference, true +} + +// SetReference sets field value +func (o *TransferData) SetReference(v string) { + o.Reference = v +} + +func (o TransferData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["reference"] = o.Reference + return toSerialize, nil +} + +type NullableTransferData struct { + value *TransferData + isSet bool +} + +func (v NullableTransferData) Get() *TransferData { + return v.value +} + +func (v *NullableTransferData) Set(val *TransferData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferData(val *TransferData) *NullableTransferData { + return &NullableTransferData{value: val, isSet: true} +} + +func (v NullableTransferData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transactionwebhook/webhook_handler.go b/src/transactionwebhook/webhook_handler.go new file mode 100644 index 000000000..c22774364 --- /dev/null +++ b/src/transactionwebhook/webhook_handler.go @@ -0,0 +1,15 @@ +package transactionwebhook + +import ( + "encoding/json" +) + +// HandleTransactionNotificationRequestV4 creates a Notification object from the given JSON string +func HandleTransactionNotificationRequestV4(req string) (*TransactionNotificationRequestV4, error) { + res := TransactionNotificationRequestV4{} + err := json.Unmarshal([]byte(req), &res) + if err != nil { + return nil, err + } + return &res, nil +} From 8850b975e3b24acb5caa5ca7abcbea340bae032c Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:26:08 +0100 Subject: [PATCH 8/9] [create-pull-request] automated change (#266) --- src/binlookup/model_recurring.go | 2 +- .../model_accept_terms_of_service_response.go | 2 +- .../model_generate_pci_description_request.go | 2 +- ...l_get_terms_of_service_document_request.go | 2 +- ..._get_terms_of_service_document_response.go | 2 +- src/legalentity/model_identification_data.go | 4 - src/legalentity/model_legal_entity.go | 38 +- .../model_legal_entity_association.go | 41 +- src/legalentity/model_legal_entity_info.go | 38 +- .../model_legal_entity_info_required_type.go | 38 +- src/legalentity/model_sole_proprietorship.go | 37 ++ .../model_terms_of_service_acceptance_info.go | 2 +- src/legalentity/model_trust.go | 513 ++++++++++++++++++ .../model_undefined_beneficiary.go | 162 ++++++ src/management/api_my_api_credential.go | 24 +- .../api_terminal_orders_company_level.go | 1 + .../api_terminal_orders_merchant_level.go | 3 +- src/management/model_rest_service_error.go | 20 +- src/management/model_terminal_assignment.go | 4 +- src/payments/model_recurring.go | 2 +- src/payout/model_recurring.go | 2 +- src/recurring/model_recurring.go | 2 +- 22 files changed, 900 insertions(+), 41 deletions(-) create mode 100644 src/legalentity/model_trust.go create mode 100644 src/legalentity/model_undefined_beneficiary.go diff --git a/src/binlookup/model_recurring.go b/src/binlookup/model_recurring.go index b69a533ee..dccf2a73c 100644 --- a/src/binlookup/model_recurring.go +++ b/src/binlookup/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 6164aabac..8f8245435 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -29,7 +29,7 @@ type AcceptTermsOfServiceResponse struct { Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` - // The type of Terms of Service. + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index dfc6232b6..2ce0ced2f 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &GeneratePciDescriptionRequest{} // GeneratePciDescriptionRequest struct for GeneratePciDescriptionRequest type GeneratePciDescriptionRequest struct { - // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) for your user. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** + // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) before you generate the questionnaires. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** AdditionalSalesChannels []string `json:"additionalSalesChannels,omitempty"` // Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. Language *string `json:"language,omitempty"` diff --git a/src/legalentity/model_get_terms_of_service_document_request.go b/src/legalentity/model_get_terms_of_service_document_request.go index b478465bf..a283a7cd2 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &GetTermsOfServiceDocumentRequest{} type GetTermsOfServiceDocumentRequest struct { // The language to be used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language string `json:"language"` - // The type of Terms of Service. + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type string `json:"type"` } diff --git a/src/legalentity/model_get_terms_of_service_document_response.go b/src/legalentity/model_get_terms_of_service_document_response.go index 686edf4bb..938297761 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -27,7 +27,7 @@ type GetTermsOfServiceDocumentResponse struct { Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` - // The type of Terms of Service. + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index 398b2aa24..c5d243a39 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -22,7 +22,6 @@ type IdentificationData struct { // The card number of the document that was issued (AU only). CardNumber *string `json:"cardNumber,omitempty"` // The expiry date of the document, in YYYY-MM-DD format. - // Deprecated ExpiryDate *string `json:"expiryDate,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the document was issued. For example, **US**. // Deprecated @@ -88,7 +87,6 @@ func (o *IdentificationData) SetCardNumber(v string) { } // GetExpiryDate returns the ExpiryDate field value if set, zero value otherwise. -// Deprecated func (o *IdentificationData) GetExpiryDate() string { if o == nil || common.IsNil(o.ExpiryDate) { var ret string @@ -99,7 +97,6 @@ func (o *IdentificationData) GetExpiryDate() string { // GetExpiryDateOk returns a tuple with the ExpiryDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// Deprecated func (o *IdentificationData) GetExpiryDateOk() (*string, bool) { if o == nil || common.IsNil(o.ExpiryDate) { return nil, false @@ -117,7 +114,6 @@ func (o *IdentificationData) HasExpiryDate() bool { } // SetExpiryDate gets a reference to the given string and assigns it to the ExpiryDate field. -// Deprecated func (o *IdentificationData) SetExpiryDate(v string) { o.ExpiryDate = &v } diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index ec173b9d9..ebe4de460 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -39,7 +39,8 @@ type LegalEntity struct { SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` // List of transfer instruments that the legal entity owns. TransferInstruments []TransferInstrumentReference `json:"transferInstruments,omitempty"` - // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. + Trust *Trust `json:"trust,omitempty"` + // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. Type *string `json:"type,omitempty"` // List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. VerificationDeadlines []VerificationDeadline `json:"verificationDeadlines,omitempty"` @@ -410,6 +411,38 @@ func (o *LegalEntity) SetTransferInstruments(v []TransferInstrumentReference) { o.TransferInstruments = v } +// GetTrust returns the Trust field value if set, zero value otherwise. +func (o *LegalEntity) GetTrust() Trust { + if o == nil || common.IsNil(o.Trust) { + var ret Trust + return ret + } + return *o.Trust +} + +// GetTrustOk returns a tuple with the Trust field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegalEntity) GetTrustOk() (*Trust, bool) { + if o == nil || common.IsNil(o.Trust) { + return nil, false + } + return o.Trust, true +} + +// HasTrust returns a boolean if a field has been set. +func (o *LegalEntity) HasTrust() bool { + if o != nil && !common.IsNil(o.Trust) { + return true + } + + return false +} + +// SetTrust gets a reference to the given Trust and assigns it to the Trust field. +func (o *LegalEntity) SetTrust(v Trust) { + o.Trust = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *LegalEntity) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -515,6 +548,9 @@ func (o LegalEntity) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.TransferInstruments) { toSerialize["transferInstruments"] = o.TransferInstruments } + if !common.IsNil(o.Trust) { + toSerialize["trust"] = o.Trust + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/legalentity/model_legal_entity_association.go b/src/legalentity/model_legal_entity_association.go index e2706750a..d17762667 100644 --- a/src/legalentity/model_legal_entity_association.go +++ b/src/legalentity/model_legal_entity_association.go @@ -29,7 +29,9 @@ type LegalEntityAssociation struct { LegalEntityId string `json:"legalEntityId"` // The name of the associated [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id). - For **individual**, `name.firstName` and `name.lastName`. - For **organization**, `legalName`. - For **soleProprietorship**, `name`. Name *string `json:"name,omitempty"` - // Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. + // Defines the Kyc Exemption Reason for a Settlor associated with a trust. For example, **professionalServiceProvider**, **deceased**, or **contributionBelowThreshold**. + SettlorExemptionReason []string `json:"settlorExemptionReason,omitempty"` + // Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust** Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. Type string `json:"type"` } @@ -204,6 +206,38 @@ func (o *LegalEntityAssociation) SetName(v string) { o.Name = &v } +// GetSettlorExemptionReason returns the SettlorExemptionReason field value if set, zero value otherwise. +func (o *LegalEntityAssociation) GetSettlorExemptionReason() []string { + if o == nil || common.IsNil(o.SettlorExemptionReason) { + var ret []string + return ret + } + return o.SettlorExemptionReason +} + +// GetSettlorExemptionReasonOk returns a tuple with the SettlorExemptionReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegalEntityAssociation) GetSettlorExemptionReasonOk() ([]string, bool) { + if o == nil || common.IsNil(o.SettlorExemptionReason) { + return nil, false + } + return o.SettlorExemptionReason, true +} + +// HasSettlorExemptionReason returns a boolean if a field has been set. +func (o *LegalEntityAssociation) HasSettlorExemptionReason() bool { + if o != nil && !common.IsNil(o.SettlorExemptionReason) { + return true + } + + return false +} + +// SetSettlorExemptionReason gets a reference to the given []string and assigns it to the SettlorExemptionReason field. +func (o *LegalEntityAssociation) SetSettlorExemptionReason(v []string) { + o.SettlorExemptionReason = v +} + // GetType returns the Type field value func (o *LegalEntityAssociation) GetType() string { if o == nil { @@ -251,6 +285,9 @@ func (o LegalEntityAssociation) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Name) { toSerialize["name"] = o.Name } + if !common.IsNil(o.SettlorExemptionReason) { + toSerialize["settlorExemptionReason"] = o.SettlorExemptionReason + } toSerialize["type"] = o.Type return toSerialize, nil } @@ -292,7 +329,7 @@ func (v *NullableLegalEntityAssociation) UnmarshalJSON(src []byte) error { } func (o *LegalEntityAssociation) isValidType() bool { - var allowedEnumValues = []string{"pciSignatory", "signatory", "soleProprietorship", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany"} + var allowedEnumValues = []string{"definedBeneficiary", "director", "pciSignatory", "protector", "secondaryTrustee", "settlor", "signatory", "soleProprietorship", "trust", "trustOwnership", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany", "undefinedBeneficiary"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/legalentity/model_legal_entity_info.go b/src/legalentity/model_legal_entity_info.go index af613e0aa..80574575a 100644 --- a/src/legalentity/model_legal_entity_info.go +++ b/src/legalentity/model_legal_entity_info.go @@ -28,7 +28,8 @@ type LegalEntityInfo struct { // Your reference for the legal entity, maximum 150 characters. Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` - // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. + Trust *Trust `json:"trust,omitempty"` + // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. Type *string `json:"type,omitempty"` } @@ -241,6 +242,38 @@ func (o *LegalEntityInfo) SetSoleProprietorship(v SoleProprietorship) { o.SoleProprietorship = &v } +// GetTrust returns the Trust field value if set, zero value otherwise. +func (o *LegalEntityInfo) GetTrust() Trust { + if o == nil || common.IsNil(o.Trust) { + var ret Trust + return ret + } + return *o.Trust +} + +// GetTrustOk returns a tuple with the Trust field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegalEntityInfo) GetTrustOk() (*Trust, bool) { + if o == nil || common.IsNil(o.Trust) { + return nil, false + } + return o.Trust, true +} + +// HasTrust returns a boolean if a field has been set. +func (o *LegalEntityInfo) HasTrust() bool { + if o != nil && !common.IsNil(o.Trust) { + return true + } + + return false +} + +// SetTrust gets a reference to the given Trust and assigns it to the Trust field. +func (o *LegalEntityInfo) SetTrust(v Trust) { + o.Trust = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *LegalEntityInfo) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -301,6 +334,9 @@ func (o LegalEntityInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.SoleProprietorship) { toSerialize["soleProprietorship"] = o.SoleProprietorship } + if !common.IsNil(o.Trust) { + toSerialize["trust"] = o.Trust + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/legalentity/model_legal_entity_info_required_type.go b/src/legalentity/model_legal_entity_info_required_type.go index ef8e156bf..8103555cf 100644 --- a/src/legalentity/model_legal_entity_info_required_type.go +++ b/src/legalentity/model_legal_entity_info_required_type.go @@ -28,7 +28,8 @@ type LegalEntityInfoRequiredType struct { // Your reference for the legal entity, maximum 150 characters. Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` - // The type of legal entity. Possible values: **individual**, **organization**, or **soleProprietorship**. + Trust *Trust `json:"trust,omitempty"` + // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. Type string `json:"type"` } @@ -242,6 +243,38 @@ func (o *LegalEntityInfoRequiredType) SetSoleProprietorship(v SoleProprietorship o.SoleProprietorship = &v } +// GetTrust returns the Trust field value if set, zero value otherwise. +func (o *LegalEntityInfoRequiredType) GetTrust() Trust { + if o == nil || common.IsNil(o.Trust) { + var ret Trust + return ret + } + return *o.Trust +} + +// GetTrustOk returns a tuple with the Trust field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LegalEntityInfoRequiredType) GetTrustOk() (*Trust, bool) { + if o == nil || common.IsNil(o.Trust) { + return nil, false + } + return o.Trust, true +} + +// HasTrust returns a boolean if a field has been set. +func (o *LegalEntityInfoRequiredType) HasTrust() bool { + if o != nil && !common.IsNil(o.Trust) { + return true + } + + return false +} + +// SetTrust gets a reference to the given Trust and assigns it to the Trust field. +func (o *LegalEntityInfoRequiredType) SetTrust(v Trust) { + o.Trust = &v +} + // GetType returns the Type field value func (o *LegalEntityInfoRequiredType) GetType() string { if o == nil { @@ -294,6 +327,9 @@ func (o LegalEntityInfoRequiredType) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.SoleProprietorship) { toSerialize["soleProprietorship"] = o.SoleProprietorship } + if !common.IsNil(o.Trust) { + toSerialize["trust"] = o.Trust + } toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/legalentity/model_sole_proprietorship.go b/src/legalentity/model_sole_proprietorship.go index e5db764f9..071681ae7 100644 --- a/src/legalentity/model_sole_proprietorship.go +++ b/src/legalentity/model_sole_proprietorship.go @@ -31,6 +31,8 @@ type SoleProprietorship struct { RegisteredAddress Address `json:"registeredAddress"` // The registration number. RegistrationNumber *string `json:"registrationNumber,omitempty"` + // The tax information of the entity. + TaxInformation []TaxInformation `json:"taxInformation,omitempty"` // The reason for not providing a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. VatAbsenceReason *string `json:"vatAbsenceReason,omitempty"` // The VAT number. @@ -257,6 +259,38 @@ func (o *SoleProprietorship) SetRegistrationNumber(v string) { o.RegistrationNumber = &v } +// GetTaxInformation returns the TaxInformation field value if set, zero value otherwise. +func (o *SoleProprietorship) GetTaxInformation() []TaxInformation { + if o == nil || common.IsNil(o.TaxInformation) { + var ret []TaxInformation + return ret + } + return o.TaxInformation +} + +// GetTaxInformationOk returns a tuple with the TaxInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SoleProprietorship) GetTaxInformationOk() ([]TaxInformation, bool) { + if o == nil || common.IsNil(o.TaxInformation) { + return nil, false + } + return o.TaxInformation, true +} + +// HasTaxInformation returns a boolean if a field has been set. +func (o *SoleProprietorship) HasTaxInformation() bool { + if o != nil && !common.IsNil(o.TaxInformation) { + return true + } + + return false +} + +// SetTaxInformation gets a reference to the given []TaxInformation and assigns it to the TaxInformation field. +func (o *SoleProprietorship) SetTaxInformation(v []TaxInformation) { + o.TaxInformation = v +} + // GetVatAbsenceReason returns the VatAbsenceReason field value if set, zero value otherwise. func (o *SoleProprietorship) GetVatAbsenceReason() string { if o == nil || common.IsNil(o.VatAbsenceReason) { @@ -346,6 +380,9 @@ func (o SoleProprietorship) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RegistrationNumber) { toSerialize["registrationNumber"] = o.RegistrationNumber } + if !common.IsNil(o.TaxInformation) { + toSerialize["taxInformation"] = o.TaxInformation + } if !common.IsNil(o.VatAbsenceReason) { toSerialize["vatAbsenceReason"] = o.VatAbsenceReason } diff --git a/src/legalentity/model_terms_of_service_acceptance_info.go b/src/legalentity/model_terms_of_service_acceptance_info.go index 426ef6d8e..5d699144b 100644 --- a/src/legalentity/model_terms_of_service_acceptance_info.go +++ b/src/legalentity/model_terms_of_service_acceptance_info.go @@ -28,7 +28,7 @@ type TermsOfServiceAcceptanceInfo struct { CreatedAt *time.Time `json:"createdAt,omitempty"` // An Adyen-generated reference for the accepted Terms of Service. Id *string `json:"id,omitempty"` - // The type of Terms of Service. + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } diff --git a/src/legalentity/model_trust.go b/src/legalentity/model_trust.go new file mode 100644 index 000000000..666c78db0 --- /dev/null +++ b/src/legalentity/model_trust.go @@ -0,0 +1,513 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Trust type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Trust{} + +// Trust struct for Trust +type Trust struct { + // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the governing country. + CountryOfGoverningLaw string `json:"countryOfGoverningLaw"` + // The date when the legal arrangement was incorporated in YYYY-MM-DD format. + DateOfIncorporation *string `json:"dateOfIncorporation,omitempty"` + // The registered name, if different from the `name`. + DoingBusinessAs *string `json:"doingBusinessAs,omitempty"` + // The legal name. + Name string `json:"name"` + PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` + RegisteredAddress Address `json:"registeredAddress"` + // The registration number. + RegistrationNumber *string `json:"registrationNumber,omitempty"` + // The tax information of the entity. + TaxInformation []TaxInformation `json:"taxInformation,omitempty"` + // Type of trust. Possible values for Australian trusts: **cashManagementTrust**, **corporateUnitTrust**, **deceasedEstate**, **discretionaryInvestmentTrust**, **discretionaryServicesManagementTrust**, **discretionaryTradingTrust**, **firstHomeSaverAccountsTrust**, **fixedTrust**, **fixedUnitTrust**, **hybridTrust**, **listedPublicUnitTrust**, **otherTrust**, **pooledSuperannuationTrust**, **publicTradingTrust**, **unlistedPublicUnitTrust**. + Type string `json:"type"` + // The undefined beneficiary information of the entity. + UndefinedBeneficiaryInfo []UndefinedBeneficiary `json:"undefinedBeneficiaryInfo,omitempty"` + // The reason for not providing a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. + VatAbsenceReason *string `json:"vatAbsenceReason,omitempty"` + // The VAT number. + VatNumber *string `json:"vatNumber,omitempty"` +} + +// NewTrust instantiates a new Trust 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 NewTrust(countryOfGoverningLaw string, name string, registeredAddress Address, type_ string) *Trust { + this := Trust{} + this.CountryOfGoverningLaw = countryOfGoverningLaw + this.Name = name + this.RegisteredAddress = registeredAddress + this.Type = type_ + return &this +} + +// NewTrustWithDefaults instantiates a new Trust 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 NewTrustWithDefaults() *Trust { + this := Trust{} + return &this +} + +// GetCountryOfGoverningLaw returns the CountryOfGoverningLaw field value +func (o *Trust) GetCountryOfGoverningLaw() string { + if o == nil { + var ret string + return ret + } + + return o.CountryOfGoverningLaw +} + +// GetCountryOfGoverningLawOk returns a tuple with the CountryOfGoverningLaw field value +// and a boolean to check if the value has been set. +func (o *Trust) GetCountryOfGoverningLawOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CountryOfGoverningLaw, true +} + +// SetCountryOfGoverningLaw sets field value +func (o *Trust) SetCountryOfGoverningLaw(v string) { + o.CountryOfGoverningLaw = v +} + +// GetDateOfIncorporation returns the DateOfIncorporation field value if set, zero value otherwise. +func (o *Trust) GetDateOfIncorporation() string { + if o == nil || common.IsNil(o.DateOfIncorporation) { + var ret string + return ret + } + return *o.DateOfIncorporation +} + +// GetDateOfIncorporationOk returns a tuple with the DateOfIncorporation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetDateOfIncorporationOk() (*string, bool) { + if o == nil || common.IsNil(o.DateOfIncorporation) { + return nil, false + } + return o.DateOfIncorporation, true +} + +// HasDateOfIncorporation returns a boolean if a field has been set. +func (o *Trust) HasDateOfIncorporation() bool { + if o != nil && !common.IsNil(o.DateOfIncorporation) { + return true + } + + return false +} + +// SetDateOfIncorporation gets a reference to the given string and assigns it to the DateOfIncorporation field. +func (o *Trust) SetDateOfIncorporation(v string) { + o.DateOfIncorporation = &v +} + +// GetDoingBusinessAs returns the DoingBusinessAs field value if set, zero value otherwise. +func (o *Trust) GetDoingBusinessAs() string { + if o == nil || common.IsNil(o.DoingBusinessAs) { + var ret string + return ret + } + return *o.DoingBusinessAs +} + +// GetDoingBusinessAsOk returns a tuple with the DoingBusinessAs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetDoingBusinessAsOk() (*string, bool) { + if o == nil || common.IsNil(o.DoingBusinessAs) { + return nil, false + } + return o.DoingBusinessAs, true +} + +// HasDoingBusinessAs returns a boolean if a field has been set. +func (o *Trust) HasDoingBusinessAs() bool { + if o != nil && !common.IsNil(o.DoingBusinessAs) { + return true + } + + return false +} + +// SetDoingBusinessAs gets a reference to the given string and assigns it to the DoingBusinessAs field. +func (o *Trust) SetDoingBusinessAs(v string) { + o.DoingBusinessAs = &v +} + +// GetName returns the Name field value +func (o *Trust) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Trust) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Trust) SetName(v string) { + o.Name = v +} + +// GetPrincipalPlaceOfBusiness returns the PrincipalPlaceOfBusiness field value if set, zero value otherwise. +func (o *Trust) GetPrincipalPlaceOfBusiness() Address { + if o == nil || common.IsNil(o.PrincipalPlaceOfBusiness) { + var ret Address + return ret + } + return *o.PrincipalPlaceOfBusiness +} + +// GetPrincipalPlaceOfBusinessOk returns a tuple with the PrincipalPlaceOfBusiness field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetPrincipalPlaceOfBusinessOk() (*Address, bool) { + if o == nil || common.IsNil(o.PrincipalPlaceOfBusiness) { + return nil, false + } + return o.PrincipalPlaceOfBusiness, true +} + +// HasPrincipalPlaceOfBusiness returns a boolean if a field has been set. +func (o *Trust) HasPrincipalPlaceOfBusiness() bool { + if o != nil && !common.IsNil(o.PrincipalPlaceOfBusiness) { + return true + } + + return false +} + +// SetPrincipalPlaceOfBusiness gets a reference to the given Address and assigns it to the PrincipalPlaceOfBusiness field. +func (o *Trust) SetPrincipalPlaceOfBusiness(v Address) { + o.PrincipalPlaceOfBusiness = &v +} + +// GetRegisteredAddress returns the RegisteredAddress field value +func (o *Trust) GetRegisteredAddress() Address { + if o == nil { + var ret Address + return ret + } + + return o.RegisteredAddress +} + +// GetRegisteredAddressOk returns a tuple with the RegisteredAddress field value +// and a boolean to check if the value has been set. +func (o *Trust) GetRegisteredAddressOk() (*Address, bool) { + if o == nil { + return nil, false + } + return &o.RegisteredAddress, true +} + +// SetRegisteredAddress sets field value +func (o *Trust) SetRegisteredAddress(v Address) { + o.RegisteredAddress = v +} + +// GetRegistrationNumber returns the RegistrationNumber field value if set, zero value otherwise. +func (o *Trust) GetRegistrationNumber() string { + if o == nil || common.IsNil(o.RegistrationNumber) { + var ret string + return ret + } + return *o.RegistrationNumber +} + +// GetRegistrationNumberOk returns a tuple with the RegistrationNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetRegistrationNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.RegistrationNumber) { + return nil, false + } + return o.RegistrationNumber, true +} + +// HasRegistrationNumber returns a boolean if a field has been set. +func (o *Trust) HasRegistrationNumber() bool { + if o != nil && !common.IsNil(o.RegistrationNumber) { + return true + } + + return false +} + +// SetRegistrationNumber gets a reference to the given string and assigns it to the RegistrationNumber field. +func (o *Trust) SetRegistrationNumber(v string) { + o.RegistrationNumber = &v +} + +// GetTaxInformation returns the TaxInformation field value if set, zero value otherwise. +func (o *Trust) GetTaxInformation() []TaxInformation { + if o == nil || common.IsNil(o.TaxInformation) { + var ret []TaxInformation + return ret + } + return o.TaxInformation +} + +// GetTaxInformationOk returns a tuple with the TaxInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetTaxInformationOk() ([]TaxInformation, bool) { + if o == nil || common.IsNil(o.TaxInformation) { + return nil, false + } + return o.TaxInformation, true +} + +// HasTaxInformation returns a boolean if a field has been set. +func (o *Trust) HasTaxInformation() bool { + if o != nil && !common.IsNil(o.TaxInformation) { + return true + } + + return false +} + +// SetTaxInformation gets a reference to the given []TaxInformation and assigns it to the TaxInformation field. +func (o *Trust) SetTaxInformation(v []TaxInformation) { + o.TaxInformation = v +} + +// GetType returns the Type field value +func (o *Trust) 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 *Trust) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Trust) SetType(v string) { + o.Type = v +} + +// GetUndefinedBeneficiaryInfo returns the UndefinedBeneficiaryInfo field value if set, zero value otherwise. +func (o *Trust) GetUndefinedBeneficiaryInfo() []UndefinedBeneficiary { + if o == nil || common.IsNil(o.UndefinedBeneficiaryInfo) { + var ret []UndefinedBeneficiary + return ret + } + return o.UndefinedBeneficiaryInfo +} + +// GetUndefinedBeneficiaryInfoOk returns a tuple with the UndefinedBeneficiaryInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetUndefinedBeneficiaryInfoOk() ([]UndefinedBeneficiary, bool) { + if o == nil || common.IsNil(o.UndefinedBeneficiaryInfo) { + return nil, false + } + return o.UndefinedBeneficiaryInfo, true +} + +// HasUndefinedBeneficiaryInfo returns a boolean if a field has been set. +func (o *Trust) HasUndefinedBeneficiaryInfo() bool { + if o != nil && !common.IsNil(o.UndefinedBeneficiaryInfo) { + return true + } + + return false +} + +// SetUndefinedBeneficiaryInfo gets a reference to the given []UndefinedBeneficiary and assigns it to the UndefinedBeneficiaryInfo field. +func (o *Trust) SetUndefinedBeneficiaryInfo(v []UndefinedBeneficiary) { + o.UndefinedBeneficiaryInfo = v +} + +// GetVatAbsenceReason returns the VatAbsenceReason field value if set, zero value otherwise. +func (o *Trust) GetVatAbsenceReason() string { + if o == nil || common.IsNil(o.VatAbsenceReason) { + var ret string + return ret + } + return *o.VatAbsenceReason +} + +// GetVatAbsenceReasonOk returns a tuple with the VatAbsenceReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetVatAbsenceReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.VatAbsenceReason) { + return nil, false + } + return o.VatAbsenceReason, true +} + +// HasVatAbsenceReason returns a boolean if a field has been set. +func (o *Trust) HasVatAbsenceReason() bool { + if o != nil && !common.IsNil(o.VatAbsenceReason) { + return true + } + + return false +} + +// SetVatAbsenceReason gets a reference to the given string and assigns it to the VatAbsenceReason field. +func (o *Trust) SetVatAbsenceReason(v string) { + o.VatAbsenceReason = &v +} + +// GetVatNumber returns the VatNumber field value if set, zero value otherwise. +func (o *Trust) GetVatNumber() string { + if o == nil || common.IsNil(o.VatNumber) { + var ret string + return ret + } + return *o.VatNumber +} + +// GetVatNumberOk returns a tuple with the VatNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetVatNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.VatNumber) { + return nil, false + } + return o.VatNumber, true +} + +// HasVatNumber returns a boolean if a field has been set. +func (o *Trust) HasVatNumber() bool { + if o != nil && !common.IsNil(o.VatNumber) { + return true + } + + return false +} + +// SetVatNumber gets a reference to the given string and assigns it to the VatNumber field. +func (o *Trust) SetVatNumber(v string) { + o.VatNumber = &v +} + +func (o Trust) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Trust) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["countryOfGoverningLaw"] = o.CountryOfGoverningLaw + if !common.IsNil(o.DateOfIncorporation) { + toSerialize["dateOfIncorporation"] = o.DateOfIncorporation + } + if !common.IsNil(o.DoingBusinessAs) { + toSerialize["doingBusinessAs"] = o.DoingBusinessAs + } + toSerialize["name"] = o.Name + if !common.IsNil(o.PrincipalPlaceOfBusiness) { + toSerialize["principalPlaceOfBusiness"] = o.PrincipalPlaceOfBusiness + } + toSerialize["registeredAddress"] = o.RegisteredAddress + if !common.IsNil(o.RegistrationNumber) { + toSerialize["registrationNumber"] = o.RegistrationNumber + } + if !common.IsNil(o.TaxInformation) { + toSerialize["taxInformation"] = o.TaxInformation + } + toSerialize["type"] = o.Type + if !common.IsNil(o.UndefinedBeneficiaryInfo) { + toSerialize["undefinedBeneficiaryInfo"] = o.UndefinedBeneficiaryInfo + } + if !common.IsNil(o.VatAbsenceReason) { + toSerialize["vatAbsenceReason"] = o.VatAbsenceReason + } + if !common.IsNil(o.VatNumber) { + toSerialize["vatNumber"] = o.VatNumber + } + return toSerialize, nil +} + +type NullableTrust struct { + value *Trust + isSet bool +} + +func (v NullableTrust) Get() *Trust { + return v.value +} + +func (v *NullableTrust) Set(val *Trust) { + v.value = val + v.isSet = true +} + +func (v NullableTrust) IsSet() bool { + return v.isSet +} + +func (v *NullableTrust) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTrust(val *Trust) *NullableTrust { + return &NullableTrust{value: val, isSet: true} +} + +func (v NullableTrust) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTrust) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *Trust) isValidType() bool { + var allowedEnumValues = []string{"cashManagementTrust", "corporateUnitTrust", "deceasedEstate", "discretionaryInvestmentTrust", "discretionaryServicesManagementTrust", "discretionaryTradingTrust", "firstHomeSaverAccountsTrust", "fixedTrust", "fixedUnitTrust", "hybridTrust", "listedPublicUnitTrust", "otherTrust", "pooledSuperannuationTrust", "publicTradingTrust", "unlistedPublicUnitTrust"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} +func (o *Trust) isValidVatAbsenceReason() bool { + var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false +} diff --git a/src/legalentity/model_undefined_beneficiary.go b/src/legalentity/model_undefined_beneficiary.go new file mode 100644 index 000000000..3c1ce3784 --- /dev/null +++ b/src/legalentity/model_undefined_beneficiary.go @@ -0,0 +1,162 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the UndefinedBeneficiary type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &UndefinedBeneficiary{} + +// UndefinedBeneficiary struct for UndefinedBeneficiary +type UndefinedBeneficiary struct { + // The details of the undefined beneficiary. + Description *string `json:"description,omitempty"` + // The reference of the undefined beneficiary. + Reference *string `json:"reference,omitempty"` +} + +// NewUndefinedBeneficiary instantiates a new UndefinedBeneficiary 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 NewUndefinedBeneficiary() *UndefinedBeneficiary { + this := UndefinedBeneficiary{} + return &this +} + +// NewUndefinedBeneficiaryWithDefaults instantiates a new UndefinedBeneficiary 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 NewUndefinedBeneficiaryWithDefaults() *UndefinedBeneficiary { + this := UndefinedBeneficiary{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UndefinedBeneficiary) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UndefinedBeneficiary) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UndefinedBeneficiary) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UndefinedBeneficiary) SetDescription(v string) { + o.Description = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *UndefinedBeneficiary) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UndefinedBeneficiary) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *UndefinedBeneficiary) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *UndefinedBeneficiary) SetReference(v string) { + o.Reference = &v +} + +func (o UndefinedBeneficiary) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UndefinedBeneficiary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableUndefinedBeneficiary struct { + value *UndefinedBeneficiary + isSet bool +} + +func (v NullableUndefinedBeneficiary) Get() *UndefinedBeneficiary { + return v.value +} + +func (v *NullableUndefinedBeneficiary) Set(val *UndefinedBeneficiary) { + v.value = val + v.isSet = true +} + +func (v NullableUndefinedBeneficiary) IsSet() bool { + return v.isSet +} + +func (v *NullableUndefinedBeneficiary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUndefinedBeneficiary(val *UndefinedBeneficiary) *NullableUndefinedBeneficiary { + return &NullableUndefinedBeneficiary{value: val, isSet: true} +} + +func (v NullableUndefinedBeneficiary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUndefinedBeneficiary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/management/api_my_api_credential.go b/src/management/api_my_api_credential.go index b746e73e6..bd1a9ed7c 100644 --- a/src/management/api_my_api_credential.go +++ b/src/management/api_my_api_credential.go @@ -118,30 +118,34 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden return *res, httpRes, err } -// All parameters accepted by MyAPICredentialApi.GenerateNewClientKeyForSelf -type MyAPICredentialApiGenerateNewClientKeyForSelfInput struct { +// All parameters accepted by MyAPICredentialApi.GenerateClientKey +type MyAPICredentialApiGenerateClientKeyInput struct { } /* -Prepare a request for GenerateNewClientKeyForSelf +Prepare a request for GenerateClientKey -@return MyAPICredentialApiGenerateNewClientKeyForSelfInput +@return MyAPICredentialApiGenerateClientKeyInput */ -func (a *MyAPICredentialApi) GenerateNewClientKeyForSelfInput() MyAPICredentialApiGenerateNewClientKeyForSelfInput { - return MyAPICredentialApiGenerateNewClientKeyForSelfInput{} +func (a *MyAPICredentialApi) GenerateClientKeyInput() MyAPICredentialApiGenerateClientKeyInput { + return MyAPICredentialApiGenerateClientKeyInput{} } /* -GenerateNewClientKeyForSelf Generate new client key for self +GenerateClientKey Generate a client key -Returns a new [client key](https://docs.adyen.com/development-resources/client-side-authentication#how-it-works) for the caller - API Credential or OAuth Access Token. You can use the new client key a few minutes after generating it. The old client key stops working 24 hours after generating a new one.To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): +Generates a new [client key](https://docs.adyen.com/development-resources/client-side-authentication/) used to authenticate requests from your payment environment. +You can use the new client key a few minutes after generating it. +The old client key stops working 24 hours after generating a new one. + +To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r MyAPICredentialApiGenerateNewClientKeyForSelfInput - Request parameters, see GenerateNewClientKeyForSelfInput +@param r MyAPICredentialApiGenerateClientKeyInput - Request parameters, see GenerateClientKeyInput @return GenerateClientKeyResponse, *http.Response, error */ -func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r MyAPICredentialApiGenerateNewClientKeyForSelfInput) (GenerateClientKeyResponse, *http.Response, error) { +func (a *MyAPICredentialApi) GenerateClientKey(ctx context.Context, r MyAPICredentialApiGenerateClientKeyInput) (GenerateClientKeyResponse, *http.Response, error) { res := &GenerateClientKeyResponse{} path := "/me/generateClientKey" queryParams := url.Values{} diff --git a/src/management/api_terminal_orders_company_level.go b/src/management/api_terminal_orders_company_level.go index c21e271f2..769669734 100644 --- a/src/management/api_terminal_orders_company_level.go +++ b/src/management/api_terminal_orders_company_level.go @@ -150,6 +150,7 @@ Creates an order for payment terminal products for the company identified in the To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write +>Requests to the Management API test endpoint do not create actual orders for test terminals. To order test terminals, you need to [submit a sales order](https://docs.adyen.com/point-of-sale/managing-terminals/order-terminals/#sales-order-steps) in your Customer Area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r TerminalOrdersCompanyLevelApiCreateOrderInput - Request parameters, see CreateOrderInput diff --git a/src/management/api_terminal_orders_merchant_level.go b/src/management/api_terminal_orders_merchant_level.go index c9d27f743..663396a0e 100644 --- a/src/management/api_terminal_orders_merchant_level.go +++ b/src/management/api_terminal_orders_merchant_level.go @@ -150,6 +150,7 @@ Creates an order for payment terminal products for the merchant account identifi To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write +>Requests to the Management API test endpoint do not create actual orders for test terminals. To order test terminals, you need to [submit a sales order](https://docs.adyen.com/point-of-sale/managing-terminals/order-terminals/#sales-order-steps) in your Customer Area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r TerminalOrdersMerchantLevelApiCreateOrderInput - Request parameters, see CreateOrderInput @@ -1047,7 +1048,7 @@ Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. The request body only needs to contain what you want to change. -However, to update the products in the `items` array, you must provice the entire array. For example, if the array has three items: +However, to update the products in the `items` array, you must provide the entire array. For example, if the array has three items: To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): diff --git a/src/management/model_rest_service_error.go b/src/management/model_rest_service_error.go index c5982dbad..c509ba7c2 100644 --- a/src/management/model_rest_service_error.go +++ b/src/management/model_rest_service_error.go @@ -28,8 +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"` - Response *JSONObject `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. @@ -205,19 +205,19 @@ func (o *RestServiceError) SetRequestId(v string) { } // GetResponse returns the Response field value if set, zero value otherwise. -func (o *RestServiceError) GetResponse() JSONObject { +func (o *RestServiceError) GetResponse() map[string]interface{} { if o == nil || common.IsNil(o.Response) { - var ret JSONObject + var ret map[string]interface{} return ret } - return *o.Response + return o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestServiceError) GetResponseOk() (*JSONObject, bool) { +func (o *RestServiceError) GetResponseOk() (map[string]interface{}, bool) { if o == nil || common.IsNil(o.Response) { - return nil, false + return map[string]interface{}{}, false } return o.Response, true } @@ -231,9 +231,9 @@ func (o *RestServiceError) HasResponse() bool { return false } -// SetResponse gets a reference to the given JSONObject and assigns it to the Response field. -func (o *RestServiceError) SetResponse(v JSONObject) { - o.Response = &v +// SetResponse gets a reference to the given map[string]interface{} and assigns it to the Response field. +func (o *RestServiceError) SetResponse(v map[string]interface{}) { + o.Response = v } // GetStatus returns the Status field value diff --git a/src/management/model_terminal_assignment.go b/src/management/model_terminal_assignment.go index 3b3dc77a5..b813eb28b 100644 --- a/src/management/model_terminal_assignment.go +++ b/src/management/model_terminal_assignment.go @@ -24,7 +24,7 @@ type TerminalAssignment struct { // The unique identifier of the merchant account to which terminal is assigned. MerchantId *string `json:"merchantId,omitempty"` ReassignmentTarget *TerminalReassignmentTarget `json:"reassignmentTarget,omitempty"` - // The status of the reassignment. Possible values: * `reassignmentInProgress`: the terminal was boarded and is now scheduled to remove the configuration. Wait for the terminal to synchronize with the Adyen platform. * `deployed`: the terminal is deployed and reassigned. * `inventory`: the terminal is in inventory and cannot process transactions. + // The status of the reassignment. Possible values: * `reassignmentInProgress`: the terminal was boarded and is now scheduled to remove the configuration. Wait for the terminal to synchronize with the Adyen platform. * `deployed`: the terminal is deployed and reassigned. * `inventory`: the terminal is in inventory and cannot process transactions. * `boarded`: the terminal is boarded to a store, or a merchant account representing a store, and can process transactions. Status string `json:"status"` // The unique identifier of the store to which terminal is assigned. StoreId *string `json:"storeId,omitempty"` @@ -254,7 +254,7 @@ func (v *NullableTerminalAssignment) UnmarshalJSON(src []byte) error { } func (o *TerminalAssignment) isValidStatus() bool { - var allowedEnumValues = []string{"reassignmentInProgress", "deployed", "inventory"} + var allowedEnumValues = []string{"boarded", "deployed", "inventory", "reassignmentInProgress"} for _, allowed := range allowedEnumValues { if o.GetStatus() == allowed { return true diff --git a/src/payments/model_recurring.go b/src/payments/model_recurring.go index d6b69f359..77098553a 100644 --- a/src/payments/model_recurring.go +++ b/src/payments/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/payout/model_recurring.go b/src/payout/model_recurring.go index 02c472eac..b9b76c070 100644 --- a/src/payout/model_recurring.go +++ b/src/payout/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/recurring/model_recurring.go b/src/recurring/model_recurring.go index 1816bd079..548b0838f 100644 --- a/src/recurring/model_recurring.go +++ b/src/recurring/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true From ac83e55789760db50b89ccfd9573230e566cf8e7 Mon Sep 17 00:00:00 2001 From: michaelpaul Date: Tue, 7 Nov 2023 13:26:23 +0000 Subject: [PATCH 9/9] chore(release): bump to 8.0.0 --- VERSION | 2 +- src/common/configuration.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 51900e718..fa5fce04b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.0-beta \ No newline at end of file +8.0.0 \ No newline at end of file diff --git a/src/common/configuration.go b/src/common/configuration.go index 98a776312..017dfc02c 100644 --- a/src/common/configuration.go +++ b/src/common/configuration.go @@ -51,7 +51,7 @@ const ( const ( LibName = "adyen-go-api-library" - LibVersion = "8.0.0-beta" + LibVersion = "8.0.0" ) // Config stores the configuration of the API client