From 7678f03e417c8d3763469292292d16c02fb01121 Mon Sep 17 00:00:00 2001 From: xendit-devx-bot Date: Thu, 30 Jan 2025 06:23:55 +0000 Subject: [PATCH] Generated Xendit go SDK --- LICENSE | 2 +- README.md | 2 +- balance_and_transaction/api_balance.go | 6 +- balance_and_transaction/api_transaction.go | 11 +- client.go | 2 +- configuration.go | 2 +- customer/api_customer.go | 21 ++- docs/invoice/BankCode.md | 14 ++ docs/invoice/ChannelPropertiesCards.md | 26 +++ ...PropertiesCardsInstallmentConfiguration.md | 82 +++++++++ ...stallmentConfigurationAllowedTermsInner.md | 82 +++++++++ docs/invoice/CreateInvoiceRequest.md | 52 ++++-- docs/invoice/Invoice.md | 26 +++ docs/invoice/InvoiceCurrency.md | 2 + docs/invoice/QrCodeType.md | 2 + invoice/api_invoice.go | 21 ++- invoice/model_address_object.go | 2 +- invoice/model_alternative_display_item.go | 2 +- invoice/model_bad_request_error.go | 2 +- invoice/model_bank.go | 2 +- invoice/model_bank_code.go | 16 +- invoice/model_channel_properties.go | 2 +- invoice/model_channel_properties_cards.go | 38 +++- ...perties_cards_installment_configuration.go | 165 ++++++++++++++++++ ...lment_configuration_allowed_terms_inner.go | 165 ++++++++++++++++++ invoice/model_create_invoice_request.go | 75 ++++++-- invoice/model_customer_object.go | 2 +- invoice/model_direct_debit.go | 2 +- invoice/model_direct_debit_type.go | 2 +- invoice/model_ewallet.go | 2 +- invoice/model_ewallet_type.go | 2 +- invoice/model_forbidden_error.go | 2 +- invoice/model_invoice.go | 39 ++++- invoice/model_invoice_callback.go | 2 +- invoice/model_invoice_callback_item.go | 2 +- invoice/model_invoice_client_type.go | 2 +- invoice/model_invoice_currency.go | 4 +- ...el_invoice_error404_response_definition.go | 2 +- invoice/model_invoice_fee.go | 2 +- invoice/model_invoice_item.go | 2 +- invoice/model_invoice_not_found_error.go | 2 +- invoice/model_invoice_payment_method.go | 2 +- invoice/model_invoice_status.go | 2 +- invoice/model_notification_channel.go | 2 +- invoice/model_notification_preference.go | 2 +- invoice/model_paylater.go | 2 +- invoice/model_paylater_type.go | 2 +- invoice/model_payment_details.go | 2 +- invoice/model_qr_code.go | 2 +- invoice/model_qr_code_type.go | 4 +- invoice/model_retail_outlet.go | 2 +- invoice/model_retail_outlet_name.go | 2 +- invoice/model_server_error.go | 2 +- invoice/model_unauthorized_error.go | 2 +- payment_method/api_payment_method.go | 41 ++++- payment_request/api_payment_request.go | 41 ++++- payout/api_payout.go | 26 ++- refund/api_refund.go | 21 ++- 58 files changed, 941 insertions(+), 107 deletions(-) create mode 100644 docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md create mode 100644 docs/invoice/ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md create mode 100644 invoice/model_channel_properties_cards_installment_configuration.go create mode 100644 invoice/model_channel_properties_cards_installment_configuration_allowed_terms_inner.go diff --git a/LICENSE b/LICENSE index 74911bc5..9d116f49 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2024 Xendit +Copyright (c) 2017-2025 Xendit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 116a1439..c369d11f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API in applications written in Go. -* Package version: 6.0.0 +* Package version: 6.1.0 # Getting Started diff --git a/balance_and_transaction/api_balance.go b/balance_and_transaction/api_balance.go index 2df88561..05d08252 100644 --- a/balance_and_transaction/api_balance.go +++ b/balance_and_transaction/api_balance.go @@ -3,6 +3,7 @@ package balance_and_transaction import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -153,7 +154,10 @@ func (a *BalanceApiService) GetBalanceExecute(r ApiGetBalanceRequest) (*Balance, localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: BalanceApiService.GetBalanceExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/balance_and_transaction/api_transaction.go b/balance_and_transaction/api_transaction.go index c374f4d3..d904e17c 100644 --- a/balance_and_transaction/api_transaction.go +++ b/balance_and_transaction/api_transaction.go @@ -3,6 +3,7 @@ package balance_and_transaction import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -143,7 +144,10 @@ func (a *TransactionApiService) GetTransactionByIDExecute(r ApiGetTransactionByI localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: TransactionApiService.GetTransactionByIDExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -388,7 +392,10 @@ func (a *TransactionApiService) GetAllTransactionsExecute(r ApiGetAllTransaction localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: TransactionApiService.GetAllTransactionsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/client.go b/client.go index 0a659764..8614f750 100644 --- a/client.go +++ b/client.go @@ -154,7 +154,7 @@ func (c *APIClient) PrepareRequest( headerParams["xendit-lib"] = "go" // TODO: overwrite this line from buddy pipeline - headerParams["xendit-lib-ver"] = "6.0.0" + headerParams["xendit-lib-ver"] = "6.1.0" var body *bytes.Buffer diff --git a/configuration.go b/configuration.go index 8efdf57c..b82a9311 100644 --- a/configuration.go +++ b/configuration.go @@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration() func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/6.0.0/go", + UserAgent: "OpenAPI-Generator/6.1.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/customer/api_customer.go b/customer/api_customer.go index f4188b51..62ddc087 100644 --- a/customer/api_customer.go +++ b/customer/api_customer.go @@ -3,6 +3,7 @@ package customer import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -186,7 +187,10 @@ func (a *CustomerApiService) CreateCustomerExecute(r ApiCreateCustomerRequest) ( localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.CreateCustomerExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -284,7 +288,10 @@ func (a *CustomerApiService) GetCustomerExecute(r ApiGetCustomerRequest) (*Custo localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.GetCustomerExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -392,7 +399,10 @@ func (a *CustomerApiService) GetCustomerByReferenceIDExecute(r ApiGetCustomerByR localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.GetCustomerByReferenceIDExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -499,7 +509,10 @@ func (a *CustomerApiService) UpdateCustomerExecute(r ApiUpdateCustomerRequest) ( localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: CustomerApiService.UpdateCustomerExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/docs/invoice/BankCode.md b/docs/invoice/BankCode.md index 2137b74c..c5ed8e85 100644 --- a/docs/invoice/BankCode.md +++ b/docs/invoice/BankCode.md @@ -21,6 +21,20 @@ Representing the available bank channels used for invoice-related transactions. * `CIMB` (value: `"CIMB"`) + * `VIETCAPITAL` (value: `"VIETCAPITAL"`) + + * `WOORI` (value: `"WOORI"`) + + * `PV` (value: `"PV"`) + + * `MSB` (value: `"MSB"`) + + * `VPB` (value: `"VPB"`) + + * `BIDV` (value: `"BIDV"`) + + * `CAKE` (value: `"CAKE"`) + * `BNC` (value: `"BNC"`) * `HANA` (value: `"HANA"`) diff --git a/docs/invoice/ChannelPropertiesCards.md b/docs/invoice/ChannelPropertiesCards.md index 7e2731fb..bcba71bd 100644 --- a/docs/invoice/ChannelPropertiesCards.md +++ b/docs/invoice/ChannelPropertiesCards.md @@ -5,6 +5,7 @@ An object representing properties specific for credit card payment method. | Name | Type | Required | Description | Examples | |------------|:-------------:|:-------------:|-------------|:-------------:| | **AllowedBins** | Pointer to **string[]** | | An array of allowed BINs (6 or 8 digits) for credit card payments. | | +| **InstallmentConfiguration** | Pointer to [**ChannelPropertiesCardsInstallmentConfiguration**](ChannelPropertiesCardsInstallmentConfiguration.md) | | | | ## Methods @@ -50,6 +51,31 @@ SetAllowedBins sets AllowedBins field to given value. HasAllowedBins returns a boolean if a field has been set. +### GetInstallmentConfiguration + +`func (o *ChannelPropertiesCards) GetInstallmentConfiguration() ChannelPropertiesCardsInstallmentConfiguration` + +GetInstallmentConfiguration returns the InstallmentConfiguration field if non-nil, zero value otherwise. + +### GetInstallmentConfigurationOk + +`func (o *ChannelPropertiesCards) GetInstallmentConfigurationOk() (*ChannelPropertiesCardsInstallmentConfiguration, bool)` + +GetInstallmentConfigurationOk returns a tuple with the InstallmentConfiguration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstallmentConfiguration + +`func (o *ChannelPropertiesCards) SetInstallmentConfiguration(v ChannelPropertiesCardsInstallmentConfiguration)` + +SetInstallmentConfiguration sets InstallmentConfiguration field to given value. + +### HasInstallmentConfiguration + +`func (o *ChannelPropertiesCards) HasInstallmentConfiguration() bool` + +HasInstallmentConfiguration returns a boolean if a field has been set. + [[Back to README]](../../README.md) diff --git a/docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md b/docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md new file mode 100644 index 00000000..06c5541b --- /dev/null +++ b/docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md @@ -0,0 +1,82 @@ +# ChannelPropertiesCardsInstallmentConfiguration +An object to pre-set cards installment for a specific invoice + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **AllowFullPayment** | Pointer to **bool** | | Indicate whether full payment (without installment) is allowed | | +| **AllowedTerms** | Pointer to [**ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner[]**](ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md) | | An object to set what kind (from specific bank / specific tenor) of cards installments will be available on a specific invoice | | + +## Methods + +### NewChannelPropertiesCardsInstallmentConfiguration + +`func NewChannelPropertiesCardsInstallmentConfiguration() *ChannelPropertiesCardsInstallmentConfiguration` + +NewChannelPropertiesCardsInstallmentConfiguration instantiates a new ChannelPropertiesCardsInstallmentConfiguration 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 + +### NewChannelPropertiesCardsInstallmentConfigurationWithDefaults + +`func NewChannelPropertiesCardsInstallmentConfigurationWithDefaults() *ChannelPropertiesCardsInstallmentConfiguration` + +NewChannelPropertiesCardsInstallmentConfigurationWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfiguration 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 + +### GetAllowFullPayment + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPayment() bool` + +GetAllowFullPayment returns the AllowFullPayment field if non-nil, zero value otherwise. + +### GetAllowFullPaymentOk + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPaymentOk() (*bool, bool)` + +GetAllowFullPaymentOk returns a tuple with the AllowFullPayment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowFullPayment + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowFullPayment(v bool)` + +SetAllowFullPayment sets AllowFullPayment field to given value. + +### HasAllowFullPayment + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowFullPayment() bool` + +HasAllowFullPayment returns a boolean if a field has been set. + +### GetAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTerms() []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner` + +GetAllowedTerms returns the AllowedTerms field if non-nil, zero value otherwise. + +### GetAllowedTermsOk + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTermsOk() (*[]ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner, bool)` + +GetAllowedTermsOk returns a tuple with the AllowedTerms field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowedTerms(v []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner)` + +SetAllowedTerms sets AllowedTerms field to given value. + +### HasAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowedTerms() bool` + +HasAllowedTerms returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md b/docs/invoice/ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md new file mode 100644 index 00000000..17e4eb11 --- /dev/null +++ b/docs/invoice/ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md @@ -0,0 +1,82 @@ +# ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner + + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Issuer** | Pointer to **string** | | The bank code of the installment provider / issuer | | +| **AllowedTerms** | Pointer to **float32[]** | | An array containing list of installment tenor available to choose | | + +## Methods + +### NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner + +`func NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner` + +NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner 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 + +### NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults + +`func NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner` + +NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner 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 + +### GetIssuer + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + +### HasIssuer + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasIssuer() bool` + +HasIssuer returns a boolean if a field has been set. + +### GetAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTerms() []float32` + +GetAllowedTerms returns the AllowedTerms field if non-nil, zero value otherwise. + +### GetAllowedTermsOk + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTermsOk() (*[]float32, bool)` + +GetAllowedTermsOk returns a tuple with the AllowedTerms field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetAllowedTerms(v []float32)` + +SetAllowedTerms sets AllowedTerms field to given value. + +### HasAllowedTerms + +`func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasAllowedTerms() bool` + +HasAllowedTerms returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/CreateInvoiceRequest.md b/docs/invoice/CreateInvoiceRequest.md index a9efae6b..0fd8c475 100644 --- a/docs/invoice/CreateInvoiceRequest.md +++ b/docs/invoice/CreateInvoiceRequest.md @@ -20,11 +20,12 @@ An object representing for an invoice creation request. | **ShouldAuthenticateCreditCard** | Pointer to **bool** | | Indicates whether credit card authentication is required. | | | **Currency** | Pointer to **string** | | The currency of the invoice. | | | **ReminderTime** | Pointer to **float32** | | The reminder time. | | -| **Local** | Pointer to **string** | | The local. | | +| **Locale** | Pointer to **string** | | The default language to display. | | | **ReminderTimeUnit** | Pointer to **string** | | The unit of the reminder time. | | | **Items** | Pointer to [**InvoiceItem[]**](InvoiceItem.md) | | An array of items included in the invoice. | | | **Fees** | Pointer to [**InvoiceFee[]**](InvoiceFee.md) | | An array of fees associated with the invoice. | | | **ChannelProperties** | Pointer to [**ChannelProperties**](ChannelProperties.md) | | | | +| **Metadata** | Pointer to **map[string]interface{}** | | A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. | | ## Methods @@ -435,30 +436,30 @@ SetReminderTime sets ReminderTime field to given value. HasReminderTime returns a boolean if a field has been set. -### GetLocal +### GetLocale -`func (o *CreateInvoiceRequest) GetLocal() string` +`func (o *CreateInvoiceRequest) GetLocale() string` -GetLocal returns the Local field if non-nil, zero value otherwise. +GetLocale returns the Locale field if non-nil, zero value otherwise. -### GetLocalOk +### GetLocaleOk -`func (o *CreateInvoiceRequest) GetLocalOk() (*string, bool)` +`func (o *CreateInvoiceRequest) GetLocaleOk() (*string, bool)` -GetLocalOk returns a tuple with the Local field if it's non-nil, zero value otherwise +GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLocal +### SetLocale -`func (o *CreateInvoiceRequest) SetLocal(v string)` +`func (o *CreateInvoiceRequest) SetLocale(v string)` -SetLocal sets Local field to given value. +SetLocale sets Locale field to given value. -### HasLocal +### HasLocale -`func (o *CreateInvoiceRequest) HasLocal() bool` +`func (o *CreateInvoiceRequest) HasLocale() bool` -HasLocal returns a boolean if a field has been set. +HasLocale returns a boolean if a field has been set. ### GetReminderTimeUnit @@ -560,6 +561,31 @@ SetChannelProperties sets ChannelProperties field to given value. HasChannelProperties returns a boolean if a field has been set. +### GetMetadata + +`func (o *CreateInvoiceRequest) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CreateInvoiceRequest) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CreateInvoiceRequest) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CreateInvoiceRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + [[Back to README]](../../README.md) diff --git a/docs/invoice/Invoice.md b/docs/invoice/Invoice.md index 48dbf758..6d9d085d 100644 --- a/docs/invoice/Invoice.md +++ b/docs/invoice/Invoice.md @@ -38,6 +38,7 @@ An object representing details for an invoice. | **CustomerNotificationPreference** | Pointer to [**NotificationPreference**](NotificationPreference.md) | | | | | **Fees** | Pointer to [**InvoiceFee[]**](InvoiceFee.md) | | An array of fees associated with the invoice. | | | **ChannelProperties** | Pointer to [**ChannelProperties**](ChannelProperties.md) | | | | +| **Metadata** | Pointer to **map[string]interface{}** | | A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. | | ## Methods @@ -823,6 +824,31 @@ SetChannelProperties sets ChannelProperties field to given value. HasChannelProperties returns a boolean if a field has been set. +### GetMetadata + +`func (o *Invoice) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *Invoice) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *Invoice) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *Invoice) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + [[Back to README]](../../README.md) diff --git a/docs/invoice/InvoiceCurrency.md b/docs/invoice/InvoiceCurrency.md index 28565a27..e9e55232 100644 --- a/docs/invoice/InvoiceCurrency.md +++ b/docs/invoice/InvoiceCurrency.md @@ -13,6 +13,8 @@ Representing the currency used for an invoice. * `PHP` (value: `"PHP"`) + * `MYR` (value: `"MYR"`) + * `XENDIT_ENUM_DEFAULT_FALLBACK` (value: `UNKNOWN_ENUM_VALUE`) If you encounter `UNKNOWN_ENUM_VALUE`, it means that this ENUM is unavailable in your current SDK version. Please upgrade to get the newest ENUM. diff --git a/docs/invoice/QrCodeType.md b/docs/invoice/QrCodeType.md index 2c48ecdd..c314716c 100644 --- a/docs/invoice/QrCodeType.md +++ b/docs/invoice/QrCodeType.md @@ -7,6 +7,8 @@ Representing the available QR Code channels used for invoice-related transaction * `PROMPTPAY` (value: `"PROMPTPAY"`) + * `QRPH` (value: `"QRPH"`) + * `XENDIT_ENUM_DEFAULT_FALLBACK` (value: `UNKNOWN_ENUM_VALUE`) If you encounter `UNKNOWN_ENUM_VALUE`, it means that this ENUM is unavailable in your current SDK version. Please upgrade to get the newest ENUM. diff --git a/invoice/api_invoice.go b/invoice/api_invoice.go index 53f97719..42760a91 100644 --- a/invoice/api_invoice.go +++ b/invoice/api_invoice.go @@ -3,6 +3,7 @@ package invoice import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -170,7 +171,10 @@ func (a *InvoiceApiService) CreateInvoiceExecute(r ApiCreateInvoiceRequest) (*In localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -266,7 +270,10 @@ func (a *InvoiceApiService) GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (* localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: InvoiceApiService.GetInvoiceByIdExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -508,7 +515,10 @@ func (a *InvoiceApiService) GetInvoicesExecute(r ApiGetInvoicesRequest) ([]Invoi localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: InvoiceApiService.GetInvoicesExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -604,7 +614,10 @@ func (a *InvoiceApiService) ExpireInvoiceExecute(r ApiExpireInvoiceRequest) (*In localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: InvoiceApiService.ExpireInvoiceExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/invoice/model_address_object.go b/invoice/model_address_object.go index afbfcd5b..ad771c36 100644 --- a/invoice/model_address_object.go +++ b/invoice/model_address_object.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_alternative_display_item.go b/invoice/model_alternative_display_item.go index 57e79260..1c2a892f 100644 --- a/invoice/model_alternative_display_item.go +++ b/invoice/model_alternative_display_item.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_bad_request_error.go b/invoice/model_bad_request_error.go index d53148a5..64f86012 100644 --- a/invoice/model_bad_request_error.go +++ b/invoice/model_bad_request_error.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_bank.go b/invoice/model_bank.go index a83b6f35..acd8f28f 100644 --- a/invoice/model_bank.go +++ b/invoice/model_bank.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_bank_code.go b/invoice/model_bank_code.go index 5ffa94f5..b4f1a7a1 100644 --- a/invoice/model_bank_code.go +++ b/invoice/model_bank_code.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -29,6 +29,13 @@ const ( BANKCODE_BJB BankCode = "BJB" BANKCODE_SAHABAT_SAMPOERNA BankCode = "SAHABAT_SAMPOERNA" BANKCODE_CIMB BankCode = "CIMB" + BANKCODE_VIETCAPITAL BankCode = "VIETCAPITAL" + BANKCODE_WOORI BankCode = "WOORI" + BANKCODE_PV BankCode = "PV" + BANKCODE_MSB BankCode = "MSB" + BANKCODE_VPB BankCode = "VPB" + BANKCODE_BIDV BankCode = "BIDV" + BANKCODE_CAKE BankCode = "CAKE" BANKCODE_BNC BankCode = "BNC" BANKCODE_HANA BankCode = "HANA" BANKCODE_MUAMALAT BankCode = "MUAMALAT" @@ -46,6 +53,13 @@ var AllowedBankCodeEnumValues = []BankCode{ "BJB", "SAHABAT_SAMPOERNA", "CIMB", + "VIETCAPITAL", + "WOORI", + "PV", + "MSB", + "VPB", + "BIDV", + "CAKE", "BNC", "HANA", "MUAMALAT", diff --git a/invoice/model_channel_properties.go b/invoice/model_channel_properties.go index 98616633..24a6477c 100644 --- a/invoice/model_channel_properties.go +++ b/invoice/model_channel_properties.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_channel_properties_cards.go b/invoice/model_channel_properties_cards.go index 1c9c7dd3..9d8497d5 100644 --- a/invoice/model_channel_properties_cards.go +++ b/invoice/model_channel_properties_cards.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -22,6 +22,7 @@ var _ utils.MappedNullable = &ChannelPropertiesCards{} type ChannelPropertiesCards struct { // An array of allowed BINs (6 or 8 digits) for credit card payments. AllowedBins []string `json:"allowed_bins,omitempty"` + InstallmentConfiguration *ChannelPropertiesCardsInstallmentConfiguration `json:"installment_configuration,omitempty"` } // NewChannelPropertiesCards instantiates a new ChannelPropertiesCards object @@ -73,6 +74,38 @@ func (o *ChannelPropertiesCards) SetAllowedBins(v []string) { o.AllowedBins = v } +// GetInstallmentConfiguration returns the InstallmentConfiguration field value if set, zero value otherwise. +func (o *ChannelPropertiesCards) GetInstallmentConfiguration() ChannelPropertiesCardsInstallmentConfiguration { + if o == nil || utils.IsNil(o.InstallmentConfiguration) { + var ret ChannelPropertiesCardsInstallmentConfiguration + return ret + } + return *o.InstallmentConfiguration +} + +// GetInstallmentConfigurationOk returns a tuple with the InstallmentConfiguration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertiesCards) GetInstallmentConfigurationOk() (*ChannelPropertiesCardsInstallmentConfiguration, bool) { + if o == nil || utils.IsNil(o.InstallmentConfiguration) { + return nil, false + } + return o.InstallmentConfiguration, true +} + +// HasInstallmentConfiguration returns a boolean if a field has been set. +func (o *ChannelPropertiesCards) HasInstallmentConfiguration() bool { + if o != nil && !utils.IsNil(o.InstallmentConfiguration) { + return true + } + + return false +} + +// SetInstallmentConfiguration gets a reference to the given ChannelPropertiesCardsInstallmentConfiguration and assigns it to the InstallmentConfiguration field. +func (o *ChannelPropertiesCards) SetInstallmentConfiguration(v ChannelPropertiesCardsInstallmentConfiguration) { + o.InstallmentConfiguration = &v +} + func (o ChannelPropertiesCards) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -86,6 +119,9 @@ func (o ChannelPropertiesCards) ToMap() (map[string]interface{}, error) { if !utils.IsNil(o.AllowedBins) { toSerialize["allowed_bins"] = o.AllowedBins } + if !utils.IsNil(o.InstallmentConfiguration) { + toSerialize["installment_configuration"] = o.InstallmentConfiguration + } return toSerialize, nil } diff --git a/invoice/model_channel_properties_cards_installment_configuration.go b/invoice/model_channel_properties_cards_installment_configuration.go new file mode 100644 index 00000000..cddbb27c --- /dev/null +++ b/invoice/model_channel_properties_cards_installment_configuration.go @@ -0,0 +1,165 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.8.7 +*/ + + +package invoice + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v6/utils" +) + +// checks if the ChannelPropertiesCardsInstallmentConfiguration type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelPropertiesCardsInstallmentConfiguration{} + +// ChannelPropertiesCardsInstallmentConfiguration An object to pre-set cards installment for a specific invoice +type ChannelPropertiesCardsInstallmentConfiguration struct { + // Indicate whether full payment (without installment) is allowed + AllowFullPayment *bool `json:"allow_full_payment,omitempty"` + // An object to set what kind (from specific bank / specific tenor) of cards installments will be available on a specific invoice + AllowedTerms []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner `json:"allowed_terms,omitempty"` +} + +// NewChannelPropertiesCardsInstallmentConfiguration instantiates a new ChannelPropertiesCardsInstallmentConfiguration 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 NewChannelPropertiesCardsInstallmentConfiguration() *ChannelPropertiesCardsInstallmentConfiguration { + this := ChannelPropertiesCardsInstallmentConfiguration{} + return &this +} + +// NewChannelPropertiesCardsInstallmentConfigurationWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfiguration 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 NewChannelPropertiesCardsInstallmentConfigurationWithDefaults() *ChannelPropertiesCardsInstallmentConfiguration { + this := ChannelPropertiesCardsInstallmentConfiguration{} + return &this +} + +// GetAllowFullPayment returns the AllowFullPayment field value if set, zero value otherwise. +func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPayment() bool { + if o == nil || utils.IsNil(o.AllowFullPayment) { + var ret bool + return ret + } + return *o.AllowFullPayment +} + +// GetAllowFullPaymentOk returns a tuple with the AllowFullPayment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowFullPaymentOk() (*bool, bool) { + if o == nil || utils.IsNil(o.AllowFullPayment) { + return nil, false + } + return o.AllowFullPayment, true +} + +// HasAllowFullPayment returns a boolean if a field has been set. +func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowFullPayment() bool { + if o != nil && !utils.IsNil(o.AllowFullPayment) { + return true + } + + return false +} + +// SetAllowFullPayment gets a reference to the given bool and assigns it to the AllowFullPayment field. +func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowFullPayment(v bool) { + o.AllowFullPayment = &v +} + +// GetAllowedTerms returns the AllowedTerms field value if set, zero value otherwise. +func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTerms() []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner { + if o == nil || utils.IsNil(o.AllowedTerms) { + var ret []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner + return ret + } + return o.AllowedTerms +} + +// GetAllowedTermsOk returns a tuple with the AllowedTerms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertiesCardsInstallmentConfiguration) GetAllowedTermsOk() ([]ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner, bool) { + if o == nil || utils.IsNil(o.AllowedTerms) { + return nil, false + } + return o.AllowedTerms, true +} + +// HasAllowedTerms returns a boolean if a field has been set. +func (o *ChannelPropertiesCardsInstallmentConfiguration) HasAllowedTerms() bool { + if o != nil && !utils.IsNil(o.AllowedTerms) { + return true + } + + return false +} + +// SetAllowedTerms gets a reference to the given []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner and assigns it to the AllowedTerms field. +func (o *ChannelPropertiesCardsInstallmentConfiguration) SetAllowedTerms(v []ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) { + o.AllowedTerms = v +} + +func (o ChannelPropertiesCardsInstallmentConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelPropertiesCardsInstallmentConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.AllowFullPayment) { + toSerialize["allow_full_payment"] = o.AllowFullPayment + } + if !utils.IsNil(o.AllowedTerms) { + toSerialize["allowed_terms"] = o.AllowedTerms + } + return toSerialize, nil +} + +type NullableChannelPropertiesCardsInstallmentConfiguration struct { + value *ChannelPropertiesCardsInstallmentConfiguration + isSet bool +} + +func (v NullableChannelPropertiesCardsInstallmentConfiguration) Get() *ChannelPropertiesCardsInstallmentConfiguration { + return v.value +} + +func (v *NullableChannelPropertiesCardsInstallmentConfiguration) Set(val *ChannelPropertiesCardsInstallmentConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableChannelPropertiesCardsInstallmentConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelPropertiesCardsInstallmentConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelPropertiesCardsInstallmentConfiguration(val *ChannelPropertiesCardsInstallmentConfiguration) *NullableChannelPropertiesCardsInstallmentConfiguration { + return &NullableChannelPropertiesCardsInstallmentConfiguration{value: val, isSet: true} +} + +func (v NullableChannelPropertiesCardsInstallmentConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelPropertiesCardsInstallmentConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_channel_properties_cards_installment_configuration_allowed_terms_inner.go b/invoice/model_channel_properties_cards_installment_configuration_allowed_terms_inner.go new file mode 100644 index 00000000..4a42d472 --- /dev/null +++ b/invoice/model_channel_properties_cards_installment_configuration_allowed_terms_inner.go @@ -0,0 +1,165 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.8.7 +*/ + + +package invoice + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v6/utils" +) + +// checks if the ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner{} + +// ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner struct for ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner +type ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner struct { + // The bank code of the installment provider / issuer + Issuer *string `json:"issuer,omitempty"` + // An array containing list of installment tenor available to choose + AllowedTerms []float32 `json:"allowed_terms,omitempty"` +} + +// NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner 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 NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner { + this := ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner{} + return &this +} + +// NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults instantiates a new ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner 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 NewChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerWithDefaults() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner { + this := ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner{} + return &this +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuer() string { + if o == nil || utils.IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetIssuerOk() (*string, bool) { + if o == nil || utils.IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasIssuer() bool { + if o != nil && !utils.IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAllowedTerms returns the AllowedTerms field value if set, zero value otherwise. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTerms() []float32 { + if o == nil || utils.IsNil(o.AllowedTerms) { + var ret []float32 + return ret + } + return o.AllowedTerms +} + +// GetAllowedTermsOk returns a tuple with the AllowedTerms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) GetAllowedTermsOk() ([]float32, bool) { + if o == nil || utils.IsNil(o.AllowedTerms) { + return nil, false + } + return o.AllowedTerms, true +} + +// HasAllowedTerms returns a boolean if a field has been set. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) HasAllowedTerms() bool { + if o != nil && !utils.IsNil(o.AllowedTerms) { + return true + } + + return false +} + +// SetAllowedTerms gets a reference to the given []float32 and assigns it to the AllowedTerms field. +func (o *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) SetAllowedTerms(v []float32) { + o.AllowedTerms = v +} + +func (o ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !utils.IsNil(o.AllowedTerms) { + toSerialize["allowed_terms"] = o.AllowedTerms + } + return toSerialize, nil +} + +type NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner struct { + value *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner + isSet bool +} + +func (v NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) Get() *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner { + return v.value +} + +func (v *NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) Set(val *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) { + v.value = val + v.isSet = true +} + +func (v NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner(val *ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) *NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner { + return &NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner{value: val, isSet: true} +} + +func (v NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_create_invoice_request.go b/invoice/model_create_invoice_request.go index f457dfad..c97a6c62 100644 --- a/invoice/model_create_invoice_request.go +++ b/invoice/model_create_invoice_request.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -50,8 +50,8 @@ type CreateInvoiceRequest struct { Currency *string `json:"currency,omitempty"` // The reminder time. ReminderTime *float32 `json:"reminder_time,omitempty"` - // The local. - Local *string `json:"local,omitempty"` + // The default language to display. + Locale *string `json:"locale,omitempty"` // The unit of the reminder time. ReminderTimeUnit *string `json:"reminder_time_unit,omitempty"` // An array of items included in the invoice. @@ -59,6 +59,8 @@ type CreateInvoiceRequest struct { // An array of fees associated with the invoice. Fees []InvoiceFee `json:"fees,omitempty"` ChannelProperties *ChannelProperties `json:"channel_properties,omitempty"` + // A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewCreateInvoiceRequest instantiates a new CreateInvoiceRequest object @@ -576,36 +578,36 @@ func (o *CreateInvoiceRequest) SetReminderTime(v float32) { o.ReminderTime = &v } -// GetLocal returns the Local field value if set, zero value otherwise. -func (o *CreateInvoiceRequest) GetLocal() string { - if o == nil || utils.IsNil(o.Local) { +// GetLocale returns the Locale field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetLocale() string { + if o == nil || utils.IsNil(o.Locale) { var ret string return ret } - return *o.Local + return *o.Locale } -// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// GetLocaleOk returns a tuple with the Locale field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInvoiceRequest) GetLocalOk() (*string, bool) { - if o == nil || utils.IsNil(o.Local) { +func (o *CreateInvoiceRequest) GetLocaleOk() (*string, bool) { + if o == nil || utils.IsNil(o.Locale) { return nil, false } - return o.Local, true + return o.Locale, true } -// HasLocal returns a boolean if a field has been set. -func (o *CreateInvoiceRequest) HasLocal() bool { - if o != nil && !utils.IsNil(o.Local) { +// HasLocale returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasLocale() bool { + if o != nil && !utils.IsNil(o.Locale) { return true } return false } -// SetLocal gets a reference to the given string and assigns it to the Local field. -func (o *CreateInvoiceRequest) SetLocal(v string) { - o.Local = &v +// SetLocale gets a reference to the given string and assigns it to the Locale field. +func (o *CreateInvoiceRequest) SetLocale(v string) { + o.Locale = &v } // GetReminderTimeUnit returns the ReminderTimeUnit field value if set, zero value otherwise. @@ -736,6 +738,38 @@ func (o *CreateInvoiceRequest) SetChannelProperties(v ChannelProperties) { o.ChannelProperties = &v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetMetadata() map[string]interface{} { + if o == nil || utils.IsNil(o.Metadata) { + var ret map[string]interface{} + 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 *CreateInvoiceRequest) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasMetadata() bool { + if o != nil && !utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateInvoiceRequest) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + func (o CreateInvoiceRequest) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -790,8 +824,8 @@ func (o CreateInvoiceRequest) ToMap() (map[string]interface{}, error) { if !utils.IsNil(o.ReminderTime) { toSerialize["reminder_time"] = o.ReminderTime } - if !utils.IsNil(o.Local) { - toSerialize["local"] = o.Local + if !utils.IsNil(o.Locale) { + toSerialize["locale"] = o.Locale } if !utils.IsNil(o.ReminderTimeUnit) { toSerialize["reminder_time_unit"] = o.ReminderTimeUnit @@ -805,6 +839,9 @@ func (o CreateInvoiceRequest) ToMap() (map[string]interface{}, error) { if !utils.IsNil(o.ChannelProperties) { toSerialize["channel_properties"] = o.ChannelProperties } + if !utils.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } return toSerialize, nil } diff --git a/invoice/model_customer_object.go b/invoice/model_customer_object.go index d0bedea0..732ac642 100644 --- a/invoice/model_customer_object.go +++ b/invoice/model_customer_object.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_direct_debit.go b/invoice/model_direct_debit.go index 0fb0c9ac..dfc54bfa 100644 --- a/invoice/model_direct_debit.go +++ b/invoice/model_direct_debit.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_direct_debit_type.go b/invoice/model_direct_debit_type.go index 957ed094..9d271332 100644 --- a/invoice/model_direct_debit_type.go +++ b/invoice/model_direct_debit_type.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_ewallet.go b/invoice/model_ewallet.go index 0d85a969..42c234fb 100644 --- a/invoice/model_ewallet.go +++ b/invoice/model_ewallet.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_ewallet_type.go b/invoice/model_ewallet_type.go index 49a1d9a5..292f4786 100644 --- a/invoice/model_ewallet_type.go +++ b/invoice/model_ewallet_type.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_forbidden_error.go b/invoice/model_forbidden_error.go index 6d4c4dd1..87db7752 100644 --- a/invoice/model_forbidden_error.go +++ b/invoice/model_forbidden_error.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice.go b/invoice/model_invoice.go index 3c94b488..87e4a332 100644 --- a/invoice/model_invoice.go +++ b/invoice/model_invoice.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -83,6 +83,8 @@ type Invoice struct { // An array of fees associated with the invoice. Fees []InvoiceFee `json:"fees,omitempty"` ChannelProperties *ChannelProperties `json:"channel_properties,omitempty"` + // A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewInvoice instantiates a new Invoice object @@ -1071,6 +1073,38 @@ func (o *Invoice) SetChannelProperties(v ChannelProperties) { o.ChannelProperties = &v } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Invoice) GetMetadata() map[string]interface{} { + if o == nil || utils.IsNil(o.Metadata) { + var ret map[string]interface{} + 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 *Invoice) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Invoice) HasMetadata() bool { + if o != nil && !utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Invoice) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + func (o Invoice) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -1149,6 +1183,9 @@ func (o Invoice) ToMap() (map[string]interface{}, error) { if !utils.IsNil(o.ChannelProperties) { toSerialize["channel_properties"] = o.ChannelProperties } + if !utils.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } return toSerialize, nil } diff --git a/invoice/model_invoice_callback.go b/invoice/model_invoice_callback.go index 2cad5027..a5872d0c 100644 --- a/invoice/model_invoice_callback.go +++ b/invoice/model_invoice_callback.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_callback_item.go b/invoice/model_invoice_callback_item.go index fa667ebe..c8489b06 100644 --- a/invoice/model_invoice_callback_item.go +++ b/invoice/model_invoice_callback_item.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_client_type.go b/invoice/model_invoice_client_type.go index 8e66ff1b..43fd8040 100644 --- a/invoice/model_invoice_client_type.go +++ b/invoice/model_invoice_client_type.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_currency.go b/invoice/model_invoice_currency.go index 4c2f9ed7..890140c0 100644 --- a/invoice/model_invoice_currency.go +++ b/invoice/model_invoice_currency.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -25,6 +25,7 @@ const ( INVOICECURRENCY_THB InvoiceCurrency = "THB" INVOICECURRENCY_VND InvoiceCurrency = "VND" INVOICECURRENCY_PHP InvoiceCurrency = "PHP" + INVOICECURRENCY_MYR InvoiceCurrency = "MYR" INVOICECURRENCY_XENDIT_ENUM_DEFAULT_FALLBACK InvoiceCurrency = "UNKNOWN_ENUM_VALUE" ) @@ -35,6 +36,7 @@ var AllowedInvoiceCurrencyEnumValues = []InvoiceCurrency{ "THB", "VND", "PHP", + "MYR", "UNKNOWN_ENUM_VALUE", } diff --git a/invoice/model_invoice_error404_response_definition.go b/invoice/model_invoice_error404_response_definition.go index b93f1936..b3d20706 100644 --- a/invoice/model_invoice_error404_response_definition.go +++ b/invoice/model_invoice_error404_response_definition.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_fee.go b/invoice/model_invoice_fee.go index 24f10052..9662e21c 100644 --- a/invoice/model_invoice_fee.go +++ b/invoice/model_invoice_fee.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_item.go b/invoice/model_invoice_item.go index 66335b18..742b58ba 100644 --- a/invoice/model_invoice_item.go +++ b/invoice/model_invoice_item.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_not_found_error.go b/invoice/model_invoice_not_found_error.go index 70b1bc0b..a0d487a2 100644 --- a/invoice/model_invoice_not_found_error.go +++ b/invoice/model_invoice_not_found_error.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_payment_method.go b/invoice/model_invoice_payment_method.go index 544fc0e5..d653617d 100644 --- a/invoice/model_invoice_payment_method.go +++ b/invoice/model_invoice_payment_method.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_invoice_status.go b/invoice/model_invoice_status.go index 7f82566e..ea4d2d87 100644 --- a/invoice/model_invoice_status.go +++ b/invoice/model_invoice_status.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_notification_channel.go b/invoice/model_notification_channel.go index 6bfa30bd..9fb0f5bd 100644 --- a/invoice/model_notification_channel.go +++ b/invoice/model_notification_channel.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_notification_preference.go b/invoice/model_notification_preference.go index b78a632d..9aeacf79 100644 --- a/invoice/model_notification_preference.go +++ b/invoice/model_notification_preference.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_paylater.go b/invoice/model_paylater.go index 1f088c54..11cf65b1 100644 --- a/invoice/model_paylater.go +++ b/invoice/model_paylater.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_paylater_type.go b/invoice/model_paylater_type.go index 3bef2af2..0e4c026f 100644 --- a/invoice/model_paylater_type.go +++ b/invoice/model_paylater_type.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_payment_details.go b/invoice/model_payment_details.go index 2233c57c..22e3c832 100644 --- a/invoice/model_payment_details.go +++ b/invoice/model_payment_details.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_qr_code.go b/invoice/model_qr_code.go index 2c00011e..3483bf24 100644 --- a/invoice/model_qr_code.go +++ b/invoice/model_qr_code.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_qr_code_type.go b/invoice/model_qr_code_type.go index ef79a653..3725f19f 100644 --- a/invoice/model_qr_code_type.go +++ b/invoice/model_qr_code_type.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ @@ -22,6 +22,7 @@ type QrCodeType string const ( QRCODETYPE_QRIS QrCodeType = "QRIS" QRCODETYPE_PROMPTPAY QrCodeType = "PROMPTPAY" + QRCODETYPE_QRPH QrCodeType = "QRPH" QRCODETYPE_XENDIT_ENUM_DEFAULT_FALLBACK QrCodeType = "UNKNOWN_ENUM_VALUE" ) @@ -29,6 +30,7 @@ const ( var AllowedQrCodeTypeEnumValues = []QrCodeType{ "QRIS", "PROMPTPAY", + "QRPH", "UNKNOWN_ENUM_VALUE", } diff --git a/invoice/model_retail_outlet.go b/invoice/model_retail_outlet.go index 6a8889f2..fb48faee 100644 --- a/invoice/model_retail_outlet.go +++ b/invoice/model_retail_outlet.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_retail_outlet_name.go b/invoice/model_retail_outlet_name.go index 945aae46..bc61dc86 100644 --- a/invoice/model_retail_outlet_name.go +++ b/invoice/model_retail_outlet_name.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_server_error.go b/invoice/model_server_error.go index 6ca54ddc..3041091b 100644 --- a/invoice/model_server_error.go +++ b/invoice/model_server_error.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/invoice/model_unauthorized_error.go b/invoice/model_unauthorized_error.go index f0d9d19f..4d5756b4 100644 --- a/invoice/model_unauthorized_error.go +++ b/invoice/model_unauthorized_error.go @@ -3,7 +3,7 @@ xendit-invoice-service xendit-invoice-service descriptions -API version: 1.7.6 +API version: 1.8.7 */ diff --git a/payment_method/api_payment_method.go b/payment_method/api_payment_method.go index e6e5007e..0e3204c4 100644 --- a/payment_method/api_payment_method.go +++ b/payment_method/api_payment_method.go @@ -3,6 +3,7 @@ package payment_method import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -235,7 +236,10 @@ func (a *PaymentMethodApiService) CreatePaymentMethodExecute(r ApiCreatePaymentM localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.CreatePaymentMethodExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -332,7 +336,10 @@ func (a *PaymentMethodApiService) GetPaymentMethodByIDExecute(r ApiGetPaymentMet localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.GetPaymentMethodByIDExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -593,7 +600,10 @@ func (a *PaymentMethodApiService) GetPaymentsByPaymentMethodIdExecute(r ApiGetPa localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.GetPaymentsByPaymentMethodIdExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -698,7 +708,10 @@ func (a *PaymentMethodApiService) PatchPaymentMethodExecute(r ApiPatchPaymentMet localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.PatchPaymentMethodExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -896,7 +909,10 @@ func (a *PaymentMethodApiService) GetAllPaymentMethodsExecute(r ApiGetAllPayment localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.GetAllPaymentMethodsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -1001,7 +1017,10 @@ func (a *PaymentMethodApiService) ExpirePaymentMethodExecute(r ApiExpirePaymentM localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.ExpirePaymentMethodExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -1106,7 +1125,10 @@ func (a *PaymentMethodApiService) AuthPaymentMethodExecute(r ApiAuthPaymentMetho localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.AuthPaymentMethodExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -1200,7 +1222,10 @@ func (a *PaymentMethodApiService) SimulatePaymentExecute(r ApiSimulatePaymentReq localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentMethodApiService.SimulatePaymentExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/payment_request/api_payment_request.go b/payment_request/api_payment_request.go index abd9293d..67e4ef3b 100644 --- a/payment_request/api_payment_request.go +++ b/payment_request/api_payment_request.go @@ -3,6 +3,7 @@ package payment_request import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -253,7 +254,10 @@ func (a *PaymentRequestApiService) CreatePaymentRequestExecute(r ApiCreatePaymen localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.CreatePaymentRequestExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -350,7 +354,10 @@ func (a *PaymentRequestApiService) GetPaymentRequestByIDExecute(r ApiGetPaymentR localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestByIDExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -456,7 +463,10 @@ func (a *PaymentRequestApiService) GetPaymentRequestCapturesExecute(r ApiGetPaym localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestCapturesExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -627,7 +637,10 @@ func (a *PaymentRequestApiService) GetAllPaymentRequestsExecute(r ApiGetAllPayme localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.GetAllPaymentRequestsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -732,7 +745,10 @@ func (a *PaymentRequestApiService) CapturePaymentRequestExecute(r ApiCapturePaym localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.CapturePaymentRequestExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -837,7 +853,10 @@ func (a *PaymentRequestApiService) AuthorizePaymentRequestExecute(r ApiAuthorize localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.AuthorizePaymentRequestExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -934,7 +953,10 @@ func (a *PaymentRequestApiService) ResendPaymentRequestAuthExecute(r ApiResendPa localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.ResendPaymentRequestAuthExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -1022,7 +1044,10 @@ func (a *PaymentRequestApiService) SimulatePaymentRequestPaymentExecute(r ApiSim localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PaymentRequestApiService.SimulatePaymentRequestPaymentExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/payout/api_payout.go b/payout/api_payout.go index 9aa5ea2b..d34d1b5d 100644 --- a/payout/api_payout.go +++ b/payout/api_payout.go @@ -3,6 +3,7 @@ package payout import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -188,7 +189,10 @@ func (a *PayoutApiService) CreatePayoutExecute(r ApiCreatePayoutRequest) (*GetPa localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PayoutApiService.CreatePayoutExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -284,7 +288,10 @@ func (a *PayoutApiService) GetPayoutByIdExecute(r ApiGetPayoutByIdRequest) (*Get localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PayoutApiService.GetPayoutByIdExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -406,7 +413,10 @@ func (a *PayoutApiService) GetPayoutChannelsExecute(r ApiGetPayoutChannelsReques localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PayoutApiService.GetPayoutChannelsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -539,7 +549,10 @@ func (a *PayoutApiService) GetPayoutsExecute(r ApiGetPayoutsRequest) (*GetPayout localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PayoutApiService.GetPayoutsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -635,7 +648,10 @@ func (a *PayoutApiService) CancelPayoutExecute(r ApiCancelPayoutRequest) (*GetPa localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: PayoutApiService.CancelPayoutExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) diff --git a/refund/api_refund.go b/refund/api_refund.go index c6faf824..3c451555 100644 --- a/refund/api_refund.go +++ b/refund/api_refund.go @@ -3,6 +3,7 @@ package refund import ( "bytes" "context" + "fmt" "io" "net/http" "net/url" @@ -173,7 +174,10 @@ func (a *RefundApiService) CreateRefundExecute(r ApiCreateRefundRequest) (*Refun localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: RefundApiService.CreateRefundExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -277,7 +281,10 @@ func (a *RefundApiService) GetRefundExecute(r ApiGetRefundRequest) (*Refund, *ht localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: RefundApiService.GetRefundExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -431,7 +438,10 @@ func (a *RefundApiService) GetAllRefundsExecute(r ApiGetAllRefundsRequest) (*Ref localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: RefundApiService.GetAllRefundsExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) @@ -535,7 +545,10 @@ func (a *RefundApiService) CancelRefundExecute(r ApiCancelRefundRequest) (*Refun localVarHTTPResponse, err := a.client.CallAPI(req) - localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", fmt.Sprintf("Error creating HTTP request: RefundApiService.CancelRefundExecute: %v", err)) + } localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))