mp_api 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mp_api/client.rb +10 -4
- data/lib/mp_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96d03188ecb0b3d3e9da6849ba87408ccd0925056a9f5668714cb9a2815fd6c4
|
|
4
|
+
data.tar.gz: 52fa56f7cc504b66a36ce645119e70ab0b08baceb65c4ca25eaeeecf52c66a59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e0fcfa13a1e9602994f820930eb4508ecf8c4131012778d5e60230fa9607c2fd261935f47024eb2ac13cf7c75bb11c3e4f066a954304affda5a2b2c78baad2e
|
|
7
|
+
data.tar.gz: 7e90f2a55b2b20fecb19254003123e289b08166c0059f32022758e410615b97568c15c4d90cf085579c4b35363edc9e631e112bfe927a157652728b51a21099b
|
data/lib/mp_api/client.rb
CHANGED
|
@@ -28,7 +28,7 @@ module MpApi
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# @param items [Array<MpApi::Item>] Array de objetos Item contendo id, title, description, category_id, quantity, unit_price
|
|
31
|
-
def create_credit_card_payment(date_of_expiration: nil, amount:, description: nil, statement_descriptor: nil, payment_method:, payer_email:, payer_identification_type:, payer_identification_number:, capture: nil, external_reference: nil, token: nil, issuer_id: nil, installments: nil, three_d_secure_mode: false, items: [])
|
|
31
|
+
def create_credit_card_payment(date_of_expiration: nil, amount:, description: nil, statement_descriptor: nil, payment_method:, payer_email:, payer_identification_type:, payer_identification_number:, capture: nil, external_reference: nil, token: nil, issuer_id: nil, installments: nil, three_d_secure_mode: false, items: [], device_id: nil)
|
|
32
32
|
body = {
|
|
33
33
|
date_of_expiration: date_of_expiration,
|
|
34
34
|
transaction_amount: amount,
|
|
@@ -52,10 +52,10 @@ module MpApi
|
|
|
52
52
|
items: items.map(&:to_api_hash)
|
|
53
53
|
}
|
|
54
54
|
}.compact
|
|
55
|
-
post("/payments", body:)
|
|
55
|
+
post("/payments", body:, headers: device_id_header(device_id))
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def create_saved_credit_card_payment(amount:, token: nil, installments: nil, customer_id: nil)
|
|
58
|
+
def create_saved_credit_card_payment(amount:, token: nil, installments: nil, customer_id: nil, device_id: nil)
|
|
59
59
|
body = {
|
|
60
60
|
transaction_amount: amount,
|
|
61
61
|
token: token,
|
|
@@ -65,7 +65,7 @@ module MpApi
|
|
|
65
65
|
id: customer_id
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
post("/payments", body:)
|
|
68
|
+
post("/payments", body:, headers: device_id_header(device_id))
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def get_payment(payment_id)
|
|
@@ -146,5 +146,11 @@ module MpApi
|
|
|
146
146
|
def get_refund(payment_id:, refund_id:)
|
|
147
147
|
get("/payments/#{payment_id}/refunds/#{refund_id}")
|
|
148
148
|
end
|
|
149
|
+
|
|
150
|
+
private
|
|
151
|
+
|
|
152
|
+
def device_id_header(device_id)
|
|
153
|
+
{"X-meli-session-id" => device_id}.compact
|
|
154
|
+
end
|
|
149
155
|
end
|
|
150
156
|
end
|
data/lib/mp_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mp_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Todas Essas Coisas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ac
|