diff --git a/pkg/cardtoken/response.go b/pkg/cardtoken/response.go index 35e50bbe..48f38c48 100644 --- a/pkg/cardtoken/response.go +++ b/pkg/cardtoken/response.go @@ -12,13 +12,13 @@ type Response struct { FirstSixDigits string `json:"first_six_digits"` LastFourDigits string `json:"last_four_digits"` Status string `json:"status"` - LuhnValidation bool `json:"luhn_validation"` - LiveMode bool `json:"live_mode"` - RequireEsc bool `json:"require_esc"` ExpirationMonth int `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` CardNumberLength int `json:"card_number_length"` SecurityCodeLength int `json:"security_code_length"` + LuhnValidation bool `json:"luhn_validation"` + LiveMode bool `json:"live_mode"` + RequireEsc bool `json:"require_esc"` } type CardholderResponse struct { diff --git a/pkg/customer/request.go b/pkg/customer/request.go index dba9f1b9..86dada98 100644 --- a/pkg/customer/request.go +++ b/pkg/customer/request.go @@ -21,10 +21,10 @@ type Request struct { type AddressRequest struct { City *CityRequest `json:"city,omitempty"` - StreetNumber int `json:"street_number,omitempty"` ID string `json:"id,omitempty"` ZipCode string `json:"zip_code,omitempty"` StreetName string `json:"street_name,omitempty"` + StreetNumber int `json:"street_number,omitempty"` } // CityRequest represents a request for a city. diff --git a/pkg/customer/response.go b/pkg/customer/response.go index 3bb41a5b..683d18f6 100644 --- a/pkg/customer/response.go +++ b/pkg/customer/response.go @@ -74,8 +74,8 @@ type IdentificationResponse struct { // IssuerResponse represents a response for an issuer. type IssuerResponse struct { - ID int `json:"id"` Name string `json:"name"` + ID int `json:"id"` } // PaymentMethodResponse represents a response for a payment method. @@ -89,8 +89,8 @@ type PaymentMethodResponse struct { // SecurityCodeResponse represents a response for a security code. type SecurityCodeResponse struct { - Length int `json:"length"` CardLocation string `json:"card_location"` + Length int `json:"length"` } // CompleteAddressResponse represents a response for a complete address. diff --git a/pkg/customer/search_request.go b/pkg/customer/search_request.go index 3bf63815..70bc24ba 100644 --- a/pkg/customer/search_request.go +++ b/pkg/customer/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of parameters. For details, see: // https://www.mercadopago.com/developers/en/reference/customers/_customers_search/get. type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/customer/search_response.go b/pkg/customer/search_response.go index f87719dd..cbbea0aa 100644 --- a/pkg/customer/search_response.go +++ b/pkg/customer/search_response.go @@ -2,8 +2,8 @@ package customer // SearchResponse represents the response from the search endpoint. type SearchResponse struct { - Results []Response `json:"results"` Paging PagingResponse `json:"paging"` + Results []Response `json:"results"` } // PagingResponse represents the paging information within SearchResponse. diff --git a/pkg/customercard/response.go b/pkg/customercard/response.go index cc075091..963a7f0b 100644 --- a/pkg/customercard/response.go +++ b/pkg/customercard/response.go @@ -45,8 +45,8 @@ type IdentificationResponse struct { // IssuerResponse represents the card issuer code. type IssuerResponse struct { - ID int `json:"id"` Name string `json:"name"` + ID int `json:"id"` } // PaymentMethodResponse represents the card's payment method. @@ -60,6 +60,6 @@ type PaymentMethodResponse struct { // SecurityCode represents the card's security code. type SecurityCodeResponse struct { - Length int `json:"length"` CardLocation string `json:"card_location"` + Length int `json:"length"` } diff --git a/pkg/invoice/response.go b/pkg/invoice/response.go index 32177e44..6d71bf02 100644 --- a/pkg/invoice/response.go +++ b/pkg/invoice/response.go @@ -18,9 +18,9 @@ type Response struct { Status string `json:"status"` Summarized string `json:"summarized"` Type string `json:"type"` + TransactionAmount float64 `json:"transaction_amount"` ID int `json:"id"` RetryAttempt int `json:"retry_attempt"` - TransactionAmount float64 `json:"transaction_amount"` } // PaymentResponse contains information about payment. diff --git a/pkg/invoice/search_request.go b/pkg/invoice/search_request.go index 28469640..310dc33f 100644 --- a/pkg/invoice/search_request.go +++ b/pkg/invoice/search_request.go @@ -7,10 +7,9 @@ import ( // SearchRequest is the helper structure to build search request. type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/merchantorder/request.go b/pkg/merchantorder/request.go index f52d9fb4..892cdd1b 100644 --- a/pkg/merchantorder/request.go +++ b/pkg/merchantorder/request.go @@ -31,8 +31,8 @@ type ItemRequest struct { PictureURL string `json:"picture_url,omitempty"` CategoryID string `json:"category_id,omitempty"` CurrencyID string `json:"currency_id,omitempty"` - Quantity int `json:"quantity,omitempty"` UnitPrice float64 `json:"unit_price,omitempty"` + Quantity int `json:"quantity,omitempty"` } // CollectorRequest represents seller information. diff --git a/pkg/merchantorder/response.go b/pkg/merchantorder/response.go index 661cce1e..9c97af10 100644 --- a/pkg/merchantorder/response.go +++ b/pkg/merchantorder/response.go @@ -24,12 +24,12 @@ type Response struct { Marketplace string `json:"marketplace"` SponsorID string `json:"sponsor_id"` OrderStatus string `json:"order_status"` - ID int64 `json:"id"` - Cancelled bool `json:"cancelled"` PaidAmount float64 `json:"paid_amount"` RefundedAmount float64 `json:"refunded_amount"` ShippingCost float64 `json:"shipping_cost"` TotalAmount float64 `json:"total_amount"` + ID int64 `json:"id"` + Cancelled bool `json:"cancelled"` } // PayerResponse represents buyer information. @@ -54,11 +54,11 @@ type PaymentResponse struct { StatusDetails string `json:"status_details"` OperationType string `json:"operation_type"` CurrencyID string `json:"currency_id"` - ID int64 `json:"id"` TransactionAmount float64 `json:"transaction_amount"` TotalPaidAmount float64 `json:"total_paid_amount"` ShippingCost float64 `json:"shipping_cost"` AmountRefunded float64 `json:"amount_refunded"` + ID int64 `json:"id"` } // ItemResponse represents item information. @@ -69,8 +69,8 @@ type ItemResponse struct { PictureURL string `json:"picture_url"` CurrencyID string `json:"currency_id"` CategoryID string `json:"category_id"` - Quantity int `json:"quantity"` UnitPrice float64 `json:"unit_price"` + Quantity int `json:"quantity"` } // ShipmentResponse represents shipment information. @@ -120,10 +120,10 @@ type ShippingOptionResponse struct { Name string `json:"name"` CurrencyID string `json:"currency_id"` - ID int64 `json:"id"` - ShippingMethodID int64 `json:"shipping_method_id"` Cost float64 `json:"cost"` ListCost float64 `json:"list_cost"` + ID int64 `json:"id"` + ShippingMethodID int64 `json:"shipping_method_id"` } // ReceiverAddressCityResponse represents city information. diff --git a/pkg/merchantorder/search_request.go b/pkg/merchantorder/search_request.go index f20f9571..4644a81d 100644 --- a/pkg/merchantorder/search_request.go +++ b/pkg/merchantorder/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of paramaters. For details, see: // https://www.mercadopago.com/developers/en/reference/merchant_orders/_merchant_orders_search/get. type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/merchantorder/update_request.go b/pkg/merchantorder/update_request.go index 92a6498e..11b46acf 100644 --- a/pkg/merchantorder/update_request.go +++ b/pkg/merchantorder/update_request.go @@ -67,10 +67,10 @@ type ShippingOptionRequest struct { Name string `json:"name,omitempty"` CurrencyID string `json:"currency_id,omitempty"` - ShippingMethodID int64 `json:"shipping_method_id,omitempty"` - ID int64 `json:"id,omitempty"` Cost float64 `json:"cost,omitempty"` ListCost float64 `json:"list_cost,omitempty"` + ShippingMethodID int64 `json:"shipping_method_id,omitempty"` + ID int64 `json:"id,omitempty"` } // ReceiverAddressCityRequest represents city information. diff --git a/pkg/oauth/response.go b/pkg/oauth/response.go index a86ae257..50306ce2 100644 --- a/pkg/oauth/response.go +++ b/pkg/oauth/response.go @@ -7,6 +7,6 @@ type Response struct { RefreshToken string `json:"refresh_token"` PublicKey string `json:"public_key"` TokenType string `json:"token_type"` - LiveMode bool `json:"live_mode"` ExpiresIn int64 `json:"expires_in"` + LiveMode bool `json:"live_mode"` } diff --git a/pkg/payment/request.go b/pkg/payment/request.go index d9ba448d..cfba1aca 100644 --- a/pkg/payment/request.go +++ b/pkg/payment/request.go @@ -29,16 +29,16 @@ type Request struct { PaymentMethodOptionID string `json:"payment_method_option_id,omitempty"` StatementDescriptor string `json:"statement_descriptor,omitempty"` ThreeDSecureMode string `json:"three_d_secure_mode,omitempty"` + ApplicationFee float64 `json:"application_fee,omitempty"` + CouponAmount float64 `json:"coupon_amount,omitempty"` + NetAmount float64 `json:"net_amount,omitempty"` + TransactionAmount float64 `json:"transaction_amount,omitempty"` Installments int `json:"installments,omitempty"` CampaignID int64 `json:"campaign_id,omitempty"` DifferentialPricingID int64 `json:"differential_pricing_id,omitempty"` SponsorID int64 `json:"sponsor_id,omitempty"` BinaryMode bool `json:"binary_mode,omitempty"` Capture bool `json:"capture,omitempty"` - ApplicationFee float64 `json:"application_fee,omitempty"` - CouponAmount float64 `json:"coupon_amount,omitempty"` - NetAmount float64 `json:"net_amount,omitempty"` - TransactionAmount float64 `json:"transaction_amount,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` } @@ -116,8 +116,8 @@ type ItemRequest struct { Description string `json:"description,omitempty"` PictureURL string `json:"picture_url,omitempty"` CategoryID string `json:"category_id,omitempty"` - Quantity int64 `json:"quantity,omitempty"` UnitPrice float64 `json:"unit_price,omitempty"` + Quantity int64 `json:"quantity,omitempty"` Warranty bool `json:"warranty,omitempty"` } diff --git a/pkg/payment/response.go b/pkg/payment/response.go index 287b9216..3a4636a2 100644 --- a/pkg/payment/response.go +++ b/pkg/payment/response.go @@ -52,16 +52,16 @@ type Response struct { CallForAuthorizeID string `json:"call_for_authorize_id"` StatementDescriptor string `json:"statement_descriptor"` MoneyReleaseStatus string `json:"money_release_status"` - Installments int `json:"installments"` - ID int64 `json:"id"` - SponsorID int64 `json:"sponsor_id"` - CollectorID int64 `json:"collector_id"` TransactionAmount float64 `json:"transaction_amount"` TransactionAmountRefunded float64 `json:"transaction_amount_refunded"` CouponAmount float64 `json:"coupon_amount"` TaxesAmount float64 `json:"taxes_amount"` ShippingAmount float64 `json:"shipping_amount"` NetAmount float64 `json:"net_amount"` + Installments int `json:"installments"` + ID int64 `json:"id"` + SponsorID int64 `json:"sponsor_id"` + CollectorID int64 `json:"collector_id"` LiveMode bool `json:"live_mode"` Captured bool `json:"captured"` BinaryMode bool `json:"binary_mode"` @@ -103,8 +103,8 @@ type ItemResponse struct { Description string `json:"description"` PictureURL string `json:"picture_url"` CategoryID string `json:"category_id"` - Quantity int `json:"quantity"` UnitPrice float64 `json:"unit_price"` + Quantity int `json:"quantity"` } // AdditionalInfoPayerResponse represents payer's additional information. @@ -147,8 +147,8 @@ type ReceiverAddressResponse struct { // OrderResponse represents order information. type OrderResponse struct { - ID int `json:"id"` Type string `json:"type"` + ID int `json:"id"` } // TransactionDetailsResponse represents transaction details. @@ -325,10 +325,10 @@ type RefundResponse struct { RefundMode string `json:"refund_mode"` Reason string `json:"reason"` UniqueSequenceNumber string `json:"unique_sequence_number"` - ID int64 `json:"id"` - PaymentID int64 `json:"payment_id"` Amount float64 `json:"amount"` AdjustmentAmount float64 `json:"adjustment_amount"` + ID int64 `json:"id"` + PaymentID int64 `json:"payment_id"` } // SourceResponse represents source information. diff --git a/pkg/payment/search_request.go b/pkg/payment/search_request.go index 8c3f133e..1cd4a751 100644 --- a/pkg/payment/search_request.go +++ b/pkg/payment/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of paramaters. For details, see: // https://www.mercadopago.com/developers/en/reference/payments/_payments_search/get. type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/payment/search_response.go b/pkg/payment/search_response.go index 0cdcaff2..0e740df5 100644 --- a/pkg/payment/search_response.go +++ b/pkg/payment/search_response.go @@ -2,8 +2,8 @@ package payment // SearchResponse represents the response from the search endpoint. type SearchResponse struct { - Results []Response `json:"results"` Paging PagingResponse `json:"paging"` + Results []Response `json:"results"` } // PagingResponse represents the paging information within SearchResponse. diff --git a/pkg/paymentmethod/response.go b/pkg/paymentmethod/response.go index a713961c..6afc17f1 100644 --- a/pkg/paymentmethod/response.go +++ b/pkg/paymentmethod/response.go @@ -11,11 +11,11 @@ type Response struct { SecureThumbnail string `json:"secure_thumbnail"` Thumbnail string `json:"thumbnail"` DeferredCapture string `json:"deferred_capture"` - AdditionalInfoNeeded []string `json:"additional_info_needed"` - ProcessingModes []string `json:"processing_modes"` - AccreditationTime int64 `json:"accreditation_time"` MinAllowedAmount float64 `json:"min_allowed_amount"` MaxAllowedAmount float64 `json:"max_allowed_amount"` + AccreditationTime int64 `json:"accreditation_time"` + AdditionalInfoNeeded []string `json:"additional_info_needed"` + ProcessingModes []string `json:"processing_modes"` } // SettingsResponse represents payment method settings. @@ -34,15 +34,15 @@ type SettingsBinResponse struct { // SettingsCardNumberResponse represents card number settings. type SettingsCardNumberResponse struct { - Length int `json:"length"` Validation string `json:"validation"` + Length int `json:"length"` } // SettingsSecurityCodeResponse represents security code settings. type SettingsSecurityCodeResponse struct { Mode string `json:"mode"` - Length int `json:"length"` CardLocation string `json:"card_location"` + Length int `json:"length"` } // FinancialInstitutionResponse represents financial institution settings. diff --git a/pkg/point/request.go b/pkg/point/request.go index 7c2ab293..4ad8b0db 100644 --- a/pkg/point/request.go +++ b/pkg/point/request.go @@ -4,21 +4,21 @@ type CreateRequest struct { AdditionalInfo *AdditionalInfoRequest `json:"additional_info"` Payment *PaymentRequest `json:"payment"` - Amount int `json:"amount"` Description string `json:"description"` + Amount int `json:"amount"` } type AdditionalInfoRequest struct { - PrintOnTerminal bool `json:"print_on_terminal,omitempty"` ExternalReference string `json:"external_reference,omitempty"` TicketNumber string `json:"ticket_number,omitempty"` + PrintOnTerminal bool `json:"print_on_terminal,omitempty"` } type PaymentRequest struct { - ID int64 `json:"id,omitempty"` - Installments int `json:"installments,omitempty"` Type string `json:"type,omitempty"` InstallmentsCost string `json:"installments_cost,omitempty"` + ID int64 `json:"id,omitempty"` + Installments int `json:"installments,omitempty"` } type UpdateDeviceOperatingModeRequest struct { diff --git a/pkg/point/response.go b/pkg/point/response.go index a07ba56a..adeca2ba 100644 --- a/pkg/point/response.go +++ b/pkg/point/response.go @@ -4,25 +4,25 @@ type Response struct { Payment PaymentResponse `json:"payment"` AdditionalInfo AdditionalInfoResponse `json:"additional_info"` - Amount int `json:"amount"` ID string `json:"id"` Description string `json:"description"` State string `json:"state"` DeviceID string `json:"device_id"` + Amount int `json:"amount"` } type AdditionalInfoResponse struct { - PrintOnTerminal bool `json:"print_on_terminal"` ExternalReference string `json:"external_reference"` TicketNumber string `json:"ticket_number"` + PrintOnTerminal bool `json:"print_on_terminal"` } type PaymentResponse struct { - ID int64 `json:"id"` - Installments int `json:"installments"` Type string `json:"type"` InstallmentsCost string `json:"installments_cost"` VoucherType string `json:"voucher_type"` + ID int64 `json:"id"` + Installments int `json:"installments"` } type CancelResponse struct { @@ -30,16 +30,16 @@ type CancelResponse struct { } type DevicesResponse struct { - Devices []DeviceResponse `json:"devices"` Paging PagingResponse `json:"paging"` + Devices []DeviceResponse `json:"devices"` } type DeviceResponse struct { - PosID int `json:"pos_id"` - StoreID int `json:"store_id"` ID string `json:"id"` ExternalPosID string `json:"external_pos_id"` OperatingMode string `json:"operating_mode"` + PosID int `json:"pos_id"` + StoreID int `json:"store_id"` } type PagingResponse struct { diff --git a/pkg/preapproval/response.go b/pkg/preapproval/response.go index 3c4e4340..22c80b8a 100644 --- a/pkg/preapproval/response.go +++ b/pkg/preapproval/response.go @@ -21,13 +21,13 @@ type Response struct { FirstInvoiceOffset string `json:"first_invoice_offset"` BackURL string `json:"back_url"` PreapprovalPlanID string `json:"preapproval_plan_id"` + PayerFirstName string `json:"payer_first_name"` + PayerLastName string `json:"payer_last_name"` CardID int `json:"card_id"` Version int `json:"version"` PayerID int `json:"payer_id"` CollectorID int `json:"collector_id"` ApplicationID int `json:"application_id"` - PayerFirstName string `json:"payer_first_name"` - PayerLastName string `json:"payer_last_name"` } // AutoRecurringResponse represents the recurrence settings. @@ -38,8 +38,8 @@ type AutoRecurringResponse struct { CurrencyID string `json:"currency_id"` FrequencyType string `json:"frequency_type"` - Frequency int `json:"frequency"` TransactionAmount float64 `json:"transaction_amount"` + Frequency int `json:"frequency"` } // FreeTrialResponse represents the free trial settings. @@ -54,10 +54,10 @@ type SummarizedResponse struct { LastChargedDate time.Time `json:"last_charged_date"` LastChargedAmount time.Time `json:"last_charged_amount"` + Semaphore string `json:"semaphore"` + PendingChargeAmount float64 `json:"pending_charge_amount"` + ChargedAmount float64 `json:"charged_amount"` Quotas int `json:"quotas"` PendingChargeQuantity int `json:"pending_charge_quantity"` ChargedQuantity int `json:"charged_quantity"` - PendingChargeAmount float64 `json:"pending_charge_amount"` - ChargedAmount float64 `json:"charged_amount"` - Semaphore string `json:"semaphore"` } diff --git a/pkg/preapproval/search_request.go b/pkg/preapproval/search_request.go index 473350de..7e0e66cb 100644 --- a/pkg/preapproval/search_request.go +++ b/pkg/preapproval/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of parameters. For details, see: // https://www.mercadopago.com/developers/en/reference/subscriptions/_preapproval_search/get type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/preapproval/search_response.go b/pkg/preapproval/search_response.go index 5549f9b8..8e0f72e0 100644 --- a/pkg/preapproval/search_response.go +++ b/pkg/preapproval/search_response.go @@ -2,8 +2,8 @@ package preapproval // SearchResponse represents the response from the search endpoint. type SearchResponse struct { - Results []Response `json:"results"` Paging PagingResponse `json:"paging"` + Results []Response `json:"results"` } // PagingResponse represents the paging information within SearchResponse. diff --git a/pkg/preapprovalplan/response.go b/pkg/preapprovalplan/response.go index 5e33ebc1..338cd086 100644 --- a/pkg/preapprovalplan/response.go +++ b/pkg/preapprovalplan/response.go @@ -25,10 +25,10 @@ type AutoRecurringResponse struct { CurrencyID string `json:"currency_id"` FrequencyType string `json:"frequency_type"` + TransactionAmount float64 `json:"transaction_amount"` Frequency int `json:"frequency"` Repetitions int `json:"repetitions"` BillingDay int `json:"billing_day"` - TransactionAmount float64 `json:"transaction_amount"` BillingDayProportional bool `json:"billing_day_proportional"` } diff --git a/pkg/preapprovalplan/search_request.go b/pkg/preapprovalplan/search_request.go index 820987f7..5395e340 100644 --- a/pkg/preapprovalplan/search_request.go +++ b/pkg/preapprovalplan/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of parameters. For details, see: // https://www.mercadopago.com/developers/en/reference/subscriptions/_preapproval_plan_id/get type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/preapprovalplan/search_response.go b/pkg/preapprovalplan/search_response.go index b459f5e7..8a4bbbf5 100644 --- a/pkg/preapprovalplan/search_response.go +++ b/pkg/preapprovalplan/search_response.go @@ -2,8 +2,8 @@ package preapprovalplan // SearchResponse represents the response from the search endpoint. type SearchResponse struct { - Results []Response `json:"results"` Paging PagingResponse `json:"paging"` + Results []Response `json:"results"` } // PagingResponse represents the paging information within SearchResponse. diff --git a/pkg/preference/request.go b/pkg/preference/request.go index 4d7c2dcf..8efc9614 100644 --- a/pkg/preference/request.go +++ b/pkg/preference/request.go @@ -26,9 +26,9 @@ type Request struct { NotificationUrl string `json:"notification_url,omitempty"` Purpose string `json:"purpose,omitempty"` StatementDescriptor string `json:"statement_descriptor,omitempty"` + MarketplaceFee float64 `json:"marketplace_fee,omitempty"` BinaryMode bool `json:"binary_mode,omitempty"` Expires bool `json:"expires,omitempty"` - MarketplaceFee float64 `json:"marketplace_fee,omitempty"` ProcessingModes []string `json:"processing_modes,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` } @@ -53,8 +53,8 @@ type PreferenceItemRequest struct { PictureURL string `json:"picture_url,omitempty"` CategoryID string `json:"category_id,omitempty"` CurrencyID string `json:"currency_id,omitempty"` - Quantity int `json:"quantity,omitempty"` UnitPrice float64 `json:"unit_price,omitempty"` + Quantity int `json:"quantity,omitempty"` } // PreferencePayerRequest contains payer information in the preference. @@ -116,10 +116,10 @@ type PreferenceShipmentsRequest struct { Mode string `json:"mode,omitempty"` Dimensions string `json:"dimensions,omitempty"` DefaultShippingMethod string `json:"default_shipping_method,omitempty"` + Cost float64 `json:"cost,omitempty"` LocalPickup bool `json:"local_pickup,omitempty"` FreeShipping bool `json:"free_shipping,omitempty"` ExpressShipment bool `json:"express_shipment,omitempty"` - Cost float64 `json:"cost,omitempty"` } // PreferenceFreeMethodRequest contains information about free shipping methods in the preference. diff --git a/pkg/preference/response.go b/pkg/preference/response.go index 026dbcdd..ae2a21dc 100644 --- a/pkg/preference/response.go +++ b/pkg/preference/response.go @@ -31,10 +31,10 @@ type Response struct { InitPoint string `json:"init_point"` SandboxInitPoint string `json:"sandbox_init_point"` SiteID string `json:"site_id"` + MarketplaceFee float64 `json:"marketplace_fee"` CollectorID int64 `json:"collector_id"` Expires bool `json:"expires"` BinaryMode bool `json:"binary_mode"` - MarketplaceFee float64 `json:"marketplace_fee"` ProcessingModes []string `json:"processing_modes"` Metadata map[string]any `json:"metadata"` } @@ -47,8 +47,8 @@ type PreferenceItemResponse struct { CurrencyID string `json:"currency_id"` PictureURL string `json:"picture_url"` CategoryID string `json:"category_id"` - Quantity int `json:"quantity"` UnitPrice float64 `json:"unit_price"` + Quantity int `json:"quantity"` } // PreferencePayerResponse contains payer information in the preference. diff --git a/pkg/preference/search_request.go b/pkg/preference/search_request.go index 7673fe36..2d181d71 100644 --- a/pkg/preference/search_request.go +++ b/pkg/preference/search_request.go @@ -9,10 +9,9 @@ import ( // Filters field can receive a lot of paramaters. For details, see: // https://www.mercadopago.com/developers/en/reference/preferences/_checkout_preferences_search/get. type SearchRequest struct { + Limit int + Offset int Filters map[string]string - - Limit int - Offset int } // GetParams creates map to build query parameters. Keys will be changed to lower case. diff --git a/pkg/refund/response.go b/pkg/refund/response.go index ffc63087..35259ba8 100644 --- a/pkg/refund/response.go +++ b/pkg/refund/response.go @@ -11,10 +11,10 @@ type Response struct { RefundMode string `json:"refund_mode"` Reason string `json:"reason"` UniqueSequenceNumber string `json:"unique_sequence_number"` - ID int64 `json:"id"` - PaymentID int64 `json:"payment_id"` Amount float64 `json:"amount"` AdjustmentAmount float64 `json:"adjustment_amount"` + ID int64 `json:"id"` + PaymentID int64 `json:"payment_id"` } // Source represents the data to identify who originated the refund diff --git a/pkg/user/response.go b/pkg/user/response.go index fd013044..282f11c6 100644 --- a/pkg/user/response.go +++ b/pkg/user/response.go @@ -1,11 +1,11 @@ package user type Response struct { - ID int64 `json:"id"` Nickname string `json:"nickname"` FirstName string `json:"first_name"` LastName string `json:"last_name"` CountryID string `json:"country_id"` Email string `json:"email"` SiteID string `json:"site_id"` + ID int64 `json:"id"` }