mercadopago-ruby 0.10.9 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -5
- data/lib/mercadopago/api/clients.rb +2 -2
- data/lib/mercadopago/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33c793b3183c497b0513492a00046c23c6bfefe03272cec004850c873fed4cd8
|
4
|
+
data.tar.gz: 5e7b870755fef440d1c04114708cc95a2ee2748a54ec55c67386435f2d95367b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6e29dfde5848dc6ebe681b7cd3b4b8a4e91e84d761342e2418ec3fd8a652807f460f272b16335e80e93f32239dff0ff2e87d914d10c4affdc1f2c7ab1fa4fbd
|
7
|
+
data.tar.gz: e4004d88e40ebb217191de0bc669a4de2b4dcce6d1870675f5a1393423f5e4d51b87bb35d7674a97f09a93d67ce3f146fceb9f217c641e404ff2aab8a4641289
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Mercado Pago Gem
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/mercadopago-ruby.svg)](https://badge.fury.io/rb/mercadopago-ruby)
|
3
|
+
[Official Mercado Pago documentation](https://www.mercadopago.com.ar/developers/es/)
|
3
4
|
-----
|
4
5
|
## Index
|
5
6
|
- [Installation](#installation)
|
@@ -26,7 +27,7 @@
|
|
26
27
|
- Get a customer by email
|
27
28
|
```ruby
|
28
29
|
@client = MercadoPago::API::Clients.new(access_token: ACCESS_TOKEN)
|
29
|
-
@client.search_customers_by_email(
|
30
|
+
@client.search_customers_by_email('customer@mail.com')
|
30
31
|
```
|
31
32
|
- Get a customer by any criteria
|
32
33
|
```ruby
|
@@ -48,8 +49,17 @@
|
|
48
49
|
@client.update_customer(CUSTOMER_ID, payload)
|
49
50
|
```
|
50
51
|
## Cards
|
52
|
+
Mercado Pago provides credit cards to being used in the sandbox environment. [See list](https://www.mercadopago.com.ar/developers/es/solutions/payments/custom-checkout/test-cards/)
|
53
|
+
- Adding a new card
|
54
|
+
Cards should be added using the official Mercado Pago's JS SDK, because risky data should not go through our Backend side, intead, Mercado Pago will return a **card_token** attribute which you can be used to add a new card to an existing customer.
|
55
|
+
[How to create a new card](https://www.mercadopago.com.br/developers/en/solutions/payments/custom-checkout/charge-with-creditcard/javascript/)
|
56
|
+
- Add a card to an existing customer
|
57
|
+
Once you have your **card_token** and you **customer_id** you can associate both, in this way adding a card to an existing customer.
|
58
|
+
```ruby
|
59
|
+
@client = MercadoPago::API::Cards.new(access_token: ACCESS_TOKEN)
|
60
|
+
@client.add_card_to_customer(CUSTOMER_ID, CARD_TOKEN)
|
61
|
+
```
|
51
62
|
- Retrieve customer cards
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
```
|
63
|
+
```ruby
|
64
|
+
@client.retrieve_customer_cards(CUSTOMER_ID)
|
65
|
+
```
|
@@ -24,8 +24,8 @@ module MercadoPago
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# Argument must be an Hash
|
27
|
-
def search_customers_by_email(
|
28
|
-
response = connection.get(customers_search_endpoint,
|
27
|
+
def search_customers_by_email(email)
|
28
|
+
response = connection.get(customers_search_endpoint, email: email) do |req|
|
29
29
|
req.params['access_token'] = access_token
|
30
30
|
end
|
31
31
|
response = process_response(response)
|
data/lib/mercadopago/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercadopago-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nardo Nykolyszyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: 1.3.5
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.7.
|
149
|
+
rubygems_version: 2.7.6
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Mercado Pago gem.
|