mercadolibre 0.14.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/mercadolibre.rb +4 -80
  4. data/lib/mercadolibre/api.rb +56 -20
  5. data/lib/mercadolibre/core/auth.rb +8 -12
  6. data/lib/mercadolibre/core/categories_and_listings.rb +8 -24
  7. data/lib/mercadolibre/core/collections.rb +10 -0
  8. data/lib/mercadolibre/core/items_and_searches.rb +25 -60
  9. data/lib/mercadolibre/core/locations_and_currencies.rb +8 -29
  10. data/lib/mercadolibre/core/order_management.rb +77 -47
  11. data/lib/mercadolibre/core/questions.rb +10 -27
  12. data/lib/mercadolibre/core/shippings.rb +2 -4
  13. data/lib/mercadolibre/core/users.rb +5 -13
  14. data/lib/mercadolibre/version.rb +1 -1
  15. data/lib/mercadopago/api.rb +55 -20
  16. data/lib/mercadopago/core/auth.rb +12 -18
  17. data/lib/mercadopago/core/payments.rb +3 -12
  18. metadata +3 -77
  19. data/lib/mercadolibre/entity/address.rb +0 -40
  20. data/lib/mercadolibre/entity/address_agency.rb +0 -21
  21. data/lib/mercadolibre/entity/answer.rb +0 -25
  22. data/lib/mercadolibre/entity/atm_transfer_reference.rb +0 -21
  23. data/lib/mercadolibre/entity/auth.rb +0 -21
  24. data/lib/mercadolibre/entity/billing_info.rb +0 -21
  25. data/lib/mercadolibre/entity/card_configuration.rb +0 -23
  26. data/lib/mercadolibre/entity/card_issuer.rb +0 -21
  27. data/lib/mercadolibre/entity/category.rb +0 -28
  28. data/lib/mercadolibre/entity/category_settings.rb +0 -26
  29. data/lib/mercadolibre/entity/city.rb +0 -27
  30. data/lib/mercadolibre/entity/collector.rb +0 -21
  31. data/lib/mercadolibre/entity/cost_components.rb +0 -21
  32. data/lib/mercadolibre/entity/country.rb +0 -26
  33. data/lib/mercadolibre/entity/currency.rb +0 -21
  34. data/lib/mercadolibre/entity/currency_conversion_ratio.rb +0 -21
  35. data/lib/mercadolibre/entity/featured_item.rb +0 -28
  36. data/lib/mercadolibre/entity/feedback.rb +0 -35
  37. data/lib/mercadolibre/entity/feedback_reply.rb +0 -25
  38. data/lib/mercadolibre/entity/geolocation.rb +0 -21
  39. data/lib/mercadolibre/entity/gtin.rb +0 -21
  40. data/lib/mercadolibre/entity/item.rb +0 -55
  41. data/lib/mercadolibre/entity/item_attribute.rb +0 -21
  42. data/lib/mercadolibre/entity/item_description.rb +0 -27
  43. data/lib/mercadolibre/entity/item_payment_method.rb +0 -21
  44. data/lib/mercadolibre/entity/item_picture.rb +0 -21
  45. data/lib/mercadolibre/entity/item_shipping.rb +0 -22
  46. data/lib/mercadolibre/entity/listing_exposure.rb +0 -21
  47. data/lib/mercadolibre/entity/listing_price.rb +0 -26
  48. data/lib/mercadolibre/entity/listing_type.rb +0 -21
  49. data/lib/mercadolibre/entity/mediation.rb +0 -25
  50. data/lib/mercadolibre/entity/mediation_interaction.rb +0 -21
  51. data/lib/mercadolibre/entity/municipality.rb +0 -21
  52. data/lib/mercadolibre/entity/neighborhood.rb +0 -21
  53. data/lib/mercadolibre/entity/order.rb +0 -44
  54. data/lib/mercadolibre/entity/order_coupon.rb +0 -21
  55. data/lib/mercadolibre/entity/order_feedback.rb +0 -25
  56. data/lib/mercadolibre/entity/order_item.rb +0 -25
  57. data/lib/mercadolibre/entity/order_note.rb +0 -25
  58. data/lib/mercadolibre/entity/order_shipping.rb +0 -33
  59. data/lib/mercadolibre/entity/payment.rb +0 -35
  60. data/lib/mercadolibre/entity/payment_method.rb +0 -33
  61. data/lib/mercadolibre/entity/payment_plan.rb +0 -21
  62. data/lib/mercadolibre/entity/payment_promotion.rb +0 -28
  63. data/lib/mercadolibre/entity/phone.rb +0 -21
  64. data/lib/mercadolibre/entity/product_identifier.rb +0 -25
  65. data/lib/mercadolibre/entity/question.rb +0 -30
  66. data/lib/mercadolibre/entity/search_location.rb +0 -27
  67. data/lib/mercadolibre/entity/shipment.rb +0 -41
  68. data/lib/mercadolibre/entity/shipment_status_history.rb +0 -24
  69. data/lib/mercadolibre/entity/shipping_delivery.rb +0 -25
  70. data/lib/mercadolibre/entity/shipping_item.rb +0 -21
  71. data/lib/mercadolibre/entity/shipping_option.rb +0 -28
  72. data/lib/mercadolibre/entity/shipping_speed.rb +0 -21
  73. data/lib/mercadolibre/entity/site.rb +0 -28
  74. data/lib/mercadolibre/entity/site_domain.rb +0 -21
  75. data/lib/mercadolibre/entity/site_trend.rb +0 -21
  76. data/lib/mercadolibre/entity/state.rb +0 -27
  77. data/lib/mercadolibre/entity/user.rb +0 -34
  78. data/lib/mercadolibre/entity/zip_code.rb +0 -29
  79. data/lib/mercadopago/entity/additional_info.rb +0 -27
  80. data/lib/mercadopago/entity/address.rb +0 -21
  81. data/lib/mercadopago/entity/auth.rb +0 -21
  82. data/lib/mercadopago/entity/collector.rb +0 -29
  83. data/lib/mercadopago/entity/fee_detail.rb +0 -21
  84. data/lib/mercadopago/entity/identification.rb +0 -21
  85. data/lib/mercadopago/entity/money_request.rb +0 -32
  86. data/lib/mercadopago/entity/order.rb +0 -21
  87. data/lib/mercadopago/entity/payer.rb +0 -27
  88. data/lib/mercadopago/entity/payment.rb +0 -83
  89. data/lib/mercadopago/entity/phone.rb +0 -21
  90. data/lib/mercadopago/entity/refund.rb +0 -25
  91. data/lib/mercadopago/entity/shipments.rb +0 -21
  92. data/lib/mercadopago/entity/source.rb +0 -21
  93. data/lib/mercadopago/entity/transaction_details.rb +0 -28
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class BillingInfo
4
- def self.attr_list
5
- [:doc_type, :doc_number]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,23 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class CardConfiguration
4
- def self.attr_list
5
- [:bin_card_pattern, :bin_card_exclusion_pattern, :card_number_length,
6
- :security_code_length, :luhn_algorithm, :installment_bins_pattern,
7
- :additional_info_needed]
8
- end
9
-
10
- attr_reader *attr_list
11
-
12
- def initialize(attributes={})
13
- attributes.each do |k, v|
14
- self.send("#{k}=", v) if self.respond_to?(k)
15
- end
16
- end
17
-
18
- private
19
-
20
- attr_writer *attr_list
21
- end
22
- end
23
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class CardIssuer
4
- def self.attr_list
5
- [:id, :name]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,28 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Category
4
- def self.attr_list
5
- [:id, :name, :picture, :permalink, :total_items_in_this_category,
6
- :path_from_root, :children_categories, :attribute_types, :settings]
7
- end
8
-
9
- attr_reader *attr_list
10
-
11
- def initialize(attributes={})
12
- attributes.each do |k, v|
13
- if ['path_from_root', 'children_categories'].include?(k.to_s)
14
- self.state = v.map { |x| Category.new(x) } unless v.nil?
15
- elsif k.to_s == 'settings'
16
- self.settings = CategorySettings.new(v) unless v.nil?
17
- else
18
- self.send("#{k}=", v) if self.respond_to?(k)
19
- end
20
- end
21
- end
22
-
23
- private
24
-
25
- attr_writer *attr_list
26
- end
27
- end
28
- end
@@ -1,26 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class CategorySettings
4
- def self.attr_list
5
- [:adult_content, :buying_allowed, :buying_modes, :coverage_areas, :currencies,
6
- :fragile, :immediate_payment, :item_conditions, :items_reviews_allowed, :listing_allowed,
7
- :max_description_length, :max_pictures_per_item, :max_sub_title_length, :max_title_length,
8
- :maximum_price, :minimum_price, :mirror_category, :price, :restrictions, :rounded_address,
9
- :seller_contact, :shipping_modes, :shipping_options, :shipping_profile,
10
- :show_contact_information, :simple_shipping, :stock, :tags, :vip_subdomain]
11
- end
12
-
13
- attr_reader *attr_list
14
-
15
- def initialize(attributes={})
16
- attributes.each do |k, v|
17
- self.send("#{k}=", v) if self.respond_to?(k)
18
- end
19
- end
20
-
21
- private
22
-
23
- attr_writer *attr_list
24
- end
25
- end
26
- end
@@ -1,27 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class City
4
- def self.attr_list
5
- [:id, :name, :state, :country]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- if k.to_s == 'state'
13
- self.state = State.new(v) unless v.nil?
14
- elsif k.to_s == 'country'
15
- self.country = Country.new(v) unless v.nil?
16
- else
17
- self.send("#{k}=", v) if self.respond_to?(k)
18
- end
19
- end
20
- end
21
-
22
- private
23
-
24
- attr_writer *attr_list
25
- end
26
- end
27
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Collector
4
- def self.attr_list
5
- [:id]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class CostComponents
4
- def self.attr_list
5
- [:special_discount]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,26 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Country
4
- def self.attr_list
5
- [:id, :name, :locale, :currency_id, :decimal_separator,
6
- :thousands_separator, :time_zone, :states]
7
- end
8
-
9
- attr_reader *attr_list
10
-
11
- def initialize(attributes={})
12
- attributes.each do |k, v|
13
- if k.to_s == 'states'
14
- self.states = v.map { |x| State.new(x) } unless v.nil?
15
- else
16
- self.send("#{k}=", v) if self.respond_to?(k)
17
- end
18
- end
19
- end
20
-
21
- private
22
-
23
- attr_writer *attr_list
24
- end
25
- end
26
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Currency
4
- def self.attr_list
5
- [:id, :description, :symbol, :decimal_places]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class CurrencyConversionRatio
4
- def self.attr_list
5
- [:currency_from, :currency_to, :currency_id, :ratio, :mercado_pago_ratio]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,28 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class FeaturedItem
4
- def self.attr_list
5
- [:item_id, :title, :price, :currency_id, :permalink, :picture,
6
- :accepts_mercado_pago, :category_id, :pool_id, :seller_id]
7
- end
8
-
9
- attr_reader *attr_list
10
-
11
- def initialize(attributes={})
12
- attributes.each do |k, v|
13
- if k.to_s == 'picture'
14
- self.picture = ItemPicture.new(v) unless v.nil?
15
- else
16
- self.send("#{k}=", v) if self.respond_to?(k)
17
- end
18
- end
19
-
20
- self.last_updated = date_created if last_updated.nil?
21
- end
22
-
23
- private
24
-
25
- attr_writer *attr_list
26
- end
27
- end
28
- end
@@ -1,35 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Feedback
4
- def self.attr_list
5
- [:to, :has_seller_refunded_money, :status, :reason, :site_id, :date_created, :from,
6
- :order_id, :modified, :id, :message, :fulfilled, :item, :visibility_date, :reply,
7
- :role, :app_id, :rating, :restock_item]
8
- end
9
-
10
- attr_reader *attr_list
11
-
12
- def initialize(attributes={})
13
- attributes.each do |k, v|
14
- if ['date_created', 'visibility_date'].include?(k.to_s)
15
- self.date_created = Time.parse(v) unless v.nil?
16
- elsif k.to_s == 'to'
17
- self.to = User.new(v)
18
- elsif k.to_s == 'from'
19
- self.from = User.new(v)
20
- elsif k.to_s == 'item'
21
- self.item = Item.new(v)
22
- elsif k.to_s == 'reply'
23
- self.reply = FeedbackReply.new(v) unless v.nil?
24
- else
25
- self.send("#{k}=", v) if self.respond_to?(k)
26
- end
27
- end
28
- end
29
-
30
- private
31
-
32
- attr_writer *attr_list
33
- end
34
- end
35
- end
@@ -1,25 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class FeedbackReply
4
- def self.attr_list
5
- [:message, :reply_date, :reply_status]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- if k.to_s == 'reply_date'
13
- self.reply_date = Time.parse(v) unless v.nil?
14
- else
15
- self.send("#{k}=", v) if self.respond_to?(k)
16
- end
17
- end
18
- end
19
-
20
- private
21
-
22
- attr_writer *attr_list
23
- end
24
- end
25
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Geolocation
4
- def self.attr_list
5
- [:latitude, :longitude]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Gtin
4
- def self.attr_list
5
- [:type, :code]
6
- end
7
-
8
- attr_reader *attr_list
9
-
10
- def initialize(attributes={})
11
- attributes.each do |k, v|
12
- self.send("#{k}=", v) if self.respond_to?(k)
13
- end
14
- end
15
-
16
- private
17
-
18
- attr_writer *attr_list
19
- end
20
- end
21
- end
@@ -1,55 +0,0 @@
1
- module Mercadolibre
2
- module Entity
3
- class Item
4
- def self.attr_list
5
- [:id, :site_id, :title, :subtitle, :seller_id, :category_id, :official_store_id,
6
- :price, :base_price, :original_price, :currency_id, :initial_quantity, :available_quantity,
7
- :sold_quantity, :buying_mode, :listing_type_id, :start_time, :stop_time, :condition, :permalink,
8
- :thumbnail, :secure_thumbnail, :pictures, :video_id, :descriptions, :accepts_mercadopago,
9
- :non_mercado_pago_payment_methods, :shipping, :seller_address, :seller_contact, :location,
10
- :geolocation, :coverage_areas, :attributes, :listing_source, :variations, :status, :sub_status,
11
- :tags, :warranty, :catalog_product_id, :parent_item_id, :differential_pricing, :deal_ids,
12
- :automatic_relist, :date_created, :last_updated, :seller, :installments, :address,
13
- ]
14
- end
15
-
16
- attr_reader *attr_list
17
-
18
- def initialize(attributes={})
19
- attributes.each do |k, v|
20
- if k.to_s == 'pictures'
21
- self.pictures = v.map { |x| ItemPicture.new(x) } unless v.nil?
22
- elsif k.to_s == 'descriptions'
23
- self.descriptions = v.map { |x| ItemDescription.new(x) } unless v.nil?
24
- elsif k.to_s == 'non_mercado_pago_payment_methods'
25
- self.non_mercado_pago_payment_methods = v.map { |x| ItemPaymentMethod.new(x) } unless v.nil?
26
- elsif k.to_s == 'shipping'
27
- self.shipping = ItemShipping.new(v)
28
- elsif k.to_s == 'seller_address'
29
- self.seller_address = Address.new(v)
30
- elsif k.to_s == 'geolocation'
31
- self.geolocation = Geolocation.new(v)
32
- elsif k.to_s == 'attributes'
33
- self.geolocation = v.map { |x| ItemAttribute.new(x) } unless v.nil?
34
- elsif k.to_s == 'seller'
35
- self.seller = User.new(v)
36
-
37
- if seller.id.present?
38
- self.seller_id = seller.id
39
- end
40
- elsif ['stop_time', 'last_updated', 'start_time', 'date_created'].include?(k.to_s)
41
- self.send("#{k}=", Time.parse(v)) unless v.nil?
42
- else
43
- self.send("#{k}=", v) if self.respond_to?(k)
44
- end
45
- end
46
-
47
- self.last_updated = date_created if last_updated.nil?
48
- end
49
-
50
- private
51
-
52
- attr_writer *attr_list
53
- end
54
- end
55
- end