mercadolibre 0.12.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db71e9bc5e43cf75b4ff5d11103b46fae85a886b
4
- data.tar.gz: 1b4611379436b01bb214eb3b3d8231f85fa4b830
3
+ metadata.gz: 3b9bf64f34ac40d7c86031cb0002139244e00bc3
4
+ data.tar.gz: c4a1cbd9204f278467a6ea2a1f0c1dd5dca93a66
5
5
  SHA512:
6
- metadata.gz: 86aa009602fa10fc83b031b34102964cb63ffa5289a2c3f0c72196a7cb75f684ac16cbf8a5bb9598f0a9c7ba2078134404be4961b14ebd78b851879143968f94
7
- data.tar.gz: 49bf3fb8ed9e9ea6b4aa575c7c7c7ac0982404b651d423f39ab5bbe20b464837c265d8393adf189499eae247f13456e0851c177014d4456df7b03adb05571d13
6
+ metadata.gz: c022fc0d069bcdfc291ea40e56af7afe44c9de641322f2d285839e9954de0b8aa1cffa52f3768e9f5c58a519ffd9681ffa55ef2a214499624f6b7b4675b43dd9
7
+ data.tar.gz: 32467c1dd36c5d48e0d8d8722ed213dedcfe33d32bf9b612896943d179e3e6d4e0d5fda758ea99c4b8df048489a3ab94d3fc3c846e2c58c1ca1047d7f8dbd33c
@@ -217,3 +217,7 @@
217
217
  ## v0.12.1
218
218
 
219
219
  * Bugfix mercadopago entity some class mismatches
220
+
221
+ ## v0.13.0
222
+
223
+ * Added fee detail class for payments
@@ -76,12 +76,19 @@ require "mercadolibre/core/users"
76
76
  require "mercadolibre/api"
77
77
 
78
78
  # mercadopago -> entities
79
+ require "mercadopago/entity/additional_info"
80
+ require "mercadopago/entity/address"
79
81
  require "mercadopago/entity/auth"
82
+ require "mercadopago/entity/collector"
83
+ require "mercadopago/entity/fee_detail"
80
84
  require "mercadopago/entity/identification"
81
85
  require "mercadopago/entity/money_request"
82
86
  require "mercadopago/entity/payer"
83
87
  require "mercadopago/entity/payment"
84
88
  require "mercadopago/entity/phone"
89
+ require "mercadopago/entity/refund"
90
+ require "mercadopago/entity/shipments"
91
+ require "mercadopago/entity/source"
85
92
  require "mercadopago/entity/transaction_details"
86
93
 
87
94
  # mercadopago -> core
@@ -1,3 +1,3 @@
1
1
  module Mercadolibre
2
- VERSION = "0.12.1"
2
+ VERSION = "0.14.0"
3
3
  end
@@ -0,0 +1,27 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class AdditionalInfo
4
+ def self.attr_list
5
+ [:items, :payer, :shipments]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ if k.to_s == 'payer'
13
+ self.payer = Payer.new(v) unless v.nil?
14
+ elsif k.to_s == 'shipments'
15
+ self.shipments = Shipments.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
@@ -0,0 +1,21 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class Address
4
+ def self.attr_list
5
+ [:zip_code, :street_name, :street_number, :floor, :apartment]
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
@@ -0,0 +1,29 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class Collector
4
+ def self.attr_list
5
+ [:id, :first_name, :phone, :email, :nickname, :identification, :last_name]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ if k.to_s == 'identification'
13
+ self.identification = Identification.new(v) unless v.nil?
14
+ elsif k.to_s == 'phone'
15
+ self.phone = Phone.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
28
+
29
+
@@ -0,0 +1,21 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class FeeDetail
4
+ def self.attr_list
5
+ [:amount, :fee_payer, :type]
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
@@ -2,7 +2,7 @@ module Mercadopago
2
2
  module Entity
3
3
  class Payer
4
4
  def self.attr_list
5
- [:type, :id, :email, :identification, :phone, :first_name, :last_name, :entity_type]
5
+ [:type, :id, :nickname, :email, :identification, :phone, :first_name, :last_name, :entity_type]
6
6
  end
7
7
 
8
8
  attr_reader *attr_list
@@ -25,5 +25,3 @@ module Mercadopago
25
25
  end
26
26
  end
27
27
  end
28
-
29
-
@@ -20,6 +20,7 @@ module Mercadopago
20
20
  :sponsor_id,
21
21
  :authorization_code,
22
22
  :collector_id,
23
+ :collector,
23
24
  :payer,
24
25
  :metadata,
25
26
  :order,
@@ -27,6 +28,7 @@ module Mercadopago
27
28
  :transaction_amount,
28
29
  :transaction_amount_refunded,
29
30
  :coupon_amount,
31
+ :shipping_cost,
30
32
  :differential_pricing_id,
31
33
  :deduction_schema,
32
34
  :transaction_details,
@@ -40,7 +42,8 @@ module Mercadopago
40
42
  :notification_url,
41
43
  :refunds,
42
44
  :payer,
43
- :transaction_details
45
+ :application_id,
46
+ :additional_info
44
47
  ]
45
48
  end
46
49
 
@@ -54,8 +57,16 @@ module Mercadopago
54
57
  self.send("#{k}=", Time.parse(v)) unless v.nil?
55
58
  elsif k.to_s == 'payer'
56
59
  self.payer = Payer.new(v)
60
+ elsif k.to_s == 'collector'
61
+ self.collector = Collector.new(v)
62
+ elsif k.to_s == 'refunds'
63
+ self.refunds = v.map { |x| Refund.new(x) }
57
64
  elsif k.to_s == 'transaction_details'
58
65
  self.transaction_details = TransactionDetails.new(v)
66
+ elsif k.to_s == 'additional_info'
67
+ self.additional_info = AdditionalInfo.new(v)
68
+ elsif k.to_s == 'fee_details'
69
+ self.fee_details = v.map { |x| FeeDetail.new(x) }
59
70
  else
60
71
  self.send("#{k}=", v) if self.respond_to?(k)
61
72
  end
@@ -0,0 +1,25 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class Refund
4
+ def self.attr_list
5
+ [:id, :amount, :source, :reason, :date_created, :payment_id, :metadata, :unique_sequence_number]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ if k.to_s == 'source'
13
+ self.source = Source.new(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
@@ -0,0 +1,21 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class Shipments
4
+ def self.attr_list
5
+ [:receiver_address]
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
@@ -0,0 +1,21 @@
1
+ module Mercadopago
2
+ module Entity
3
+ class Source
4
+ def self.attr_list
5
+ [:id, :name, :type]
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
@@ -8,6 +8,7 @@ module Mercadopago
8
8
  :external_resource_url,
9
9
  :installment_amount,
10
10
  :financial_institution,
11
+ :financial_institution_description,
11
12
  :payment_method_reference_id]
12
13
  end
13
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercadolibre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
@@ -136,12 +136,19 @@ files:
136
136
  - lib/mercadopago/api.rb
137
137
  - lib/mercadopago/core/auth.rb
138
138
  - lib/mercadopago/core/payments.rb
139
+ - lib/mercadopago/entity/additional_info.rb
140
+ - lib/mercadopago/entity/address.rb
139
141
  - lib/mercadopago/entity/auth.rb
142
+ - lib/mercadopago/entity/collector.rb
143
+ - lib/mercadopago/entity/fee_detail.rb
140
144
  - lib/mercadopago/entity/identification.rb
141
145
  - lib/mercadopago/entity/money_request.rb
142
146
  - lib/mercadopago/entity/payer.rb
143
147
  - lib/mercadopago/entity/payment.rb
144
148
  - lib/mercadopago/entity/phone.rb
149
+ - lib/mercadopago/entity/refund.rb
150
+ - lib/mercadopago/entity/shipments.rb
151
+ - lib/mercadopago/entity/source.rb
145
152
  - lib/mercadopago/entity/transaction_details.rb
146
153
  homepage: https://github.com/unformattmh/mercadolibre
147
154
  licenses: